How to Complete User Task Based on Assignee in Camunda Parallel User Task

I have created a Camunda workflow, where there is a parallel user task exist. If I try to complete the user task, it is completing the user task based on the order given in the list. Ex: {"John", "Max", "Jassica"}. If I complete user task once, it is considering that John have completed the user task.

Is there a way I can tell Camunda that "Hey this is the user who completed the user task."?

Am trying to get the list of pending user task for each user. Ex: {"John", "Max", "Jassica"} are the list of assignees in my parallel user task.

When I initiate the workflow, each user will be assigned with 1 pending task.

taskService.complete(taskIds, processVariables);

using this code, I will complete the user task, but it is not specific to any assignee. Even am completing the task as Max, it is still considering John, so pending task will become 0 for John and 1 for Max.

I want to complete the user task by specific assignee.

1 Answer

You should claim the task with the userId who is working on it. Typically, it is a good idea to claim early, so when you start working on a task, you call taskService.claim(taskId, userId), because then you can exclude this task from other users taskslists and avoid double work.

But it is also fine to do a "late-claim", so directly before you call complete, just call claim.

How you get the userId to use for the claim is up to you and typically requires accessing the web authorization to get the logged in user from a token or a session.

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Marcus Vance

Marcus Vance

Cybersecurity & Digital Privacy Researcher

Marcus Vance is a cybersecurity auditor and technology writer dedicated to educating the public about online safety, data privacy regulations, enterprise security, and emerging cyber threats.

Share this article
Twitter Facebook Pinterest