Data pages in pega

What Are Data Pages in Pega?

A Data Page loads data to the clipboard for the system to use. The system can access data from the Data Page on demand. On the first reference to a Data Page, such as from a Data Transform, Activity, or another rule, the Data Page is created in the clipboard and loads the required data.

Data Pages provide a reusable way to access data without requiring every part of the application to directly communicate with the underlying data source.

Structure of a Data Page

We can create a Data Page with two types of structures:

Single Page

Holds a single object, page, or result.

List

Holds multiple objects, results, or pages.

The first important setting on a Data Page is its Mode. The mode determines whether the data can be read, edited, or saved after the Data Page is loaded.

We can create a Data Page in three modes:

  1. Read Only — Node, Requestor, and Thread
  2. Editable — Requestor and Thread
  3. Savable — Requestor and Thread

Scope of Data Pages in Pega

Scope defines the context in which data is loaded onto the clipboard and determines who can access the Data Page. We can load a Data Page in three contexts, or scopes:

1. Node — Read Only
2. Requestor — Read Only, Editable, Savable
3. Thread — Read Only, Editable, Savable

We need to understand Data Page scope in Pega because the scope determines how broadly the data is shared.

Data Page scopes in Pega

Node-Level Data Page in Pega

If a Data Page scope is defined as Node, whenever the node is restarted, the system creates the Data Page on the first reference and loads the data into the clipboard.

Node-level Data Page in Pega
  • All requestors who are currently on that particular node can access the data from this Node-level Data Page.
  • We can create a Node-level Data Page in Read Only mode only, so the data remains the same for all requestors and cannot be modified or updated.

Load Authorization for Node-Level Pages

We need to define the Access Group in the Load Management tab of the Data Page rule. This option appears only for Node-level Data Pages.

When Pega needs to create a Node-level Data Page for the first time and load data into it, it needs to execute the configured source, such as a Load Activity, Data Transform, Report Definition, or Connector.

To execute these rules, the system should have access to the required rulesets and versions. The Data Page rule's ruleset version and the source rule's ruleset version should be visible to the system through the configured Access Group.

In this way, the system gets temporary access to the rules through the Access Group. Pega opens the Access Group's application and examines the ruleset stack to make sure the required ruleset versions are available.

Access Group in Node-level Data Page

Requestor-Level Data Page in Pega

When a Data Page is loaded at the Requestor level, all the threads opened by that requestor can use data from the Data Page.

For example, a requestor may have multiple work objects open at the same time. Each work object has its own thread, but all those threads can access the Requestor-level Data Page belonging to that requestor.

Suppose Requestor 1 has two threads because the requestor opened two work objects in two tabs. Pega creates two threads:

Thread 1 — Work Object 1
Thread 2 — Work Object 2

Both threads can use the data from the Requestor-level Data Page.

Let's look at an example.

We created two Service Request cases in Pega: S-2002 and S-2003. Pega created two threads in the clipboard.

Requestor scope Data Page in Pega

The two work objects can use the D_ServiceRequestList Data Page because it is available at the Requestor level.

Requestor-level Data Page in Pega

Simply put, all threads belonging to the current Requestor can use the data from the Data Page.

If Requestor 2 is using the same Data Page on the same node, the data is accessible only to the threads opened by Requestor 2.

Thread-Level Data Page in Pega

When a Data Page is loaded at the Thread level, the data is restricted to a particular thread, even if the requestor has multiple threads.

Example 1:

Requestor 2 has two threads, representing two work objects. Each work object will have its own Data Page instance on the clipboard. Each work object can access this Data Page as often as needed while processing the work.

The same Data Page can exist in two threads, but the data might be different. Data is populated onto the Data Page separately for each work object.

We can use a Thread-level Data Page when the data is unique to each work object and should not be shared across multiple requestors or threads.

Example 2:

A CSR (Customer Service Representative) is working on an insurance application and can receive and handle a call from any customer at any time. Each time the CSR receives a call from a customer, they open or create a work object that needs to fetch customer data from an external system.

Suppose we have a Data Page called D_CustomerInfo. We need to have this Data Page at the Thread level because the customer information must remain unique to the work object.

The CSR receives a call from customer John and opens work object CS-1. Customer data is fetched from the external system into the Thread-level Data Page D_CustomerInfo.

