Using the Java code placeholder in the BPEL process

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.

Getting ready

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.

How to do it…

The steps involved in using the Java code placeholder in the BPEL process are as follows:

  1. Open the BPEL_and_Java_1_1 process.
  2. From the Component Palette, select Oracle Extensions.
  3. Pick the Java Embedding component and drop it into the BPEL process. We can see the BPEL process with the Java Embedding activity inside it.
    How to do it…
  4. Now open the BPEL_and_Java_2_0 process.
  5. Again in the Component Palette select Oracle Extensions.
  6. Pick the Java Embedding component and drop it into the BPEL process. We have created the BPEL 2.0 process with the Java Embedding activity inside it.

How it works…

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.

See also

To learn how to include the code into the Java Embedding activity, refer to the Invoking Java code from the BPEL process recipe.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset