Orchestration processes can encounter errors during processing, such as services being unavailable or improperly formatted incoming messages. TIBCO ActiveMatrix BusinessWorks BPEL Extension allows you to catch errors and determine what actions to perform in the event of an error.
Potential errors, also known as exceptions or faults, that each activity can raise are displayed on the Error Output tab of each activity. See
Chapter 10, Palette Reference for more information about each activity’s potential errors.
The Catch activity is used to trap errors and define an error handling routine. This activity can catch specific errors that activities can encounter, or the activity can be configured to catch all errors that do not have their own error-handling routine. Processing transfers to the appropriate Catch activity when an error occurs, and then you can create transitions to other activities to perform actions to handle the error. You cannot draw transitions to the Catch activity or from activities in the error handling routine to the main processing flow. The only transitions that are permitted are transitions to the end of the scope.
Figure 27 illustrates a partial orchestration process that has two error handling routines.
The CatchAll activity begins the error-handling routine defined at the top-level scope for the process. This routine catches any unhandled error, replies with a fault message, then exits the process.
The group FindInventory is a scope where the inventory is either available in current stock or must be ordered from an outside vendor. Processing within the scope begins with an activity that checks the status of inventory for the items ordered. If inventory is available, the INV_AVAILABLE process variable is set to true and the scope exits. If inventory is not available, an invocation to an external service orders more inventory, then the variable is set and the process continues to execute. Within this scope, if an invalid item is requested, the BadItem error is raised and processing transfers to the CatchBadItem error-handling routine. In the event of an error, the error is written to the log file then processing transitions to the end of the scope.
Errors that occur that are not handled by any error-handling routine are propagated to the calling environment. In the example in
Figure 27, the CatchBadItem activity catches any BadItem errors that occur while the FindInventory group is executing. The CatchAll activity catches any other error.
Errors can also occur during the processing of an error-handling routine. In this case, the error cannot be caught by any error-handling routine within the same scope. The error is propagated to the parent scope.