When using Java code inside the BPEL process we use the Java Embedding activity. At the moment both versions of BPEL processes (1.1 and 2.0) are widely used. Consequently, we will address the use of the Java code placeholder in both types of BPEL processes.
To complete this recipe, we need nothing special. We just create an empty composite with two empty synchronous BPEL processes. We name them BPEL_and_Java_1_1
and BPEL_and_Java_2_0
, each addressing its BPEL version respectively.
The steps involved in using the Java code placeholder in the BPEL process are as follows:
Placing the Java Embedding activity into the BPEL process enables us to use the Java code in the BPEL process. Let us now compare both versions of BPEL processes.
The Java Embedding activity definition in the BPEL_and_Java_1_1
process is as follows:
<bpelx:exec name="Java_Embedding1"/>
The definition in the BPEL_and_Java_2_0
process is as follows:
<extensionActivity> <bpelx:exec name="Java_Embedding1"/> </extensionActivity>
We see that in BPEL version 2.0, the process has the Java Embedding activity surrounded by the <extensionActivity>
tag.
If we compare the Java Embedding configuration dialog, we can see that there is almost no difference between the BPEL versions.