Examples of job conditional dependencies evaluation
This section contains an example showing how the operation processing flow is affected when using job-level conditions.
- JOB1 ends successfully only when RC=0, RC=4, or RC=8 is returned. Any different result causes the job to end in error.
- JOB2 must run if JOB1 ends successfully with RC=4.
- JOB3 must run if JOB1 ends successfully with RC=8.
- JOB2 and JOB3 are skipped if JOB1 ends successfully with RC=0.
- JOB5 runs unconditionally when both JOB1 completes successfully and the two jobs, JOB2 and JOB3, are either completed or skipped.
- Use NOERROR to force the JOB1 status to C (Completed) for RC=4 and RC=8.
- Make JOB5 a normal successor of JOB1, JOB2, and JOB3.
- Define a condition on JOB2, the conditional successor, to run it when JOB1 status is C and JOB1 RC=4.
- Define a condition on JOB3, the conditional successor, to run it when JOB1 status is C and JOB1 RC=8.
An alternative way to implement these requirements, without using the NOERROR function, is described in An example of using recovery jobs to implement workflow.
In Example of conditioning operations, dotted lines represent conditional dependencies and straight lines represent normal dependencies.
JOB1
status
and return code: - JOB1 ends with status C and RC=0
- Successors status evaluation if JOB1 ends with status C and
return code 0 shows the operation
processing flow: A possible path exists because JOB1 has completed successfully
and a normal successor, JOB5, exists. Because a path exists, the successor
conditions can be evaluated.
- JOB1 condition is false because JOB1 return code is not 4. JOB2 status is set to X.
- JOB3 condition is false because JOB1 return code is not 8. JOB3 status is set to X.
- JOB5 has three predecessors with statuses C, X, and X so JOB5 status becomes R (Ready).
- JOB1 ends with status C and RC=4; JOB2 runs successfully
- Successors status evaluation if JOB1 ends with status C and
return code 4 and JOB2 runs successfully shows the operation
processing flow: A possible path exists because JOB1 has completed successfully
and a normal successor, JOB5, exists. Because a path exists, the successor
conditions can be evaluated.
- JOB2 condition is true because JOB1 status is C and RC=4. JOB2 status runs and then successfully completes.
- JOB3 condition is false because JOB1 return code is not 8. JOB3 status is set to X.
- JOB5 has three predecessors with statuses C, C, and X so JOB5 status becomes R.
- JOB1 ends with status C and RC=4; JOB2 ends in error
- Successors status evaluation if JOB1 ends with status C and
return code 4 and JOB2 ends in error shows the operation
processing flow: A possible path exists because JOB1 has completed successfully
and a normal successor, JOB5, exists. Because a path exists, the successor
conditions can be evaluated.
- JOB2 condition is true because JOB1 status is C and RC=4. JOB2 runs, but ends in error
- JOB3 condition is false because JOB1 return code is not 8. JOB3 status is set to X.
- JOB5 has three predecessors with statuses C, E, and X so JOB5 status is set to W(Wait).
- JOB1 ends with status E and RC=U2345
- Successors
status evaluation if JOB1 ends with status E and return code U2345 shows the operation processing
flow: In this case no path for progression exists in the plan, therefore
the conditions evaluations cannot be finalized.
- The condition on JOB2 is left U (Undefined), even though both condition dependencies are false. JOB2 status is set to W.
- The condition on JOB2 is left undefined, even though both condition dependencies are false. JOB3 status is set to W.
- JOB5 has three predecessors with statuses E, W, and W. JOB5 status is set to W.
- JOB1 is marked with the Unexpected RC flag and the warning message EQQE141W is logged in the Controller MLOG and in the system log.
Now the operator can examine the reason why JOB1 failed, check if the condition definitions are correct, and then either rerun the occurrence or fix the error and continue the processing.