Using the BPEL Designer and Service Engine

Using a Fault Handler

The BPEL language provides the capability to catch and manage exceptions using fault handlers. For example, exceptions occur when web services return different data than was expected. If faults are not handled, the entire BPEL process can be thrown into a faulted state. Therefore, to prevent the entire process from fault, you can add fault handlers to catch and manage exceptions within particular Scopes.

When to Use

Each fault handler contains an activity that runs in case of an error. For example, a partner service is notified if an error has occurred. Fault handlers can be added to the entire process or to individual Scope elements.

You can attach one Fault Handler container to either the Process or the Scope elements. Inside the Fault Handlers container, you can create several Catch activities configured to catch specific kinds of faults, or one Catch All handler element to catch all the exceptions not caught by specific handlers.

Usage

  1. Right-click the Scope or Process element and choose Add > Fault Handlers.

    An empty container element appears.

  2. Right-click the Fault Handler container and choose Add > Catch or Add > Catch All.

    You may add as many specific Catch elements as you wish to the Fault Handlers group. You can add only one Catch All element per Fault Handlers container.

  3. Add an activity to the Catch or Catch All element that will be executed in case of a fault.

Catch Element

Use this element to intercept and deal with a specific kind of fault.

This element is used within an appropriate Fault Handlers container element.

Catch Element Properties

The properties of the Catch element are defined in the Properties window. You can also right-click the element on the diagram and choose Properties.

The available properties are:

Catch Properties Window

Catch All Element

Use the Catch All element to intercept and deal with all faults that are not caught by an associated catch element.

The Catch All element is used within a fault handler window along with one or more Catch elements. It is defined within a Fault Handlers container element along with one or more Catch elements.

There are no properties for the Catch All element. Its behavior is pre-defined and requires no property configuration.