Skip to main content

Data Pages

Case processing often requires access to data sourced from other applications or systems. Ensuring the accuracy of sourced data reduces the chance of errors — and undesirable outcomes — for Cases significantly. In Pega Platform™ applications, a Data Page retrieves data from a specified data source and caches that data in memory. A Data Page manages the integration to the data source, separating business processes from any integration details. This separation allows application developers to use sourced data in an application without knowing the data source and connection details.

The following figure shows the working of a Data Page:

Sample data sources and a data page that retrieves data in memory from the sources

 

On-demand data access

Unlike most pages that are used in Pega Platform, applications attempt to populate the contents of a Data Page only when the page is accessed, rather than through an explicit Action. Due to the on-demand nature of Data Page content, Data Pages are considered a type of declarative Rule. Pega Platform automatically prepends the characters D_ to the name of a Data Page to differentiate the page from other pages in memory.

Note: Data Pages created in versions of Pega Platform before 7.1 begin with Declare_ instead of D_.

In the following image, click the + icons to explore how Pega Platform populates the contents of a Data Page:

Check your knowledge with the following interaction:

Data Page definition

In Dev Studio, you can create Data Pages. When creating a Data Page, a developer must provide four key pieces of information:

  1. The structure of the page contents.
  2. The Object Type represented by the contents of the Data Page.
  3. The edit mode supported by the page.
  4. The scope of the Data Page.

Structure

The structure of the page determines whether the Data Page can contain one item or many items. Set the structure of a Data Page by selecting an option from the Structure drop-down list.

When using a list structure, the Data Page embeds the list items in an ordered array named pxResults. To access a specific record within the list, use the syntax DataPageName.pxResults(n), where n is the index of the ordered array that corresponds to the record.

Consider a Data Page that contains pricing information for a single stock. The structure is set to Page. However, if a Data Page contains pricing information for all the stocks in an investment portfolio, you set the structure to List

In the center of the following image, slide the vertical line to compare the page and list structures:

Object Type

The Object Type of the page identifies the information contained by the Data Page. To set the Object Type for a Data Page, enter the class of the object in the Object Type field. The Object Type allows the Data Page to reference any property defined for the class. For example, a Data Page that lists dental insurance plans provided by an insurer contains the plan name, cost, and deductible and a Data Page that lists recent orders placed by a customer contains the order number, order date, total cost, and shipping address as shown in the following figure:

a data page that lists dental insurance plans provided by an insurer contains the plan name, cost, and deductible. A data page that lists recent orders placed by a customer contains the order number, order date, total cost, and shipping address.

Edit mode

The edit mode of a Data Page indicates how or if an application can manipulate the information on a Data Page. Set the Data Page mode by selecting an option from the Mode drop-down list.

Set the edit mode to Read-Only to prevent an application from updating the Data Page except when loading and updating the contents from the data source. Read-only mode prevents you from editing information sourced from a system of record and ensures that the Data Page content always matches the content loaded from the system of record. For example, when accessing the accident history of an auto insurance customer from the Department of Motor Vehicles (DMV) database, state or national laws may prohibit editing the sourced data. To comply with this legal requirement, set the page mode to Read-Only.

Note: If a Data Page mode is Read-Only, the Clipboard tool lists the Data Page in the Data Pages category.

Set the edit mode to Editable to allow an application to edit the Data Page contents. For example, a retailer allows customers to save one or more preferred shipping addresses when placing an order. The list of addresses is loaded from the customer database using a Data Page. To allow a customer to update an address during an order, you set the page mode to Editable.

Note: If the Data Page mode is Editable, the Clipboard tool lists the Data Page in the User Pages category.

Set the edit mode to Savable to configure a save plan that allows the application to push the page contents back to the data source. For example, after a customer updates a shipping address, the application copies the updated address to a savable Data Page configured to update the customer database. When the customer completes the order, the application follows the save plan to connect to the customer database.

Scope

The scope of a Data Page determines the Visibility of the page contents within the application. To set the page scope, select one of the supported options in the Scope drop-down: Thread, Requestor, or Node.

In the following image, click the + icons to learn more about the scope options and examine how you can leverage scope settings to manage cached data within Pega Platform applications:

 

Check your knowledge with the following interaction:


This Topic is available in the following Module:

If you are having problems with your training, please review the Pega Academy Support FAQs.

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best.

Pega Academy has detected you are using a browser which may prevent you from experiencing the site as intended. To improve your experience, please update your browser.

Close Deprecation Notice