Search Process Instances by Initiator

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

Search Process Instances by Initiator

How can I search for process instances started/created by a particular user? I used the identityService to set the authenticatedUser before creating the instance so that the START_USER_ID_ column in the ACT_HI_PROCINST table is populated. I don't see any obvious way of performing this operation using ProcessInstanceQuery. Appreciate any help.

3 Replies
Highlighted
Alfresco Employee

Re: Search Process Instances by Initiator

For that you can use HistoricProcessInstanceQuery HistoricProcessInstanceQuery (Activiti - Engine 5.22.0 API) 

Highlighted
Member II

Re: Search Process Instances by Initiator

Thanks Bassam. My understanding was that the HistoricProcessInstanceQuery can be used only against ended instances and not against active process instances. I need to run the query against active instances.

Highlighted
Alfresco Employee

Re: Search Process Instances by Initiator

HistoricProcessInstanceQuery can also be used for unfinished instances as well. To only retrieve unfinished instances use unfinished method HistoricProcessInstanceQuery (Activiti - Engine 5.22.0 API)