Hey there, today we are going to learn about something new that has been introduced in the recent versions of PEGA. It is about the datapages whose contents will be saved, yes you heard it right. Till now we used datapages to fetch and store the data for later uses. PEGA, has added an extra feature which is to save the data using a datapage.
Before we jump into the discussion, feel free to checkout my earlier post on Datapages, which gives you the basic information about the datapages.
The below is the outline of the contents that we are going to discuss
1) What is a savable datapage
4) Configuring a savable datapage
What is savable datapage
Savable datapages is a new feature introduced from 7.4 version onwards. You can define a data page to save data to a system of record by using save plans. By using save plans, you can save the updated information after without an activity.
Usecase 1 :
Assume a car rental application, where end users have options to book a car for rental reservation. As part of this the user need to be shown the available slots for a car to book. And when user selects a particular slot, we need to make that particular slot status to unavailable, so that all other users will not be selecting the same slot.
Without Savable Datapage
To show the details related to available slots, we will be using a datapage, later when user selects any slot we use an activity to update the details.
With Savable Datapage
To show the details related to available slots, we will be using a datapage, and also we use the same datapage to save the updated contents by configuring data save options.
Usecase 2 :
Assume you are getting customer details like Account Number, Address, Phone Number etc., from an external database. User have the ability to change the address/phone. Once the user updates any of his details, we need to update the external database.
Without Savable datapage
We use a datapage to store the customer details to avoid multiple calls for the same data if needed multiple times. And whenever the details are changed we use an activity to send the updated data back.
With Savable Datapage
We use a datapage to store the customer details to avoid multiple calls for the same data if needed multiple times. And whenever the details are changed, we use the same datapage to send the updated data back.
We can save datapages of both the List (more than a single record) and Page (single record). The only difference will be the options that are available to save them will differ. And one can find these options under the section Data save options
b. Robotic Automation
c. Robotic Desktop Automation
a. Database save
c. Robotic Automation
d. Robotic Desktop Automation
Configuring Savable Datapage
Before configuring savable datapage, following things needs to be considered.
1) Structure of the datapage i.e., List/Page as the options for saving will differ.
2) Type of database save i.e., Activity/DataTransform/Robotic Automation/Robotic Desktop Automation
3) When to save i.e, when should be the data as part of the datapage should be committed. For example, as part of flow processing or assignment processing etc., Pega gives capability to save datapage contents by using one of the below options.
b. Flow Action
We will discuss in detail about each one by showing the sample configuration.
Usecase 1 : User has ability to update his address/phone number by accessing a local action. When the user chooses the local action, the screen will be present with current values in the database. Once the user updates any values and submits the form, the same will be updated in the database. Through the entire process we will use the same datapage to present and update the contents. And I will be explaining to achieve the same outcome in all the three ways (Flow, Flow Action, Activity) mentioned above.
The datapage shown below will be used to retrieve the address details and when the user updates any values, the same will be updated in database.
As we are dealing with only one row at a time the structure is configured as a page. And the type of data save option I selected as Database save.
Note: Database save option will be shown only when the Edit mode is Savable.
Triggering data save options
We can trigger datapages for saving the data in the following three ways as mentioned earlier.
a. Using Save Datapage utility
2. Flow Action
a. Using post-processing options
a. Using Save-Datapage method
We will be implementing the usecase by taking the first option as the approach.
Data save option – Flow
1. Update Address – Case wide optional process
Running a case to update the address by clicking Actions – Update Address
Current address in the database
Updating the address fields to different values and submitting the Assignment.
Updated address in database
The same can be achieved by using the other options i.e, Post-Processing of a Flow Action or Activity.
That’s it. Yeah, we reached the end. Hope you learned something new in this post.
We are open to an attack of queries/improvements if you have any. We always learn better in what we do.
Please feel free to comment or share this with your friends. Sharing helps in spreading knowledge J
Happy Learning !!!
Author - Satish Segu
A passionate and self teaching programmer with lots of love for Android programming. Currently being working as PEGA Developer and posses kowledge in a variety of areas starting from Case Management, Agents, Security, BIX etc., Connect with me through below links.