Data Page, its configuration, usage and execution.

Data pages in Pega


What is a Data Page?

  • Data page is a clipboard page that can be shared across a thread, a requestor or multiple requestors (node level).
  • Data page rule is an instance of Rule-Declare-Pages and is available under Data Model in Records Explorer.
  • Data pages are loaded when it’s first referenced during execution.
  • Data pages can be parameterized.
  • Data pages can be reloaded/expired based on the configuration defined.
  • Data Pages always starts with the prefix “D_“ or “Declare_”(legacy). Data pages are informally called as DPage.
How to Configure a Data page ?

  • The New Rule form of Data Page accepts NameClass Ruleset Version.


  • Data Page configuration is simple when you know the actual purpose of each of the fields. Let’s quickly see the usage of each.


1. Definition Tab

This tab of the Data page rule has 3 main sections,

  • Data page definition
  • Data sources
  • Post load processing
Data page definition

  • This section of the data page has most of the configurations which describes how the data page is in clipboard.


Structure

This defines the mode of the data page. Possible modes of a data page can be Page List [Page List].

1.Page : The data page can be tretated as single page structure.
2.PageList : This page tretated as a pageList containing mutiple pages (COde-PegaList) results.

Object type

Each page in the clipboard will have a class context. For Example, the OperatorID page is of class Data-Admin-Operator-IDpxRequestor page is of class Code-Pega-Requestor. In the same way, each data page in the clipboard belongs to a class and this field holds that class name.

Mode

This field decides where exactly the data page will be shown in the clipboard. It can be Read-OnlyEditable Savable.

  • Read-Only– The data page of this mode will be used only for referring data. We can’t update the information on this data page. It can be modified only during loading or in Post processing activity. Read-Only data pages can be seen under the Data Pages category in the clipboard.

  • Editable – The data page of this mode can be used for referring the data as well as it can be updated on the fly using Activity, Data Transforms, etc. This mode of data page works similar to User Pages and can be seen under the User pages category in the clipboard.

  • Savable– The data page of this mode can be used to persist information directly into the database. We can explore the Savable Data page in detail in a separate post. These modes of data pages are similar to User Pages and can be seen under the User pages category in the clipboard.

  • This option is applicable only if the mode of the data page is Read-only.

  • We can improve clipboard performance in data page loading by enabling this option. Enabling this is recommended when the data is going to be static and used repeatedly. For Example, a data page to hold the list of Countries

  • When this option is enabled, the below feature will not be supported in Data page.
  1. Declarative rules.
  2. Page messages.
  3. Complex property references [Property-Ref].
  4. Saving pages to a database.

        Scope

        Node:If a data page is defined with node-level scope, then all the requestors & its related threads (BROWSER, APP, BATCH, PORTAL) running in the same node can share the same data page. 

        Node level data pages can only be of mode Read-Only.

        Requestor: If a data page is defined with requestor level scope, the threads active in that requestor can access the same data page. 

        • Requestor level data pages can be of mode Read-only, Editable and Savable.

        Thread:Thread level data pages are similar to user pages. If a data page (having case-related information) is defined with thread-level scope, it can be accessed multiple times by the same thread without having it to reload.

        • Thread level data pages can be of mode Read-only, Editable and Savable.

        For Example: Assume that you have launched a Case manager portal and opened multiple cases in a series of tabs. The cases opened in each tab runs in a new thread. If a data page having case-related information is defined with Thread level, It can be reused by the same case multiple times. If a data page is defined with the Requestor level, then all the cases opened in each tab can access the same data page.

        What is Keyed page access?


        • This is applicable only for Pagelist structure and mode -read only.
        • Access page with user defined keys - Checking this will enable you to access particular pages using keys.
        • Allow multiple pages per key- checking this will allow you to return more than one page usingkeys.
        • Pagelist key - You can can specify multiple keys to access.

        Data sources

        This section gives us an option to configure the actual source of our data page.


        • We can select any of the available sources based on the structure of the page and load the data page.
        • We can also have multiple sources for a data page and decide on those conditionally using a when rule.
        • Only Activity of type Load Data Page can be used as a source of data page when Activity is selected as the source type. The activity type can be changed under the security tab of the activity rule.
        Post load processing

        • We can’t ensure that we always have the required data readily available to us. There might be a situation where we should manipulate information based on the results.
        • Post loading activity that we specify here will be used to perform any custom manipulations on the results.
        😀Load Management :

        • This tab of the data page rule is more important as the configurations available here ensures that the data is up-to-date.
        • Load management is only applicable when the mode of the data page is read-only.
        Page Management

        • This option is most likely used by the developers when they want to manually remove/flush the data page from the clipboard.



        • Load authorization

        • This section is only applicable if the scope of the data page is Node.


        1. Requestor and Thread level data pages use the application context of the logged-in user. Node level data page is outside of the requestor context and hence the application context will be decided based on the access group provided in this field.

        Refresh Strategy

        • This section enables us to define a mechanism using which the data on the page remains up-to-date.

        Reload once per interaction:

        • Enabling this option will freshly load the data page whenever it is referred. Careful consideration is required before enabling as this may cause a huge performance issue.
        • This option is available only when the data page is of scope Thread or Requestor.
        • When selected, the system ignores any values in the Reload if older than and Do not reload when fields at run time.
        Do not reload when

        • We can also control the refresh strategy of the data page using a when rule.
        • This option is available only when the data page is of scope Thread or Requestor.
        Reload if older than

        • We can make a data page reload based on the time duration in DaysHoursMinutes and Seconds.
                                    
        • When the data page runs for the first time, it sets the cache with the expiration time based on the configuration.
        Page limits

        • This option is most recommended when the data page is of mode read-only with scope as Requestor or node.
                           

        Limit to a single data page

        • This option is only available when the data page has at least one parameter defined. This can be seen in the later part of the post when we discuss the parameters tab.

        Clear pages after non-use

        • This option when selected forces the system to delete the clipboard instances of the data page after an interval passes with no access. Subsequent attempts by a requestor to access the data pages cause the pages to reload.
        • The time interval until it waits is defined in the DSS DeclarePages/DefaultIdleTimeSeconds. This value will be used to expire the page. By default, DSS value is set to 86400 seconds or one day.
        • we can adjust the value of the DSS based on our needs.

                                                                         
        *Interview Questions on Datapages.
        • What is Datapage ? Y we use data pages in pega?
        • What are the scopes for data page?
        • Differnce b/w Node level, thread level,requestor level ?
        • How can we achive Error handling in Data page?
        • What is Savable page?
        • What is Keyed page access in datapage?
        • Why we use Refresh strategy in datapage?
        • What is Post Load Processing ?
        • What are the data sources of datapage?
                                                                     







                


        Comments

        Popular posts from this blog

        Pega Flows

        How to Configure Split Join, Split for Each, Spin off in flow rule?