Question
Bank Of America
US
Last activity: 4 Oct 2018 11:08 EDT
Call we call datapage from a function ?
Call we call Data Page from a pega function ?
**Moderation Team has archived post**
This post has been archived for educational purposes. Contents and links will no longer be updated. If you have the same/similar question, please write a new post.
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Accepted Solution
Pegasystems Inc.
AU
PublicAPI.findPage works on Data Pages also, if its a parametised Data Page, you would fill a parameter page and pass it to te find Page method.
So for instance, D_SomeDataPage[FirstParameter: "Something"] would be called in a function somewhat like below (Not field tested, though taken from a similar function).
PublicAPI tools = ThreadContainer.get().getPublicAPI(); //create a Parameter Page for the DP ParameterPage pp = new ParameterPage(); //set the DP Name String pageToFind = "D_SomeDataPage"; //Put the params on pp.put("FirstParameter", "Something"); //Find the DataPage (specific data page find is an internal Pega API, we should use the OOTB) ClipboardPage newDeclarePage = tools.findPage(pageToFind, pp, true);
Pegasystems Inc.
US
there is a public API: loadAsyncDeclarativePage. can be called from anywhere.
GovCIO
US
Hi Kevin,
I just checked the API from my V7.1.6 PE but I didn't see it. Which version it is?
Thanks,
Ravi Kumar.
Pegasystems Inc.
US
where did you check? I thought this has been there since 7.1. Anyway, I checked the 7.1.6 source code, it is there. Load-DataPage is another way of doing it as described by Lee below. Inside it calls the API quoted above.
GovCIO
US
Thanks Kevin for the update. Let me check once from my side and will also check Lee's points.
Thanks,
Ravi Kumar.
Bank Of America
US
can you please share syntax how to call from function.
Updated: 17 Dec 2015 16:41 EST
Pegasystems Inc.
US
Call what from a Function - Activity or the loadAsyncDeclarativePage API directly?
I am in 7.1.9 and do not see "loadAsyncDeclarativePage" within the Pega Engine API Index.
There are literally tons of examples showing "doActivity" being called.
Do an "All Content Contains" search for "doActivity" then click "Show results in new window".
In an Activity java step the middle doActivity() argument is implicitly "myStepPage" but if there is no dependency on step page the middle argument can be null - similar to the difference between calling an instance method vs a static method.
Within a Function's Java code you can derive the current step page using tools.getStepPage().
Does that help?
Pegasystems Inc.
US
Functions can call Activities.
In fact there is a Function named "callActivity".
There is a Load-DataPage Activity Method.
When multiple Data Pages are sourced to a Connector and wanting to wait for those connectors to complete you would use a Load-DataPage step for each Connector-sourced Data Page followed by a Connect-Wait step.
Accepted Solution
Pegasystems Inc.
AU
PublicAPI.findPage works on Data Pages also, if its a parametised Data Page, you would fill a parameter page and pass it to te find Page method.
So for instance, D_SomeDataPage[FirstParameter: "Something"] would be called in a function somewhat like below (Not field tested, though taken from a similar function).
PublicAPI tools = ThreadContainer.get().getPublicAPI(); //create a Parameter Page for the DP ParameterPage pp = new ParameterPage(); //set the DP Name String pageToFind = "D_SomeDataPage"; //Put the params on pp.put("FirstParameter", "Something"); //Find the DataPage (specific data page find is an internal Pega API, we should use the OOTB) ClipboardPage newDeclarePage = tools.findPage(pageToFind, pp, true);
-
Santo Quattrone Vachan Chauhan
Pegasystems Inc.
US
There are various "Load Management" options for Data Pages such "Per Interaction".
I can see a Data Page that did not exist previously loading using tools.findPage().
But what it the Data Page already exists?
Why would calling tools.findPage() a second time cause it to reload?
There is an Activity named "FlushDeclarativePage" with a Java step that calls: pega.getDeclarativePageUtils().flushPage(pageName, null));
Flush the Data Page then call tools.findPage() again?
Pegasystems Inc.
AU
I'd assumed the question was asking how to get access to the data page from within a function, in which case using findPage would give you the Data Page and allow the load management options dictate whether it needs refreshing or not.
Unless there's a specific need to reload rather than load the Data Page I (personally) wouldn't manually flush a Data Page merely to load it.
Bank Of America
US
Hi Lee,
Depends how your data page is defined . If you have parameters which are unique , still the same approach will work based on scope of data page.
if you want to flush data page , there is a public api removedatapage which will work .
Thanks and Regards
Vinoth Sridharan
Bank Of America
US
Hi Joe ,
This is exactly what my needs are .Appreciate your inputs .
Thanks and Regards
Vinoth Sridharan
Reply s.p.a.
IT
Thank you so much, this was wery useful !