Details
-
Feature
-
Status: Released (View Workflow)
-
Major
-
Resolution: Fixed
-
None
Description
Workflow Control
This feature allows to configure the next job node in a job chain for a range of exit codes of the current job.
In addition to controlling the workflow by next_state (true) and error_state attributes the exit code of shell processes can be used directly. The return values true and false of API tasks are mapped to the same result as exit code 0 (success) and 1 (error).
Use Cases
- If the exit code of the current task returns 3 then the next state for the order should be the error state. Other exit codes are considered to represent the successful execution of the task.
- If the exit code of the current task returns one of the values 3-9 then the order should be assigned a specific state and should be continued by the respective job node.
Examples
<job_chain xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://www.sos-berlin.com/repository/scheduler/1.9/scheduler.xsd"> <job_chain_node state="100" job="/test-a"/> <job_chain_node state="200" job="/test-a"> <on_return_codes> <on_return_code return_code="7..9 100..199 -99999..-1000"> <to_state state="end"/> </on_return_code> </on_return_codes> </job_chain_node> <job_chain_node state="300" job="/test-a"/> <job_chain_node.end state="end"/> </job_chain>
Explanations
- Should the element <to_state> be missing, then JobScheduler will apply the job_chain_node/@next_state or job_chain_node/@error_state attribute.
- For return_code single values can be specified and closed intervals [i, j] separated by spaces, e.g. "1..5 7 12..15".
- Each return code can only be used once..
- The attributes next_state and error_state are applied if no on_return_code element is used.
- Should no <on_return_code> element match the current return code then JobScheduler will apply the job_chain_node/@next_state (return code 0) or job_chain_node/@error_state (other return codes) attribute.
Attachments
Issue Links
- is duplicated by
-
JS-614 Next job chain node depends on exit code
- Dismissed
- is related to
-
DOC-34 Add documentation for configurable workflow control by exit code handling
- Approved
-
JS-1790 Order steps should be considered successful if a task's exit code is handled by <on_return_code> configuration
- Released
-
JS-1757 Exit code set by spooler_task.exit_code should be evaluated by job chain on_return_code
- Dismissed
- is required by
-
JS-1193 Start of an order should be possible depending on the result of a task of a job chain node
- Released
- requires interactional consideration of
-
JOE-106 JOE allows to manage job node dependencies
- Released