Question

Load data Pages asynchronously using connect wait method

Hi,

I am trying to load the data pages asynchronously using Load-DataPage and Connect-Wait method. It is working as the data page seems to run in seperate requestor or thread. But my question here is If my data page is running in different thread how can i access the value of the data page in the current thread.

Below are the steps I did.

1. Created a data Page of type thread

2. Created an sample activity of type activity(WrapperActivity) in this activity

3. Create another TESTLOADPAGE activity of type "Asynchronous" with below steps

1. Load-DataPage - gave the data page name and pool id

2. Connect-Wait - gave the pool id and time limit of 30 sec (Since my data page operation will take 15-20 sec)

4. Now in my WrapperActivity I called the TESTLOADPAGE activity using call-Asyn-Actvity or general Call method. I can see my datapage is performing it task. But i could not access any property from the data page. I want to get the value from the data page. Please let me know if there is any way.

https://pdn.pega.com/use-activity-methods-procedurally-and-asynchronously-load-data i gone through this link but i cannot find the answer.

**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.

Correct Answer
December 24, 2016 - 1:33am

Thanks it worked CarissaW .

It was my mistake I had initially loaded the data page with parameters in load-datapage. Then i was trying to access datapage without giving parameter, that is why it was loading again fresh.

Comments

Keep up to date on this post and subscribe to comments

November 14, 2016 - 10:03am

Hi,

Are you using parameters while loading Data Page?

 

November 15, 2016 - 3:45am
Response to dames

Yes there were input parameters and output params passed to the data page . But I was not output values from the DataPage too Since the datapage is running asynchronously at seperate thread

November 17, 2016 - 4:09am

Hi all,

 How to access the loaded asynchronous data pages (ADP) in curernt thread . Any information on this will be helpful 

November 17, 2016 - 2:09pm

The Load-DataPage method will load the data page asynchronously so you shouldn't need a wrapper activity that calls the TESTLOADPAGE activity asynchronously. The Connect-Wait method will then join the requestor thread with the background thread that loads the data page. After these steps you should be able to refer to your data page.

Can you try the following steps in your activity?

  1. Load-DataPage
  2. Connect-Wait
  3. Property-Set that refers to your data page

 

December 24, 2016 - 1:33am
Response to CarissaW_GCS

Thanks it worked CarissaW .

It was my mistake I had initially loaded the data page with parameters in load-datapage. Then i was trying to access datapage without giving parameter, that is why it was loading again fresh.

October 13, 2017 - 9:04am
Response to CarissaW_GCS

CarissaW_GCS,

Can you explain what happens to the Connect-Wait....if within the activity a reference to the data page is made before the connect-wait step? 

Step 1 load-data-page with param of D_mydatapage, PoolID ABC

Step 2 property-set with param of Param.SomeParam = D_mydatapage.SomeProperty

Step 3 Connect-Wait with param of wait -1, PoolId ABC

Will connect-wait still get the status of the load-data-page, will connect-wait be confused, etc?   And what would happen if I had multiple load-data-page steps with the same PoolID of ABC?

October 13, 2017 - 3:50pm
Response to Gabuc000

I ran a quick test on my system. I enabled the ADP Load and Data Types event types in Tracer while running my test activity. If I execute a Property-Set before the Connect-Wait step, then the data page is load synchronously at that point.

July 5, 2018 - 5:43am
Response to CarissaW_GCS

If I referred data page in Property-Set after connect-wait, it is loading the data page once again which should not happen.Without that property-set how I'm able to refer pyworkpage values inside the data page?

July 5, 2018 - 9:03am
Response to GowthamiR

Can you share more details on the steps in your activity and the data page? Is it a parameterized data page? If the data page uses parameters then those will need to be passed with the appropriate value or a new data page would be loaded.