2 Replies Latest reply on May 7, 2010 9:12 AM by newbeewan2

    Getting the assignee from the last activity

    newbeewan2

      Hi,

       

      Is there a possibilité in an assignmentHandler to know the assignee from the previous task ?

       

      Or how to put that value into a variable (particular EL or serializable class...) to access it in the rest of the processIntance ?

       

      Thanks

        • 1. Re: Getting the assignee from the last activity
          swiderski.maciej

          Hi,

           

          one way to do that is to use event listener on event end for a task and then get assignee of that task and store is a process variable - lastAssignee.

           

          HTH

          Maciej

          • 2. Re: Getting the assignee from the last activity
            newbeewan2

            Hum thanks, it works !

             

            ...
                public void notify(EventListenerExecution execution) throws Exception {
                    TaskService taskService = processEngine.getTaskService();
                    Task task = taskService.createTaskQuery().processInstanceId(execution.getProcessInstance().getId()).uniqueResult();
                    if(task != null){
                        execution.createVariable("lastAssignee", task.getAssignee());
                    }
                    
                }
            ...
            

             

            I don't know if it will work every time, is there an other possibility to get the current task ?

             

            Regards