Need to force business exception in a flow - Best practice?

Well in order to force a business exception in the case where the HTTP request status is not 200, you can use the following steps:

  1. Surround the https activity within try block of a try catch activity
    Then add a new Throw activity in catch block
  2. Set the Exception property of the Throw activity to a New BusinessRuleException(“Failed to download file from web service”.)

This will ensure that the process fails with a business exception if the HTTP request status is not 200.

Whether the process will continue or stop after throwing the business exception depends on where the Throw activity is placed in the process.

If the Throw activity is placed at the end of the process, the process will stop and the transaction status will be set to failed.

If the Throw activity is placed in the middle of the process, the process will continue to the next activity after the Throw activity.

Hope this clarifies

Cheers @Pelayo_Celaya_Fernandez

1 Like