Configuring lists with local and external data
|Description||Configuring lists with local and external data|
|Version as of||8.5|
|Capability/Industry Area||Data Integration|
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.
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.
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
- In the navigation pane of Dev Studio, click Data types.
- Click a data type that does not have any sources, select the Sources tab, and then click Create a local source.
- 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
- In the navigation pane of App Studio, click Data.
- Click the data object that you want to open.
- In the Data views tab, click More > Open in Dev Studio.
- In the Data page definition section, set structure as List, and then set the Mode attribute as Read Only (for data retrieval).
- Optional: Configure a connector rule:
- In the Data Source section, select Connector and select the source type (for example, REST).
- In the Name field, provide the connector rule name for the selected type.
- In the Request Data Transform field, enter or select the request data transform.
- In the Response Page List field, enter or select the response page list.
- In the Endpoint URL field, enter the endpoint URL.
- In the Method field, select the method (for example, GET).
- Optional: Configure a data transform:
- For the Source parameter, select data transform.
- 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.