Fault Handlers

Fault handlers are defined in the business process to allow faults thrown by invoked services to be caught and to then take the appropriate action. A service must have a fault or faults defined on its interface for a fault handler to be able to catch the fault in the business process. A complex activity, including the root level, can contain zero or more fault handlers. Fault handlers are associated with a specific fault type, except the catch-all fault handler, which behaves as it name implies. Faults thrown from invoked services generally have associated variables. You must use the specifically named fault handler as opposed to the catch-all fault handler if the fault data is to be accessed.

When a fault handler completes its execution without re-throwing the fault or terminating the business process, control of execution is returned to the parent complex activity, as if the complex activity completed normally.

How a complex activity is tied to a fault

Complex activities can contain zero or more fault and exception handlers. Only one exception handler or fault handler can be the catch-all handler. You cannot have a catch-all fault handler and catch-all exception handler defined within the same complex activity.

Complex activities can contain zero or more fault handlers. Only one fault handler per complex activity can be the catch-all fault handler. Fault handlers within a complex activity can only catch faults that originate within that complex activity, which means that the fault must originate directly within the complex activity or within a nested complex activity. If a complex activity does not have a named fault handler for a throw fault and does not have a catch-all fault handler, the fault is thrown up to the enclosing complex activity until the root level of the business process is reached. A fault that is not caught at any level is a system exception.

How a fault handler is tied to a compensation handler

A fault handler can specifically call compensation on a single complex activity or all complex activities nested within a complex activity that also contains the fault handler. If no fault handler exists for a specific complex activity, the default fault handler is invoked. The default fault handler invokes compensation on all nested complex activities before re-throwing the fault to the containing complex activity.

Creating a Fault Handler

Creating a Compensation Handler

Building a Complex Activity

Send your feedback on this help topic to Sybase Tech Pubs: pubs@sybase.com