Powered By Blogger

Saturday, January 14, 2012

Manual recovery of faulted instances from em console

Fault policy framework provides a way for manual intervention in case of faults (System faults/business faults).
We can use this feature to change the input payload of a invoke activity and resubmit the request.
In this discussion we see how we can configure fault-policies/ bindings to achieve this.
We can perform following fault recovery actions from Oracle Enterprise Manager Fusion Middleware Control
  • Retry the activity
  • Modify a variable (All global variables)
  • Continue the instance (mark the activity as a success)
  • Rethrow the exception
  • Abort the instance
  • Throw a replay scope exception
 As a best practice it is always good to retry faulted invoke activity before we move to manual recovery.
Below fault-policy talks about above strategy

fault-policies.xml

<?xml version="1.0" encoding="UTF-8" ?>
<faultPolicies xmlns="http://schemas.oracle.com/bpel/faultpolicy">
  <faultPolicy version="2.0.1"
           id="ProcessingFaults"
               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>
      <!-- remote fault processing here: -->
    <faultName xmlns:bpelx="http://schemas.oracle.com/bpel/extension"
               name="bpelx:remoteFault">
         <condition>
                <action ref="ora-retry"/>
        </condition>
      <condition>
                <action ref="ora-human-intervention"/>
      </condition>
    </faultName>
   
    <!-- binding fault processing here: -->
    <<aultName xmlns:bpelx="http://schemas.oracle.com/bpel/extension"
                name="bpelx:bindingFault">       
            <condition>
                 <action ref="ora-human-intervention"/>
           </condition>
    </faultName>
    </Conditions>
     <Actions>
    <!-- RetryInterval is in seconds -->
      <Action id="ora-retry">
        <retry>
          <retryCount>3</retryCount>
          <retryInterval>5</retryInterval>
          <exponentialBackoff/>
        </retry>
      </Action>
       <!-- Human Intervention -->
      <Action id="ora-human-intervention">
        <humanIntervention/>
      </Action>
    </Actions>   
  </faultPolicy>
</faultPolicies>

fault-bindings.xml

This file binds the policies in fault-policies xml file with composite application level.
<?xml version="1.0" encoding="UTF-8" ?>
<faultPolicyBindings version="2.0.1"
                     xmlns="http://schemas.oracle.com/bpel/faultpolicy"
                     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <composite faultPolicy="ProcessingFaults"/>
</faultPolicyBindings>

Place policies and bindings files in same location as composite.xml
Steps for recovery from EM console:
  • Log in  to em console and expand farm and SOA navigation trees on left pane
  • Click on required composite on left pane
  • Click on instanceId which is in running sate
  • Click on recovery 
  • Select the Recoverable record, in the bottom page segment choose required recovery action from drop down and click Recover button
This will recover instance form fault state.
In next post, I would like to talk about few best practices in configuring fault policies. 

No comments:

Post a Comment