Friday 20 September 2024

Load Data Page asynchronously in Pega


In this post, we'll explore how to load a data page asynchronously using the Load-DataPage method in an activity.
 

If the data page takes time to load, we can utilize the Load-DataPage method to preload the data efficiently. To achieve this, we need to combine two activity methods: Load-DataPage and Connect-Wait.

In the screenshot below, I've configured the D_GetRuleList data page to load asynchronously, assigning a random value for the pool ID. This pool ID will be used in the Connect-Wait method to synchronize the data page from the background thread to the current requestor thread.



In the step below, we’ve set the wait time to 30 seconds. This means we’ll wait for up to 30 seconds for the data page to finish loading. If the data page loads within that timeframe, we won’t wait the full 30 seconds and will proceed immediately to the next step of the activity.



In the below step, we are setting the output of the data page in a parameter to check the output.

In the below screenshot, we can see the data page is loading asynchronously and in the 3rd step, pega shows the data page is found in thread.


3rd step executed and we successfully got the output wihout loading the data page in current requestor.

 


 

References:

https://academy.pega.com/topic/asynchronous-integration/v3/in/69216/67706

https://docs-previous.pega.com/reference/87/connect-wait-method










No comments:

Post a Comment