Java code embedding
Java code embedding is a method for integrating Java code and resources into BPEL processes. It allows us to embed Java code snippets directly into BPEL process code. This provides the opportunity to use Java for certain aspects where BPEL does not provide an appropriate activity. It also provides a possibility to use Java code to call other Java resources (EJBs, JCA, JMS, and so on).
To embed Java code snippets into BPEL, Oracle provides a custom BPEL activity called<exec>
, defined in the http://schemas.oracle.com/bpel/extension namespace. This namespace is usually declared with the bpelx
prefix, so we write the activity as<bpelx:exec>
.
The BPEL server will execute the Java code, embedded in the<exec>
activity, within its JTA (Java Transaction API) transaction context. If the embedded Java code calls EJBs (session or entity beans), the transactional context will be automatically propagated. If an exception occurs during the execution of the embedded...