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 ) ; } }
Sends a RESUME internal event to resume the activity instance .