public void execute() throws ActivityException {
        EventWaitInstance received = registerWaitEvents(false, true);
        if (received!=null) {
            setReturnCodeAndExitStatus(received.getCompletionCode());
            processMessage(getExternalEventInstanceDetails(received.getMessageDocumentId()));
            boolean toFinish = handleCompletionCode();
            if (toFinish && exitStatus==null)
                exitStatus = WorkStatus.STATUS_COMPLETED;
        } else {
            exitStatus = WorkStatus.STATUS_COMPLETED;
            setReturnCode(null);
        }
    }
public void execute ( ) throws ActivityException { EventWaitInstance received = registerWaitEvents ( false , true ) ; if ( received != null ) { setReturnCodeAndExitStatus ( received . getCompletionCode ( ) ) ; processMessage ( getExternalEventInstanceDetails ( received . getMessageDocumentId ( ) ) ) ; boolean toFinish = handleCompletionCode ( ) ; if ( toFinish && exitStatus == null ) exitStatus = WorkStatus . STATUS_COMPLETED ; } else { exitStatus = WorkStatus . STATUS_COMPLETED ; setReturnCode ( null ) ; } }
Method that executes the logic based on the work