Exception Handlers

Exception handlers are defined in the business process to allow exceptions thrown by the business process to be caught and to then take the appropriate action. Exceptions occur when a business process encounters a throw exception activity in the business process logic. A complex activity, including the root level, can contain zero or more exception handlers. Exception handlers are associated with a specific exception type, except the catch-all exception handler, which behaves as its name implies.

When an exception handler completes its execution without re-throwing the exception 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 exceptions

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.

An exception handler can only catch exceptions that originate within that complex activity, which means the exception must originate within the complex activity or within a nested complex activity. If a complex activity does not have a named exception handler, the exception is caught by the catch-all handler. If a catch-all handler does not exist, then the exception is thrown up to the enclosing complex activity until the root level of the business process is reached. An exception that is not caught at any level is a system exception.

How exception handlers are tied to a compensation handler

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

Creating an Exception Handler

Creating a Compensation Handler

Building a Complex Activity

Fault Handlers

Exception Processing Tool Palette

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