ActiveBPEL® Designer User’s Guide
To start at the beginning of the tutorial, see Introduction to ActiveBPEL Tutorial.
Fault handling in a BPEL process is reverse work, undoing the partial and unsuccessful work of a scope in which a fault has occurred. When a fault occurs, normal processing is terminated, and control is transferred to the corresponding fault handler.
So far in the tutorial, you have completed a BPEL process definition that contains all the steps for normal processing. Now you will add a fault handler to handle a service invocation fault.
If the loan approval process throws a fault, it terminates the process via a standard fault, and turns over control to the fault handler activity.
In the loanServicePT.wsdl file, there is a fault name and a fault message defined for each of the WSDL’s operations, namely the request, check, and approve operations. The loan approval process uses the fault name and message in defining fault handling activities for the customer, assessor, and approver services.
In the Navigator view of ActiveBPEL, you should have the following files:
By completing Part 6 of the tutorial, you will be able to:
Step 1: Add a Catch fault handler and fault variable
Upon receipt of an inbound fault message, a fault handler assigns the fault message to a variable before proceeding to perform an activity enclosed by the catch.
lns:errorMessage.


error,
which is the name we will associate with the fault variable definition.
The properties for the Catch activity should look like the following
example:

Also notice that a new variable named error has
been added to Process Variables view. This variable is exclusively
for fault handling, indicated by an icon that differs from normal
process variables.

Step 2: Add a fault handling activity
When a fault is caught, the fault handler must execute an activity. We will add a Reply activity to tell the customer that the process was unable to handle the request.


The process can now catch a fault from either the loan assessor or the loan approver service. This is because both services define the same fault name and message. For the loan approval process, it makes sense to add one fault handler to the process as a whole. As an alternative, we could have designed the process to include individual fault handlers for each invoke activity.
Tip: Instead of filling in the Reply’s properties manually, you can use the Operation Wizard to drag the Web References’ request operation to the Catch activity. When the wizard opens, select Reply with Fault to automatically fill in the Reply’s properties shown in the example above.
Proceed to Tutorial Part 7: Adding Compensation and Correlation.
Copyright (c) 2004-2007 Active Endpoints, Inc.