BPEL - Incorporating Java & Java EE Code



There are several methods for incorporating Java and Java EE code in BPEL processes. Following are a few important methods −

  • Wrap as a Simple Object Access Protocol (SOAP) service

  • Embed Java code snippets into a BPEL process with the bpelx − exec tag

  • Use an XML facade to simplify DOM manipulation

  • Use bpelx − exec built-in methods

  • Use Java code wrapped in a service interface

The Java Embedding activity allows us to add activities in a BPEL process. We can write a Java snippet using standard JDK libraries, the BPEL APIs, custom and 3rd party Java Classes included in JAR files in deployed SCA composites (in SCA-INF/lib directory) and Java Classes and libraries available on the Classpath for the SOA Suite run time.

Java Embedding means functionality hidden inside, in a not very decoupled way. The Java code is hard to maintain. By embedding Java in BPEL (XML driven), we start mixing technology, that require different skills as well as expensive XML to Java Object marshalling and unmarshalling.

The best use cases for Java Embedding seems to be for advanced logging/tracing or for special validations/transformations. However, not to replace built in capabilities of the BPEL engine as well as the other components in SOA Suite 11g and the adapters that come with it.

Advertisements