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
Continue-on-error behavior of BPEL processes and activities
When you define a BPEL process, you can specify what should happen if an unexpected fault is raised and a fault handler is not defined for that fault. You can use the Continue processing upon unhandled faults setting when you define your process to specify that it is to stop where the fault occurs.
For most activities, the continue-on-error behavior is the same as for the process. You can specify the continue-on-error behavior explicitly for invoke, Java snippet, custom, and human task activities. By default, the continue-on-error behavior of these activities is also the same as for the process. If an unexpected fault is detected, fault handling of the activity is started.
If the Continue processing upon unhandled faults setting is set to Yes, then the standard fault handling is applied. If the Continue processing upon unhandled faults setting for the activity or the process is set to No and the fault is not handled by a fault handler on the immediately enclosing scope or by a fault link leaving this activity, the activity is stopped. If the activity has an associated fault handler or compensation handler, the immediately enclosing scope is the activity itself. In all other cases, the immediately enclosing scope is the next surrounding scope in which the activity is contained. If a catch-all fault link or fault handler is defined on the immediately enclosing scope, the value of the Continue processing upon unhandled faults setting does not have any effect, because the fault is always handled and the activity is never stopped.
For activities that stopped because of an unexpected fault, you can use the stopReason property of the activity to determine the cause of the fault and the actions that you can take to repair it. The following table shows the values the stopReason property can take in fault situations.
Values for the stopReason property Value of the stopReason property Cause Allowed actions STOP_REASON_ACTIVATION_FAILED The evaluation of the join condition of the activity failed. You can use the force join condition to set the condition to true or false or to reevaluate it.
- Force retry
- Force the join condition
STOP_REASON_IMPLEMENTATION_FAILED The implementation of the activity threw a fault. This value is set if the implementation of the activity failed, for example:
- A service called by an invoke activity returned a fault that is not handled by a fault handler.
- A timeout expression failed when a wait activity was activated.
- The evaluation of an exit condition of an activity failed.
- Force retry
- Force complete
If the evaluation of a while or repeatUntil condition failed, the value of the kind property is either KIND_WHILE or KIND_REPEAT.
- Force retry
- Force complete
- Force the loop condition
If the evaluation of a forEach counter or condition failed, the value of the kind property is either KIND_FOR_EACH_SERIAL or KIND_FOR_EACH_PARALLEL.
- Force retry
- Force complete
- Force the values of the forEach counter
The evaluation of the branch expression in choice activity (also known as a switch activity) failed. Force the navigation of the branch STOP_REASON_FOLLOW_ON_NAVIGATION_FAILED The evaluation of a transition condition of an outgoing link failed. This value is set in one of the following situations:
- In a parallel flow (also known as a parallel activities activity), after an activity completed, the transition conditions of the outgoing links were evaluated, and one of them produced a fault.
- In a cyclic flow, if none of the outgoing links qualify for follow-on navigation.
- Force the navigation of the outgoing link
- Force complete
STOP_REASON_EXIT_CONDITION_FALSE The criteria for the exit condition were not met. This value is set only when the exit condition is evaluated on exit of an activity and the condition evaluates to false. If this error occurs, the activity is always stopped regardless of the Continue On Error setting.
- Force retry
- Force complete
Stopped activities can be repaired with the one of the Business Process Choreographer API force or skip methods, or with the corresponding actions in Business Process Choreographer Explorer. You can also modify the activity variables before you carry out the repair action. The following table summarizes the API methods and the Business Process Choreographer Explorer actions.
Repair actions and API methods for stopped activities Repair action API method Action in Business Process Choreographer Explorer Force retry forceRetry Restart Force complete forceComplete Force Complete Force the join condition forceJoinCondition Repair Join Force the loop condition forceLoopCondition Next Iteration or End Loop Force the values of the forEach counter forceForEachCounterValues Repair For Each Force the navigation a branch within a choice activity forceNavigate(..., int positionOfBranch)Force Case Navigation or Force Case Execution Force the navigation of an outgoing link forceNavigate(..., ... linksToBeFollowed)Force Navigation Force complete and jump forceCompleteAndJump Force Complete Source Activity and Jump Skip skip Skip or Skip Activity Skip and jump skipAndJump Skip Source Activity And Jump
Fault handling in BPEL processes
Related concepts:
State transition diagrams for activities in BPEL processes
Continue on Error setting
Related tasks:
Processing human task activities
Forcing the completion of an activity
Retrying the execution of a stopped activity