Versions Compared

Key

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

...

Try-Catch Instruction with empty Catch Block

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

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

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

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

  • The order enters and immediately leaves the Catch block.
  • The order will continue with the next job or instruction following the Catch block.

Image Added


Feature Status:

Display feature availability
StartingFromRelease2.5.0

Jira
serverSOS JIRA
columnIdsissuekey,summary,issuetype,created,updated,duedate,assignee,reporter,priority,status,resolution
columnskey,summary,type,created,updated,due,assignee,reporter,priority,status,resolution
serverId6dc67751-9d67-34cd-985b-194a8cdc9602
keyJS-2005

For earlier JS7 releases a dummy job has to be added to the Catch block to force a successful outcome for the order.

Try-Catch Instruction with Jobs in Catch Block

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

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 act to recover from a previously failed job.

This configuration will catch any 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 that Try-Catch instructions can be nested, i.e. in a Catch block another Try-Catch instruction can be used for error handling.

Image Added


Try-Catch Instruction with Catch Block making Orders leave the Workflow with successful Outcome

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

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 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.

Image Added


Feature Status:

Display feature availability
StartingFromRelease2.5.0

Jira
serverSOS JIRA
columnIdsissuekey,summary,issuetype,created,updated,duedate,assignee,reporter,priority,status,resolution
columnskey,summary,type,created,updated,due,assignee,reporter,priority,status,resolution
serverId6dc67751-9d67-34cd-985b-194a8cdc9602
keyJS-2005

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

Try-Catch Instruction with Catch Block making Orders leave the Workflow with failed Outcome

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

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 makes the order leave the workflow.

This configuration will catch any 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.

Image Added


Feature Status:

Display feature availability
StartingFromRelease2.5.0

Jira
serverSOS JIRA
columnIdsissuekey,summary,issuetype,created,updated,duedate,assignee,reporter,priority,status,resolution
columnskey,summary,type,created,updated,due,assignee,reporter,priority,status,resolution
serverId6dc67751-9d67-34cd-985b-194a8cdc9602
keyJS-2014

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