To the right of the Namespace URI field, click the Search icon to select the fault to Select the fault in the Fault Chooser dialog, and click OK.

Using Fault Handling in a BPEL Process 11-27

3. Double-click and define the Rethrow activity.

4. Optionally enter a name or accept the default value, as shown in Figure 11–4 . Figure 11–4 Rethrow Dialog

5. Click Apply, then OK.

When complete, design can look similar to that shown in Figure 11–5 . Figure 11–5 Throw Activity in BPEL Process

11.8.2 What Happens When You Rethrow Faults

Example 11–21 shows the .bpel file after design is complete for a rethrow activity. The rethrow activity is inside a fault handler catch activity. Example 11–21 Rethrow Activity scope name=scope1 faultHandlers catch faultName=tns:error faultVariable=tmpVar faultElement=tns:fault sequence 11-28 Oracle Fusion Middleware Developers Guide for Oracle SOA Suite assign copy fromconcatcaught fault: , tmpVarfrom tooutput.payloadto copy assign rethrow name=Rethrow_1 sequence catch faultHandlers throw faultName=tns:error faultVariable=fault scope

11.9 Returning External Faults

A BPEL process service component can send a fault to another application to indicate a problem, as opposed to throwing an internal fault. In a synchronous operation, the reply activity can return the fault. In an asynchronous operation, the invoke activity performs this function.

11.9.1 How to Return a Fault in a Synchronous Interaction

The syntax of a reply activity that returns a fault in a synchronous interaction is shown in Example 11–22 : Example 11–22 Reply Activity reply partnerlinke=partner-link-name portType=port-type-name operation=operation-name variable=variable-name optional faultName=fault-name reply Always returning a fault in response to a synchronous request is not very useful. It is better to make the activity part of a conditional branch, in which the first branch is executed if the data requested is available. If the requested data is not available, then the BPEL process service component returns a fault with this information. For more information, see the following chapters: ■ Chapter 7, Invoking a Synchronous Web Service from a BPEL Process for synchronous interactions ■ Chapter 10, Using Conditional Branching in a BPEL Process for setting up the conditional structure

11.9.2 How to Return a Fault in an Asynchronous Interaction

In an asynchronous interaction, the client does not wait for a reply. The reply activity is not used to return a fault. Instead, the BPEL process service component returns a fault using a callback operation on the same port type that normally receives the requested information, with an invoke activity. For more information about asynchronous interactions, see Chapter 8, Invoking an Asynchronous Web Service from a BPEL Process.