flavio.donze flavio.donze - 7 months ago 66
Java Question

activiti API for task candidate users

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()
?

Answer

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());
    }
}
Comments