Use PublicAPI GetParentPage() to access a higher-level clipboard page
Summary
A developer asks: I have a flow rule that iterates through the pages of a Page List
property of an embedded Data- class. In that flow, we need a when rule that evaluates a property on the containing object. The primary page of the flow is the Data- page.
The only way I've found to evaluate properties of the containing object is to use the CallWhen() utility function, and the only way to get a reference to the containing page is to use param.ReferencePageName.
- Is that the only way to write a when rule in a Data class that's embedded in a Work- class?
- Is param.ReferencePageName something that's valid to use in general, or does it happen to work in this particular case?
On a broader level, if I have a contained object and wish to evaluate properties of the container, what ways are there to do that?
Suggested Approach
In the when rule in the embedded page, you can call the PublicAPI Java function getParentPage(). That is, pass in step page, then use getParentPage() on the step page, as an alternative to param.ReferencePageName.
The keywords parent
. and top
do not work, as they are not valid keywords in when rules.
You could create a function rule such as CheckPropertyOnParent() that takes a property name and value and returns true or false.
Or you could write a more general-purpose function rule that gets the value of the property on the parent, and then you do the comparison downstream.