ActiveVOS Designer User’s Guide

Tutorial Part 6: Adding Fault Handling

To start at the beginning of the tutorial, see Introduction to ActiveVOS 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 process throws a fault, it terminates the process via a standard fault, and turns over control to the fault handler activity.

In the loanprocess.wsdl file, there is a fault name and a fault message defined for the WSDL’s operation, namely the request operation. The loan process uses the fault name and message in defining fault handling activities for the assessor and approver services.

In the Project Explorer view, 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.

  1. Click on the Fault Handlers tab of the Process Editor.
  2. From the Handlers palette, drag a Catch activity to the canvas.
  3. Select the catch handler.
  4. In the Properties view, select Fault Variable Definition, and click the Dialog (...) Button at the end of the row.
  5. Fill in the Fault Variable Definition dialog as follows and click OK:
    1. Select the Element radio button.
    2. From the list of messages, select loan:errorMessage.

    Variable Definition dialog

  6. In the Properties view, select Fault Name, and click the Dialog (...) Button at the end of the row.
  7. In the Fault Name list, notice that the WSDL fault name associated with both the assessor and approver services is the same, but each is in a different namespace. For convenience, the WSDL for each service used the same fault name, but usually if you are orchestrating two different services the fault names would be different. Select the approvews:loanProcessFault, as shown in the example.
  8. approver’s LoanProcess Fault

  9. In the Fault Variable field, type errorApprove, which is the name we will associate with the fault variable definition. The properties for the Catch activity should look like the following example:
  10. Properties for error variable in Catch activity

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

process variables view with fault variable

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.

  1. From the Event palette, drag a Reply activity into the Catch handler and name the activity ReplywithApprovalFault, as shown.
  2. Reply activity in catch handler

  3. Fill in the properties for the reply activity to handle the fault, as shown in the example. You must select them in the following order: Participant (loanProcessor), Operation (request), Fault Name (unableToHandleRequest).
  4. Reply activity properties, inlcuding Fault Name

  5. On the Data tab, select the new variable (errorApprove).
  6. Reply activity properties, inlcuding Fault Name

  7. Add a similar Fault handler for the risk assessment service by selecting the same fault variable definition and the new fault name riskws:loanProcessFault and naming the fault variable errorRisk. Name the Reply ReplywithRiskFault.

Your Fault Handlers view should be similar to the following:

fault handlers complete

Proceed to Tutorial Part 7: Adding Compensation and Correlation.