2 Replies Latest reply on Jan 15, 2010 4:30 AM by m p

    jbpm 4 task problem

    m p Newbie

      Hi everybody,

      i'm trying to migrate my process from 3.2.1 to 4.3;

       

      In jbpm 3.1.2 i had an action on a transition that send an email with the current task ID in its body;

      now in jbpm 4.3 i have this task:

       

      <task assignee="peter" form="review.ftl" g="241,85,80,40" name="readyToStart">
            <on event="start">
          <event-listener class="com.jbpm.utils.test">    
            </event-listener>
         </on>
            <transition g="-43,-18" name="to fork1" to="task1"/>
         </task>

       

      and in the class test:

       

      public class test implements EventListener{

       

          public void notify(EventListenerExecution execution) throws Exception {
          ProcessEngine eng=    Configuration.getProcessEngine();
          String process=execution.getProcessInstance().getId();
        
              Task t=eng.getTaskService().createTaskQuery().processInstanceId(process).uniqueResult();
              t.getId();
              System.err.println(t.getAssignee());
              System.err.println(t.getId());
              System.err.println(t.getExecutionId());
          }

       

      }

       

      but the task-id is not the "current task"-id but the previous task-id.

       

      It seems that the eventlistener is fired before that in the database the current Task is updated ,

      so i get the previous task-id.

       

      There is a way to get the task-id of the current task?

       

       

      Massimo