cancel
Showing results for 
Search instead for 
Did you mean: 

How to get all completed user tasks with main process instance Id.

kusam_activiti
Champ in-the-making
Champ in-the-making
Hi,

We are using Activiti 5.13 and Workflow is defined with a main process and sub-processes.  We want to retrieve all completed user tasks  along with main process instance id( sub-process instance ids are already included), is there any way to get these results?

Thanks for your help.
4 REPLIES 4

trademak
Star Contributor
Star Contributor
And the user tasks are part of the sub process? You can get a list of completed user tasks using the HistoryService.

Best regards,

pradeep_mulimat
Champ in-the-making
Champ in-the-making
how can i get the username who instantiated the process?

I had executed the below query

SELECT * FROM activiti.act_ru_identitylink;

and this is the result

'25', '1', 'employee', 'candidate', NULL, '24'

User id is NULL

if i get the process instance id, i can get the details for particular user from teh ACT_HI_PROCINST .


Thanks in Advance.
Pradeep M

trademak
Star Contributor
Star Contributor
When you specify an activiti:initiator attribute on the start event then this will be used to store the username of the person who started the process in the defined process variable.
You also have to make sure that Authentication.setAuthenticatedUserId is invoked before starting the process instance as well for the username to be known.

Best regards,

Thank you Tijs Rademakers Smiley Happy