How to find out if a task is active

I am just creating a query to find out if a task for a given process is active and / or claimed.
GET …/task?processInstanceId=44f20433-4826-11ea-bc58-74e54374d2e3&active=true

The problem is that setting active to true or false brings the same result.

I need to know which task is active and if there is a task active I need to know if it is claimed and by whom.
Can anyone help?

When you say “active” what do you mean?

With active I mean that the task has the process token and is ready to claim .

in Camunda docs: The typical use case is to query all “active” tasks for a user for a given date.
Active Only include active tasks. Value may only be true , as false is the default behavior.

active is a query parameter

If you query for tasks the way you have then you’ll only find tasks in which there is a token waiting to be completed - the result never return completed tasks.

Exactly those task I am searching in a specific process. But request parameter “active” does not bring results.

Hi @fazzomurata,

active parameter when set to true, is used to return tasks that are not suspended.

But as I understood, your need is different… You need to retrieve the set of running tasks which have been claimed and another set of running tasks which are still unclaimed.

The above get request without the active parameter would retrieve all running tasks for the passed process instance Id.

If you need to retrieve only claimed tasks then pass the parameter assigned with a true value.

And if you need to retrieve only unclaimed tasks then pass the parameter unassigned with a true value.

Thank you so much for this reply.
Exactly, I need to retrieve the running task for a process instance which have been claimed /unclaimed.

So do I also get the current, running task by using request parameter claimed /unclaimed?

Hi @fazzomurata,

Yes, passing the request parameter assigned/unassigned… you should get the current running assigned/unassigned task(s)

1 Like