cancel
Showing results for 
Search instead for 
Did you mean: 

Act_Hi_procinst start_user_id empty

zhoubosz
Champ in-the-making
Champ in-the-making
Hi,

I am trying to retrieve information from the history service.
This is how I instantiate a procsesInstance:

RuntimeService runtime = engine.getRuntimeService();
ProcessInstance instance = runtime.startProcessInstanceById(
               definitionId, parameters);

This is what I put into the bpmn20 file:

<startEvent id="startevent1" name="Start" activiti:initiator="initiator"></startEvent>


However, start_user_id is empty in my db:
[attachment=0]Capture.PNG[/attachment]

Am I missing anything? Do I have to trigger anything in order to have the initiator written into the database?

Cheers,
Bo
4 REPLIES 4

trademak
Star Contributor
Star Contributor
Hi,

To be able to have an initiator you should call the IdentityService setAuthenticatedUserId method before starting a new process instance.
This will make use there's an process initiator.

Best regards,

fabttl
Champ in-the-making
Champ in-the-making
Hi Tijs,

Is the  IdentityService setAuthenticatedUserId thread safe ?
If not, what would be your recommandation to start a process with identified user in a multithreaded environnement ?

Thanks a lot,

Fabrice

ronald_van_kuij
Champ on-the-rise
Champ on-the-rise
I works on the local thread afaik…

ronald_van_kuij
Champ on-the-rise
Champ on-the-rise
I mean, it is set locally to the thread, so no threading issues afaik.