Montag, 8. Oktober 2012

Fault Management Framework - Part 3

Putting conditions and actions into the policy file

 The conditions in fault-policies.xml can be used to categorize errors into types:

·         Mediator-specific errors

·         Business- and SOAP-errors

·         Adapter-specific errors

By using the <test> element you can evaluate and filter the $fault.mediatorErrorCode. Following error types exist in the mediator component:

·         TYPE_ALL – all mediator errors

·         TYPE_DATA – for data related errors

·         TYPE_METADATA – for metadata related errors

·         TYPE_FATAL – for fatal errors

·         TYPE_TRANSIENT – for resolvable errors

These groups have sub-groups like e.g. TYPE_FATAL_DB for fatal database errors.

Example for Database-Adapter:  

<faultName

       xmlns:bpelx="http://schemas.oracle.com/bpel/extension" 

       name="bpelx:bindingFault">

        <condition><!—ORA-02292: Integrity constraint violated -->

            <test>$fault.code=”2292”</test>

            <action ref="ora-terminate"/>

        </condition>

    </faultName>

By using the <javaAction> it is possible to execute an external java class. This java object has to implement the interface IFaultRecoveryJavaClass, which returns a string of handleFault(). Different return values lead to another action, depending on the return value. If no <returnValue> elements are defined, the defaultAction will be executed.

    <Action id="ora-java-execute">

         <javaAction className="com.xxxxpackage.faultpolicy.UserJavaAction"  defaultAction="ora-terminate" propertySet="someProperty">

                <returnValue value="TERMINATE" ref="ora-terminate"/>

                <returnValue value="RETRY" ref="ora-retry"/>

                <returnValue value="HUMAN" ref="ora-human-intervention"/>

          </javaAction>

    </Action>
 
There will be a part 4 next week...

Keine Kommentare:

Kommentar veröffentlichen