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.
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.
Right-click the Scope or Process element and choose Add > Fault Handlers.
An empty container element appears.
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.
Add an activity to the Catch or Catch All element that will be executed in case of a fault.
Use this element to intercept and deal with a specific kind of fault.
This element is used within an appropriate Fault Handlers container element.
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:
Fault Name — Selects the qname of the fault from the list of faults, which contains faults defined in the WSDL files. You can also specify a new user-defined fault in a fault handler or in a throw.
Fault Variable Name — Specifies the name of a variable. The Catch is the receiver of the fault. The fault is produced by either a throw, a partner, or system. The fault variable puts the message's data into the fault. This variable is created and initialized in the Catch.
Fault Variable Type — Specify the type of the variable. The type can be either Message (WSDL) or Global Element (XSD).
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 predefined and requires no property configuration.