This presentation is part of the Reusability and Specialization e-Learning Course.
Circumstances allow you to specialize a rule based on a property and/or a date. Keep in mind that circumstance resolution occurs after Class and RuleSet resolution.
There are three types of circumstancing in PRPC:
- Property Circumstance: Property circumstance allows you to circumstance based on a property that is currently on the clipboard. For example, specializing a rule when a property such as .MembershipType = Gold. Currently, a single rule can only be circumstanced by one property.
- Date Circumstance: Date circumstance compares a single property on the clipboard to the as-of date on the rule. The rule that has the most recent as-of circumstance date is selected. A future date will not be used.
- Date-Range circumstance: Date-Range circumstance allows you to use the current system time to determine which rule is applicable for this date range.
Security across circumstances does not exist. For example, you cannot control read/write access to rules in the same Class/RuleSet with different circumstances without customizing security rules.
Also, having many circumstance versions of the same rule can be more difficult to navigate than rules separated by classes; however, circumstances tends to be simpler to implement than Class and RuleSets specialization since they have less impact on overall system design.
As of PRPC 5.2, a circumstance version of a rule takes precedence over a non-circumstance version that exists in a higher RuleSet. For example, we have the 2 rules Test1 that exists in RuleSet ABC in versions 01-01-01. One instance is not circumstanced; the other is circumstanced by property, in this case the state New York. We also have another instance of Test1 in RuleSet ABC in versions 01-01-02. This instance is not circumstanced.
When a rule is called from a primary page with state equal to New York, which rule will run? It depends on your version of PRPC. As of PRPC 5.2, the rule with the circumstance value will run. Prior to version 5.2, the instance in RuleSet version 01-01-02 with no circumstance would run. Pre-5.2 functionality can be obtained by using the “Base Rule” flag, which will cause all circumstanced versions in lower rule sets to be hidden from rule resolution.