This presentation is part of the Declarative Pages Self-Study Course.
The Definition tab on the declare pages rule form allows you to define the class and scope of the declarative page or pages created by this rule, and how they are refreshed.
Page Scope defines the scope of the declarative page. There are two options to choose from: Thread and Node.
Thread scope pages are individually loaded and maintained in each thread that references that page name. If a requestor has multiple threads, each thread will have its own instance of the page. The rules used to define and load the page are subject to rule resolution based on the loading requestor’s RuleSet list.
Note: Thread pages persist in the system until the requestor session that created them ends.
Node scope pages are loaded into a common area in the PegaRULES application server or node, and can be shared across all requestors. The rules used to define and load the page are subject to rule resolution based on the RuleSet list defined by the Access Group referenced in the Declare-Pages rule, not by the RuleSet list of individual requestors. The associated access group is defined on this tab.
Note: In a multi-node system, each node has its own copy of the clipboard pages created by this declare pages rule. For each node, the first user to reference the declare pages rule causes the load activity to run on that node to create the page on the clipboard.
Thus, for a multi-node system, depending upon when the first user runs the load activity on each node, and what refresh rate is specified for that declare pages rule, the pages created on each node may not be exactly identical to each other at every second.
Page Class defines the class of the declared clipboard page and the Applies To class of the named Activity rule that will be used to populate the page.
Load Activity is executed when the page needs to be created or reloaded. The load activity rule is relatively straight forward. This activity:
- Creates the Declare_Page and then set properties on it
- Must be labeled with an activity type of LoadDeclarativePage activity in the Security tab
Parameters may be made available through the Definition tab. As a best practice, name your activities beginning “Load ……”
Page Structure allows pages to be single or a PageList.
In addition to defining how your Declare Pages are created with a Load Activity, you can define how they are refreshed using Conditional Refresh Strategy.
The first Refresh Strategy is common to all types of Declare Page types, that is both thread and node scoped pages. Quite simply, define a period of time in Days, Hour, Minutes, and Seconds in the appropriate fields. When the page is referenced, this value is used to check that the page is “stale”. If the page is older than the specified time, the Load Activity is executed to recreate it; otherwise, it’s classed as “fresh.”
For Thread Scope pages, there is an additional, optional feature allowing you to add a When rule. The When rule answers the question “Is the Declare Page fresh?” When your declared page is referenced by a rule, if the When rule evaluates as True, the Load Activity will not be executed because the page is deemed fresh. If the When rule evaluates as False, the page is deemed ‘stale’ and the load activity will be executed.