When you can a when rule from a function like "IsInPageListWhen", the when rule is executed with each of the embedded page as the context page of the when rule. In such cases, if the parameter to be passed to the when rule changes depending on the context page, then it is better to hold those values in the same page rather than having the values as parameters.
If the param values remain constant for every time the when rule is called, then the param can be set before the when rule.
If the the data needs to be supplied only via params to the when rule, then as @ashokk09 pointed out, call a data transform for each page from within a when rule before calling the function.
Please give me the problem statement/ actual scenario to address it even further.