Skip to main content

Remaining rule candidates and ranking

In this step, the rule resolution algorithm uses a three-step sub-process to rank the remaining candidate rules. First, the list of rule candidates is sorted. Then, all rule candidates impacted by a rule marked as Withdrawn are removed from the list. Finally, a default rule candidate is defined.

Sorting

The rule resolution algorithm sorts the remaining rule candidates according to this specific order: Class, Ruleset, Circumstance, Circumstance Date, Date/Time Range, then Version.

The first two criteria — Class and Ruleset — provide the basics of rule resolution. The closer a rule candidate is to the applies to class of the referenced rule, the higher the rule candidate is ranked. Within each class, the rule candidates are sorted according to the operators' ruleset list.

Caution: Rules which do not have the Use class-based inheritance to arrive at the correct rule to execute check box selected in their class definition are not ranked by class.

The next three criteria — Circumstance (Property or Template), Circumstance Date, and Date/Time Range — are used as qualifiers to the basics of rule resolution, and are used to further refine, or specialize, rule candidates.

The last criteria — Version — ranks the remaining candidate rules by the ruleset version that contains them. This ensures that circumstanced rules are not automatically overridden if the base rule is updated in a more recent ruleset version.

In the example, the list of rule candidates is ranked according to class and ruleset order, including any circumstanced rules, so no rules are removed from the list of rule candidates.

rule resolution sort rule candidates

Removal of rule candidates with an Availability set to Withdrawn

After the rule candidates are ranked, the rule resolution algorithm removes any rule candidates affected by a rule where the Availability is set to Withdrawn.

Unlike a rule with the Availability set to Not Available, a rule with the Availability set to Withdrawn also affects rules in lower ruleset versions. If the Availability of a rule is set to Withdrawn, all other rule candidates in a lower ruleset version that match the applies to class, the rule purpose, and any qualifiers of the withdrawn rule are removed from the list as well.

In the example provided, the Availability of the CreateRequest section in the Purchasing: 02-01-10 ruleset is set to Withdrawn. Two other rule candidates that match the applies to class and purpose of the withdrawn rule belong to lower versions of the Purchasing ruleset, and are removed from the list also. Instances of CreateRequest in other classes and rulesets are retained for further consideration.

In the center of the following image, slide the vertical line to view the three rules highlighted on the left and the same three rules removed from the list on the right.

Note: In the preceding example, if an instance of the CreateRequest section is saved to a higher version of the Purchasing ruleset and the Availability if the instance is set to Available, that instance is retained for further consideration.

Default rule candidate determination

The last sub-step in the ranking phase of the rule resolution algorithm determines the default rule candidate.

A default rule candidate is the first rule candidate (highest ranked) that has no qualifiers. This default rule candidate is the last possible rule to be executed as it always matches any additional requests for this rule.

Additional rule candidates ranked below the default rule candidate are discarded.

In the example, the default rule candidate is TGB-Purchasing-Work-CreateRequest in the Purchasing:02-01-05 ruleset. The two rules below the default rule candidate are removed from the list of rule candidates.

In the center of the following image, slide the vertical line to view the two rules highlighted on the left and the same two rules removed from the list on the right.

Remaining rule candidates and the rules cache

The rule resolution algorithm adds the remaining rule candidates to the rules cache.

rule resolution set rules cache

Check your knowledge with the following interaction.

If you are having problems with your training, please review the Pega Academy Support FAQs.

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best.

Pega Academy has detected you are using a browser which may prevent you from experiencing the site as intended. To improve your experience, please update your browser.

Close Deprecation Notice