Oracle BPEL, retrieving the validate activity fault message

The ‘Validate’ activity in Oracle BPEL gives us the functionality to validate variables again schema definitions.
When using it in your bpel process you will get a nice informative message in the ‘Flow trace’.


When you’re using some generic error hospital functionality you also want this message to be available in there.
First try would be, add a Scope around the activity and catch the ‘invalidVariables’ System Fault.

When using a getFaultString on the fault variable or after assigning it to your own fault variable you will see the fault stack will be empty

		<part name="summary">
			<summary xsi:type="def:string"/>
		<part name="detail">
			<detail xsi:type="def:string"/>
		<part name="code">
			<code xsi:type="def:string"/>

Because of some bug in the engine you won’t be able to get a handle to the fault message.

To be able to retrieve the fault message do the next.
Create a mediator in the composite based on a wsdl/operation which you ‘represent’ the element you’re trying to validate.

If you have a variable in your process like this :
variable name=”myEmployee” messageType=”emp:myEmployeeMessage”
variable name=”myEmployee” element=”emp:myEmployeeRef”

Then also create/use a wsdl which exposes an operation with the same messagetype/element in it.

In certain situations you will be validating an element which isn’t available directly in some operation in some wsdl (for example when you validate against an element which is only defined in a canonical xsd definition).
In that case just create a dummy wsdl/operation and use the element-definition in there, make sure you use the same namespace-structure.

Create the mediator based on this wsdl.

In the mediator enable the validateSchema option (true)

	<Mediator name="validateInput" xmlns:xsi="" wsdlTargetNamespace="" xmlns="">
	   <operation name="process" deliveryPolicy="AllOrNothing" priority="4" validateSchema="true"/>

We won’t be defining any routing rules, we just need the operation to validate the input and that’s it.
When the input isn’t validate it will trigger a remote fault which we will catch in our bpel process.

Instead of using the validate-activity, create an invoke to the mediator partnerlink.


As you can see, we now receive a fault stack back which includes our validation message.

The bpel will looking something like this :

The remote fault will be thrown by the mediator, in the second scope we now catch the remote fault instead of the invalid variables fault, and this fault variable does contain the information we need.

download :

Share this Post:
Digg Google Bookmarks reddit Mixx StumbleUpon Technorati Yahoo! Buzz DesignFloat Delicious BlinkList Furl

3 Responses to “Oracle BPEL, retrieving the validate activity fault message”

[…] Suite 11g: Consuming web service which enforce security policies on their WSDL files by Esentri and Oracle BPEL, retrieving the validate activity fault message by Eric […]