IBM BPM, V8.0.1, All platforms > Programming IBM BPM > Enterprise Service Bus programming > Imports and exports

Fault handling

You can configure your import and export bindings to handle faults (for example, business exceptions) that occur during processing by specifying fault selectors and fault handlers. The fault selector determines whether the response message is a normal response, a business or runtime fault that is received by an import. A fault handler processes fault data and transforms it into the correct format to be sent by the export or import binding.


Fault selector

When an inbound response is received, a fault selector is used by the import to determine whether the response message is a normal response, a business fault or a runtime exception. The message at the import includes raw transport header information and encoded data for the body of the message. The fault selector can use header data, body data, or both, to determine the type of the message. Once the fault type has been determined using the fault selector the appropriate fault handler can be used to convert the fault data to a business object. WebSphere ESB provides the following fault selectors:

An API is provided for custom fault selectors to be written. These are implemented with a Java class that implements the commonj.connector.runtime.FaultSelector interface.


Fault handler

A fault handler is a type of data handler that is designed to handle fault message data. A fault handler processes fault data and transforms it into the correct format to be sent by the export or import binding. Fault handlers are defined in combination with the response data handler, so that an import can handle runtime exceptions and business faults returned to it. They are only defined on imports. They default to the data handler defined for the response data. Similarly to data handlers, they can be defined at the binding, interface and operation level. Any of the data handlers provided by WebSphere ESB can be used as a fault handler.

Imports and exports