Adding a global exception handler to an orchestration

During run time if any of the activities of the orchestration throws an exception, and a global exception handler has been enabled, the global CatchAll branch is run.

About this task

The following figure shows an example orchestration:

An example orchestration

In this example, if either the Database Get Inserted or the Database Insert Rows activities fail and throw an exception, the If..Then activity in the CatchAll branch is run.

Procedure

  1. Right-click the start icon Start icon of the orchestration and from the menu, and select the Add CatchAll Branch option. The CatchAll branch is added to the orchestration and the following variables are automatically created:
    • faultName - During run time, the faultName variable contains the name of the exception thrown by an activity in the orchestration.
    • faultData - During run time, the faultData variable contains the error message associated with the exception. This additional information is only currently returned for the Web Services activities. For Web Services activities, the faultData variable contains the fault.
    • faultInfo - During run time, the faultInfo variable returns the following nodes:
      • name - During run time, the faultInfo/name node contains the name of the exception thrown by an activity in the orchestration. The faultInfo/name node is an xsd:QName type.
      • message - During run time, the faultInfo/message node contains the error message associated with the exception. The faultInfo/message node is an xsd:string type.
      • activityId - During run time, the faultInfo/activityId node contains the activity ID that uniquely identifies the activity where the exception occurred. The faultInfo/activityId node is an xsd:int type.
      • activityName - During run time, the faultInfo/activityName node contains the activity name where the exception occurred. The faultInfo/activityName node is an xsd:string type.
      • faultTime - During run time, the faultInfo/faultTime node contains the time the error occurred. The faultInfo/faultTime node is an xsd:dateTime type.
      Note: The exception name returned by an activity in the faultName variable and the faultInfo/name node may change in a future release.
  2. Configure the CatchAll branch by dragging activities from the Activities tab to the CatchAll branch, as shown in the preceding figure.

Results

Note: The scope of the faultName, faultData, and faultInfo variables is limited to the CatchAll branch. This scope limitation means that the value of the these variables is only guaranteed to be valid within the CatchAll branch. For example, if you add a If...Then activity that tests the value of the faultName variable, the If...Then activity must be placed inside the CatchAll branch as shown in the preceding figure.