Hello Rainer,

Thanks for you reply. I know we have been over this before. I am trying to test 
with simple process definition and it does not work.

Here is my test process:
<?xml version="1.0" encoding="UTF-8"?>
  | 
  | <process-definition
  |   xmlns="http://jbpm.org/3/jpdl";  
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
  |   xsi:schemaLocation="http://jbpm.org/3/jpdl 
http://jbpm.org/xsd/jpdl-3.0.xsd";
  |   name="dbexample">
  |    <start-state name="start">
  |       <transition name="tr1" to="first"></transition>
  |    </start-state>
  |    <end-state name="end"></end-state>
  |    <state name="first">
  |      <transition name="tr1" to="second"></transition>   
  |      <event type="node-enter">
  |        <action class="jpl.mipl.pgs.test.Testing">
  |          <leaveNode>false</leaveNode>
  |          <waitTimeBound>2000</waitTimeBound>
  |        </action>
  |      </event>
  |    </state>
  |    <state name="second">
  |      <transition name="tr1" to="end"></transition>
  |      <event type="node-enter">
  |        <action class="jpl.mipl.pgs.test.Testing" name="">
  |             <halt>true</halt>
  |             <leaveNode>false</leaveNode>
  |             <waitTimeBound>1000</waitTimeBound>
  |          </action>
  |      </event>
  |    </state>
  | </process-definition>
  | 
My main program simply does the following
    while (!executionContext.getToken().hasEnded())
  |     {
  |       ContextInstance ci = 
executionContext.getProcessInstance().getContextInstance();
  |       synchronized(ci)
  |       {
  |         if (ci.hasTransientVariable(jpl.mipl.pgs.test.Testing.HALT))
  |         {
  |           System.err.println("Halting 
token="+executionContext.getToken().getFullName()+
  |               " executed upto 
token="+executionContext.getToken().getName());
  |           return;
  |         }
  |       }
  |       //... code that persistes process instance
  |       executionContext.getToken().signal()
  |       //.....code that persists process instance
  |       ......
  | 
The action in state 'second' sets the halt variable and returns the control to 
the above loop. At this point the main prints the System.err message and 
exists. I than rerun the main but this time telling it that it needs to load 
the process instance with given id from the persistent store. The process 
instanace loads without any errors, but I get following excepition when I try 
to examine the token


  | Exception in thread "main" org.hibernate.LazyInitializationException: 
failed to lazily initialize a collection of role: 
org.jbpm.graph.exe.Token.children, 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.initialize(AbstractPersistentCollection.java:343)
  |         at 
org.hibernate.collection.AbstractPersistentCollection.read(AbstractPersistentCollection.java:86)
  |         at 
org.hibernate.collection.PersistentMap.entrySet(PersistentMap.java:206)
  |         at org.jbpm.graph.exe.Token.getActiveChildren(Token.java:366)
  |         at jpl.mipl.pgs.jbpm.JBPMExeEngine.execute(JBPMExeEngine.java:447)
  |         at jpl.mipl.pgs.jbpm.JBPMExeEngine.main(JBPMExeEngine.java:518)
  | 
  | 

This is just with single token, I still need to test with running (children) 
tokens in parallel and being able to accomplish this.

By the way I was advised to look into async action for this very thing, what do 
you recommend?

Thanks
Raj


View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3921983#3921983

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3921983


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to