Function to check if Data Page Exists

Hi All ,

We are on 8.1 . We wanted to see if there is a way to check the existence of a data page on clipboard. Since these are declarative in nature we cannot use findpageexists() and other OOTB functions . We need to check because we have to load a node level declare page which internally calls a web service . This web service is quite heavy takes around 10 (s) and the web service is authenticated via a token which gets generated based on the username / password of the user . We do not have a system user name / password and hence we need to rely upon which user logs into the system first , generate the token and then try to load the data page either via Load Data Page or Queue Method . The challenge here is that we do not want to fire these methods unnecessarily which is where we want to check the existence of that data page .

Appreciate your comments .



Correct Answer
August 19, 2019 - 6:20am

Yes It should not be a problem.



Keep up to date on this post and subscribe to comments

August 18, 2019 - 2:12pm

Hi Dinesh,


You can try below in the java step of an activity:

  1. PRThread currentThread = tools.getThread();
  2. ClipboardPage theDataPage = ((com.pega.pegarules.priv.context.PegaThread)currentThread).findDataPageWithoutLoading("D_TestDataPage");
  4. if(theDataPage!=null)
  5. {
  6. //add code for if exists
  7. }
  8. else
  9. {
  10. //add code for if it does not
  11. }


August 18, 2019 - 2:38pm
Response to Vikash Karn

Slightly off-topic: Is there an article on the list of private (java) functions and their purpose?

August 19, 2019 - 12:29am
Response to Vikash Karn

Hi Vikash ,

Thanks very much for the code it seems to work . Is it safe to use this code as it is a private API ? I believe we shouldnt have a problem until we upgrade right ? 



August 19, 2019 - 6:20am
Response to Dineshsb1

Yes It should not be a problem.