
Data storage configuration
The Common Data Model uses a consistent design pattern to interface with external and internal data. All entities in the Common Data Model use internal or local storage by default. Sample data for the entities are stored in the database of your Pega application.
Example of local storage configuration
The following figure shows an example of how the pattern is applied using the Contact entity.
In the example, a Case in the application uses the Contact entity to store and retrieve contact data in the local data store (the system of record).
The logical data model shows that the entity is part of the Common-LDM-Entity Class and that the D_Contact Data Page connects to the local data store by using a REST API (Common-Interface-Contact). The system of record (SOR) is the database of the Pega application.
Example of external storage configuration
If you want to connect the Contact entity to an external data source, you can create a connection to the new source and modify the Data Page to connect to it. The following figure shows the D_Contact Data Page that connects to an external source:
In the example, a Case in the application uses the Contact entity to store and retrieve contact data in the external data store (the SOR).
The logical data model shows that the entity is part of the Common-LDM-Entity Class and that the D_Contact Data Page connects to the external data store by using a REST API (Common-Interface-Contact). The SOR is the customer-maintained external database. The external database can be any of the Pega-supported databases.
Design and naming conventions
The two diagrams show the design patterns and naming conventions that the Common Data Model uses. When you create a new entity, you must use the same design patterns and naming conventions.
The following table lists each component of the Contact entity and its associated naming convention:
Component |
Naming convention |
Entity name |
Contact |
Logical data model |
Common-LDM-Entity-Contact |
Data Pages |
D_Contact D_Contact_List |
Data Transform |
Con_Detail_Request Con_Detail_Response |
Data Pages
Data Pages connect the entity to a data source. Each entity has two Data Pages. For the Contact entity, the D_Contact Data Page holds the details of a single contact and D_Contact_List holds a list of contacts.
In the Common Data Model, each entity connects to a local data source, which is the database of the Pega application. You can modify the Data Page to connect to an external source.
In Dev Studio, you can view and edit the Data Page that interfaces with a data source. The following figure shows the D_Contact Data Page:
In this example, the source, CONTACT_DETAIL, is a database table in the Pega database. A REST API (Common-Int-Contact) connects to the internal data storage. Common Data Model includes one Class in the Interface Class structure for each corresponding entity Class. The Classes in Common-Int- mimic connection to an external SOR. If you create an external REST connection with the New REST Integration wizard, the wizard creates a structure that is similar to the Common-Int Class structure. The Rules in these Classes provide a sample design pattern for customers to connect to their external systems of record where needed.
The Data Page also contains profiles that the system uses to handle Create, Read, Update, and Delete (CRUD) operations for an individual record. Including these operations on one Data Page facilitates development and reduces calls to the database. These profiles use Data Transforms to perform the operations.
Data Transforms
Data Transforms map data fields in the application to data fields in the source. For example, in the Contact entity, name fields include FirstName and LastName, and in the source data, these fields have the same names. If you connect to an external data source, the names used in the external source might be different. The following diagram shows an example of mapping for an external source:
The Common Data Model includes one Class in the Interface Class structure for each corresponding entity Class. Data Transforms map the data back and forth from the interface Classes to the entity Classes during retrieval and persistence via REST APIs called from Data Pages.
The following figure shows the Data Transform section of the D_Contact Data Page:
The Data Transforms, CDM_Request and CDM_Response, call the appropriate DataTransform for each profile. For example, for Profile_Con_Create, the CDM_Response Data Transform calls the Con_Create_Response Data Transform, which maps all the data fields because the request and response operations likely have different formats. Data Transforms in the remaining profiles support the replace, update, and delete operations; these do not map all fields because the operations do not use all fields.
This Topic is available in the following Module:
If you are having problems with your training, please review the Pega Academy Support FAQs.
Want to help us improve this content?