Package com.collibra.dgc.workflow.api.bean

# 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 Type
  Method
  Description
  `String`
  `getCurrent()`
  Return the current user name.
  `UUID`
  `getRoleId(String roleName)`
  Retrieves the role Id for the given roleName.
  `Set<UUID>`
  `getRoleIds(String roleNames)`
  Retrieves all the role Ids from a comma separated string of role names.
  `Set<UUID>`
  `getUserIds(String expression)`
  Retrieves all the user Ids from a comma separated string of user expressions.
  `Set<UUID>`
  `getUserIdsFromRoles(String roles)`
  Retrieve the userIds from a comma separated list of roles.
  `Set<String>`
  `getUserNames(String expression)`
  Converts a Candidate user expression to a `Set` of user names using the current workflow business item.
  `String`
  `getUserNamesCsv(String expression)`
  Converts a Candidate user expression to a comma separated list of user names using the current workflow business item.
  `Set<String>`
  `getUserNamesWithError(String expression)`
  Converts a Candidate user expression to a `Set` of user names using the current workflow business item.
  `Set<String>`
  `getUserNamesWithParticipatePermissionWithError(String expression)`
  Converts a Candidate user expression to a `Set` of user names using the current workflow business item with Participate Permissions.
  `Set<com.collibra.dgc.core.api.model.user.User>`
  `getUsers(String expression)`
  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`
  `isEmpty(String expression)`
  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

    Set<UUID> getUserIds(String expression)
    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

    Set<com.collibra.dgc.core.api.model.user.User> getUsers(String expression)
    Retrieves all the users from a comma separated string of user expressions.
    Parameters:
      `expression` - The comma separated list of user expressions.
    Returns:
      A `Set` of `User`s.

  - ### getUserIdsFromRoles

    Set<UUID> getUserIdsFromRoles(String roles)
    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

    Set<com.collibra.dgc.core.api.model.user.User> getUsersFromRoles(String roles)
    Retrieve the users from a comma separated list of roles.
    Parameters:
      `roles` - The csv of roles to convert to users.
    Returns:
      A `Set` of `User`s.

  - ### getRoleIds

    Set<UUID> getRoleIds(String roleNames)
    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 result `Set`.
    Parameters:
      `roleNames` - The comma separated list of role names
    Returns:
      A `Set` of role ids.

  - ### getRoleId

    UUID getRoleId(String roleName)
    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

    void runAsUserById(UUID userId, Runnable runnable)
    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 user
      `runnable` - the runnable logic

  - ### getCurrent

    String getCurrent()
    Return the current user name.
    Returns:
      the current user name

  - ### getUserNamesCsv

    String getUserNamesCsv(String expression)
    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

    Set<String> getUserNames(String expression)
    Converts a Candidate user expression to a `Set` of user names using the current workflow business item.
    Parameters:
      `expression` - The candidate user expression
    Returns:
      A `Set` of user names

  - ### isEmpty

    boolean isEmpty(String expression)
    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

    Set<String> getUserNamesWithParticipatePermissionWithError(String expression)
    Converts a Candidate user expression to a `Set` 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

    Set<String> getUserNamesWithError(String expression)
    Converts a Candidate user expression to a `Set` of user names using the current workflow business item.
    Parameters:
      `expression` - The candidate user expression
    Returns:
      A `Set` of user names

  - ### runAsUserByUserName

    void runAsUserByUserName(String userName, Runnable runnable)
    Run the given runnable logic as a given user. The logic will be executed in a separate transaction.
    Parameters:
      `userName` - the username of the user
      `runnable` - the runnable logic