4 Replies Latest reply on Jun 25, 2009 11:49 PM by freak182

    How to end TaskInstance in a ActionHandler

      Hello,

      I get the TaskInstance in ActionHandler like this:

      final Collection<TaskInstance> tasks = context.getTaskMgmtInstance().getTaskInstances();
      
      for(TaskInstance inst : tasks){
       inst.end();
       }
      


      also i try this....

      final Collection<TaskInstance> tasks = context.getTaskMgmtInstance().getTaskInstances();
       final Token token = context.getToken();
      
       token.signal();
       for(TaskInstance inst : tasks){
      
       inst.end();
       }
      
       context.getJbpmContext().save(token.getProcessInstance());
      
      
      


      ..the above code works but is does not route the next task to the intended transition ("to approver B").The transition was taken is the default transition. I even force the the transition with this>

      
      private String timeoutTransition;
      
      ................................
      
      final Collection<TaskInstance> tasks = context.getTaskMgmtInstance().getTaskInstances();
       final Token token = context.getToken();
      
       token.signal(timeoutTransition);
       for(TaskInstance inst : tasks){
      
       inst.end(timeoutTransition);
       }
      
       context.getJbpmContext().save(token.getProcessInstance());
      
      
      


      the above code give me CuncurrentModificationException...any ideas?

      Thanks a lot.
      Cheers.