![MyCo 01-01-01 ruleset requires MyCoInt:01-01-01 and Customer:01-01-03](https://demo5-academy.pega.com/sites/default/files/styles/1024/public/media/images/2022-03/ruleset-validation-application.png?itok=j7REOSeZ)
Ruleset validation
Ruleset validation is performed every time a rule is saved. It guarantees that referenced rules are available on the target system when the ruleset is promoted. Ruleset validation does not affect rule resolution at run time but is applied only at design time.
The selected validation mode applies to all versions of the ruleset. There are two options for the validation mode:
- Application Validation
- Ruleset Validation
The New Application wizard creates rulesets that are set to both Application Validation (AV) and Ruleset Validation (RV) modes. The rulesets that contain the application rules are set to AV mode to reduce the difference between design and run time.
Conversely, the organizational rulesets created by the New Application wizard are set to RV mode. RV ensures strict validation for prerequisite rulesets when migrated.
Application validation mode
If the AV mode is used, rules in the ruleset can reference all rules in the rulesets defined in the:
- Same application
- Rulesets belonging to any built-on application
Rules in the ruleset cannot reference rules outside the current application stack or above the defining application. In the following example, all rulesets are AV mode. The shaded and unshaded boxes represent applications. The loan application is built on a loan framework.
In the following image, click the + icons to learn more about how AV mode is applied to each ruleset.
AV allows for codependent rulesets within the same application. That is, rules in LoanPricing can reference rules in LoanUnderwriting, and rules in LoanUnderwriting can reference rules in LoanPricing. Each ruleset in the application has a version. When AV mode is used, the application defines the ruleset versions accessible for a given ruleset.
For example, ruleset LoanPricing:01-01-03 can access ruleset version 01-01-01 to 01-01-03 of the ruleset LoanUnderwriting, and 01-01-01 to 01-02-10 of the LoanPricingFW and LoanUnderwritingFW rulesets.
When AV mode is selected, if you change the application definition, the rules may become invalid. Invalid rules might cause serious errors at run time. Use the Validation tool in Dev Studio (Configure > Application >Tools > Validation) to quickly identify invalid rules in the application.
Ruleset validation mode
When you use RV mode, each ruleset version defines one or more ruleset versions on which the ruleset version depends. For example, if you create a ruleset MyCo:01-01-01 that uses rules in MyCoInt:01-01-01 and Customer:01-01-01, then MyCoInt:01-01-01 and Customer:01-01-01 ruleset versions must be specified as a prerequisite. Only rules in the ruleset versions that are specified as prerequisites (and their prerequisites) can be referenced from the ruleset.
For example, if MyCo:01-01-01 specifies Customer:01-01-03 as a prerequisite, rules in version 01-01-01 to 01-01-03 of the Customer ruleset can be referenced.
Ruleset prerequisites
If your ruleset version does not have any prerequisite ruleset versions, you need to specify the base product ruleset Pega-ProcessCommander as a prerequisite.
The Pega-ProcessCommander ruleset lists all product rulesets. You do not need to list any product rulesets below Pega-ProcessCommander. There is a 99 patch version of the Pega-ProcessCommander ruleset available in the product by default. Use that ruleset version as a prerequisite to avoid having to update the ruleset after product updates.
For example, if the product is updated from 07-10-13 to 07-10-18, you do not need to update the rule prerequisites since the 99 version automatically picks the highest patch for the ruleset version.
Note: Ruleset prerequisites cannot be cyclic. For example, if Alpha:01-01-01 defines Beta:01-01-01 as a prerequisite, then Beta:01-01-01 cannot define Alpha:01-01-01 as a prerequisite.
Check your knowledge with the following interaction:
Mixing application ruleset validation modes
You can mix rulesets that use AV and RV modes.
- Rulesets with another ruleset in brackets next to them use RV. For example, for MyCoPL [MyCo], the MyCo ruleset in brackets is the prerequisite ruleset.
- Rulesets without a ruleset with brackets next to them use AV.
With RV, you cannot call AV rulesets that are not in the prerequisites.
In the following image, click the + icons to learn more about AV and RV mode mixed rulesets.
Ruleset validation best practices
Follow these best practices when configuring rulesets.
- Only use RV for rulesets that are designed to be used across multiple applications, such as organizational rulesets, to make them easily portable and prevent the introduction of dependencies on a specific application.
- Create applications for common rulesets; use the built-on functionality to include common rulesets in the application.
- Include unlocked AV rulesets in one application only. Doing so prevents AV rulesets from referring to rules that may not exist in applications that do not contain the ruleset.
- Run the Validation tool after implementation of critical changes or milestones (for example, changes to the application ruleset list or built-on application as well as changes made before lock/export).
Note: To learn more about the Validation tool, see Validation tool.
Check your knowledge with the following interaction:
This Topic is available in the following Modules:
If you are having problems with your training, please review the Pega Academy Support FAQs.
Want to help us improve this content?