Users bean
Available through the users variable
Contains important functions for everything that is user related. For example:
${users.current}retrieves the current user name.${users.getUserNamesWithError(stakeholderUserExpression)}evaluates the given user expression and lists the usernames.
User impersonation
The Users bean provides two methods that allow your workflow to perform actions as a specific user:
runAsUserById(UUID userId, Runnable runnable): Perform the runnable action as a the user with the provided ID.runAsUserByUserName(String userName, Runnable runnable): Perform the runnable action as a the user with the provided username.
By default, synchronous script tasks are attributed to the user who starts the task, while asynchronous script tasks are attributed to the workflow user. Your workflow can also perform actions as a specific user, for example:
users.runAsUserById(string2Uuid("01977cfd-f1e7-72c9-ae79-d7ff022c5502"), {commentApi.addComment(addCommentRequest)})Last updated
Was this helpful?