Introduction
- The Fail Instruction is used to fail orders in a workflow.
- By default an order halts and is assigned the FAILED state. FAILED orders remain with their workflow position and require user intervention to transition from this state.
- If the Fail Instruction is included:
- in a JS7 - Retry Instruction then the FAILED order triggers the next retry loop, provided that the Fail Instruction is not specified as being uncatchable.
- in a JS7 - Try-Catch Instruction then the FAILED order is caught and is handled by the Catch Instruction.
- Users can resume, suspend and cancel FAILED orders - see JS7 - Order State Transitions.
Workflow Instruction: Fail
Download Workflow Example (.json upload): pdwFail.json
Explanation:
- The workflow makes use of an If Instruction to check a previous job's return values. See JS7 - If Instruction for details of how to add expressions to If Instructions.
- If the If Instruction evaluates to true then the Fail Instruction is executed. The order is then assigned the FAILED state.
- When an order is failed, a message and a return code which specify the reason for failing the order can be added as an option.
- The operation failing an order can be specified being Uncatchable indicating that a surrounding Retry Instruction will not be triggered. Instead, the order will be moved to the position after the Retry Instruction and will halt with a FAILED state.
Resources
Overview
Content Tools