Candidate groups of tasks

Hello,
how to get the candidate groups of user tasks? I don’t have a process instance yet, I have only the process definition with the taskDefinitionId.

ThanksCapturar

@jaymesanches if you want to get candidateGroups from bpmn you can parse the bpmn and read the attribute or else you can call rest api or java api called getDiagram() and later you can parse and read that attribute

1 Like

Hi @jaymesanches,

with the Java API, you could do something like this:

UserTask userTask = repositoryService
    .getBpmnModelInstance("processDefinitionId")
    .getModelElementById("Task_1sqwlpn");
String candidateGroups = userTask.getCamundaCandidateGroups();

I would also encourage you to look into the BPMN Model API documentation for further reading on this:
https://docs.camunda.org/manual/latest/user-guide/model-api/bpmn-model-api/read-a-model/

Best,
Tobias

1 Like