In Pega, data is accessed through two types of memory: permanent and temporary.
Permanent Memory
Permanent memory stores data in a database such as Oracle, SQL, or PostgreSQL. This data can be retrieved whenever required.
Temporary Memory
Temporary memory holds data only for a specific time period. In Pega, rules can be accessed from temporary memory through the Rule Cache, and data can be accessed from the Clipboard.
The Role of Clipboard in Pega
Pega uses the Clipboard Page as temporary memory. Without temporary memory, each data request triggers an expensive database call. With temporary memory, the initial DB call retrieves the data, which is then stored in the Clipboard for subsequent access.
Data Pages in Pega Platform
A data page in Pega retrieves data from a specified source and caches it in memory. Unlike other pages in Pega, a data page's contents are populated on-demand when accessed, making it a type of declarative rule. Pega automatically prefixes data page names with "D_" to differentiate them from other pages in memory.
Creating Data Pages in Pega Dev Studio
When creating a data page, developers must provide four key pieces of information:
Structure of the Page ContentsThe structure determines whether the data page contains a single item or multiple items. A list structure embeds items in an ordered array named `pxResults`. To access a specific record, use the syntax `D_PageName.pxResults(n)`, where `n` is the index.
Object TypeThe object type identifies the data contained in the data page. Set the object type by entering the class of the object in the Object type field. This allows the data page to reference any property defined for the class.
Edit ModeThe edit mode specifies how an application can manipulate the data page contents. Options include:
Read-Only: Prevents updates to the data page except from the data source. Read-only data pages are found under the Data pages category in the clipboard.
Editable: Allows updates to the data page contents. Editable data pages are found under the User pages category.- Savable: Enables persisting information directly into the database. Savable data pages are also found under the User pages category.
Scope of the Data PageThe scope determines the visibility of the page contents within the application. Options include:
Node: Shared across all requestors and threads within the same node. Only supports Read-Only mode.
Requestor: Shared among threads within the same requestor. Supports Read-Only, Editable, and Savable modes.
Thread: Specific to a single thread. Supports Read-Only, Editable, and Savable modes.
Data Sources for Data Pages
Configure a data source for a data page by specifying the type and name of the source. Options include:
Data transform
Activity
Connector
Report definition
Database lookup
Robotic automation
Robotic desktop automation
Load Management
This tab is crucial for ensuring data is up-to-date and only applicable when the data page mode is read-only. Options include:
Page Management: Manually remove/flush the data page from the clipboard.
Load Authorization: Applicable if the scope is Node. Defines the access group for the data page outside the requestor context.
Refresh Strategy: Mechanism to keep data up-to-date. Options include reloading the data page based on time duration or using a when rule to control the refresh strategy.
Parameters
Data pages can be parameterized, allowing customization of the data on the page. Parameters can limit the system to maintaining only the latest instance of the data page in the clipboard.
Understanding these aspects of data pages in Pega is essential for effective application development and ensuring optimal performance.
-Team Enigma Metaverse
Comments