371
Views
3
Comments
Solved
GetUserId() in Process returns 0
Question

I have a business process and I want to assign a Human Activity to the person who is logged in and just did something. However, inside the process, GetUserId() is returning 0. 

How do I get the UserId of the person logged in who did the thing that fires off the Process inside the process itself?

mvp_badge
MVP
Rank: #62
Solution

Hi PJ,

You can assign the GetUserId() to an attribute of the Entity linked to that process. 

Cheers,

José

Rank: #369

Hi PJ,

Just like timers, there is nu current session user id. Alternative to Jose's solution, you can add the UserId as an input parameter in de Process. This parameter will then also become available in the Launch-activity. You can use this userid to assign it to the human activity.

Regards,

Lennart

A better Idea is to use a service account. A specific User in the User table with no password so he cannot login and incase the id =0 use the service account.