Rule Event Behavior on the Request Details Page

Rules can be used to achieve dynamic behavior on the request form itself, independent of workflow actions. Table 5-6. Effects of rule events lists the rule events you can specify for any request type rule (simple or advanced), along with descriptions of how each is processed and how it affects field behavior on the request detail page.

Caution: All of these rule events are applied dynamically in the request detail page. For other interfaces in which requests are updated (Quick Edit page, Mass Update page, Web service APIs to create or update requests), the rules are not processed dynamically as these events occur. Rather, they are processed when requests are saved. Any field that is configured to be required as a result of any of these rules will ultimately be required when the request is saved, and if such a field does not have a value, then the user sees a message indicating that the request(s) could not be saved.

Table 5-6. Effects of rule events

Rule Event

Rule Event Processing and Field Behavior

Apply on creation

Applied any time a request of this type is created.

Note: When users change request type on the request details page, target request type rules defined for this event are triggered.

Apply on copy

Applied any time a request of this type is copied.

Notes:

  • When selecting the "Apply on copy" rule event, you are able to configure field dependencies. This feature is not supported in the "Apply on creation" rule event.

  • If a request type contains rules of the "Apply on copy" rule event and rules of the "Apply on creation" rule event, only the "Apply on copy" rules are triggered when users copy the requests of that type.

Apply on page load

Rules defined for this event are triggered when the request detail page is loaded in a Web browser; however, these rules are not applied when a request is first created. (Use the "Apply on creation" rule event for that.)

Note: Rules defined for this event are not triggered on the look-ahead page.

Apply on field change

Rules defined for this event are triggered any time one of the fields listed in the Dependencies section changes to a new value if all of the dependencies specified for the rule are met.

For example, consider a rule that has dependencies on when the Priority field has the value "Critical" and the Assigned To field is null. The rule is evaluated whenever either the Priority field or the Assigned To field is changed, and is triggered only if both of the dependency conditions are true when the rule is evaluated.

Apply before save

When a user clicks Save on the request detail page, or clicks a workflow "action" button (which saves the request before processing the workflow action), then any rules defined for this event are processed before the save request is submitted.

The "showMessage()" function can cancel the request save if the rule is not satisfied.

Apply before transition

When the user clicks a workflow "action" button, rules defined for this event are applied and then processed before the transition is taken. For example, if a rule is triggered to show a message and cancel the action, then the user sees the message displayed and the transition is not taken.

As another example, if an "Apply before transition" rule is defined to set a timestamp in a particular request field, then the rule is processed and the target field is updated before the transition is taken.

The "showMessage()" function can cancel the transition event if the rule is not satisfied.

Note: PPM does not support the use of special commands to trigger rules.

When a user clicks either Save Progress or Continue Workflow Action on the look-ahead page, only "Apply before save" rules are triggered. This is because when the user clicks the workflow "action" button on the Request Details page before going to the look-ahead page, PPM has executed "Apply before transition" rules.

Once a rule is triggered, any dependencies defined for the rule (in the Dependencies section of the Rules window) must be met before the rule is executed. A simple default rule has a limited set of dependencies available, but an advanced rule can have dependencies set up to run the rule under very specific circumstances based on the current values of any fields in the request.

Note: Rule dependency is not supported if the dependency field is using the () pattern to present negative numbers. For example, using (1000) to represent -1000.

Considering the fact that Auto Complete List and/or Drop Down List values can be localized, which may then cause consistency issue for the dependencies, we recommend you to match Text Field code to the code of Auto Complete List or Drop Down List when you set up request type field dependencies.

Rule Event Precedence

It is possible to configure conflicting rules on different events. In this case, "Apply before save" or "Apply before transition" rules are applied last. These rules take precedence if there is a rules conflict.

For example, consider a request type that has an "Apply on page load" rule that makes the Priority field required, and an "Apply before save" rule that makes the Priority field optional. When the user saves the request, the Priority field is option because the "Apply before save" rule takes precedence.

Typically, rules are processed in the order specified in the request type configuration. For advanced rules, this ordering can include a mix of SQL-based and JavaScript-based rules.