Top
Systemwalker Runbook Automation Studio User's Guide
Systemwalker

11.2.1 Assigning an Activity to a User

When modeling an activity, you assign it to a Role according to who is responsible for completing the activity. In some situations, however, you may want to assign an activity to a particular user, and not just to any user who is a member of a certain Role. This can be achieved using the Assign Task to User Java Action. You can use this Java Action as a Role Action with Activity Nodes, Voting Activity Nodes, and Compound Activity Nodes.

Note

You can assign the activity only to users within the Role to which the activity is currently assigned. If you want to reassign the activity to users from another Role, you must change the activity's Role assignment.

To assign an activity to a user:

  1. Select the Activity Node, Voting Activity Node or Compound Activity Node to display the Properties view for the nodes.

  2. Select the Action Set tab. Click Add on the Role Actions tab. The Action Type List dialog is displayed.

  3. Expand Server Actions and double click Assign Task To User.

  4. Specify a JavaScript expression for the users to be assigned.

    You can type a constant (that is, the name of a user), select a User Defined Attribute (UDA) that has the name as its value, or build a complex JavaScript expression that evaluates to a name. For details, refer to section 11.14 Defining JavaScript Expressions.

    Note

    If you select a UDA, the UDA must be of type STRING. Otherwise an error will occur when the Java Action is executed.

    If you want to specify multiple users, use commas to separate the names. The following figure shows an example.

    Figure 11.8 Assigning an Activity to Users

    Note

    The JavaScript expression whether it is a simple UDA or a complex JavaScript expression must be resolved into one or multiple users within the Role to which the activity is currently assigned.

  5. On the Details tab, type a descriptive name and your notes for the Java Action.

  6. Click OK.

Note

It is not necessary to compensate this action using a compensation action, because changes made by this action are in Systemwalker Runbook Automation only and they will be rolled back after the process instance goes into error state. For information on compensation actions, refer to section 11.1.7 Dealing With Errors in Java Actions.

Note

By defining the Role Java Action, the activity is assigned to a particular user. In this case, defining the Role of the user to whom you want to assign the activity is not required. You can assign a Voting Activity and a Compound Activity in the same manner.