Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Exit -> Return Code

...

The feature uses the inverse logic of return codes: an exit return code of 0 is returned when a job has run successfully and all other return codes (i.e. non 0) are returned when a job ends in error.

...

The implementation of return_codes is specified for a job chain node and is part of the job chain object. The implementation of return_codes is therefore independent of the job specified for a node and can be used more flexibly than next_state, error_state and add_order.

Example: Starting an order according to the

...

return code returned by a job chain node

Demonstration Files

Download: JobChainReturnCodes Example working example (Windows Version), for Linux simply change the job's shell scripts with Linux scripts.

...

Processing the return codes

The configuration of the exit return codes takes place in two stages:

  • The standard progression through the job chains:
    • When any of the jobs in either chain ends with an exit return code = 0, i.e. successfully, it will proceed to the job defined by the next_state
    • When any of the jobs ends with an exit return code other than 0, i.e. in error, then processing of the order will be stopped and the order will proceed to the error_state.
  • Generation of the order to start JobChain1:
    • If Job 3 ends with an exit return code = 0 then the Order 1 for JobChain1 will be generated by JobScheduler and started. This is configured using the on_return_codes attrbute.

...

...