Question

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

Field name in condition definition—

Property @baseclass.Employees is undefined.
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?

**Moderation Team has archived post**

This post has been archived for educational purposes. Contents and links will no longer be updated. If you have the same/similar question, please write a new post.

Correct Answer
December 28, 2017 - 8:36pm

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)

[.Employees] contains a page where [".Gender"] equals ["true"]

But please do fix the scope of the autocomplete control someday. I am too lazy to formally file a Support Request for that. 

Comments

Keep up to date on this post and subscribe to comments

November 30, 2017 - 6:28am

Use IsInPagelist function - @Utilities.IsInPageList(lookFor,lookAt,lookIn) 

Example:

@Utilities.IsInPageList("Female","Gender",.Employees )

December 28, 2017 - 8:37pm

Do you have any solution to check a property value of a page in a page list? I just tried declared expression. Surprisingly it is not working as well. What a Information system is if it cannot even take care of linear data structure....

Mod
December 1, 2017 - 3:26am
Response to ParisQ07

Hello ParisQ07,

Do let us know if you wish to file a product enhancement request. We, moderators, could file one for you on our internal portal. However, you would need to follow it up by discussing with your Pega Account Executive.

Regards,

Lochana | Community Moderator | Pegasystems Inc.

December 1, 2017 - 3:35am
Response to Lochan_DV

It's not an enhancement. From my perspective, it is a bug. At least there should be some instruction somewhere.

Mod
December 1, 2017 - 4:00am
Response to ParisQ07

Thanks for your reply.  If you believe this is a product defect, you could create an SR with Pega Support. They would then validate and create a BUG item on your behalf.

Regards,

Lochana | Community Moderator | Pegasystems Inc.

December 28, 2017 - 4:48am
Response to Lochan_DV

Hi Lochan,

Merry Christmas.

What is SR? Isn't this forum Pega Support? We are unable to use this when rule option, that is a project defect, how can we follow up this issue.

 

I thought in version 7.3.1 you have fixed this bug. Then it turns out that it is still there.

Mod
December 28, 2017 - 6:00am
Response to ParisQ07

Thanks @ParisQ07

Merry Christmas to you too :)

Yes, this is a forum for all your Pega product questions. Sometimes, there arises a need to create SR (Service Request) - when there is a detailed level of investigation that requires our engineers to look into your system and troubleshoot or if it is a product defect. In this case, I'd advise an SR so that you could get more of detailed and researched response and if required the engineers will create a product defect on your behalf.

An SR can be created on the My Support Portal. If you need further assistance in creating SR, please contact your Pega Account Executive.

Lochana | Community Moderator | Pegasystems Inc.

December 28, 2017 - 8:24pm
Response to Lochan_DV

I probably will not file a SR formally for now. I don't want to bother my account manager.

Thanks for your help though :)

Mod
December 28, 2017 - 9:16pm
Response to ParisQ07

You're welcome :)

Lochana | Community Moderator | Pegasystems Inc.

December 28, 2017 - 8:36pm

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)

[.Employees] contains a page where [".Gender"] equals ["true"]

But please do fix the scope of the autocomplete control someday. I am too lazy to formally file a Support Request for that.