IBM BPM, V8.0.1, All platforms > Get started with IBM BPM > Key concepts > BPEL processes and human tasks > BPEL processes overview > Fault and compensation handling in BPEL processes

Fault handling in BPEL processes

When a fault occurs in a process, the navigation continues with the fault handler or fault link.

Fault handlers can be specified for invoke activities, scopes, and on the process. Fault links can be specified for generalized-flow activities. Scopes and all basic activities, except for throw and rethrow activities, can be the source activity of a fault link.

A fault handler or fault link can catch a specific fault name, fault type, or both. When a fault occurs, Business Flow Manager uses the following rules to match the fault with a fault handler or fault link on the enclosing scope, or on the activity where the fault occurred.

If a fault is raised that does not match any of the fault handler or fault link definitions, the default fault handler is started. The default fault handler is not specified explicitly. The default fault handler runs all of the available compensation handlers for the immediately enclosing scopes in the reverse order of completion of the corresponding scopes. If the scope is the source of one or more fault links, Business Flow Manager then tries to find a matching fault link. If a matching fault link is not available or the scope is not the source of any fault links, the default fault handler rethrows the fault to the next level, that is, the enclosing scope or the process. On this next level, Business Flow Manager again tries to match the fault to the fault handlers or fault links that are available.

If the fault is not caught by any of the specific fault handlers or fault links, or by the catch-all fault handler or catch-all fault link, the fault reaches the process scope, and the process ends in the failed state. Even if a fault handler catches the fault on the process scope and handles it, the process still ends in the failed state.


Fault handler considerations

When you define a fault handler, consider the following options:


Fault link considerations

When you use fault links in your BPEL process, consider the following:


Transactional considerations

In general, if a runtime exception is raised by a called service that participates in the current transaction, the current transaction rolls back to the state that the process was in before the transaction started.

If the transaction was triggered by Business Flow Manager, it is automatically retried and the service is called again. When the transaction is retried, the Business Flow Manager can overrule the transactional behavior attribute of the activity, and introduce additional transaction boundaries in order to determine the activity that is causing the runtime exception.

If the called service raises the runtime exception repeatedly, the runtime exception is stored in a separate transaction. During the next retry the service is not called again but the stored exception is restored and the navigation continues with the fault handling.

Fault and compensation handling in BPEL processes


Related concepts:
Faults overview