Declare Expression form - Using the Locate page feature
This presentation is part of the Declarative Expressions Self-Study Course.
Transcript
In addition to the standard behavior, you can also set up locate pages on the Pages & Classes tab using the Page Name and Page Class fields.
Locate pages is a feature that supports backward chaining and can be used to retrieve data and load it into the clipboard, temporarily on demand. In other words, if the data is not already in the clipboard, and this rule needs it to perform a calculation, the system will execute an activity to retrieve the necessary data.
To use locate pages, type the name of the locatable page in the Page Name field. Note: You must use a keyword ‘locate’ all in lowercase as the first part of the page name. The rest of the name is up to you.
In the Page Class field, enter the class of the locate page.
In the Locate Page Expression field, enter a Boolean expression. This logic is used to decide whether or not to execute the activity that creates the locate page. Typically, you would use an expression that checks for the existence of the locate page in the clipboard. If it doesn’t exist, the expression returns false and the locate activity gets run to create the page. If the page already exists, then the expression returns true and there is no need to run the activity.
Note: The Locate Page Expression field does not reference a When rule. You must write an expression, and typically people tend to use functions a lot in this field. If you need to use a When rule, then use the callWhen function.
In the Locate Page Activity field, enter the name of an activity that will generate the locate page by whatever means. Typically, these activities might execute interface calls to retrieve external data, etc. The activity you reference here must be labelled as a Locate activity in its Security tab.