public List < TaskAction > getCustomActions ( ) throws ServiceException , DataAccessException { CodeTimer timer = new CodeTimer ( "getCustomActions()" , true ) ; List < TaskAction > dynamicTaskActions = new ArrayList < TaskAction > ( ) ; try { ActivityInstance activityInstance = getActivityInstance ( true ) ; if ( activityInstance != null ) { Long processInstanceId = activityInstance . getProcessInstanceId ( ) ; ProcessInstance processInstance = ServiceLocator . getWorkflowServices ( ) . getProcess ( processInstanceId ) ; Process processVO = null ; if ( processInstance . getProcessInstDefId ( ) > 0L ) processVO = ProcessCache . getProcessInstanceDefiniton ( processInstance . getProcessId ( ) , processInstance . getProcessInstDefId ( ) ) ; if ( processVO == null ) processVO = ProcessCache . getProcess ( processInstance . getProcessId ( ) ) ; if ( processInstance . isEmbedded ( ) ) processVO = processVO . getSubProcessVO ( new Long ( processInstance . getComment ( ) ) ) ; List < Transition > outgoingWorkTransVOs = processVO . getAllTransitions ( activityInstance . getActivityId ( ) ) ; for ( Transition workTransVO : outgoingWorkTransVOs ) { String resultCode = workTransVO . getCompletionCode ( ) ; if ( resultCode != null ) { Integer eventType = workTransVO . getEventType ( ) ; if ( eventType . equals ( EventType . FINISH ) || eventType . equals ( EventType . RESUME ) || TaskAction . FORWARD . equals ( resultCode ) ) { TaskAction taskAction = new TaskAction ( ) ; taskAction . setTaskActionName ( resultCode ) ; taskAction . setCustom ( true ) ; dynamicTaskActions . add ( taskAction ) ; } } } } } catch ( Exception ex ) { logger . severeException ( ex . getMessage ( ) , ex ) ; } timer . stopAndLogTiming ( "" ) ; return dynamicTaskActions ; }
Gets the custom task actions associated with a task instance as determined by the result codes for the possible outgoing work transitions from the associated activity .