Design > Designing Processes > Fault Handling
  

Fault Handling

When you integrate applications with Process Designer, you can handle error conditions by:

Fault Handling and Boundary Events

A boundary event is an event that catches an error that occurs on the boundary of a particular step, that is, within the scope of the step where it is defined. When you enable fault handling for a step in your process, you are defining a boundary event. The fault handler listens for a fault on that step when the process executes. When the the fault is caught, the step is interrupted and the process then follows the path you define for handling the fault. In the fault path, for example, you might send an email notification and terminate the process, retry after waiting for a specified interval, suspend the process, or complete the process using an alternative path.
For example, you can catch a fault that occurs when a REST service returns an error code to the process because the host system is not accessible or because the process provided invalid data.
Note: A fault handler on a step is an interrupting boundary event. This means that when a fault occurs, the process follows the fault path and the main path from the step does not execute.

Design Guidelines for Fault Handling

When you define fault handlers, you must note the following points:
Faults can be triggered by:

Faults Triggered by Service Connectors

If a fault is triggered by a service connector, the faultInfo process object includes a description of the error and returns this to the process.
When you enable fault handling in Process Designer, you also catch any explicit runtimeError faults that might be generated by an SOA connector. For example:
<wsdl:operation name="read">
<wsdl:input message="tns:readRequest"></wsdl:input>
<wsdl:output message="tns:readResponse"></wsdl:output>
<wsdl:fault name="runtimeError" message="tns:faultResponse"/>
</wsdl:operation>

Step Types that Support Fault Handling

You can enable fault handling on the following step types:
If enabled, the fault handler catches all faults on the individual step. Because it is interrupting, it creates a separate execution path in the process. You specify a fault name field so you can get all the fault details in the process object.
On the Fault Handling tab for each of these Step types, you can set these properties:
Property
Description
Catch Faults
Required. Check to enable fault handling on this step.
By default, this option is disabled.
Fault Field Name
Required if Catch Faults is enabled.
The fault name, which defaults to faultInfo.
The following image shows a service step with fault handling enabled:
You can also configure a specific fault type, reason, and description in a Throw step. You can then call the Throw step from other processes when it is caught by a pattern or process, rather than using an output field to pass fault information.

Methods to Return a Fault from a Process

  1. 1Use an output. This is suitable when you foresee that the error might occur and you want to use a data decision step to branch the process based on the normal process flow.
  2. 2Throw a fault. This is suitable when the only appropriate response to the error is to pass the error up to the caller or log the error and suspend the process. For example, if you attempt to access a web service that responds with the HTTP status code, 403 Forbidden, it indicates that the service understood the request but refuses to take any action, because access is denied. Throwing a fault is normally the best option to handle this error because you are unlikely to resolve it in the normal process flow.

Throw Step Usage

When you add a Throw step to a process, the error information is propagated by the Throw step. This allows you to catch the fault when you call it, for example, through a Subprocess step.
Note that:
  1. 1The name must be a string value.
  2. 2Throw is a terminating step so it does not support any outbound links.
  3. 3A Throw step can be used to rethrow information caught using a fault handler. In that case, the payload for the step is a faultInfo element that contains the parameters returned by the service, service connector, or SOA connector.
  4. 4You can also use a Throw step to construct specific fault information that you want to use as part of your process.