What is the ruleset stack in Pega?
Ruleset list or stack is assembled by Pega when the user logs into the application and ruleset stack are used during the rule resolution process. Rule resolution will be looking into the ruleset stack in a specific order so the order is important. Top Ruleset takes the highest precedence.
How Pega will assemble the Ruleset stack?
- OneHelp,OneHelpInt - application ruleset for application configuration.
- PH, PHInt - organizational ruleset contains reusable organizational assets, such as data structures.
Let's take the above application OneHelp is built on the OHFW framework application which is built on UIKit and UIKit is built on the PegaRULES application. Once the user logs into the OneHelp application we will see how Pega assemble the Ruleset stack for the operator. First, PegaRULES ruleset stack is added and on top of PegaRULES list UIKit ruleset stack, on top of UIKit OHFW ruleset stack and on top of OHFW list OneHelp application ruleset list, finally it will add if any personal ruleset (if we are allowed for the rule check out) with the name of the Operator.
Below is the ruleset stack for the operator ohadmin when the operator logs into the application OneHelp.
Application Ruleset stack in Pega
We can view the Ruleset stack for the current application at Configure->Application->Structure->Ruleset stack
Summary: how the stack is built
- Pega starts with the lowest layer, the PegaRULES application and its rulesets.
- Each application built on top adds its own rulesets above the ones below it.
- The current application's rulesets come next, then any personal ruleset the operator is allowed to use, which sits at the very top.
How rule resolution uses it
When Pega needs a rule, it searches the stack from the top down, and within a ruleset from the highest version to the lowest. The first match wins. That is why the same rule name in a higher ruleset overrides one in a lower ruleset, and why a rule saved in the wrong ruleset can seem to change nothing.
A worked example
In the OneHelp example above, the stack from bottom to top is PegaRULES, UIKit, OHFW, then OneHelp. Suppose the section pyCaseHeader exists in UIKit and also in OneHelp. A user of OneHelp gets the OneHelp version, because it is higher in the stack. If a developer saves a change to the section into the OHFW ruleset instead, users will still see the OneHelp copy, and the change will look ignored.
Tips
- Save rules in the ruleset where they belong: shared things in the framework or organisation layer, application-specific things in the implementation ruleset.
- Use the Rule Inspector or the Rule resolution view to see which version of a rule is being used.
- Keep the stack short and tidy. Fewer rulesets mean faster rule resolution and easier debugging.
- Lock ruleset versions that are released, and put new work into a new version.
Interview tip
Explain that the stack is assembled at login and searched top-down by rule resolution. Then use the override example to show what happens when the same rule exists in two layers. Related: Enterprise Class Structure and the Pega Basics label.





If my rule in
ReplyDeleteonehelp:01-01-01
PH:01-01-02
which rule it will rule in priority wise
First it will pick from OneHelp if the rule is not available in that then it will go to PH
DeletePlease go through Rule resolution process for more details..
Deletehttps://www.pegahelp.com/2020/07/rule-resolution-process-in-pega.html
Nice article on Ruleset stack.
ReplyDeleteHere have a query in Application ruleset stack, after OneHelp and OneHelpInt directly Ph and PhInt are coming that are organization lever ruleset. Why does pega add organization level ruleset in application ruleset stack? Please explain.
Organization ruleset is intended to store the company wide data structures or integrations. Lets assume Amazon is a company and customerID is a property which can be used across organization. So we can create these properties in organization ruleset which can be accessed by other applications as well.
ReplyDeleteOrganization ruleset is intended to store the company wide data structures or integrations. Lets assume Amazon is a company and customerID is a property which can be used across organization. So we can create these properties in organization ruleset which can be accessed by other applications as well.
ReplyDelete