cancel
Showing results for 
Search instead for 
Did you mean: 

How to set user that starts a worklow ?

jcharnet
Champ in-the-making
Champ in-the-making
Hello. What should I do to set the user that is starting a workflow process ?
I want to be able to see my started process through "My Instances" view in Activiti Explorer. I've noticed that Activiti Explorer fetches data from ACT_HI_PROCINST where the column START_USER_ID_ matches the logged in user.
I'm starting my process outside Activiti Explorer, and this columns (START_USER_ID_) is not being populated.
Any idea on how to achieve this ?


Thanks,

John
2 REPLIES 2

trademak
Star Contributor
Star Contributor
Hi,

It's explained in the userguide with the start event:

try {
  identityService.setAuthenticatedUserId("bono");
  runtimeService.startProcessInstanceByKey("someProcessKey");
} finally {
  identityService.setAuthenticatedUserId(null);
}

Best regards,

jcharnet
Champ in-the-making
Champ in-the-making
Perfect, sorry I missed that in the userguide.

Thanks