Is it possible to use REST to get current tasks for all users

cancel
Showing results for 
Search instead for 
Did you mean: 
dhrobbins
Active Member II

Is it possible to use REST to get current tasks for all users

Jump to solution

Is it possible to get all current tasks for all users via REST.  Our environment is Community Edition 5.2.2.

While I know it is possible to get all tasks for a currently authenticated user with the following REST call:

http://localhost:8080/alfresco/service/api/task-instances 

 

I need to be query current tasks for all workflows in order to perform reporting. Out goal is to create page where managers can identify how many workflows are in process and what phase they are in.  These managers do NOT participate in the workflows.  If this means consuming data then filtering on the client that is also an option for us.

Other possibilities I've considered are:

  • Assign a group to the workflow so it can see all tasks? 
  • Create an endpoint and query using WorkflowService.queryTasks();
1 Solution

Accepted Solutions
thuynh
Established Member II

Re: Is it possible to use REST to get current tasks for all users

Jump to solution

Hi David Robbins ,

Is it possible to get all current tasks for all users via REST

You can get list of tasks by this REST API: Activiti User Guide 

Example: http://localhost:8081/activiti-rest/service/runtime/tasks?processInstanceId={instanceid} (from the user guide, you can provide many other query parameters in the REST call)

Out goal is to create page where managers can identify how many workflows are in process and what phase they are in

You need a drill-down dashboard

First, you need to retrieve all the instances by: http://localhost:8081/activiti-rest/service/runtime/process-instances 

Then, upon clicking on a single instance to drill down to see where is the execution, tasks, etc.: 

These managers do NOT participate in the workflows

The manager accounts need to have enough privileges to call most API calls (view instances, view instance, view task details). Have manager accounts associated with 'management' group. Have a look at ACT_ID_GROUP and ACT_ID_MEMBERSHIP tables. Also have a look at how activiti-explorer implements gonzo user as a manager within management group

 

Hope this helps,

Thanks,

Thong Huynh

View solution in original post

2 Replies
thuynh
Established Member II

Re: Is it possible to use REST to get current tasks for all users

Jump to solution

Hi David Robbins ,

Is it possible to get all current tasks for all users via REST

You can get list of tasks by this REST API: Activiti User Guide 

Example: http://localhost:8081/activiti-rest/service/runtime/tasks?processInstanceId={instanceid} (from the user guide, you can provide many other query parameters in the REST call)

Out goal is to create page where managers can identify how many workflows are in process and what phase they are in

You need a drill-down dashboard

First, you need to retrieve all the instances by: http://localhost:8081/activiti-rest/service/runtime/process-instances 

Then, upon clicking on a single instance to drill down to see where is the execution, tasks, etc.: 

These managers do NOT participate in the workflows

The manager accounts need to have enough privileges to call most API calls (view instances, view instance, view task details). Have manager accounts associated with 'management' group. Have a look at ACT_ID_GROUP and ACT_ID_MEMBERSHIP tables. Also have a look at how activiti-explorer implements gonzo user as a manager within management group

 

Hope this helps,

Thanks,

Thong Huynh

dhrobbins
Active Member II

Re: Is it possible to use REST to get current tasks for all users

Jump to solution

Thong, thank you for the very detailed answer.