Question
DCS
GB
Last activity: 2 Jun 2022 11:09 EDT
Refer When rule from SR property and execute when rule dynamically to SR class context from Strategy Expression
Hi,
We would like to evaluate the when rule dynamically coming from SR Property in a Strategy Framework. We have tried to use the following OOTB functions but there is No luck. Looking for some suggestions.
When we try to use Pega OOTB evaluateWhen function, when rule name should be hard coded. It's not allowed to reference the SR property (which holds when rule name) dynamically.
- @evaluateWhen("myWhenRule","XXXXX-SR",tools) - working
- @evaluateWhen(.EligibilityRule,"XXXXX-SR",tools) - Not working
When we try to use the Pega OOTB callWhen function always looks for when rule from Strategy Applies to Class (Primary) or baseclass instead of page being passed.
- @callWhen(tools, MyWhen, myStepPage) - Error
Caused by: com.pega.pegarules.pub.generator.RuleNotFoundException: Failed to find a 'RULE-OBJ-WHEN' with the name 'TESTWHENSR' that applies to '@baseclass'. There were 1 rules with this name in the rulebase, but none matched this request. The 1 rules named 'TESTWHENSR' defined in the rulebase are: 1 related to applies-to class '@baseclass', but were defined on subclasses: XXXXX-SR
Thanks,
Nanjundan Chinnasamy
Lead Decision Architect | Decision Consultant Solutions