Saturday, January 20, 2007

Overule the BPEL instance name

When running BPEL processes, the BPEL consolse is showing the status of the process. This is nice, but when you have hundreds or even thousands process instances, is hard to known for which payload the process instance is running.

A nice feature is to manipulate the title of the process. The maximum length of the title is 50 characters.

Note: in 10.1.3 they change the underlying XML parser. It is now using the Oracle XML parsers. This means that the returned object from getVariableDataI() is not returning a Dom Element but an oracle.xml.parser.v2.XMLElement object.

http://www.oracle.com/technology/tech/xml/xdk/doc/production10g/doc/java/javadoc/index.html

Create a Java step after the first step in your process. You can use the data of the payload to put this in the title:

<bpelx:exec name="JavaSetTitle" language="java" version="1.4">
<![CDATA[
Element inVarElem = (Element)getVariableData("inputVariable"
, "payload"
, "/client:HelloWorldProcessRequest/client:input");
try
{
String inputdata = inVarElemOrpsId.getNodeValue();
String title = "HelloWorld " + inputdata;
setTitle(title);
addAuditTrailEntry("New Title is: >" + title + "<");
}
catch (Exception ex)
{
ex.printStackTrace();
}]]>
</bpelx:exec>


10.1.3 example:

String inputvar1 = ((oracle.xml.parser.v2.XMLElement)
getVariableData(
"inputVariable"
, "payload"
, "/client:BPELProcess1ProcessRequest/client:input1")
).getFirstChild().getNodeValue();
String title = "Title "+ inputvar1;
setTitle(title);

Post a Comment