Keyed Data Page
As we know, Data Object/Data Type we can configured as Local Data Source (Pega Database) or
External Database.
Here we have one Data Page, which is configured here with One External Database.
Suppose this is Oracle DB and after some time, we change MySql DB then we have to just change in
Data Page Configuration rather than Pega Application Case type which using Data coming from
External Source.
In Case of Performance, Data Page Play Key Role.
Demo 1
Let assume we have one table in DB
Student Details (Table)
Having columns Roll No, Name, Email, Branch, Mob
So first we create one Data Type in Dev Studio,
So as we have created, StudentDetails Data Type created and we source local data and 6 rules are
created and Roll No as primary key.
Now our requirement is -> we want one drop down that will display all roll no and want to display
that record so we can use data reference.
So we do first this.
Create one case type like Demo787 and add one stage one step with configure view.
Now click on setting logo,
Pass search property.
Now done
See your case…
It is working fine !
But we don’t want to use Data Reference.
We will do via create rule manually I section rule.
So add second step and add one pyID.
Now open that section rule, select and apply 2
Now we add on drop down for select Roll No,
For this control, create one property(Text) select Roll Number and pass this property.
Now come to List Source, So as we want that This property get data from Data Page.
So we have 3 data page – Page, PageList and Savable.
So we will pass PageList Datapage and give which column we need.
Now submit and run, check this giving Roll No list.
Yes working fine as expected.
Now we want to display data based on selection so we create one section in data class (Student
Details).
So as you can notice here, first step we configured Data Reference so some section rule for this in
background is created.
But we will create now own,
MyDataSection
As we created section, by drag and drop.
Now come back to work class section,
Use add embedded section,
In this case, we have 2 option we can get data from Data page and we can get data from the PageList
Property.
First we see Data Page,
So here we select data page, here you notice when we select work class, bydefault it taking data
page which created when case type created.
But we will create our data page in Data class and there we will pass parameter as we done earlier!
Here I am not creating own Data Page, we shifted to data class,
And using Page Data Page.
NOTE:
In case of Data Page we have 3 data page:
1- Savable Data Page
2- Page DataPage
it source from Lookup with Data class because it will give one record so here we can
pass input parameter.
3- ListPage DataPage
It source from Report Definition
Run it is working fine after save button.
Give refresh condition, on that portion where we want to show updates values.
On which property selection you want to refresh the section,
On that property apply refresh section ->
So here we will apply on drop down,
Click on the drop down ->
Submit and done
It will be work!
Now interesting thing is
When you run case, This data is not part of Case Not Available in User Page (pyWorkPage) means
Data is part of Data Page. You can see in current thread!
Now we want this data , should be part of our case type.
So how can we do that? See that approach.
For this add 3rd step on process……
Like below
Add on pyID in select and apply 3 step,
Open that section,
Add one drop down and create one property with named select3 and list source from List Data Page
Student Details.
Save and Run check working.
Ya working fine….
Now we want when user select roll no, it should be display.
So rather than creating section rule in Data class(It will be Data Page Data not Case Type Data).
So we will create one List Property in work(Case Type) class named as MyListPropoperty(single
Page).
Now give Data class name
We just put as Manual now.
And now go to section rule and add this.
For adding this Page Propoerty take one Dynamic Layout and add One Embedded,
Select clipboard page, select Data Class Path, pass clipboard page as pass .MyListProperty (via .) and
pass section which created already in Data class. Like below.
VERY VERY IMP: in clipboard page , pass page list property.
Check and verify in
Now run this,
When you run this,
It will not display data, as we know this is configured with property set to as manual, which is
manual.
Now change manual to Refer to Data Page.
Then it will ask about key because that is lookup.
Pass key of your drop down. Like below
NOTE: Make Sure You this DataPage D_StudentDetails must be Refresh Strategy selected as Reload
Once Per Interaction.
And add one more step, in same stage i.e. 4rth step configure view -> add directly MyListProperty.
So 4rth section also get data from this PageList Property.
Just look to Table Date once.
Now Run and see,
Ignore 1st and 2nd step,
As I run I am on step 3,
I selected 102 -> got data
NOTE: So this coming from Page Property which is in Clipboard. This data now part of Case Type but
in previous way, data was part of Data Page only.
You can see/notice this in clipboard.
This MyListPoperty holding data and referring to one data page D_StudentDetails.
As we have configured Data Access as Refer to Data Page in MyListPoperty below picture,
That means it will give always the most current data from an external system or
application.
Now do not click on submit, as we know that on 4rth step again we are accessing
data from Page property which is configured in Configured View.
So we just update data, swati to swatiABC in table.
Then we will click on submit then 4rth Step will run it will show the data which
Page Property so page property on 3rd step having “swati” but meanwhile we
have updated data in Table.
As you know about refer to data page give always current data from Table.
You will get data updated as 4rth step “swati ABC”,
Actually this chapter is for Access Pattern,
Configuring data access patterns
This lesson covers five data access patterns.
After this lesson, you should be able to:
l Describe the data access patterns available in Pega and their uses
l Configure a property to refer to a data page
l Configure a property to copy a data page
l Configure a data page with keyed access
l Reference a data page from a UI control
l Configure a reference property
1- System of record (Refer to Data Page)
- Here Data is part of Case, this just referencing data
- Current data to be populated
- Eg Train Ticket
When we see tickets are available 2 and we are going to book, may be another
guy booked and then when we fill information then click to submit! Sometimes we
seen that ticket not available. Because on every next step, they getting data from
data page via refer to data page.
2- Snapshot Pattern (Copy Data From Data Page)
Now for this change, Data Access “refer to data page” to “copy data from data page”
Now we run again we will select 102 -> we will get swati ABC as we have in Table.
3rd step it is showing swati ABC, wait change in table swati abc to krishana. Then click on
next step -> you will get old output means, whatever in Page property data copied, it will
never hit to table now until parameter change.
- Here data saved/copied in to Clipboard
- Eg HOME LOAN Fixed
- Copy data from data page i.e. data is part of case
- Again same as “refer to data page” data is available in clipboard but there is no
referencing
-
- Copy data from the data page to a case when you need data
from a specific point in time. Once you copy the data to the case,
the data is not retrieved from the source again unless the
request parameters change.
- For example, when a user creates an insurance claim, the
application copies customer information to the claim from an
external system. Each time the case is opened, the customer
information recorded in the case remains unchanged.
NOTE: now see about input parameter change.
Whenever Parameter value change, again it will give updated/current data from table.
So for this we run,
We give 103 and saved,
We just saved and change krishana as “puneet” in Table
Here now you can change 101, means as input change it, again change 101 to 103.
You will get Latest data.
3- Reference Pattern
As we have configured in Drop down Source as directly with Data Page.
This is called Reference Pattern.
NOTE: whenever we have any property Source with Directly with Data Page.
This is called Reference Pattern.
Like as we know about Data Reference -> This property configured directly from Data
Page.
4- Keyed Access Pattern
When we run this case type, (ignore 1st and 2nd step)
How many Data Page we are using,
2, 1 for Populate Roll No (List Data Page) and 1 for showing information (Page Data Page)
You can see in clipboard in case id thread under -> Data Page -> 2 data page we have,
Whenever input change, there will be more traverse
When we have so many different different traverse, then reduce this traversing we use Keyed Data
Pages.
So now what we do,
We will use only one Data Page for fetch the roll no and fetch the record/page from Table.
Through List DataPage, we will fetch Roll no. for drop down and through same List Data Page we will
display Record.
So for both work we will use same List DataPage.
Demo,
Open List Data Page i.e. D_StudentDetailsList
In case of List Structure only, you can see Keyed Page Access option
Select checkbox i.e. Access pages with user defined keys
Click on + Add Key option,
Pass Primary key as chosen during configured Local Data Source
Now open Page Property i.e. MyListProperty
Now save this.
And run (better remove 1st and 2nd step)
Open clipboard for current thread -> go to Data Page -> ….. on the 3rd Step,
Under clipboard -> current thread -> data page -> we have only one Data Page now i.e. List Data
Page.
5- Alias Pattern