Manually Creating a Fault Policy File for Automated Fault Recovery
To manually create a fault policy file for automated fault recovery:
Note:
The preseeded recovery action tag names (ora-retry, ora-human-intervention, ora-terminate, and so on) are only samples. You can substitute these names with ones appropriate to your environment.
A fault policy file with fully-defined condition, action, and alert sections looks as follows:
Note:
-
Fault policy file names are not restricted to one specific name. However, they must conform to the
fault-policy.xsdschema file. -
This fault policy file provides an example of catching faults based on fault names. You can also catch faults based on message types, or on both:
<faultName name="myfault" type="fault:faultType">
<?xml version="1.0" encoding="UTF-8"?>
<faultPolicies xmlns="http://schemas.oracle.com/bpel/faultpolicy"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<faultPolicy version="2.0.1" id="ModifyAndRecover"
xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns="http://schemas.oracle.com/bpel/faultpolicy"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Conditions>
<!-- Handle remoteFault system exceptions -->
<faultName xmlns:bpelx="http://schemas.oracle.com/bpel/extension"
name="bpelx:remoteFault">
<condition>
<!--<test>$fault.code="1"</test>-->
<alert ref = "ora-jms"/>
<alert ref = "ora-email"/>
<action ref="default-human-intervention"/>
</condition>
</faultName>
<faultName xmlns:bpelx="http://schemas.oracle.com/bpel/extension"
name="bpelx:bindingFault">
<condition>
<action ref="default-human-intervention"/>
</condition>
</faultName> </Conditions>
<Alerts>
<Alert id="ora-email">
<email>
<To>joe.smith@example.com</To>
<CC>joe.smith@example.com</CC>
</email>
</Alert>
<Alert id="ora-jms">
<JMS propertySet="jms-props">
<Headers>
<property name="correlationId">myvalue</property>
<property name="correlationId1">myvalue1</property>
</Headers>
</JMS>
</Alert>
</Alerts>
<Actions>
<!-- Generics -->
<Action id="default-terminate">
<abort/>
</Action>
<Action id="default-replay-scope">
<replayScope/>
</Action>
<Action id="default-rethrow-fault">
<rethrowFault/>
</Action>
<Action id="default-human-intervention">
<humanIntervention/>
</Action>
<Action id="ora-retry-with-human-intervention">
<retry>
<retryCount>1</retryCount>
<retryInterval>2</retryInterval>
<exponentialBackoff/>
<retryFailureAction ref="default-terminate"/>
</retry>
</Action>
</Actions>
<Properties>
<propertySet name="jms-props">
<property name="jmsDestination">MyQueue</property>
<property
name="connectionFactory">jms/fabric/ehconnectionfactory</property>
</propertySet>
</Properties>
</faultPolicy>
</faultPolicies>