cancel
Showing results for 
Search instead for 
Did you mean: 

Query all process instances with pending tasks for a candidate

edufrazao
Champ on-the-rise
Champ on-the-rise
Hi.
How can I query all Process Instances that have pending tasks related to a user?

I'm using this statement:

List<ProcessInstance> instances = runtimeService
         .createProcessInstanceQuery()
         .involvedUser(login)
         .active()
         .list();


But it gets only instances that haves tasks where the assignee is the user. I also need to include the user candidate list, and group candidate lists where the user belongs to.

Thanks.
5 REPLIES 5

jbarrez
Star Contributor
Star Contributor
That's not possible currently with the out of the box query api. You will need a native query if you need it right now.

edufrazao
Champ on-the-rise
Champ on-the-rise
Thanks for your Jbarrez. I will implement it as a native query. Do you think that can be a useful enchancement to the query API that justifies a ticket?

jbarrez
Star Contributor
Star Contributor
Sure thing, all input is valid input. But I have no idea when it will be prioritised though.

Always more than welcome to create a pull request 😉

edufrazao
Champ on-the-rise
Champ on-the-rise
I'm not very familiar with Activiti yet. I'm starting to learn it right now, but I will study the Query API, and create a pull request for your approval, and post the enchancement ticket here.!

jbarrez
Star Contributor
Star Contributor
Looking forward to it!