get finished process instances which involved a user

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

get finished process instances which involved a user

i am currently trying to get finished process Instances with  processDefinitionKey("courriersArrivés") and i want to check which process instances involved the user with id "ha".
when i type this 
System.out.println( historyService.createHistoricProcessInstanceQuery().processDefinitionKey("courriersArrivés").involvedUser("ha").finished().list().size());
i always got 0 :/ even i am sure that i have tasks whcih where assigned to "ha" because when the process is runnig ha recieve its tasks,but when it is finished i face this problem

So how to do that in activiti ? 

Thank's in advanced Smiley Happy

3 Replies
Intermediate

Re: get finished process instances which involved a user

An involved user is nit the same as an assignee or candidate.

Check out the following thread:
 

Greg

Active Member II

Re: get finished process instances which involved a user

i have already mention "ha" as a candidate in  groupe  "Bureau d'ordre",and this is how i assigned th task

taskService.addCandidateGroup(
taskService.createTaskQuery().processInstanceId(processInstance.getId()).list().get(0).getId(),
"Bureau d'ordre");

Senior Member

Re: get finished process instances which involved a user

You should use TaskService.addCandidateUser, not TaskService.addCandidateGroup.
If you use only TaskService.addCandidateGroup, act_hi_identitylink has only a groupId.

If you use TaskService.addCandidateGroup, act_hi_identitylink has a userId and you can use involvedUser option.