Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents
outlinh1. true
outlinh1. true
1printablefalse
2stylh1. none
3indent20px

Introduction

JobScheduler can manage work flow workflows according to the results of jobs - , i.e. their return codes. It can use job return codes to:

  • define the next job node to be executed in the same job chain and
  • start orders for other job chains.

Feature History

Workflow Control control by return code handling was introduced with Release release 1.9.0.

Issues

This feature Feature support is subject to the following issues:

...

Workflow control by job return codes allows conditional job chain execution and the representation of more dynamic and complex processes than was previously possible with JobScheduler. This feature should therefore be relevant to Engineering, Operating and Business. 

The return codes from individual jobs in a job chain can be used to:

...

The feature has been implemented to use individual return codes (0, 1, 2, etc.) or return code ranges (1-5, 6-9, etc.).

A typical implementation within a job chain would be:

  • a return code of 0 will cause an order should go to  move to the next_state in the job chain.
  • a return code between 1 and 5 will cause the order should go to move to the cleanup_files state. 
  • a return code between 6 and 9 will cause the order to go proceed to the error state.

A typical implementation for additional job chains:

  • a return code of 0 will cause an order should go to move to the next_state in the job chain and to generate an order for an additional job chain.
  • a non-zero return code causes an order to go proceed to the error_state and start a second, error handling job chain.

...

  • The standard progression through the job chains:
    • When any of the jobs in either chain ends with an exit 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 code other than 0 (, i.e. in error) , then processing of the order will be stopped and the chain order will go proceed to the error_state.
  • Generation of the order to start JobChain1:
    • If Job 3 ends with an exit code = 0 then the Order 1 for JobChain1 will be generated by JobScheduler and started. This in is configured using the on_return_codescodes attrbute.

Configuring the return codes

...

  • 1)  Give the return code e.g. return_code = 0 is success in the ReturnCodes field
    • Syntax:
      • Individual return codes are separated by blank 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 the job_chain_node/@nextnode@next_state (return code 0) or job_chain_node/@errornode@error_state (other return codes) attribute.
  • 2), 3)  Select the target job chain e.g. JobChain1 from the drop down list 
    • (warning) 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 an 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.

...