Monday, March 28, 2011

Java embedding in BPEL 2.0

According to BPEL 2.0 specifications, java embedding is not available as standard activity. Though BPEL 2.0 allows to define and use non-standard activity using <extensionActivity> element. So you will find following syntax changes from BPEL 1.1.

In Oracle SOA suite, <bpelx:exec> element appears inside <extensionactivity> element.

Also, the java import has different syntax as below:
<import importtype="http://schemas.oracle.com/bpel/extension/java" location="class/package name"></import>

Here is an example:
<process name="myTest" targetNamespace="http://test.oracle.com/bpel2.0/myTest">
. . .
. . .
<import location="java.util.Date"
importType="http://schemas.oracle.com/bpel/extension/java"/>
. . .
<sequence>
. . .
<extensionActivity>
<bpelx:exec language="java">
System.out.println("Current time is: "+ new Date());
</bpelx:exec>
</extensionActivity>

1 comment:

Sanddy said...

Thanks a lot. This is working for me.