Guidelines for Defining Fault Policies

24-6 Developers Guide for Oracle Application Integration Architecture Foundation Pack ■ Section 24.4.2, Guidelines for BPEL Catch and Catch-All Blocks in Synchronous Request-Response ■ Section 24.4.3, Guidelines for Configuring Mediator for Handling Business Faults

24.4.1 Guidelines for Defining Fault Policies

This section includes the following topics: ■ Section 24.4.1.1, Defining a Fault Policy XML File for Handling Run-time Faults ■ Section 24.4.1.2, Defining a Fault Policy XML File for Handling Business Faults

24.4.1.1 Defining a Fault Policy XML File for Handling Run-time Faults

Define faults in the fault policy XML file per guidelines illustrated in the following code snippet. In the fault policy, define a section under Conditions as shown in Example 24–4 . Example 24–4 Fault Definition in the Fault Policy XML File faultName xmlns:bpelx=http:schemas.oracle.combpelextensionname=bpelx: remoteFault condition action ref=aia-ora-java condition faultName faultName xmlns:bpelx=http:schemas.oracle.combpelextension name=bpelx: bindingFault condition action ref=aia-ora-java condition faultName Though AIA recommends that by default, remote and binding faults should be defined, as shown previously, other run-time faults can be handled in the same way if required per the functionality of the service. For example, if you are required to handle the subLanguageExecutionFault fault, then define the section as shown in Example 24–5 . Example 24–5 subLanguageExecutionFault Fault Handling faultName xmlns:bpelx=http:schemas.oracle.combpelextensionname=bpelx: subLanguageExecutionFault condition action ref=aia-ora-java condition faultName However, all the run-time faults that are defined in the fault policy file need to be caught in the BPEL process in a catch block, which is specific to the fault. For more information about defining BPEL catch and catch-all blocks for the synchronous request-response MEP, see Section 24.4.2, Guidelines for BPEL Catch and Catch-All Blocks in Synchronous Request-Response.

24.4.1.2 Defining a Fault Policy XML File for Handling Business Faults

The Fault Management Framework will be used to handle the business faults that are for an invoke activity. In other words, only business faults thrown by external services Configuring Oracle AIA Processes for Error Handling and Trace Logging 24-7 and applications when invoked using the invoke activity are intercepted by the Oracle Fusion Middleware Fault Management Framework, according to the definitions specified in the fault policy file. The business faults that are internal to the BPEL, business faults thrown by a throw activity, for example, are not intercepted by the Fault Management Framework. To define a fault policy to intercept Oracle AIA faults: 1. Examine your partner link WSDL and check to determine whether it is throwing any Oracle AIA faults. 2. If it is throwing Oracle AIA faults, look for the partner link namespace and name of the fault in the partner link WSDL. 3. In the fault policy, define a section under Conditions as shown in Example 24–6 . Example 24–6 Conditions Element in the Fault Policy Conditions faultName xmlns:corecustomerpartyebs=http:xmlns.oracle.comEnterprise ServicesCoreCustomerPartyV2 name=corecustomerpartyebs:fault condition test[ XPath expression to be evaluated for the fault variable available in the fault]test action ref=aia-ora-java condition faultName Conditions 4. Configure the default condition to call the aia-ora-java action, as shown in Example 24–7 . Example 24–7 Default Condition Configuration Used to Call the aia-ora-java action Conditions faultName xmlns:corecustomerpartyebs=http:xmlns.oracle.comEnterprise ServicesCoreCustomerPartyV2 name=corecustomerpartyebs:fault condition test[XPath expression to be evaluated for the fault variable available in the fault]test action ref=aia-ora-java condition faultName faultName condition action ref=aia-ora-java condition faultName Conditions 5. All business faults defined in the fault policy file need to be caught in the BPEL process in a catch-block that is specific to the business fault. For more information, see Section 24.4.2, Guidelines for BPEL Catch and Catch-All Blocks in Synchronous Request-Response. Note: To avoid unnecessary processing, ensure that you specify retry options only when explicitly required. 24-8 Developers Guide for Oracle Application Integration Architecture Foundation Pack

24.4.2 Guidelines for BPEL Catch and Catch-All Blocks in Synchronous Request-Response