Interface WorkflowUsers
public interface WorkflowUsers
Workflow bean providing access to user related functionalities. Don't use this outside of a workflow. The bean will
be accessible by using 'users' in your workflow expressions.
-
Method Summary
Modifier and TypeMethodDescriptionReturn the current user name.Retrieves the role Id for the given roleName.getRoleIds
(String roleNames) Retrieves all the role Ids from a comma separated string of role names.getUserIds
(String expression) Retrieves all the user Ids from a comma separated string of user expressions.getUserIdsFromRoles
(String roles) Retrieve the userIds from a comma separated list of roles.getUserNames
(String expression) Converts a Candidate user expression to aSet
of user names using the current workflow business item.getUserNamesCsv
(String expression) Converts a Candidate user expression to a comma separated list of user names using the current workflow business item.getUserNamesWithError
(String expression) Converts a Candidate user expression to aSet
of user names using the current workflow business item.getUserNamesWithParticipatePermissionWithError
(String expression) Converts a Candidate user expression to aSet
of user names using the current workflow business item with Participate Permissions.Set<com.collibra.dgc.core.api.model.user.User>
Retrieves all the users from a comma separated string of user expressions.Set<com.collibra.dgc.core.api.model.user.User>
getUsersFromRoles
(String roles) Retrieve the users from a comma separated list of roles.boolean
Analyses the given expression and indicates if the expression resolves to any user or not.void
runAsUserById
(UUID userId, Runnable runnable) Run the given runnable logic as a given user.void
runAsUserByUserName
(String userName, Runnable runnable) Run the given runnable logic as a given user.
-
Method Details
-
getUserIds
Retrieves all the user Ids from a comma separated string of user expressions.- Parameters:
expression
- The comma separated list of user expressions- Returns:
- A
Set
of user ids.
-
getUsers
Retrieves all the users from a comma separated string of user expressions.- Parameters:
expression
- The comma separated list of user expressions.- Returns:
- A
Set
ofUser
s.
-
getUserIdsFromRoles
Retrieve the userIds from a comma separated list of roles.- Parameters:
roles
- The csv string of roles to convert to user Ids.- Returns:
- A set of user ids.
-
getUsersFromRoles
Retrieve the users from a comma separated list of roles.- Parameters:
roles
- The csv of roles to convert to users.- Returns:
- A
Set
ofUser
s.
-
getRoleIds
Retrieves all the role Ids from a comma separated string of role names. When a corresponding role is not found for a given role name, no roleId is added to the resultSet
.- Parameters:
roleNames
- The comma separated list of role names- Returns:
- A
Set
of role ids.
-
getRoleId
Retrieves the role Id for the given roleName.- Parameters:
roleName
- The name of the role to retrieve the role id for.- Returns:
- The roleId of the given roleName,
null
if role not found
-
runAsUserById
Run the given runnable logic as a given user. The logic will be executed in a separate transaction.- Parameters:
userId
- the user id of the userrunnable
- the runnable logic
-
getCurrent
String getCurrent()Return the current user name.- Returns:
- the current user name
-
getUserNamesCsv
Converts a Candidate user expression to a comma separated list of user names using the current workflow business item.- Parameters:
expression
- The candidate user expression- Returns:
- A
String
of user names, comma separated
-
getUserNames
Converts a Candidate user expression to aSet
of user names using the current workflow business item.- Parameters:
expression
- The candidate user expression- Returns:
- A
Set
of user names
-
isEmpty
Analyses the given expression and indicates if the expression resolves to any user or not.- Parameters:
expression
- The expression to check for emptyness- Returns:
true
if the expression is empty,false
otherwise.
-
getUserNamesWithParticipatePermissionWithError
Converts a Candidate user expression to aSet
of user names using the current workflow business item with Participate Permissions.- Parameters:
expression
- The candidate user expression- Returns:
- A
Set
of user names
-
getUserNamesWithError
Converts a Candidate user expression to aSet
of user names using the current workflow business item.- Parameters:
expression
- The candidate user expression- Returns:
- A
Set
of user names
-
runAsUserByUserName
Run the given runnable logic as a given user. The logic will be executed in a separate transaction.- Parameters:
userName
- the username of the userrunnable
- the runnable logic
-