What Do I Need to Know About Fault Policy Files

Configuring Oracle AIA Processes for Error Handling and Trace Logging 24-3

24.2 Overview of AIA Error Handler Framework

For more information about the Error Handling Framework and its features, see Setting Up Error Handling in Oracle Fusion Middleware Infrastructure Components and Utilities Users Guide for Oracle Application Integration Architecture Foundation Pack.

24.3 Enabling AIA Processes for Fault Handling

This section includes the following topics: ■ Section 24.3.1, What Do I Need to Know About Fault Policy Files ■ Section 24.3.2, How to Implement Fault Handling in BPEL Processes

24.3.1 What Do I Need to Know About Fault Policy Files

A fault policy bindings file associates the policies defined in a fault policy file with the SOA composite application or the service component or reference binding component. The fault policy bindings file must be named fault-bindings.xml. This conforms to the fault-bindings.xsd schema file. Fault policy file names are not restricted to one specific name. However, AIA recommends a naming convention to be followed for the fault policy files. All fault policy files should be named using the convention ServiceNameFaultPolicy.xml. They must conform to the fault-policy.xsd schema file. For more information about naming conventions, see Chapter 29, Oracle AIA Naming Standards for AIA Development. AIA recommends that the fault policy bindings file should be defined to associate the policies defined in a fault policy file with the SOA composite application. AIA Foundation Pack comes with a default fault policy, which is stored in Oracle Metadata Services MDS, in the AIAMetaDatafaultPoliciesV1 folder. When default fault policies are to be used, then the composite.xml file should have the elements shown in Example 24–1 added to it Example 24–1 Elements to be Added to composite.xml property name=oracle.composite.faultPolicyFile[pointer to the fault policy xml file in the MDS]property property name=oracle.composite.faultBindingFile[pointer to the fault policy bindings file fault-bindings.xml in the MDS]property When Service Constructor is used to construct the AIA Services, and if the developer opts for using a default fault policy file, then Service Constructor will automatically insert the preceding elements in the composite.xml file. For more information about Service Constructor, see Chapter 19, Working with Service Constructor. If a developer chooses to have a customized, service-specific fault policy file for her AIA Service, then, AIA recommends that the fault policy file and fault policy bindings file fault-bindings.xml be placed in the same directory as the composite.xml file of the SOA composite application. When a developer is using Service Constructor to construct the AIA Services and opts for using a service-specific fault policy file and fault policy bindings file, then the tool will create a template file in the same directory as the composite.xml file of the SOA composite application. The developers need to define the fault policies in those 24-4 Developers Guide for Oracle Application Integration Architecture Foundation Pack template files. In this case, the tool will not create the XML elements property in the composite.xml. For more information, see Schema Definition File for Fault-policies.xml and Schema Definition File for Fault-bindings.xml in Oracle Fusion Middleware Developers Guide for Oracle SOA Suite.

24.3.1.1 Associating a Fault Policy File with Fault Policy Bindings File

The following example shows how to associate a fault policy defined in a sample fault-policy file with a fault-policy binding.xml file. Consider a sample fault policy file, SamplesQueryCustomerPartyPortalProvABCSImplFaultPolicy.xml, with the fault policies defined as shown in Example 24–2 . Example 24–2 Sample Fault Policy File with Fault Policies Defined faultPolicies xmlns=http:schemas.oracle.combpelfaultpolicy faultPolicy version=2.0.1 id=SamplesQueryCustomerPartyPortalProvABCSImplFaultPolicy . . . . . . . faultPolicy faultPolicies We need to associate the policies defined in the preceding fault policy file with the level of fault policy binding that you are using-either a SOA composite application or a component BPEL process or Oracle Mediator service component. To do this, you need to modify the template fault-bindings.xml file created by the AIA Service Constructor when the developer chooses to have a service-specific fault policy instead of using a default fault policy. In the fault-bindings.xml file, the association is done as shown in Example 24–3 . Example 24–3 Association in fault-bindings.xml faultPolicyBindings version=2.0.1xmlns=http:schemas.oracle.combpel faultpolicy xmlns:xsi=http:www.w3.org2001XMLSchema-instance compositefaultPolicy=SamplesQueryCustomerPartyPortalProvABCSImpl FaultPolicy faultPolicyBindings We recommend that the fault policy binding level be a SOA composite application by default because this conforms with our recommendation that a composite needs to be built with a single component in it.

24.3.2 How to Implement Fault Handling in BPEL Processes