The configuration of the fault management Framework for a SCA component has been made more flexible than it was in 10g. We can configure fault policies not only on composite level but also on component level. This enables us to configure retry policies not only on an error type and filter but also on specific components. To do this you just need two files:
- fault-policies.xml, fault-policies.xsd
- fault-bindings.xml, fault-bindings.xsd
You have to enable the fault policy by adding the files to your sca component, or you can add a reference in the sca component to hem, for example when they are placed in the mds.
fault-bindings.xml
Examples of fault-bindings.xml files can be found in oracle’s documentations:
- Fault policy on composite level, the chapter is called fault-buildings.xml but they are talking about fault-bindings.xml don’t let this confuse you
- Fault policy on component level
fault-policies.xml
An detailed fault-policies.xml file can be found here.
Mediator
The Fault Management Framework is only applicable for mediators that processes their rules parallel, see documentation Fault Policies Mediator. If an error is matched in the fault policy an possible predefined fault action in the mediator will be ignored. Be aware of this when you are defining your fault policies and error handling.
Example
I have made a simple sca component to show the working of the framework. This sca component has two components {BPEL and Mediator} which are exposed as services to the outside world.
They will pass the message to a BPEL that throws a remote exception so we can test the working of the configured fault policies and bindings. In this case a simple available exception but in real it could be an custom defined Business exception to trigger the fault handling. We will see also the way to recover an BPEL instance and a Mediator instance.
The fault-policies.xml that’s configured in this project
This fault-bindings.xml that’s configured in this project
If you would like to define on component level the fault policies the fault-bindings.xml would look like this
Testing the composite
We deploy the composite and test if all the instances are cached by the defined fault policy.
Mediator Routing
First i invoked the service that’s connected to the mediator routing.
De defined fault policy works fine because the instance is been marked recoverable. By clicking on the link ‘Recoverable’ you get a popup where you can modify the payload (if needed) and select a recover action.
BPELRouting
Second i tested the service that’s connected to the BPELRouting component.
We have here also the same link to recover this instance.
That’s the end of a simple example to get started with the Fault Management Framework.
This example has been executed on
Fusion Middleware 11g (11.1.1.2.0)
Reference documentation

January 19th, 2010 at 15:13:53
Hi,
I have a faultpolicy for synchronous processes which calls custom java class which in turn calls a composite to perform some actions.After this the fault policy rethrows the error back to the faulted process.
But if I do not catch the fault in the calling process, the error ahndling composite also rolls back. Is this a known issue or am I missing something?
Thanks
Anju
January 21st, 2010 at 11:27:58
Hi Anju,
It sound that there is a fault in the configuration files. The re throw from the faulted process is this defined in the fault policy?
Please note that the fault policy works on the links from composite to composite. I could not say what the the fault policy will do when you preform a service call in ‘Embeded java’ in a process. I assume that this will not be picked-up by the fault policy.
February 10th, 2010 at 15:17:33
Sorry I think I explained it wrong. By custom java class , I meant a custom java fault handler.
This is invoked by the fault policy framework and logs the error. After that the framework rethrows the fault back. The contents of the action are as follows:
Action id=”custom-fault-handler”
javaAction className=”CustomFaultHandler” defaultAction=”ora-rethrow-fault”
returnValue value=”OK” ref=”ora-rethrow-fault”
February 19th, 2010 at 12:35:33
Hi,I am new to BPEL. I am trying to define Fault Policy Framework.
Can you pls provide both the XSDs as well.
February 19th, 2010 at 15:37:20
Hello Harry,
do you mean the xsd for fault-policies.xml and fault-bindings.xml?
I have supplied them in the post. Click on the xsd link next to the xml file.
Theo
February 19th, 2010 at 16:43:18
Can you let me know the importance of these XSD- fault-bindings.xsd and fault-policies.xsd.
I have mentione dthe schemaLocation but havent created any xsd. Still, it is working fine.
February 19th, 2010 at 17:06:03
I supplied the xsd files to see what you can configure in the policy.xml for example the different kind of RetryType you can specify.
With this xsd you can check if your xml files are correctly specified.
-Theo
February 23rd, 2010 at 14:39:29
Thanx Theo.
Can u pls help me on 1 more thing.
In my BPEL, I am calling DB adapter to update the table. I want to throw exception if the row updated is 0.
Pls suggest how to retrieve the no. of updated rows.
March 4th, 2010 at 14:15:15
Hi Theo,
The above example is working fine when i use the namespace as mentioned in the figures. I am trying to change the “xmlns:tns” and “targetNamespace” in XSDs and “xmlns” attribute in both XMLs.
After changing all these attributes to “http://www.harry.com/bpel/faultpolicy”, I am not able to see the BPEL in pending state. After execution, it is showing as faulted in EM.
Pls suggest.
April 19th, 2010 at 23:52:08
Have you tried doing Mediator fault handling?
It doesn’t work at my end for mediator.
Please provide a usecase example for mediator fault handling.
it doesn’t work at this point because the namespace http://schemas.oracle.com/mediator/faults doesn’t seem to work.
It says, faultPolicy tag is not defined in schema.
April 20th, 2010 at 09:18:07
Hi Prabhanjan,
as is writen in the documentation of Oracle Fault policies are applicable to parallel routing rules only. Are your Mediator rules processed parallel?
Have you configured also your binding? You need to bind your fault policy to the composite or to specific Components.
April 20th, 2010 at 09:28:32
Hi Harry,
Try to undeploy/ and deploy your component it could be that the server is cached your definition files and doesn’t see your changes.
April 22nd, 2010 at 06:46:17
Hi..
I am using 11.1.1.1.0.
I am unable to recover the messages.. I mean in console it is not dispalying options for recovery actions, delete rejected messages etc.
Is this only for versions after 11.1.1.1.0.
Or am i doing wrong.
Please let me know.
April 22nd, 2010 at 06:56:46
forgot to tell..
I implemented the same as Arem’s example.
I have choosen all processes as synchronous and throwing remote fault in second bpel.
Thanks
April 22nd, 2010 at 09:01:50
Hello Pavan,
to answer your first question it should also work on 11.1.1.0. To find the problem in your SCA comonent i can give you some check points:
- Is there a instance created after invoking a endpoint?
- Do you see the fault thrown in the BPELConsole?
- It the fault policy and binding correctly definded?
Try not to make the complete sca componente at once but build it step by step. First happy flow hellowworld bpel, then add exception check if you can see the exception shown in the console, the configure fault policy and binding to catch the exception and to define the policy to handle the exception in the way you want it to happen.
Happy programming!!
April 22nd, 2010 at 09:56:43
yeah.. thanks Arem..
I did some mistake..
It is working fine now.
Thanks
April 22nd, 2010 at 10:00:17
yeah.. thanks Arem..
I did some mistake..
It is working fine now.
Here i have a doubt.. If i use sync process and if i choose humanintervention in my policy.. and if the person takes 2 days to perform recovery…is this sync process will wait or timed out??
Thanks
April 23rd, 2010 at 11:14:44
Hi…
Can we handle rollback fault by using fault-policies. If yes please help me out.
I tried by keeping below part in my fault-policies.
It is not working.
It is urgent
Thanks
July 9th, 2010 at 13:32:43
Hi,
Can you please tell me how can i place the two files in MDS?
Regards,
Sundar