Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Intermediate save

...

Code Block
languagexml
titleJobChain0 with return code parameters
<job_chain title="JobChain0">
	<job_chain_node error_state="Error" job="Job1" next_state="2" state="1"/>
	<job_chain_node error_state="Error" job="Job2" next_state="3" state="2"/>
	<job_chain_node error_state="Error" job="Job3" next_state="4" state="3">
		<on_return_codes>
			<on_return_code return_code="0">
				<add_order xmlns="https://jobscheduler-plugins.sos-berlin.com/NodeOrderPlugin" job_chain="Chain1"/>
			</on_return_code>
		</on_return_codes>
	</job_chain_node>
	<job_chain_node error_state="Error" job="Job4" next_state="5" state="4"/>
	<job_chain_node error_state="Error" job="Job5" next_state="6" state="5"/>
	<job_chain_node error_state="Error" job="Job6" next_state="Success" state="6"/>
	<job_chain_node state="Success"/>
	<job_chain_node state="Error"/>
</job_chain>

Further Examples

The following subjects have not been covered in this article:

  • Workflow within a job chain (to_state)
  • Error handling in the event of non-zero return codes
  • Dynamic modification of parameters within a job chain
  • Setting parameters and IDs for orders for additional job chains

Delimitation

Limitations of use

Overlapping return codes

  • No overlapping 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
languagexml
collapsetrue
<!-- do not use overlapping return codes -->
<on_return_code  return_code="3">
	<add_order  xmlns="https://jobscheduler-plugins.sos-berlin.com/NodeOrderPlugin" job_chain="Chain_C"/>
</on_return_code>

<on_return_code  return_code="3">
	<add_order  xmlns="https://jobscheduler-plugins.sos-berlin.com/NodeOrderPlugin" job_chain="Chain_D"/>
</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="Chain_C"/>
	<add_order  xmlns="https://jobscheduler-plugins.sos-berlin.com/NodeOrderPlugin" job_chain="Chain_D"/>
</on_return_code>

 

  • No overlapping Overlapping return code ranges can should not be be used.

    • This is currently possible in JOE (Versions 1.9.7, 1.10.1) and when configuration is carried out with a code editor.

    • Example:

Code Block
languagexml
collapsetrue
<!-- 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="Chain_C"/>
	<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="Chain_D"/>
</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="Chain_C"/>
	<add_order  xmlns="https://jobscheduler-plugins.sos-berlin.com/NodeOrderPlugin" job_chain="Chain_D"/>
	<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="Chain_D"/>
</on_return_code>

...

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.

Further Examples

The following subjects have not been covered in this article:

  • Dynamic modification of parameters within a job chain
  • Setting parameters and IDs for orders for additional job chains

References