You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 14 Next »

Introduction

  • The Retry Instruction adds error handling to one or more job nodes and other instructions in a workflow.
  • If one of the jobs in the Retry block fails, then the order is moved to the begin of the Retry block to repeat execution.
  • The number of tries and the respective delays are configured using the Retry Instruction.
  • If the maximum number of tries is reached and a job in the Retry block fails, then the order is considered to have failed.

Workflow Instruction: Retry



Explanation:

  • If any of the three jobs within the Retry block fails, then the order will wait for the specified delay and then repeat the Retry block from the first job node in the block.
  • This example makes use of a maximum of 10 tries and an individual delay, which is lengthened by one second with each retry.
  • If the number of delays specified is lower than the number of tries then the last delay specified will be used for subsequent retries.

Use of Retry Variables

FEATURE AVAILABILITY STARTING FROM RELEASE 2.7.2

Users who wish to programmatically use variables that indicate the max. number of retries and the current retry counter in their jobs can use the built-in variables

  • $js7MaxTries: maximum number of retries
  • $js7TryCount: current number of retries

The variables can be used in an JS7 - If Instruction and they can be mapped to environment variables in a shell job like this:


Explanation:

  • The $js7MaxTries variable is mapped to the MAX_TRIES environment variable.
  • The $js7TryCount variable is mapped to the TRY_COUNT environment variable.

Environment variables can be used in shell jobs for Unix using $MAX_TRIES and $TRY_COUNT syntax. In shell jobs for Windows the %MAX_TRIES% and %TRY_COUNT% syntax is used.

Further Resources

How To ... Instructions


  • No labels