code: private void resumeActivityInstance(ActivityInstance actInst, String pCompletionCode, Long documentId,
              String message, int delay) throws MdwException, SQLException {
          ProcessInstance pi = edao.getProcessInstance(actInst.getProcessInstanceId());
          if (!this.isProcessInstanceResumable(pi)) {
              logger.info("ProcessInstance in NOT resumable. ProcessInstanceId:" + pi.getId());
          }
          InternalEvent outgoingMsg = InternalEvent.
              createActivityNotifyMessage(actInst, EventType.RESUME, pi.getMasterRequestId(), pCompletionCode);
          if (documentId != null) {        // should be always true
              outgoingMsg.setSecondaryOwnerType(OwnerType.DOCUMENT);
              outgoingMsg.setSecondaryOwnerId(documentId);
          }
          if (message != null && message.length() < 2500) {
              outgoingMsg.addParameter("ExternalEventMessage", message);
          }
          if (this.isProcessInstanceProgressable(pi)) {
              edao.setProcessInstanceStatus(pi.getId(), WorkStatus.STATUS_IN_PROGRESS);
          }
          if (delay > 0) {
              this.sendDelayedInternalEvent(outgoingMsg, delay,
                      ScheduledEvent.INTERNAL_EVENT_PREFIX+actInst.getId(), false);
          } else {
              this.sendInternalEvent(outgoingMsg);
          }
      }
docs: Sends a RESUME internal event to resume the activity instance.
  
  This may be called in the following cases:
  1) received an external event (including the case the message is received before registration)
  In this case, the argument message is populated.
  2) when register even wait instance, and the even has already arrived. In this case
  the argument message null.