Search code examples
processbusiness-process-managementcamunda

What is the best way to find out the candidate group a task?


After I loaded a List of tasks with a taskQuery

taskService.createTaskQuery()
            .processDefinitionKey(PROCESSKEY)
            .taskCandidateGroupIn(list).initializeFormKeys().list()

What is the best way to find out the candidate group of every task? I want to display it in a JSF view, but the class Task has no corresponding field.


Solution

  • The best approach is to write a custom query that gives you all task information the way you need them with on select. You do not want to start looping over result lists and sending one or more query per item, especially not in a high performance application as your task list.

    Check the custom query documentation for details.