Use the Error Handler Activity to capture errors details as an object that occur in an Integration Activity or a Stored Procedure Activity. You can use these error details in any expression, such as default values, business rules, and messages.
Note: For the Error Handler Activity to capture error details, you must set the Error Handler Activity as the compensation activity.
Integration Activities and the Stored Procedure Activity depend on interaction with external services and systems. For these activities, it is important to define what happens if there is an error in the activity. , for example, if an external service is unavailable.
For the activity that you want to define a compensation, click the activity, and in the Properties panel select and alternate activity from the Compensation drop-down menu. The compensated activity can be any activity in the workflow. It can be connected to a different branch in the flow, or not connected to other activities at all.
- Catch an exception in a workflow, and then compensate based on that exception.
- A workflow requires interaction with a third party application. If that integration fails, you want to run a compensatory action to reverse the third part interaction.
- After you name and define the Error Handler Activity, connect the activity to an alternative activity from which you want the flow to continue in the event of an error.
- Select the activity you want to compensate. In the Properties panel, from the Compensation drop-down menu, select the Error Handler Activity you defined.
- After you define the Error Handler Activity, you can use the data it captured in subsequent activities as part of any expression, such as default values, business rules, and messages. For example, in a Form Activity or Task Activity you can define an error message text field and set its default value as the Error Handler object's message attribute.