Unable to use the when-rule: [Pagelist] contains a page where [Property] equals [Value]
I have a page list like .employees: name, gender, age, etc
I want to check is there any female employee,
so I would create a when rule which checks:
[.Employees] contains a page where [.gender] equals ['false']
After that, the error appears:
1. Pega don't allow me to choose [.gender], it only pop up property at current class, which .Employees should represent a list of a sub-class.
2. When I try to save it like [.Employees.gender] or [.Employees(<CURRENT>).gender] or [.Employees().gender], none of them work.
It shows
I have a page list like .employees: name, gender, age, etc
I want to check is there any female employee,
so I would create a when rule which checks:
[.Employees] contains a page where [.gender] equals ['false']
After that, the error appears:
1. Pega don't allow me to choose [.gender], it only pop up property at current class, which .Employees should represent a list of a sub-class.
2. When I try to save it like [.Employees.gender] or [.Employees(<CURRENT>).gender] or [.Employees().gender], none of them work.
It shows
Invalid expression or reference: No candidates found [possible function name, ruleset/version or number of parameter problem]
Invalid expression or reference: Operation "==" is not permitted on types: truefalse and unknown
If it is mean to fail, why not just remove it from the when rule, and explicitly suggest us to use Activity or data transform instead.(BTW, how to use activity or data transform to achieve this goal)
If I can write my own pure function it would be super easy. Just that pega don't allow us code by ourselves, so we have to look for a "reinvented wheel"(aka. OOTB function).
Any suggestion?
Finally we manage to do it via expression in when rule. @IsInPageList("true", ".Gender", .Employees)
Or if you want to make use of this When Rule Option, don't rely on their AutoComplete controls. Use text for both [PageList name] filed and [Value] field, just like how they are taken by the "IsInPageList" method. (Note that there is a dot in the page list name, and the value should also be quoted)
But please do fix the scope of the autocomplete control someday. I am too lazy to formally file a Support Request for that.