Back Forward Circumstances — Concepts and terms

Show all 

A circumstance is an optional qualification available for all rules. Using a circumstance allows your application to support multiple variants of a rule. For example, variations of an ordinary rule instance can be created for different customer status levels or for different geographic locations.

Circumstance qualified rules

A circumstance-qualified rule instance (often referred to as a "circumstanced rule") is always based upon an unqualified rule instance ( base rule ). You can circumstance a base rule with a single property and its value, or with multiple properties and their values (called multivariate circumstancing ). The circumstanced rule is selected by rule resolution if the value of the circumstance property on the rule matches that property's value on the clipboard at runtime.

On many displays, a circumstance icon identifies a circumstance-qualified rule instance. A Qualifies icon identifies a base rule instance that has one or more circumstanced instances. The rule form for a circumstance-qualified rule displays the property and its value next to the Circumstance label located in the top right area of the form.

Example

Assume that you have difference pricing levels for your customers. You first define a base pricing rule for all customers. Then you qualify the base rule by creating circumstanced rules for customers at different buying levels. The property .CustomerType is part of the customer order and has values of "Silver" and "Gold". In this example, a customer has purchased a $100 item. Using the property and values, you create circumstance-qualified instances of the base rules as shown here:

When the system processes the order, the value of that property dictates which rule is run and thereby determines the discount (if any) the customer receives.

For information on how rule resolution processes circumstanced rules, see How the system finds rules through rule resolution. See also the Pega Developer Network article PDNPRKB-25168 About rule resolution.

Contrasting single-value with multivariate circumstances

If you use a single circumstance property, you define the property name and its value directly in the Save As form. PROJ-1166

If you use multivariate circumstancing, you two rules in the Save As form:

Multivariate circumstancing enable you to specialize a rule by more than one feature. For example, an insurance company may be required to collect, for every state, claims that exceed a specific amount and the method by which the claims were conveyed (letter, phone, email, and so on). Another example may be the need for a rule that is specialized by an age range and not an absolute value.

Creating a circumstance-qualified rule

To create a circumstance-qualified rule, first define an unqualified or base rule instance (with the Circumstance values left blank). Then use the toolbar Save As button (Save As ) to create a second rule qualified by a circumstance. If the original rule has an Applies To class as an initial key part, the circumstance-qualified rule must have the same Applies To class or a subclass derived from that class. C-2441 GENTJ

For instructions on how to create circumstance-qualified rules, see these PDNPega Developer Network articles:

Finding circumstance-qualified rules

F.Karachi, v5.4 Select> Process and Rules > Tools > Find Rules > Find by Circumstance to BYRNB 2/23/10 create a list view report comprising single-property and multiple-property circumstanced rules. You can filter the report by searching on the following default circumstance properties: U.S. State Codes, Channels, and Customer Level. You can also search for circumstance-qualified rules by entering text used in key parts (Applies To or Name) in the Name Contains field.

For more information on how to report on circumstanced rules, or how to add or change the circumstance property columns for the report, see the PDNPega Developer Network article PRKB-25220 How to find rules with a specific circumstance .

Redirection

For decision tree, decision table, and map value rules, you can redirect one circumstance-qualified rule to another circumstance-qualified rule (a peer with the same base rule), to reduce the number of distinct rules that you need to maintain. Select the Redirect this rule checkbox on the Results tab.

Notes

NoteCircumstances are available only for certain rule types — those with the Allow Selection based on Property Rules? box selected on the Class form defining the rule type. As of V5.4, you can circumstance-qualify Declare-Constraints, Declare-Expression, and Declare-OnChange rules.5.4, proj-823
You can circumstance-qualify Rule-PortalSkin rule types. V6.1, grp-5980, proj 242 You cannot use circumstances with a final rule. MARIK 8/16/03 REMOVED The RuleSet Version of the circumstanced rule must be the same as or higher than the RuleSet Version of the base rule. If you revise a base rule (placing the new one in a version that has a higher number than the circumstanced versions), you must copy (and revise if needed) each circumstanced rule into the higher-numbered version also. CLINIC 8/25/06

Note If a circumstance-qualified stream rule contains JSP tags (rather than directives), the base rule must also contain JSP tags rather than directives. Conversely, if the time-qualified rule contains directives, the base rule must contain directives. B-20380REMOVED (per S.Stewart 5/2/08): You can't check out a circumstance-qualified rule at a time when the base rule is already checked out by you or by anyone. Similarly, you can't check out a rule that is a base rule when you or another developer has a related circumstance-qualified rule checked out. B-25517 BUG1755 B-20574

NoteIf two rules with the same Applies To key part and family name are both unqualified and each has one or more associated property circumstance-qualified rules, the same circumstance property must be used. For example, if activity MyClass.Alpha has an associated circumstance-qualified rule using property .State, then another activity MyClass.Alpha cannot have a circumstance rule with any property other than .State. B-19418 rejected and ERNSG 7/21/06

NoteDatabase software supporting your Process Commander system limits the number of columns that can occur in any database table. When creating a Circumstance Definition rule, you may not exceed this limit. See Pega Developer Network article PDNPRKB-25322 Troubleshooting: "Exceeds the maximum number of columns" when creating a Circumstance Definition rule.

Note In releases before V5.2, circumstance-qualified rules with a RuleSet version number lower than the RuleSet version of a base rule were ignored (never selected) during rule resolution. Starting with version V5.2, this is not the default rule resolution behavior: you can copy a base rule to a higher version without the need to also copy each of the (possibly many) qualified rules associated with the base rule into that higher version. If desired, you can revert in specific cases to pre-5.2 behavior by selecting the Base Rule checkbox on the form produced by the Availability toolbar button (Availability). C- 2555

NoteUse the Data-Circumstance-Duplicates.CircumstanceMultiples.ALL report to identify single circumstance-qualified rules that incorrectly use two or more different properties. Such conflicts can arise when rules are imported into a RuleSet that already contains some circumstanced rules. B-20800 GENTJ 5/30/06 To access this report, select Pega button> Application > Inventory > Inventory Reports. Enter Rule as the Category and circumstance as the search text.

Definitions base rule, declarative rule, family name, final rule, property reference, qualified rule, redirected rule, rule resolution, stream rule, time-qualified rules, withdrawn rule
Related topics How to complete rule form keys with Save As
How the system finds rules through rule resolution
How to change rule availability
About Circumstance Definition rules
About Circumstance Template rules

Up Concepts