...
- the How to configure the handling of exit codes by jobs article
- the JobScheduler <job_chain_node.job_chain> Element reference
Feature comparison
...
This is done in the Nodes tab of the JobScheduler Object Editor JOE for JobChain0 as shown in Screenshot 1 below.
(A more detailed description of how to use JOE to configure a job chain can be found in JobScheduler Tutorial 2 - Editing a Simple Job with JOE.)
- The standard progression through the job chains is configured in the NextState and ErrorState fields of the form.
- Generation of the order to start JobChain1 is configured as shown in the screenshot:
- 1) Select Job3 since we want to start JobChain1 if this job ends successfully
- 2) Click on the Return Codes button to open the Return Code configuration form
Screenshot 1
- 1) Give the return code, e.g
. return_code = 0
signals success, in the ReturnCodes field- Syntax:
- Individual return codes are separated by spaces (e.g. 1 2).
- Return code ranges are inclusive and written 1..5 6..9
- Return codes can only be specified once
- Behavior:
- Note that non-zero return codes can be used but will be seen as an errors in the originating job chain.
- Should no
<on_return_code>
element match the current return code then JobScheduler will apply thejob_chain_node@next_state
(return code 0) orjob_chain_node@error_state
(other return codes) attribute.
- Syntax:
- 2), 3) Select the target job chain e.g. JobChain1 from the drop down list
- only job chains present in the same folder will be available in the Job Chain dropdown list
- Other job chains can be:
- navigated to using the Browse button.
- specified using the syntax:
/myFolder/myJobChain.
- 4) Click on Add Order button to assign the Order to the
JobChain1
- 5) Click on Apply (at the foot of the form)to make the changes in the job chain configuration
- Save the job chain configuration.
Screenshot 2
Example Job Chain Code
...
Limitations of use
Overlapping return codes
Avoid creating overlapping return codes and/or overlapping return code ranges.
- Overlapping return codes should not be used to create multiple orders.
This is automatically corrected in JOE but is possible when configuration is carried out with a code editor.
Example:Code Block language xml title Example showing 'overlapping' of return-codes collapse true <!-- do not use overlapping return codes --> <on_return_code return_code="3"> <add_order xmlns="https://jobscheduler-plugins.sos-berlin.com/NodeOrderPlugin" job_chain="JobChainC"/> </on_return_code> <on_return_code return_code="3"> <add_order xmlns="https://jobscheduler-plugins.sos-berlin.com/NodeOrderPlugin" job_chain="JobChainD"/> </on_return_code> <!-- use mutliple add_order elements for the same return code --> <on_return_code return_code="3"> <add_order xmlns="https://jobscheduler-plugins.sos-berlin.com/NodeOrderPlugin" job_chain="JobChainC"/> <add_order xmlns="https://jobscheduler-plugins.sos-berlin.com/NodeOrderPlugin" job_chain="JobChainD"/> </on_return_code>
...
Overlapping return code ranges should not be be used.
This is currently possible in JOE (versions 1.9.7, 1.10.1).
Example:
Code Block language xml title Example showing 'overlapping' of return-code ranges collapse true <!-- do not use overlapping return code ranges --> <on_return_code return_code="3"> <add_order xmlns="https://jobscheduler-plugins.sos-berlin.com/NodeOrderPlugin" job_chain="JobChainC"/> <to_state state="6"/> </on_return_code> <on_return_code return_code="1..3"> <add_order xmlns="https://jobscheduler-plugins.sos-berlin.com/NodeOrderPlugin" job_chain="JobChainD"/> </on_return_code> <!-- use a number of return code configurations --> <on_return_code return_code="3"> <add_order xmlns="https://jobscheduler-plugins.sos-berlin.com/NodeOrderPlugin" job_chain="JobChainC"/> <add_order xmlns="https://jobscheduler-plugins.sos-berlin.com/NodeOrderPlugin" job_chain="JobChainD"/> <to_state state="6"/> </on_return_code> <on_return_code return_code="1..2"> <add_order xmlns="https://jobscheduler-plugins.sos-berlin.com/NodeOrderPlugin" job_chain="JobChainD"/> </on_return_code>
<on_return_code> matching limitations
...
JobScheduler executes on_return_code elements one after the other and executes any element containing a to_state attribute first. This means that of a job ends with a return code that is matched by a number of on_return_code elements, only the element with a to_state attribute will be executed as once this has been done, the order will no longer be at the original state to execute any further on_return_code elements.
...
References
Change Management References
...