Versions Compared

Key

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

The JS7 - Try / Catch Instruction is used for the error handling in a workflow. If any job runs in the try block and failed due to any reason the catch block will execute otherwise it will skip the catch block. If the catch block will also fail then the order Order will be considered as failed. The folder 04_ErrorHandling contains the example for the try-catch. The four workflows are available with the different use cases for the try-catch:

The jsReTry workflow will retry to execute the job if it fails due to any reason. You can define no of maximum retries. If after the maximum retries the job fails then the order Order will be considered as failed and end the workflow. If after multiple retries the job will become successful then the order Order will complete successfully.

To execute the workflow in the folder 04_ErrorHandling please follow the below steps:

  1. Click on the folder 04_ErrorHandling from the and expand any of the workflows. Here I am using ErrorHandling and expand the jsReTry workflow.



  2. To add the order Order in the workflow. Click on the action menu of the workflow and click on Add orderOrder button from the drop-down menu.




  3. On clicking the Add Order. A popup window will appear. 
  4. You can add the Order ID or leave the Order Id value blank it will take the default Order Id to process the Order. Click on Submit button to add the Order



  5. To check the status of the Order click on the Workflow name with this new Order history panel will appear. 



  6. From the Order history panel, you can see the Order is successful and finished. Click on the Order ID to open the detail logs of execution.



  7. A log window will open and the order Order log will be displayed. The order Order log contains log output from all jobs executed by the orderOrder
  8. You can download the log file by clicking the Download button from the upper right corner of the log window. Also, you can expand and collapse the individual job output using the arrow button from the left corner of the log window.