JBoss Community

Find Task by Process Def and group

reply from Lalit Bhatia in jBPM - View the full discussion

A similar situation where If I have Process Instance key/business key and Group and I need to figure out list of Tasks then I guess following piece of code should work -

 

-------------------------------------------------------------------

     ProcessInstanceQuery piQuery = new ProcessInstanceQueryImpl();
     ProcessInstance pi = piQuery.processInstanceKey(businessKey).list().get(0);

 

        // find the Task by process instance id and user id - since the task is assigned to user group
        // user associated with group will also be candidate
     TaskQuery tQuery = taskService.createTaskQuery().processInstanceId(pi.getId()).candidate(userId);

 

--------------------------------------------------------------------------------------

 

what do you say guys?

Reply to this message by going to Community

Start a new discussion in jBPM at Community