Configuring lists with local and external data

From PegaWiki
This is the approved revision of this page, as well as being the most recent.
Jump to navigation Jump to search



Description Configuring lists with local and external data
Version as of 8.5
Application Platform
Capability/Industry Area Data Integration



Description[edit]

A list is an abstract data type that stores a countable set of data objects. Data objects can be appended or prepended to the list, including duplicates, and accessed via a given index or iteration. Lists are typically implemented with variable length (shrink or grow).

In Pega Platform, a list is defined as a return structure (data type) in the data page rule definition:

  • Rule: data page
  • Structure: list
  • Description: Defines return as a set of data objects.
A list structure returned by a data page - example

Returned list items can be stored in a property rule:

  • Rule: property
  • Types: page list and value list
  • Description: Defines the storage of list items, either hardcoded or as results of executing a data page.

Common data sources for lists include:

  • Connector (for example, REST, SOAP, HTTP) to a service for external data
  • Report definition or lookup for class (database table) for locally stored data
  • Data transform that can retrieve hardcoded, external, locally stored data, or aggregate from several data pages
  • Hardcoded list of values (for properties)

Note: Data can be retrieved from aggregate sources combining the methods above.

Note: A page list property is populated using other rules, such as a data transform, combining results from several data pages. A value list source can be directly configured on the property rule.

Value list data source configuration options - example

Apply the following general best practices for configuring local and external data:

  • Use locally stored data if CRUD (create, read update, delete) functions will be performed using Pega Platform.
  • Use external data if CRUD functions cannot be done in Pega Platform and detailed high-quality data is available via a provider. (In most cases, external data is read only.)

Locally stored data examples include lists of countries and lists of organization IDs, which contain data that does not change very often. External data might contain financial statements, where new and historic statements are retrieved from one or multiple providers. Effectively, local and external data can be used in combination with storing organizational IDs locally and retrieving enriched data, such as financial reports, externally.

Configuring local data[edit]

  1. In the navigation pane of Dev Studio, click Data types.
  2. Click a data type that does not have any sources, select the Sources tab, and then click Create a local source.
  3. Populate data for each record and designate a key if needed. A list data page and a report definition as source will be created by default. You can configure the list data page further with parameters and data transform mappings after creating the source.

Configuring external data[edit]

  1. In the navigation pane of App Studio, click Data.
  2. Click the data object that you want to open.
  3. In the Data views tab, click More > Open in Dev Studio.
  4. In the Data page definition section, set structure as List, and then set the Mode attribute as Read Only (for data retrieval).
  5. Optional: Configure a connector rule:
    1. In the Data Source section, select Connector and select the source type (for example, REST).
    2. In the Name field, provide the connector rule name for the selected type.
    3. In the Request Data Transform field, enter or select the request data transform.
    4. In the Response Page List field, enter or select the response page list.
    5. In the Endpoint URL field, enter the endpoint URL.
    6. In the Method field, select the method (for example, GET).
  6. Optional: Configure a data transform:
    1. For the Source parameter, select data transform.
    2. Select a data transform that calls another data page (returning a page via the connect rule) in a loop for each page.

Note: Data page parameters define the input, including a data format that is retrieved. For example, you can choose to get the return data in the JSON or XML format for a REST service.

Examples[edit]

Autocomplete UI with locally stored country data
A page list property in a table UI displaying a list of attribute names and associated values retrieved from data provider based on the organization ID.

Further reading[edit]

Creating a data page

Creating a local data storage

Configuring page, page group, and page list properties