protected StepExecutionResult executeWFItem ( final StepExecutionContext executionContext , final Map < Integer , StepExecutionResult > failedMap , final int c , final StepExecutionItem cmd ) { boolean hasHandler = cmd instanceof HasFailureHandler ; boolean hideError = false ; if ( hasHandler ) { final HasFailureHandler handles = ( HasFailureHandler ) cmd ; final StepExecutionItem handler = handles . getFailureHandler ( ) ; if ( null != handler && handler instanceof HandlerExecutionItem ) { hideError = ( ( HandlerExecutionItem ) handler ) . isKeepgoingOnSuccess ( ) ; } } if ( null != executionContext . getExecutionListener ( ) ) { executionContext . getExecutionListener ( ) . ignoreErrors ( hideError ) ; } if ( null != executionContext . getExecutionListener ( ) ) { executionContext . getExecutionListener ( ) . log ( Constants . DEBUG_LEVEL , c + ": Workflow step executing: " + cmd ) ; } StepExecutionResult result ; try { result = framework . getExecutionService ( ) . executeStep ( ExecutionContextImpl . builder ( executionContext ) . stepNumber ( c ) . build ( ) , cmd ) ; if ( ! result . isSuccess ( ) ) { failedMap . put ( c , result ) ; } } catch ( StepException e ) { result = StepExecutionResultImpl . wrapStepException ( e ) ; failedMap . put ( c , result ) ; } if ( null != executionContext . getExecutionListener ( ) ) { executionContext . getExecutionListener ( ) . log ( Constants . DEBUG_LEVEL , c + ": Workflow step finished, result: " + result ) ; } return result ; }
Execute a workflow item returns true if the item succeeds . This method will throw an exception if the workflow item fails and the Workflow is has keepgoing == false .