Thursday, July 14, 2011

This is the first in a series of posts related to the BPM 11g Java API. As far as I know, as of this writing, there is no official Oracle BPM 11g Java API documentation that is being release yet, but the corresponding jars are already present on a standard JDeveloper installation (probably after installing BPM Extension).
The purpose of this post is to show simple runnable classes so readers can easily have an acquintance with the BPM 11g APIs, without needing to setup a complex web project.
We can manipulate BPM processes through a BPMServiceClient that we can acquire from a BPMServiceClientFactory. Below is a utility class that I set to easily acquire a client instance for my testing. This class need the following jars in the classpath: Oracle.bpm.client.jar, Oracle.bpm.project.model.jar, and Oracle.bpm.runtime.jar which are present inside the BPM folders in "MIDDLEWARE_HOME\jdeveloper\soa\modules" directory.

Hi vishnu,1)Are you sure that those processes are not yet completed? 2)Did you provide appropriate user and password inforamtion in the code above "Fixture.getIBPMContext("pino", "password1");"?3)Can you access the same processes using the same user in BP< workspace?

Can this sample code be used in 11.1.1.6 env? I run this sample in 11.1.1.6 env then I get error message as below:Exception in thread "main" java.lang.NoClassDefFoundError: oracle/bpm/metadata/history/HistoryService at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClassCond(ClassLoader.java:630) at java.lang.ClassLoader.defineClass(ClassLoader.java:614) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141) at java.net.URLClassLoader.defineClass(URLClassLoader.java:283) at java.net.URLClassLoader.access$000(URLClassLoader.java:58) at java.net.URLClassLoader$1.run(URLClassLoader.java:197) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:190) at java.lang.ClassLoader.loadClass(ClassLoader.java:305) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301) at java.lang.ClassLoader.loadClass(ClassLoader.java:246) at oracle.bpm.client.BPMServiceClientFactory.getBPMServiceClient(BPMServiceClientFactory.java:240) at oracle.bpm.sample.test.Fixture.getBPMServiceClient(Fixture.java:44) at oracle.bpm.sample.test.GetProcessInstances.testGetProcessInstances(GetProcessInstances.java:26) at oracle.bpm.sample.test.GetProcessInstances.main(GetProcessInstances.java:21)Caused by: java.lang.ClassNotFoundException: oracle.bpm.metadata.history.HistoryService at java.net.URLClassLoader$1.run(URLClassLoader.java:202) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:190) at java.lang.ClassLoader.loadClass(ClassLoader.java:305) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301) at java.lang.ClassLoader.loadClass(ClassLoader.java:246) ... 16 more

If we leave the predicate, then the instances are returned, but the methods processinstance.getSca().getCompositeInstanceId() processinstance.getSca().getCompositeName());are not returning any values.Could you please help?