public Status getImpliedStatus ( final ExecutableNode node ) { // If it's running or finished with 'SUCCEEDED', than don't even // bother starting this job. if ( Status . isStatusRunning ( node . getStatus ( ) ) || node . getStatus ( ) == Status . SUCCEEDED ) { return null ; } // Go through the node's dependencies. If all of the previous job's // statuses is finished and not FAILED or KILLED, than we can safely // run this job. Status status = Status . READY ; // Check if condition on job status is satisfied switch ( checkConditionOnJobStatus ( node ) ) { case FAILED : this . logger . info ( "Condition on job status: " + node . getConditionOnJobStatus ( ) + " is " + "evaluated to false for " + node . getId ( ) ) ; status = Status . CANCELLED ; break ; // Condition not satisfied yet, need to wait case PENDING : return null ; default : break ; } if ( status != Status . CANCELLED && ! isConditionOnRuntimeVariableMet ( node ) ) { status = Status . CANCELLED ; } // If it's disabled but ready to run, we want to make sure it continues // being disabled. if ( node . getStatus ( ) == Status . DISABLED || node . getStatus ( ) == Status . SKIPPED ) { return Status . SKIPPED ; } // If the flow has failed, and we want to finish only the currently running // jobs, we just // kill everything else. We also kill, if the flow has been cancelled. if ( this . flowFailed && this . failureAction == ExecutionOptions . FailureAction . FINISH_CURRENTLY_RUNNING ) { return Status . CANCELLED ; } else if ( isKilled ( ) ) { return Status . CANCELLED ; } return status ; }
Determines what the state of the next node should be . Returns null if the node should not be run .