The jBPM BPEL runtime inherits the engine API provided by jBPM jPDL. The class JbpmContext is the (pojo) facade to the publicly available process operations. The so-called "named" sessions, available from the jbpmContext object, encapsulate different categories of database access. The GraphSession provides methods to retrieve the deployed process definitions and the running process instances. A sample includes:
Thanks for your reply. This helps a lot.
What about process administration functionality? Is there a way (API) to start/stop deployed/running processes?
Kind regards, ruhl22.
I have inspected the mentioned classes, my previous question is obsolete.
Thanks again, ruhl22.
I have implemented a session bean facade and deployed it to the jboss server, where the jbpm-bpel engine runs. Additionally, using a client application, I access the method exposed by the deployed session bean.
Everything runs as imagined, except that I get an exception (related to hibernate lazy collection initialization) when trying to access the Actions of a BpelProcess.
Clinent code: Map<String, Action> actionMap = bpelProcessTemplate.getActions(); actionMap.size(); //exception flies here.
The exception stack is:
Exception in thread "main" org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: org.jbpm.graph.def.ProcessDefinition.actions, no session or session was closed at org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationException(AbstractPersistentCollection.java:358) at org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationExceptionIfNotConnected(AbstractPersistentCollection.java:350) at org.hibernate.collection.AbstractPersistentCollection.readSize(AbstractPersistentCollection.java:97) at org.hibernate.collection.PersistentMap.size(PersistentMap.java:95) at com.agetas.jbpm.client.Run.main(Run.java:83)
Do you have any idea, how I can prevent this exception to occur? I don't want to modify the hibernate mapping code of the classes within jbpm-jpdl.jar, to deactivate lazy loading...
Thanks in advane, ruhl22.