Databases Reference
In-Depth Information
Binding fault policies
To put a fault policy into operation, we need to specify to what components within a
composite that the fault policy is to be applied. This is known as binding.
Fault bindings for a composite are defined in the
fault-bindings.xml
file, which
should be placed in the same folder as the
composite.xml
file to which it applies. An
example outline of a fault binding file is shown as follows:
<?xmlversion="1.0"encoding="UTF-8"?>
<faultPolicyBindingsversion="2.0.1"
xmlns="http://schemas.oracle.com/bpel/faultpolicy">
<
composite
faultPolicy="UserAccountPolicy"/>
<
component
faultPolicy="UserRegistrationPolicy">
<name>UserRegistration</name>
<
/component
>
<
reference
faultPolicy="CreditCardPolicy">
<name>CreditCard</name>
</reference>
</faultPolicyBindings>
From this, we can see that we can bind fault policies to composites, components, or
external references.
Defining bindings on the composite
The
composite
element is an
optional
element, which allows us to specify the
default fault policy for a composite. It contains a single attribute
faultPolicy
, which
contains the
id
of the fault policy to be used for the composite.
In the previous example, we had specified that the
UserAccount
composite should
use
UserAccountPolicy
as its default fault policy.
Defining bindings on a component
After the composite binding, we can specify zero or more
component
bindings,
each of which allows us to bind a fault policy to one or more Mediator or BPEL
components. It contains a single attribute named
faultPolicy
, which contains the
id
of the fault policy to be used for this binding.
Within the
component
elements, we specify one or more
name
elements. The
name
element should contain the name of a component within the composite that we wish
to bind the fault policy to.