LoggedUserId inconsistency

1
0
-1

Im trying to get FirstName, LastName and Password from a current user. Im using LoggedUserId.value to get his ID. but only worked one time. In Bonita Engine Log appers this:
"depends on loggedUserId is neither defined in the script nor in dependencies."
or sometimes appears:.
"groovy.lang.MissingPropertyException: No such property: loggedUserId for class: Script1".

  1. import org.bonitasoft.engine.api.IdentityAPI;
  2. import org.bonitasoft.engine.identity.User;
  3.  
  4. String firstName = apiAccessor.getIdentityAPI().getUser(loggedUserId.value).getFirstName();
  5. String lastName = apiAccessor.getIdentityAPI().getUser(loggedUserId.value).getLastName();
  6. String tia = apiAccessor.getIdentityAPI().getUser(loggedUserId.value).getPassword();
  7. stuSubs.add(firstName+" "+lastName+", TIA:"+tia);
  8. //stuSubs its a java.util.List

How to use loggedUserId , stopping these errors?

No answers yet.
Notifications