This discussion is archived
4 Replies Latest reply: May 9, 2012 11:31 AM by NarsingPumandla RSS

Fault Policy is not working (BPEL Process-Async)

SG_SOA Newbie
Currently Being Moderated
Hi Gurus,

I want to use the fault management framework in BPEL process

Scenario 1
=====================================================
I have one Asynchronous BPEL process which invokes a webservice and I have created one fault-policies.xml and fault-bindings.xml and put both of them in the same directory structure of Composite.xml.

I want to catch the "remoteFault" so, at the runtime i have shutdowned that particular webservice. So, Asynchronous BPEL process is able to throw the system fault but the fault policy is not working. As a message it is showing that "*BPELFault" has not been caught by a catch block*".


*Fault-policies.xml:*
*==========*

<?xml version="1.0" encoding="UTF-8"?>
<faultPolicies xmlns="http://schemas.oracle.com/bpel/faultpolicy">
<faultPolicy version="2.0.1" id="ErrorHandlingModel1"
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>
<faultName xmlns:bpelx="http://schemas.oracle.com/bpel/extension"
name="bpelx:remoteFault">
<condition>
<action ref="ora-retry"/>
</condition>
</faultName>
</Conditions>
<Actions>
<Action id="ora-retry">
<retry>
<retryCount>5</retryCount>
<retryInterval>2</retryInterval>
<exponentialBackoff/>
<retryFailureAction ref="ora-abort"/>
</retry>
</Action>
<Action id="ora-abort">
<abort/>
</Action>
</Actions>
</faultPolicy>
</faultPolicies>


*Fault-bindings.xml:*
*===========*

<?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">
<component faultPolicy="ErrorHandlingModel1">
<name>TestBPEL</name>
</component>
</faultPolicyBindings>



Is there any steps are required to come up with proper outcome.

Please help.

Thanks in Advance
  • 1. Re: Fault Policy is not working (BPEL Process-Async)
    935409 Newbie
    Currently Being Moderated
    Hi Sharmistha,
    Have you modified the properties in composite.xml to point to the fault policy files in the current project directory?
    It should look like this:
    <property name="oracle.composite.faultBindingFile">fault-bindings.xml</property>
    <property name="oracle.composite.faultPolicyFile">fault-policies.xml</property>

    Sonali
  • 2. Re: Fault Policy is not working (BPEL Process-Async)
    NarsingPumandla Pro
    Currently Being Moderated
    No need to modify any properties in the composite.xml file, when you place the two files in the project directory where the composite.xml file resides, it should work.

    see the sample files i have posted here, it should work , please check for the syntax. Also in the fault-bindings.xml file, apply the fault policy to the composite.

    see my post in the below thread.

    sample fault-bindings and fault policy files for 11g

    Hope this helps
    N
  • 3. Re: Fault Policy is not working (BPEL Process-Async)
    SG_SOA Newbie
    Currently Being Moderated
    Hi Naresh,

    Thanks for the reply. it works :)

    I have one more question : is that possible to handle any business fault using fault-policies.xml file,if it is thrown by Sync BPEL process (Using Throw activity) ?

    Because i alwz getting the message like "BPELFault is not handled by catch block" although the fault-policies.xml and fault-bindings.xml files are defined properly.

    Actually i want to handle business fault thrown byt Sync BPEL process using fault Management Framework.


    Thanks in advance.

    Sharmistha.
  • 4. Re: Fault Policy is not working (BPEL Process-Async)
    NarsingPumandla Pro
    Currently Being Moderated
    Fault policies can be used to handle business faults also but if you throw a fault using throw activity, fault policies will not be executed; fault policies will only be executed when the invoke activity fails

    When you manually throw a fault using throw activity that fault can be caught by a specific catch or catchAll branch but fault policies won't be executed

    http://soablogsbyritika.blogspot.com/2011/07/handling-custom-faults-in-11g-using.html

    Hope this helps,
    N

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points