Table of Contents

Search

  1. Preface
  2. Part 1: Using Process Developer
  3. Part 2: Creating and Modifying Processes
  4. Part 3: Functions, Events, Errors, and Correlation
  5. Part 4: Testing and Deployment
  6. Part 5: Process Central and Process Server (On-Premises)

Process Developer

Process Developer

Defining Catch and CatchAll Fault Handlers

Defining Catch and CatchAll Fault Handlers

You can define two types of fault handlers:
  • A
    <catch>
    fault handler that defines a set of custom fault-handling activities that execute based on an optional fault name and/or fault variable. If the fault name is missing, then the catch intercepts all faults with the same type of fault data.
  • A
    <catchAll>
    fault handler that executes if a thrown fault is not caught by a
    <catch>
    fault handler. Catch all is a variant of catch. It does not specify a fault name or variable to catch.
You can define
<catch>
and
<catchAll>
handlers for the process on the Process Editor Fault Handlers tab, as described in Adding a Fault Handler.
The following illustration shows an example of fault handlers created on the Process Editor canvas.
You can also define fault handlers for a scope, as the error catch event, labeled
Catch All
, shows in the following illustration.
You can define each catch activity to intercept a specific kind of fault, defined by a globally unique fault name and a variable associated with the fault. Optionally, you can have a defined type associated with the fault variable, either a message type or an element type.
XML Syntax
<faultHandlers>? <catch faultName="QName"? faultVariable="BPELVariablename"? (faultMessageType="QName" | faultElement="QName")?>* activity </catch> <catchAll>? activity </catchAll> </faultHandlers>
Required Properties
Optional Properties
Catch only:
Fault name only or fault variable only or fault name plus fault variable
Catch only:
Fault name, Fault variable definition, Fault variable
Extension Attributes and Extension Elements. See Declaring Extension Elements and Attributes.
Catch Fault Name and Fault Variable
The fault name and fault variable/variable definition are optional attributes, but you must provide at least one of them for a
<catch>
. These attributes determine which catch in a fault handler executes when a fault is thrown.
If you do not define either a fault name or variable, the catch is executed as a
<catchAll>
.
In most cases, the values for these attributes are from the WSDL for a service being invoked. The name of the fault is typically the name of fault on an operation with the target namespace as the qualifying namespace value. The variable for a fault is typically the message sent when an operation in WSDL throws a fault. In the case where a catch includes a fault variable, that variable must be defined within the catch. This variable gets populated with the data from the fault when the catch executes. In addition, Process Developer provides special handling for undeclared faults.
For more details about the use of fault names and variables, see the following topics:
CatchAll Handler Examples
The
<catchAll>
catches any faults that were not caught by an existing catch block. The benefit of this construct is that you can be sure that your fault handler has an opportunity to execute your fault handling code in the event a fault is thrown. One drawback is that you will not have any details regarding the type of fault that was thrown since there is no fault name or fault variable available to a
<catchAll>
, per se. However, Process Developer provides custom functions to handle undeclared faults in a
<catchAll>
. This construct is best used in cases where you do not care what fault is thrown or in cases where you want to be sure that no faults get past your existing fault handler logic.
The default
<catchAll>
fault handler is as follows:
<catchAll> <sequence> <compensate/> <rethrow/> </sequence> </catchAll>

0 COMMENTS

We’d like to hear from you!