How to use loggedUserId in Bonita 7.2.3?

1
0
-1

My problem is simple. I need to get the userId of the currenty user "performing" the script activity. In the documentation says that loggedUserId is among the provided variables, but it's not in the provided variables in the groovy script editor. I'm using the Community Edition.
How can i get the id?

1 answer

1
0
-1
This one is the BEST answer!

I've created a bug report here:
https://bonita.atlassian.net/browse/BBPMC-388

You can add your own comments,

regards
Seán

PS: While not fixing your problem, if this reply answers your question, please mark as resolved.

Comments

Submitted by Sean McP on Thu, 06/23/2016 - 11:15

Here is the response from Bonita:

  1. Actually in most of the cases, the fact that loggerUserId is not available is expected behavior. Let me explain.
  2.  
  3. In the context of an operation, a connector, a variable initialization, etc..., the engine will execute the Groovy script in an asynchronous and disconnected fashion. Which means that the user currently logged in is not available in that context.
  4.  
  5. So following this logic, the variable loggerUserId is available on the Groovy script editor in the V6 forms designer. By example, when using a script to initialize a text field widget. In the case of the forms, the engine knows which user is currently displaying the form.
  6.  
  7. Hope it makes sense.

Which it does...

Basically Bonitasoft will update the documentation so the variable is no longer available and confusing people.

If you can mark my answer as Resolved...

regards
Seán

Notifications