You can set activity level priority for Activity Nodes, Voting Activity Nodes and Compound Activity Nodes to an integer greater than or equal to 0. You can use the Set Activity Priority Java Action to set the priority for the activity.
Priority at the activity level can be set either by using a Java Action or through the General tab in the Properties view. For more information on setting activity level priority through the General tab, refer to section 6.7.3 Setting Activity Level Priority.
To set the activity priority using Java Action:
Select the Activity Node or Voting Activity Node or a Compound Activity Node to display the Properties view for the nodes.
Select the Action Set tab.
Select the Prologue Actions tab from the Java Action types and click Add. The Action Type List dialog is displayed.
Expand Server Actions and double click Set Activity Priority. The Action Editor - Set Activity Priority is displayed.
Type a descriptive name and your notes for the Java Action.
Enter a JavaScript expression in the Activity Priority field that evaluates to an Integer value. There are different ways to set the priority. You can type a constant (that is, a number), select a User Defined Attribute (UDA) that has the priority as its value, or build a complex JavaScript expression. For details, refer to Defining JavaScript Expressions .
Note
If you select a UDA, the UDA must be of type INTEGER or LONG. Otherwise an error will occur when the Java Action is executed.
In the following example, the activity priority is set to the value of the UDA Priority.
Figure 11.11 Setting Activity Priority
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.