Versions Compared

Key

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

Table of Contents

Introduction

Assume Consider the following scenario:

  • A number of jobs are executed in sequence.
  • If one or more jobs fail with return code 1 then the these jobs should be repeated for a number of times. For any other non-zero return codes, the order should be put to a failed state and should wait for user intervention, for example to resume or to cancel the failed order.
  • A related scenario is available from described in the  JS7 - How to retry a job and to catch specific exit codes article.

Solution

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

...

  • Within the Retry Block the JS7 - If Instruction is used to check the return code value, This value is available with the built-in $returnCode variable.
  • The first If Instruction uss uses 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 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.

...

...