Hi, i think the only way to end all tasks from the task-node is to kill them 
(or cancel them) in the action of the timer.

I added the code:
    TaskInstance ti= executionContext.getTaskInstance();
  |     //ti.end();
  | 
  |     
  |     Collection tasks = 
executionContext.getTaskMgmtInstance().getUnfinishedTasks(token);
  |     Iterator taskItr = tasks.iterator();
  |     while(taskItr.hasNext()) {
  |         TaskInstance ti2 = (TaskInstance)taskItr.next();
  |         if (ti2!=ti) {if(!ti2.hasEnded()) ti2.cancel();}
  |                             {ti.end();}

So it should cancel the other task of the node (there are 2, timer and the 
other task that waits for the user's action) and end the timer one, but 
althought all processes are "propery" ended, it informs of an error:

14:02:27,758 DEBUG [TaskInstance] completion of task 'send_order' results in
  | taking the default transition
  | 14:02:27,768 WARN  [Timer] timer action threw exception
  | org.jbpm.JbpmException: couldn't signal token 'Token(/)' : node 
'EndState(end_state)' doesn't have a default transition
  |         at org.jbpm.graph.exe.Token.signal(Token.java:121)
  |         at 
org.jbpm.graph.exe.Token$$FastClassByCGLIB$$74df1c6e.invoke(<generate
  | d>)
  |         at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
  |         at 
org.hibernate.proxy.CGLIBLazyInitializer.intercept(CGLIBLazyInitializ
  | er.java:136)
  |         at 
org.jbpm.graph.exe.Token$$EnhancerByCGLIB$$5810960d.signal(<generated
  | >)
  |         at org.jbpm.taskmgmt.exe.TaskInstance.end(TaskInstance.java:408)
  |         at org.jbpm.taskmgmt.exe.TaskInstance.end(TaskInstance.java:322)
  |         at org.jbpm.taskmgmt.exe.TaskInstance.cancel(TaskInstance.java:313)
  |         at org.jbpm.combustible.timeout.execute(timeout.java:57)
  |         at org.jbpm.graph.def.Action.execute(Action.java:123)
  |         at 
org.jbpm.graph.def.Action$$FastClassByCGLIB$$7876e90e.invoke(<generat
  | ed>)
  |         at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
  |         at 
org.hibernate.proxy.CGLIBLazyInitializer.intercept(CGLIBLazyInitializ
  | er.java:136)
  |         at 
org.jbpm.graph.def.Action$$EnhancerByCGLIB$$c72232ad.execute(<generat
  | ed>)
  |         at org.jbpm.scheduler.exe.Timer.execute(Timer.java:84)
  |         at 
org.jbpm.scheduler.impl.SchedulerThread.executeTimers(SchedulerThread
  | .java:118)
  |         at 
org.jbpm.scheduler.impl.SchedulerThread.run(SchedulerThread.java:70)
  | 14:02:27,848 ERROR [Timer] unhandled timer exception
  | org.jbpm.graph.def.DelegationException
  |         at 
org.jbpm.graph.def.GraphElement.raiseException(GraphElement.java:349)
  | 
  |         at 
org.jbpm.graph.def.GraphElement$$FastClassByCGLIB$$7a7d6aa6.invoke(<g
  | enerated>)
  |         at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
  |         at 
org.hibernate.proxy.CGLIBLazyInitializer.intercept(CGLIBLazyInitializ
  | er.java:136)
  |         at 
org.jbpm.graph.def.ProcessDefinition$$EnhancerByCGLIB$$13d1c6e9.raise
  | Exception(<generated>)
  |         at 
org.jbpm.graph.def.GraphElement.raiseException(GraphElement.java:343)
  | 
  |         at 
org.jbpm.graph.def.GraphElement$$FastClassByCGLIB$$7a7d6aa6.invoke(<g
  | enerated>)
  |         at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
  |         at 
org.hibernate.proxy.CGLIBLazyInitializer.intercept(CGLIBLazyInitializ
  | er.java:136)
  |         at 
org.jbpm.graph.node.TaskNode$$EnhancerByCGLIB$$9de0c543.raiseExceptio
  | n(<generated>)
  |         at 
org.jbpm.graph.def.GraphElement.raiseException(GraphElement.java:343)
  | 
  |         at 
org.jbpm.graph.def.GraphElement$$FastClassByCGLIB$$7a7d6aa6.invoke(<g
  | enerated>)
  |         at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
  |         at 
org.hibernate.proxy.CGLIBLazyInitializer.intercept(CGLIBLazyInitializ
  | er.java:136)
  |         at 
org.jbpm.taskmgmt.def.Task$$EnhancerByCGLIB$$a6c2cb06.raiseException(
  | <generated>)
  |         at org.jbpm.scheduler.exe.Timer.execute(Timer.java:94)
  |         at 
org.jbpm.scheduler.impl.SchedulerThread.executeTimers(SchedulerThread
  | .java:118)
  |         at 
org.jbpm.scheduler.impl.SchedulerThread.run(SchedulerThread.java:70)
  | Caused by: org.jbpm.JbpmException: couldn't signal token 'Token(/)' : node 
'EndS
  | tate(end_state)' doesn't have a default transition
  |         at org.jbpm.graph.exe.Token.signal(Token.java:121)
  |         at 
org.jbpm.graph.exe.Token$$FastClassByCGLIB$$74df1c6e.invoke(<generate
  | d>)
  |         at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
  |         at 
org.hibernate.proxy.CGLIBLazyInitializer.intercept(CGLIBLazyInitializ
  | er.java:136)
  |         at 
org.jbpm.graph.exe.Token$$EnhancerByCGLIB$$5810960d.signal(<generated
  | >)
  |         at org.jbpm.taskmgmt.exe.TaskInstance.end(TaskInstance.java:408)
  |         at org.jbpm.taskmgmt.exe.TaskInstance.end(TaskInstance.java:322)
  |         at org.jbpm.taskmgmt.exe.TaskInstance.cancel(TaskInstance.java:313)
  |         at org.jbpm.combustible.timeout.execute(timeout.java:57)
  |         at org.jbpm.graph.def.Action.execute(Action.java:123)
  |         at 
org.jbpm.graph.def.Action$$FastClassByCGLIB$$7876e90e.invoke(<generat
  | ed>)
  |         at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
  |         at 
org.hibernate.proxy.CGLIBLazyInitializer.intercept(CGLIBLazyInitializ
  | er.java:136)
  |         at 
org.jbpm.graph.def.Action$$EnhancerByCGLIB$$c72232ad.execute(<generat
  | ed>)
  |         at org.jbpm.scheduler.exe.Timer.execute(Timer.java:84)
  |         ... 2 more

It seems that by doing cancel or end the token goes to the next node (end) and 
in the cancellation or ending of the other task it tries again to move forward 
the token... i don't know what else to try. :(

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

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


-------------------------------------------------------
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