HOW TO USE THE JAVA EMBEDDING IN ORACLE BPEL
The Java Embedding activity allows us to add activities in a BPEL process in which 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.
I will show the creation of the Hello World of Java Embedding – a very simple BPEL process that has a string as an input and a string as output. This simple process contains a Java Embedding activity that uses Java to:
- Write a line of log output to the console
- Set the name for the composite instance
- Access the name element in the input parameter
- Set the value on the output parameter
- Write an entry in the BPEL audit trail
2.Create a synchronous Bpel "JavaEmbedBpel"

6.The XMLElement class used in this snippet is not part of the standard JDK APIs. Therefore, this class has to be imported in the BPEL process, using a special import element:
<import location="oracle.xml.parser.v2.XMLElement" importType="http://schemas.oracle.com/bpel/extension/java"/>
7.Snippet uses a number of the API methods available for use in Java Embedding:- getVariableData() - to access variables in BPEL process
- setVariableData – to set the value on variables
- addAuditTrailEntry() – add an entry to the audit trail
- getPreference() – access preference (property)
- setCompositeInstanceTitle() - set the title that is displayed in the EM FMW Console
- getInstanceId( ) -get value of Unique ID associated with this BPEL process instance
- setStatus(), setTitle(), setCreator รข€“ set meta data on process instance
- setIndex() - set up to 6 index variables that can be used to query process instances through the BPEL API
8.Now we can deploy and test the process
Input Payload
Output Payload





























































