2
votes

I would like to get the candidate users for a task but can not find any API in

org.activiti.engine.TaskService
or
org.activiti.engine.task.TaskInfoQuery

Is there any API or do I need to use taskService.createNativeTaskQuery()?

1

1 Answers

2
votes

This is how I ended up filtering the candidates, users will hold a list of all the candidate user ids.

List<String> users = new ArrayList<String>();
List<IdentityLink> links = taskService.getIdentityLinksForTask(taskId);
for (IdentityLink link : links) {
    if (IdentityLinkType.CANDIDATE.equals(link.getType())) {
        users.add(link.getUserId());
    }
}