Creating Advanced Request Type Rules

To create an advanced request type rule:

  1. Log on to PPM.

  2. On the Open menu, click Administration > Open Workbench.

    The PPM Workbench opens.

  3. On the shortcut bar, click Demand Mgmt > Request Types.

    The Request Type Workbench opens.

  4. Open a request type for which you want to create an advanced rule.

  5. In the Request Type window, click the Rules tab.

  6. Click New.

    The Request Type Rules window opens.

  7. In the Rule Name field, type a name for the rule.

  8. In the Description field, you can type a short description of the rule.

  9. To implement this rule, for Enabled?, leave Yes selected.

  10. 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.

  11. From the Rule Type list, select Advanced.

    A warning is displayed.

    Click Yes to continue. The Request Type Rules window switches to advanced mode.

  12. 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.

  13. To set up a dependency:

    1. In the Dependencies section, click New.

      The Dependencies window opens.

    2. 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.

    3. From the Condition list, select one of the following:

      • A condition such as is null, or contains any value.

      • 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.

    4. If you selected a condition other than is null or contains any value, 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.

    5. 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.

    6. Click OK.

    The dependency you created is listed in the Dependencies table.

  14. In the Results section of the Rules window, click New.

    The Results window opens.

  15. 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.

  16. 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.

  17. 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:

      1. In the Logic list, leave SQL Default selected.

      2. 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:

      1. In the Logic list, select UI Rules.

      2. 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 the RequestRulesUserLibrary.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 and RequestRulesUserLibrary.js files.

  18. Click OK.

  19. Click Save.