Next, the CSR receives a call from customer Mark and opens work object CS-2. Customer data is fetched from the external system into the Thread-level Data Page D_CustomerInfo.

Both work objects are opened by the same requestor, and Pega creates two threads for the two work objects, CS-1 and CS-2.

If we look at the clipboard and examine the Data Page, the data can be different between CS-1 and CS-2 because Pega populates the Data Page with data specific to each thread.

Read-Only Data Page in Pega

When we set a Data Page mode as Read Only, it cannot be modified, and the Data Page will be available under Data Pages in the clipboard.

Available scopes:

Read Only mode can be used for Node, Requestor, and Thread scopes.

Editable Data Page in Pega

When we set a Data Page mode as Editable, it can be modified, and the Data Page will be available under User Pages in the clipboard, where pyWorkPage is also available.

When the Data Page is initially referenced, Pega creates the Data Page with Read-Write access in User Pages. We can then edit the Data Page and save the data to the database.

For example, suppose Service Request work object S-2004 is using an Editable Data Page D_ComplaintList for a complaint list.

Editable Data Page rule in Pega

When the Data Page is referenced in the work object process, Pega creates it and places it under User Pages in the clipboard.

Editable Data Page in Pega clipboard
Important:

The Editable option is available only for the Thread and Requestor scopes. We cannot define a refresh strategy for Editable Data Pages.

Savable Data Page in Pega

Traditionally, we need an Activity to save data to the database. By using a Savable Data Page, we can save data directly to the database without using an Activity.

Pega provides a Smart Shape that allows us to save data during case processing.

We can achieve this feature in different ways.

1. Flow — Save Data Page Smart Shape
Save Data Page Smart Shape in Pega
2. Flow Action Post-Processing
Flow Action post-processing with Savable Data Page
3. Using the "Save-Data Page" Method in an Activity
Save Data Page method in Activity

Data Page Refresh Strategy in Pega

When it comes to refresh strategy, Data Pages with Read Only mode can have a refresh strategy. Editable and Savable Data Pages do not have a refresh strategy.

Data Page refresh strategy in Pega

Reload Once Per Interaction

If selected, the system refreshes the Data Page once per user interaction and ignores the other refresh strategies as illustrated in the above picture. This option is available only when the page scope is Thread or Requestor.

Do Not Reload When

This option is optional. If we refer to a When rule and it evaluates to true, Pega will not refresh the Data Page. If it evaluates to false, the system refreshes the Data Page once per user interaction. This option is available only when the page scope is Thread or Requestor.

Reload If Older Than

This option allows us to set the timer that determines when the Data Page should expire and be reloaded. Enter positive numbers in days, hours, minutes, and seconds.

When the system first loads the Data Page, the timer starts from that point. The Data Page will be refreshed only when it is accessed after the expiration time, and it will be refreshed only once per user interaction.

How to Clear a Data Page in Pega

How to clear a Data Page in Pega

In the Data Page Load Management tab, we can see a Clear Data Page button. Once we click this button, the system clears the Data Page.

If the Data Page is a parameterized Data Page, we have an option to delete all instances or only those with specific parameter values.

Related Data Page Topics

Thanks for reading this post. Hope it helps. Please share it with others 😀

12 comments:

  1. Good Post Ramesh.
    what is the significance of post load processing? any real time scenarios ?

    ReplyDelete
  2. Nice super explanation Ramesh, specially in Save date page your theory part superb ,Goodjob Ramesh.

    ReplyDelete
  3. In details explanation....than you so much Ramesh.

    ReplyDelete
  4. If you can please clarify difference between "Editable" and "Savable". I never used Editable because Savable let's me update existing record as well as create a new record.

    Why should I ever need to use Editable. An example would be really appreciated.

    ReplyDelete
  5. Can you please explain how the Data Page will be called in Data Transform

    ReplyDelete
  6. Good explanation..........

    ReplyDelete
  7. Nice explanation..very clear

    ReplyDelete
  8. If a user logs in from two different browsers, we see different requestor Id's from Admin portal. Is the requestor ID which we see in the admin portal same as the requestor of a data page? Is the requestor scope limited only to that particular browser requestor session or it is visible to all the logins in different browser for the same user?

    ReplyDelete
  9. All my questions got clarified with this post...thanks for the wonderful explanation

    ReplyDelete