Posted: 27 Feb 2020 2:01 EST Last activity: 8 Apr 2020 8:54 EDT
Requestor level data page reload
We have a requirement where the data page related to Assign-Worklist class has to load only when a new instance is added to this class. This is a requestor level page. Each time a user uses this data page it reloads, since we marked "relaod once per interaction" on the load managament. Multiple users wil access this data page on a sinlge requestor.
Now the challenge is the data page should only load when there is a new instance added to Assign-Worklist. Can anyone suggest a solution for this.
You can use keyed data page where you pass the parameter to datapage
So first create a Declare-trigger. The trigger fires whenever the table got updated/saved. And in declare-trigger activity just set any flag (for ex: isUpdated = true).
Secondly load the datapage by passing this parameter "IsUpdated= true". So based on pxsavedatatimestamp you need to set the same property to false for the next time run in the datapage source activity.
And uncheck reload once per interaction, then it won't be loaded every time. As we are flushing it when a new instance is added it will be loaded only when accessed again only when new instance is added.
1. Create a delare trigger on Table(class of declare trigger must be equal to class of table).
2. Create activity with these steps
2a) first flush data page with any of these process
com.pega.pegarules.priv.DeclarativePageUtils oDPU = pega.getDeclarativePageUtils();
ParameterPage params = new ParameterPage();
String dataPageName = tools.getParamValue("dataPageName");
page-remove method in activity
3. give Data page in step page to load