How to use "contains a page where [when record] evaluates to true" in a when rule

Hello, may I know How to use “contains a page where [when record] evaluates to true” in a when rule?

The requirement is: I want to check in a page list whether any page has a index (a property of the page) is > 0

so, in top level when rule A, I use “contains a page where [when record] evaluates to true” , I do as below for 2nd level [when record] B:

In B, I add a parameter of type page name: DocPage, and define DocPage in “Pages & Classes” as the data class of the pagelist.

Then I use "DocPage.index >0 " in B

However, it does not work, an error is reported in run time. It’s saying about class mismatch issue.

Wonder whether the A pass a page type parameter to B (as I guess)? If not, could you kindly share a sample? thanks.

Hi @MaxonL16591286: I read the scenario as below. Please correct me if this is wrong.

You gave a page list and you need to check if any of the page in the page list has a value (index property) > 0. So you need to use a when rule to check if the value is > 0.

If this is the case, can you please check the function IsInPageListWhen. This will traverse through each page in the page list and evaluate the when rule.

Thanks.

@ArulDevan

Yes, IsInPageListWhen meet my requirement, however wonder how could I define the when rule used by it?

No such comment found in the function definition.

  1. Define the when rule under case type class, receive a page as parameter, then function will pass each page in page list as parameter.

  2. Define the when rule under data class (of the page list), no parameter needed

I tried both but all get error, thanks,

@MaxonL16591286

Please follow below steps.

Have your when condition like this @IsInPageListWhen (“IsProcessorStatus_Exc”,TempPage.pxResults) .

IsProcessorStatus_Exc = when rule should be in your page list class definition class.

Inside when rule you can have your business logic condition.

What all the parameter you are initializing before when rule step, you could directly use that parameter inside when rule also.

@Gunasekaran_Baskaran

yes, it works now! Many thanks!