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

Compare with Current View Page History

« Previous Version 7 Next »

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 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 jsTryCatch workflow is used for error handling when the execution of the job in the try block will fail the catch will execute and try to complete the order successfully. If the catch will execute and fail then the order is considered as failed. In the example, if the try block generates an odd no then the catch block will execute and try to create an even number to complete the workflow. If the catch block fails to create an even number, the order will fail and end the execution.

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 the jsTryCatch workflow.



  2. To add the order in the workflow. Click on the action menu of the workflow and click on Add order 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 log will be displayed. The order log contains log output from all jobs executed by the order. 
  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.

  • No labels