Red Hat Training

A Red Hat training course is available for Red Hat Process Automation Manager

第5章 Case roles

Case roles provide an additional layer of abstraction for user participation in case handling. Roles, users, and groups are used for different purposes in case management.

Role
Roles drive the authorization for the case instance, and can be used for user activity assignments. The only role that is predefined is Owner. A user or one or more groups can be assigned to the owner role. The owner is whoever the case belongs to. Roles are not restricted to a single set of people or groups as part of case definition. Roles should always be used for task assignment rather than assigning a specific user or group in order to ensure the case remains dynamic.
Group
A group is a number of people who are able to carry out a particular task or have a set of specified responsibilities. There can be any number of people assigned to a group, and a group can be assigned to a role. Members of a group can be added or changed at any time, which is why a group should never be hardcoded to a particular task.
User
A user is an individual who can be given a particular task by assigning them a role or adding them to a group.

The following illustrate how the preceding case management concepts apply to a hotel reservation.

  • Role = Guest
  • Group = Receptionist, Maid
  • User = Marilyn

The role assignment (Guest) affects the specific work of the case and is unique to all case instances. The number of users or groups that can be assigned to a role is limited by the Case Cardinality, which is set during role creation in the process designer. For example, there may be only one guest in a hotel reservation case, or there may be two suppliers of IT hardware as in the IT Orders sample project.

When the roles are defined, case management must ensure that these are not hardcoded to single set of people or groups as part of case definition and that they can differ for each case instance. This is where case role assignments become important. Role assignments can be assigned or removed in the following ways:

  • When a case starts.
  • At any given point in time while a case is active.
  • Removed at any given point in time while a case is active.

The second and third options do not alter the task assignments for active tasks.

Roles are optional and not a case requirement, however, you should use roles within case definitions.

重要

Always use roles for task assignments instead of actual user or group names. This ensures the case remains dynamic and actual user or group assignment can be made as late as possible.

Roles are assigned to users or groups and authorized to perform tasks when a case instance is started either in an application or by using the REST API.

For more information about how to assign and authorize roles, see Role authorization.

5.1. Role authorization

Roles are authorized to perform certain case management tasks when starting a new case instance using the Showcase application or the REST API.

Use the following procedure to start a new IT Orders case using the REST API.

Prerequisite

  • The IT Orders sample project has been imported in Business Central and deployed to the Process Server.

Procedure

  1. Create a POST REST API call with the following endpoint:

    http://host:port/kie-server/services/rest/server/containers/itorders/cases/itorders.orderhardware/instances

    • itorders: The container alias that has been deployed to the Process Server.
    • itorders.orderhardware: The name of the case definition.
  2. Provide the following role configuration in the request body:

    {
      "case-data" : {  },
      "case-user-assignments" : {
        "owner" : "cami",
        "manager" : "cami"
      },
      "case-group-assignments" : {
        "supplier" : "IT"
     }
    }

This starts a new case with defined roles, as well as autostart activities, which are started and ready to be worked on. Two of the roles are user assignments (owner and manager) and the third is a group assignment (supplier).

After the case instance is successfully started, the case instance returns the case ID: IT-0000000001.

For information about how to start a new case instance using the Showcase application, see 「Starting an IT Orders case in the Showcase application」.