Before We Begin
Before getting into the discussion, refer to our earlier post on Alias pattern to understand the basics of Data Modeling in Pega.
What is Data Access Pattern?
To build any application in Pega, we definitely need supporting data. For example, Candidate data for HR application, Customer data for CRM application, Employee data for any IT firm application.
Now, where do these supporting data reside & how efficiently Pega can access those data? 😳 .
Data access pattern available in PEGA helps us access those data. There are different types of access patterns available in Pega.
- Alias pattern
- System of Record pattern [SoR]
- Snapshot pattern
- Reference pattern
- Keyed access pattern
We will explore the System of record [SoR] pattern & Snapshot pattern in this post.
What is SoR & Snapshot Pattern?
Let’s assume that Customer details in a CRM application reside in an external system.
System of Record Pattern
- In the above scenario, the external system that holds the customer-related information is referred to as the System of Record and Pega can refer to the external information at run time using SoR pattern.
- SoR pattern does not maintain a copy of the record in Pega, rather it just refers to the configured source to fetch the information whenever required.
- Hence the updates made in the configured source will get reflected in Pega whenever referred. For example, when a Customer Email ID gets updated in the external system, Pega refers to the updated customer Email ID.
Snapshot Pattern
- Pega hits the external system for the first time and copies information from the external system using the Snapshot pattern.
Let’s now explore the configuration & usage of each pattern with a real-time example.
Business Scenario
Let’s consider a call center application built for a telecommunication organization. Customers can reach out to service representatives to inquire about their existing plan/connection. For example, a Customer can call a service representative and discuss the bill amount that he/she has received for the current/past month.
In the given scenario, we have two supporting data namely Customer detail and Plan detail that the customer owns. Let’s now see how best we can access this data from Pega.
Accessing Customer data using SoR Pattern
We have configured a data type as System of Record to store Customer information.
Now let us see how to refer the customer data using SoR pattern in the service request case that service representative creates.
- Create a Page property with context class as OSP-Data-CustomerInfo and configure it to reference data from the system of record.
- CustomerData property refers to a data page D_CustomerInfo.
- D_CustomerInfo just does a lookup of customer records using the Customer ID.
- CSR gets a call from the Customer and creates an SR case by entering the Customer id provided by the customer. When CustomerData property is referred for the first time, it executes the Data Page D_CustomerInfo & populates the customer information under the CustomerData page property.
- Let’s assume that the Customer has updated his/her email ID in the external system. The updated email ID will automatically get reflected in Pega since we have configured access using the SoR pattern.
- When the case is opened again, it executes the Data Page D_CustomerInfo freshly and populates the updated information in the case.
- Any further updates made to the customer information in the external system will get reflected in both the inflight cases and new cases.
Accessing Plan data using Snapshot Pattern
We have configured a data type in Pega to store Plan related information.
Now let us see how to refer the Plan data using Snapshot pattern in the service request case that service representative creates.
- Create a Page property with context class as OSP-Data-PlanData and configure it to copy data from the system of record.
- PlanData property maintains a copy of data from data page D_PlanData.
- D_PlanData just does a lookup of plan details using the Plan ID.
- CSR gets a call from the Customer and creates an SR case by entering the Customer id provided by the customer. When PlanData property is referred for the first time, it executes the Data Page D_PlanData & maintains a copy of the plan details under the PlanData page property.
- Let’s assume that the Organization has updated the Plan1 billing cycle as Yearly instead of Monthly in the external system. The updated billing cycle of Plan 1 should be reflected only for the customer who freshly buy Plan1 and not for the existing Plan1 customers.
- Any further updates made to the Plan information in the external system will get reflected only for the new cases & not for the inflight cases.
- When the service representative creates a new service case for Plan1, it should be using the updated plan details.
Hope now the configuration & usage of SoR pattern and Snapshot pattern is clear with the discussed examples.
Pointers to Remember
- SoR pattern can be used when we want to keep the data up-to-date for both inflight & new cases whereas, Snapshot pattern can be used to maintain a copy of data for inflight cases and up-to-date information for new cases.
- Both Page and PageList properties can be configured using SoR & Snapshot pattern.
- Properties configured with SoR & Snapshot pattern can be used for Reporting without any restriction.
Stay tuned for our continuation post which will cover Reference pattern and Keyed access pattern.
We are glad to publish the article requested by @ Rakhesh on “Data Access Patterns in Pega”. If you want us to publish any articles of your choice, please fill out this form & we will make sure it gets published.
Hi OSP Team,
You guys are doing amazing job and each post is very detailed explanation.Thanks for sharing !
Could you please publish the topic on filelistener with new case creation .
Thanks,
Kumar.
Thank you so much @Kumar
Sure we will post on the requested topic.
Happy Learning from OSP 😊
Explained a very detailed manner with examples.
Thanks a lot
Could you please explain about Alexa Channel Integration with Pega.
Thank you so much @Jagadeeshwar
Sure we will post an article on Alexa Channel Integration. Subscribe & stay-tuned for updates!!!