Declarative Expression rules - Best practices
This presentation is part of the Declarative Expressions Self-Study Course.
Transcript
There are two best practices to consider when using declarative expressions:
- First, Pega recommends never setting the target properties of declarative expressions through any manual process. They should always be calculated using the declarative expression. If you are declaring the calculation method for a property, there should be no valid reason to calculate it procedurally in a different way. If you need to vary the calculation, build conditions and alternatives into your declarative rules.
- Select Whenever used when the expression involves values from properties on multiple pages.
Full rule resolution does not apply to declarative rules prior to PRPC version 5.4. If you want to calculate differently in different circumstances, you have to design accordingly. A few options to consider include:
- Using class inheritance and overriding – specialize your expressions just as you would any other rules.
- Version your rules – Use RuleSet versions to specialize in a similar fashion.
- Use the Conditions options in the rule itself to add ‘circumstances’.