Escolar Documentos
Profissional Documentos
Cultura Documentos
The views expressed on this blog are my own and do not necessarily reflect the views of any Organisations owning these
products.I keep on doing R & D with different products in and around Middle ware stack and these posts are result of
that.Most of the post are result of my own experiments or ideas taken from other blogs sometimes information too.If in any
case You feel content is not right you can comment to remove that post.
Example.
===========
Create a new project in Jdeveloper
give some logical name to BPEL process make it a synchronous bpel process and say finish.
So now your composite should look like this.Drag and drop a BPEL process in your composite
Now again make this as a synchronous BPEL process and deselect the exposed as web service option.
now double click on Throw fault bpel process and drag and drop a throw activity in between .NOw double
click on throw activity and choose one of the system fault
So you bpel process which throws a fault should look like this
Now go to the Catch Bpel process and drag and drop an invoke activity ,now connect the invoke activity
with the throw partnerlink as shown below
NOw add a catch block to catch the fault,this will catch the same remote fault for which you have defined
it.
NOw drag and drop a assign activity and copy the fault code to the output variable.
Again drag and drop a reply activity and send this output variable to the client.
We are doing so because we have only one client application here and we want that he should get the
error.So when we reply the output to client we are basically throwing the fault to the calling application.
So now your fault handling process is ready,now we will add our fault policy to this project.
copy your fault-binding.xml and fault-policies.xml file in the same folder where you have your
composite.xml lies
my fault-binding.xml file look something like this
<?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="bpelFaultHandling">
<name>CatchFault</name>
</component>
</faultPolicyBindings>
and my fault-policies.xml file looks like
<?xml version="1.0" encoding="UTF-8"?>
<faultPolicies xmlns="http://schemas.oracle.com/bpel/faultpolicy">
<faultPolicy version="2.0.1" id="bpelFaultHandling"
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-human-intervention"/>
</condition>
</faultName>
</Conditions>
<Actions>
<!-- This is an action will mark the work item to be "pending recovery from console"-->
<Action id="ora-human-intervention">
<humanIntervention/>
</Action>
</Actions>
</faultPolicy>
</faultPolicies>
There are two important things that you need to note down
1>if you can see in your falut-binding.xml you can see an entry like
component faultPolicy="bpelFaultHandling"
this is baiscally a reference id which is passed to the fault-policies.xml so correpsonding to that
we have an entry in fault-policies.xml
faultPolicy version="2.0.1" id="bpelFaultHandling"
So the important thing is that this refernce id should match in the two files.
In my case it is bpelFaultHandling in both the case.
<name>CatchFault</name>
This CatchFault is the name of the BPELProcess which is catching the fault.In my case the name of process
which is
catching fault is CatchFault.
Now again we need to make two more addition in to our composite to make him aware that fault policies
are added
<property name="oracle.composite.faultPolicyFile">fault-policies.xml</property>
<property name="oracle.composite.faultBindingFile">fault-bindings.xml</property>
This should be added just after the service tag finishes
I am just pasting my composite.xml for example.
Here we are getting an option of manual recovery as we have defined in our fault policy for manual
intervention.Let me know if you have issues in it.