AnsweredAssumed Answered

How to get next User Task for a specific user?

Question asked by shukla.raghav on Apr 11, 2013
Latest reply on Nov 20, 2017 by suri_kumar
Well, here is a logical question that pops up in my mind after being familiar with Activiti for nearly 3 months. Its an important question for me since i am just about to use Activiti BPM for a professional application in couple of days and currently in design phase for the same.

When we design a BPMN process, we define the various activities to be performed by the user and system, in a specified SEQUENCE and a WELL DEFINED ORDER. We also define which USER TASK is assigned. Thereby the BPMN engine knows which User has what task Assigned and also in what order. Then why do we need to pass the Task Definition ID for fetching the user task in the following manner

 Task tasks = processEngine.getTaskService().createTaskQuery().taskDefinitionKey("fof").list();
Why is it that we need to tell activiti ID of the task when it already has the process definition that defines tasks and its candidate users. Why cant we have something like this in activiti to fetch next task for the current user
Task tasks = processEngine.getTaskService().getNextTask(User currentUser);

I know there is processEngine.getTaskService().createTaskQuery().taskAssignee(), but is returns all the tasks that are assigned to a specific user and not the next task for the user.

Please suggest what should be done.