Versions Compared

Key

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

...

The below workflow implements the use case from the with the following instructions:

...

Explanation:

  • This workflow implements:
    • an outer Retry Block to repeat execution,
    • an inner Job Instruction that fails with varying return codes,
    • an inner If Instruction to decide about the handling of specific return codes.

...

The job is implemented to complete with varying return codes that which are handled like this:


Explanation:

...

  • Within the Retry Block the JS7 - If Instruction is used to check the return code value, This value is available from with the built-in $returnCode variable.
  • The first If Instruction excludes by use of uss the $returnCode != 0 predicate to exclude any successful orders from the nested If Instruction. For details about predicates, see JS7 - Expressions for Variables.
  • The second If Instruction determines the error handling by use of using the $returnCode == 1 predicate:
    • if the return code value is 1 then the left branch (true) of the If Instruction is used,
    • for any other return code values the right branch (false) is used.
  • Subsequently we find two occurrences of a JS7 - Fail Instruction.

...

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

Implications

In this scenario the job is configured to consider return codes 1 and 2 as signaling success. This allows to later on check the return code and act accordingly by to be checked and appropriate action to be taken by either failing or retrying order execution.

At the same time this implies that the job is not considered being to have failed. As a result:

These implications might reflect what some users need. For an alternative solution that fails the offending job and that creates notifications see JS7 - How to retry a job and to catch specific exit codes.

...