Versions Compared

Key

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

...

The implementation makes use of the following instructions:

Workflow

ddThe below workflow implements the use case.

Download: retry-on-return-code.workflow.json

x

Image Removed

...

Image Added


Explanation:

  • This workflow implements
    • an outer Retry Block to repeat execution.
    • an inner Try / Catch Block to handle specific exit codes of the job.

Try Block

Image Added


Explanation:

  • After a first job job1 the job2 should be restarted for a number of times if it fails with return code 1.
  • The JS7 - Retry Instruction manages the retry capability and the intervals.
  • JS7 - Try / Catch Instruction 
    • executes the job within the Try Block.
      • Should the job complete successfully then processing will continue after the Catch Block.
      • Should the job fail then it will enter the Catch Block.

Catch Block

If Instruction

Image Added


Explanation:

  • Within the Catch Block the JS7 - If Instruction is used to check the return code value which gives two options:
  • If the return code is 1 then left branch of the If Instructions used for any other return code values the right branch is used.
  • Subsequently we find two occurrences of a JS7 - Fail Instruction.

Fail Instruction

Left Fail

Image Added


Explanation:

  • The left Fail Instruction fails the order with a return code 1.
  • In addition, a message can be added that becomes visible with the JOC Cockpit GUI for the failed order.
  • As a consequence the failed order is picked up by the outer Retry Instruction that will repeat execution of job1.

Right Fail

Image Added


Explanation:

  • The right Fail Instruction fails the order with a return code 2.
  • In addition, a message can be added that becomes visible with the JOC Cockpit GUI for the failed order.
  • The checkbox uncatchable is used to indicate that the failed order cannot be picked by the outer Retry Instruction and therefore will remain with the current position in a failed state.