I’m encountered a problem with TaskQuery when taskCandidateGroup query parameter
is set.
In my test, I created two human task where ‘CandidateGroups’ is assigned to a
specified group ‘MASTER_GROUP’.
When I try to execute TaskQuery:
final TaskService taskService = processEngine.getTaskService();
final TaskQuery taskQuery = taskService.createTaskQuery().taskCandidateGroup("MASTER_GROUP");
final List<Task> taskList = taskQuery.orderByTaskCreateTime().asc().listPage(firstResult, maxResults);
This snippet code works fine for unclaimed task; but when I claim one of the two
availble task and, then, I retry to execute the query, it doesn’t work. I obtain
only the unclaimed task. But the claimed task has been claimed with a belonging user to
the MASTER_GROUP.
Therefore I would expect to get both tasks once again where only one of the two (the claimed one) has a valued assignedUser.
to sort it out. It is not clear if you expect the claimed tasks in the group task list or if they should be in the personal task list. It’s a common debate as both options are valid.
To reply your dubt It is not clear if you expect the claimed tasks in the group task list or if they should be in the personal task list. I expect to retrieve also the claimed tasks in the group task list: after claimed a task, an user is assigned but the group is the same then I expect to get it by the query.