How To Use Java Embedding in a BPEL Process in Oracle JDeveloper

Incorporating Java and Java EE Code in a BPEL Process 13-9 System.out.printlnBPEL:Modify VarSDO... + o + ExtSDO: + out; mytest.apps.SDOHelper.printo; mytest.apps.SDOHelper.printout; mytest.apps.SDOHelper.modifySDOo; System.out.printlnBPEL:After Modify VarSDO... + o + ExtSDO: + out; mytest.apps.SDOHelper.printo; mytest.apps.SDOHelper.printout; }catchException e { e.printStackTrace; }]] bpelx:exec Example 13–7 provides an example of the Java classes modifySDOo and printo that are embedded in the BPEL file. Example 13–7 Java Classes public static void modifySDOObject o{ ifo instanceof commonj.sdo.DataObject { DataObjecto.getChangeSummary.beginLogging; SDOType type = SDOTypeDataObjecto.getType; HelperContext hCtx = type.getHelperContext; ListDataObject lines = ListDataObjectDataObjecto.getline; for DataObject line: lines { line.seteligibilityStatus, Y; } } else { System.out.printlnSDOHelper.modifySDO: + o + is not a DataObject; } } . . . . . . public static void printObject o { try{ ifo instanceof commonj.sdo.DataObject { DataObject sdo = commonj.sdo.DataObjecto; SDOType type = SDOType sdo.getType; HelperContext hCtx = type.getHelperContext; System.out.printlnhCtx.getXMLHelper.savesdo, type.getURI, type.getName; } else { System.out.printlnSDOHelper.print: Not a sdo + o; } }catchException e { e.printStackTrace; } }

13.6 Sharing a Custom Implementation of a Class with Oracle BPEL Process Manager

When you implement a custom Connection Manager class with the same name as a class used by Oracle BPEL Process Manager, you must ensure that the custom class does not override the class used by Oracle BPEL Process Manager. 13-10 Oracle Fusion Middleware Developers Guide for Oracle SOA Suite For example, assume the following is occurring: ■ You are using embedded Java in a BPEL project. ■ The Connection Manager custom class is overriding the BPEL Connection Manager class. ■ A java.lang.NoClassDefFoundError is occurring at runtime.

13.6.1 How to Configure the BPEL Connection Manager Class to Take Precedence

To configure the BPEL Connection Manager class to take precedence: 1. Start Oracle JDeveloper.

2. Highlight the BPEL project.

3. From the Edit main menu, select Properties.

4. Select Libraries and Classpath.

5. Click Add JARDirectory.

6. Navigate to the location of the custom JAR file and click Select.

This adds the custom Connection Manager JAR file to the classpath.

7. Click OK.

8. Redeploy the BPEL project and retest.