Rule Resolution in Pega
What is Rule Resolution?
Rule resolution is a search algorithm used by the Pega system to find the most appropriate
instance of a rule to execute in a given situation. Rule resolution occurs whenever a rule is
required for case processing.
Rule resolution applies to most rules that are instances of classes derived from the abstract Rule-
@baseClass. However, it does not apply to records that belong to other abstract base classes
such as Data-, System-, or Work-.
Examples of Rules That Follow Rule Resolution:
• Rule-Obj-Activity – Defines automation tasks.
• Rule-Obj-When – Used to evaluate conditions.
• Rule-Declare-DecisionTable – Implements decision logic.
• Rule-Obj-Flow – Defines process flows.
• Rule-HTML-Section – Manages UI components.
• Rule-Obj-DataTransform – Handles data transformation.
Examples of Rules That Do Not Follow Rule Resolution:
• Rule-Obj-Class – Defines class structures.
• Rule-Access-Privilege – Manages security privileges.
• Rule-Access-Role – Defines access roles.
• Data-Admin-Operator-AccessGroup – Configures operator access groups.
Before diving deeper into rule resolution, it is important to understand rule availability. Rule
availability determines whether a rule is eligible to execute or not. This is configured in the rule
form.
Let’s compare rule availability to a group of five friends planning a trip to Goa:
• Friend 1: "I am always available to attend." (Available)
• Friend 2: "I am not interested in coming." (Not Available)
• Friend 3: "I am ready, but my girlfriend’s birthday is blocking that day." (Blocked)
• Friend 4: "I am coming, and no one can change my decision." (Final)
• Friend 5: "I am not coming, and I will not allow my friends to come either."
(Withdrawn)
This analogy helps in understanding how rule availability works in Pega.
Linked In: Bobby Sanaboyina
Types of Rule Availability in Pega
There are five types of rule availability:
1. Available – The rule is active and can be executed.
2. Not Available – The rule cannot be executed.
3. Blocked – The rule exists but cannot be used.
4. Final – The rule can be executed but cannot be overridden.
5. Withdrawn – The rule is removed, and all lower version instances are also ignored.
Lets deep dive into rule resolution
How Rule Resolution Works in Pega?
Whenever a rule is invoked, Pega follows a step-by-step process to determine the correct rule:
1. Identify the Context
o Pega first identifies the relevant context, including the current class, type of
request, and applicable parameters.
2. Search for the Rule in the Class Hierarchy
o Pega starts searching for the rule in the class where the request originated.
o If the rule is not found, Pega moves up the class hierarchy, checking each parent
class until it reaches the top.
3. Filter Based on Rule Availability
o Only active rules (available, final) are considered.
o Blocked or withdrawn rules are ignored.
4. Select the Most Specific Rule
o More specific rules are given priority over general ones to ensure the most
relevant behavior is executed.
5. Choose the Most Recent Version
o If multiple rules meet the criteria, Pega selects the most recent active version.
6. Execute the Selected Rule
o Once the best match is found, Pega executes the rule.
7. Handle Errors if No Rule is Found
o If no applicable rule is found, Pega may throw an error such as:
▪ "Rule not found exception"
▪ "Invalid parameter exception"
Linked In: Bobby Sanaboyina
Conclusion
Rule resolution is a fundamental mechanism in Pega that ensures the most appropriate rule is
selected and executed. Understanding rule availability and how Pega navigates the class hierarchy
helps developers troubleshoot and optimize rule execution effectively.
By applying rule resolution principles, Pega ensures that the right rules are executed in the right
context, enhancing the efficiency and reliability of case processing.
I hope this guide clarifies rule resolution for you!
Linked In: Bobby Sanaboyina