Versions Compared

Key

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

Table of Contents

Introduction

JS7 offers allows a number of strategies for error handling:

...

Download example (upload .json): pdwTryCatch.workflow.json

The basic way how to use for using the Try-Catch Instruction includes:

  • adding any number of jobs or other workflow instructions to the Try block
  • using an empty Catch block.

This configuration will catch any the errors occurring in jobs or instructions inside the Try block:

...

The Try-Catch Instruction can be used:

  • to add any number of jobs or other workflow instructions to the Try block
  • to use a Catch block that includes one or more jobs or other workflow instructions that which are aimed at recovering from a previously failed job.

This configuration will catch any the errors occurring in jobs or instructions inside the Try block:

  • The order enters the Catch block and executes jobs and instructions inside this block.
    • If job2b completes successfully then the order will leave the Catch block and will continue with job3.
    • If job2b fails then the order will be put in the failed state, will be stopped and will remain in the Catch block to wait for user intervention.
    • Consider Note that Try-Catch instructions can be nested, i.e. in a Catch block another Try-Catch instruction can be used for error handling.

...

The Try-Catch Instruction can be used:

  • to add any number of jobs or other workflow instructions to the Try block
  • to use a Catch block that includes the JS7 - Finish Instruction that makes the order leave the workflow.

This configuration will catch any the errors occurring in jobs or instructions inside the Try block. When entering the Catch block the order will leave the workflow and will carry a successful History outcome.

...

For earlier JS7 releases users have to add a dummy job before the Finish instruction that . This guarantees successful execution in order to force a successful History outcome.

...

The Try-Catch Instruction can be used:

  • to add any number of jobs or other workflow instructions to the Try block:
  • to use a Catch block that includes the JS7 - Fail Instruction that which makes the order leave the workflow.

This configuration will catch any the errors occurring in jobs or instructions inside the Try block. When entering the Catch block the order will leave the workflow and will carry a failed History outcome.

...

For earlier JS7 releases users should apply the Finish instruction instead of the Fail instruction in the Catch block to . This will make an the order leave the workflow with a failed History outcome.

...