code: protected void processMessage(String message) throws ActivityException {
          try {
              String rcvdMsgDocVar = getAttributeValueSmart(RECEIVED_MESSAGE_DOC_VAR);
              if (rcvdMsgDocVar != null && !rcvdMsgDocVar.isEmpty()) {
                  Process processVO = getProcessDefinition();
                  Variable variableVO = processVO.getVariable(rcvdMsgDocVar);
                  if (variableVO == null)
                      throw new ActivityException("Received Message Variable '" + rcvdMsgDocVar + "' is not defined or is not Document Type for process " + processVO.getFullLabel());
                  if (message != null) {
                      this.setParameterValueAsDocument(rcvdMsgDocVar, variableVO.getType(), message);
                  }
              }
              return;
          }
          catch (Exception ex) {
              logger.severeException(ex.getMessage(), ex);
              return;
          }
      }
docs: You should override this method to process event messages.
  
  The default method does nothing if Received Message Variable is not defined and returns WorkStatus.STATUS_COMPLETED.
  If Received Message Variable is defined then
  it would store the received message in that pre-defined document variable
  Process Designer has to define a Document type variable in order to store the message received
  
  When the method returns WorkStatus.STATUS_COMPLETED, the engine will complete the activity and move on.
  By default, the transition is determined based on null completion code and
  FINISH event type. You can change the completion code by using the method
  this.setReturnCode(). You can also change the event type from FINISH
  to ABORT, CORRECT and DELAY, by prepending the completion code with
  "ABORT:", "CORRECT:" and "DELAY:", respectively. Examples are
  "ABORT:my-return-code" and "CORRECT:".
  
  You can leave the activity in a status other than WorkStatus.STATUS_COMPLETED by returning
  a different status code.
  
  If WorkStatus.STATUS_WAITING is returned, your overridden method needs to re-register
  the events to be waited on. The work flow does not transition away and the completion code
  is ignored.
  
  You can also return WorkStatus.STATUS_HOLD or return WorkStatus.STATUS_CANCELLED.
  
  @return see above
  @param message
  @throws ActivityException