Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: 'Delimitation' section rewritten

...

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 order IdsIDs for orders for additional job chains

Delimitation
Status
colourYellow
title To REDO

Workflow in the event of error is possible but does not suppress the error:

Consider the situation where orders to start either one of two job chains are to be started according to the result of a job in the middle of a job chain:

  • One of the orders could be generated when the job returns 0 and the original job chain would processing at the next_state.
  • The other order could be generated when the job returns a specific non-zero code such as 1.
    • This code would then be seen as an error and per default cause processing of the original job chain to revert to the error state.
    • The non-zero return code could however be used to specify a to_state parameter for the original job chain. This would ensure that processing of the original job chain could continue from a state (i.e. job) specified for the to_state parameter.
  • If an order for another job chain is to be generated in the event of an error occurring in a job  ->
  • If alternative job chains are to be started depending on the return code (OR) then only one of the alternatives can not result in an error (only one success code poss)

References

...