Creating Advanced Request Type Rules
To create an advanced request type rule:
-
Log on to PPM.
-
On the Open menu, click Administration > Open Workbench.
The PPM Workbench opens.
-
On the shortcut bar, click Demand Mgmt > Request Types.
The Request Type Workbench opens.
-
Open a request type for which you want to create an advanced rule.
-
In the Request Type window, click the Rules tab.
-
Click New.
The Request Type Rules window opens.
-
In the Rule Name field, type a name for the rule.
-
In the Description field, you can type a short description of the rule.
-
To implement this rule, for Enabled?, leave Yes selected.
-
To specify the event to trigger the rule, from the Rule Event list, select an event. For a description of selectable events, see Rule Event Behavior on the Request Details Page.
-
From the Rule Type list, select Advanced.
A warning is displayed.
Click Yes to continue. The Request Type Rules window switches to advanced mode.
-
If the results of the new rule might trigger rules defined for the same event (same dependency) that occur later in the rules sequence, and you want to prevent that from occurring, for the Processing cascading rules? option, select No.
-
To set up a dependency:
-
In the Dependencies section, click New.
The Dependencies window opens.
-
Use the Field list to select a field to trigger the rule.
Tip: After the Validate window opens, expand it to the right so that you can view all displayed columns.
Note: You cannot configure request default rules to trigger from a multiple select auto-complete. Do not select a multi-select auto-complete field.
After you select a field, the following read-only fields are populated:
-
Field Type. This field displays the type of field you selected.
-
Validation Name. This field displays the type of validation (such as CRT - Assigned To - Enabled) for the field you selected.
-
Visible Token. This field displays the name of the visible token (such as
REQ.ASSIGNED_TO_NAME
) for the selected field. -
Token. This field displays the name of the token, (such as
REQ.ASSIGNED_TO_USER_ID
) for the selected field.
The field you select determines which items are available in the Condition list.
-
-
From the Condition list, select one of the following:
-
A condition such as is null, contains any value, or is not null.
-
A condition to use to compare the value in the selected field with a constant, which you must then specify.
-
A condition to use to compare the value in the selected field with a value in a different field, which you must then specify.
-
-
If you selected a condition other than is null, contains any value, or is not null, then from the list displayed to the right, either leave constant value selected or select another field value.
Note: If you specify a numeric field, make sure that you always use.
-
Do one of the following:
-
If you selected constant value, then in the Value field, type the value to compare to the field value. (Depending on the field, the Value field might be a list, an auto-complete, or text box.)
Caution: If your PPM instance supports multiple languages, and you specify a numeric field as a dependency, make sure that you always use English format to specify field values.
Example: Suppose a request type includes a numeric field, and you want to create a rule that triggers an event if the field is set to the constant value 1234.56. In this case, make sure that you use the English variant without a group separator.
-
If you selected another field value, then use the Field auto-complete to select the field for value comparison.
Caution: If your PPM instance supports multiple languages, and the other field value you specify is a numeric field, make sure the values for the other field use English format.
-
-
Click OK.
The dependency you created is listed in the Dependencies table.
-
-
In the Results section of the Rules window, click New.
The Results window opens.
-
Use the Field auto-complete to select a field that the rule is to either automatically populate or for which it is to change an attribute such as read-only or hidden.
-
To close the window, click OK. Alternatively, if you want to specify another field, click Add, and then repeat step 15.
The Result Fields table lists the fields you selected.
-
To specify a rule that controls the behavior of the field(s) listed in the Result Fields table, do one of the following:
-
To specify an SQL-based rule that populates the fields:
-
In the Logic list, leave SQL Default selected.
-
In the Logic field, type the SQL statement that is to load values into the field(s) you added to the Result Fields table section.
Each
SELECT
value is loaded into its corresponding column in the Results table in order. The system validates the SQL statement to ensure that it contains the correct tokens:[SYS]
tokens,[AS]
tokens, or tokens of fields present in the Dependencies section. If the SQL statement is invalid, an error message is displayed. -
To specify a JavaScript-based rule that changes field behavior (for example, showMessage, setFieldRequired, or setFieldVisible) but does not populate fields with values:
-
In the Logic list, select UI Rules.
-
In the Logic field, type the JavaScript function.
Caution: For the purposes of validation, you cannot just type any JavaScript in the Logic text box (in the Rules window). You must use a function defined in the
RequestRulesSystemLibrary.js
file or in theRequestRulesUserLibrary.js
file.Tip: To view a list of the available JavaScript functions, their descriptions, syntax, and usage, to the right of the Logic list, click ?. This list automatically includes all functions defined in both the
RequestRulesSystemLibrary.js
andRequestRulesUserLibrary.js
files.
-
-
-
Click OK.
-
Click Save.