Question
CGI
US
Last activity: 8 May 2024 16:20 EDT
Difference b/w Load-DataPage and Call-Async-Activity in Pega 7
- Load-DataPage loads a data page asynchronously and has a pool ID parameter.
- Call-Async-Activity calls an activity asynchronously and has a pool ID parameter. Only methods available in the asynchronous activity are Load-DataPage, Connect-Wait. Can't do any additional processing in this activity other than loading data page.
Both above methods do their job asynchronously(by spawning a background thread. assuming its a parallel PRThread but not a separate requestor ) and Connect-Wait can be used to wait on the poolID mentioned in above methods. in that case, can we not live just with Load-DataPage? does Call-Async-Activity method help achieve anything better?
**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
Updated: 8 May 2024 16:20 EDT
Pegasystems Inc.
IN
Call-Async-Activity was introduced to allow asynchronous execution of activity, in parallel to main requestor, in a different java thread.
Yes, the only use case supported currently is to load data pages asynchronously.
When compared with Load-DataPage, the advantage you get is that you can group asynchronous load of related data pages.
For example:
Suppose there are 3 data pages in an application D_CustomerSavingAccounts, D_CustomerLoanAccounts and D_CustomerSummary, and at some point all three of them are needed for processing some logic.
D_CustomerSavingAccounts, D_CustomerLoanAccounts are independent of each other, but D_CustomerSummary requires some data from both D_CustomerSavingAccounts, D_CustomerLoanAccounts.
These data pages can be made available using Load-DataPage in following way:
First queue both D_CustomerSavingAccounts, D_CustomerLoanAccounts for asynchronous load and wait till they are available.
Then queue D_CustomerSummary for asynchronous load and wait till it is available.
Then the logic which requires these three data pages can be run.
So, using Load-DataPage the main requestor has to wait twice.
Instead, if the logic of loading these data pages is moved to an asynchronous activity.
Then just queue the activity for asynchronous load and wait for it to complete.
Then the logic which requires these three data pages can be run.
Call-Async-Activity was introduced to allow asynchronous execution of activity, in parallel to main requestor, in a different java thread.
Yes, the only use case supported currently is to load data pages asynchronously.
When compared with Load-DataPage, the advantage you get is that you can group asynchronous load of related data pages.
For example:
Suppose there are 3 data pages in an application D_CustomerSavingAccounts, D_CustomerLoanAccounts and D_CustomerSummary, and at some point all three of them are needed for processing some logic.
D_CustomerSavingAccounts, D_CustomerLoanAccounts are independent of each other, but D_CustomerSummary requires some data from both D_CustomerSavingAccounts, D_CustomerLoanAccounts.
These data pages can be made available using Load-DataPage in following way:
First queue both D_CustomerSavingAccounts, D_CustomerLoanAccounts for asynchronous load and wait till they are available.
Then queue D_CustomerSummary for asynchronous load and wait till it is available.
Then the logic which requires these three data pages can be run.
So, using Load-DataPage the main requestor has to wait twice.
Instead, if the logic of loading these data pages is moved to an asynchronous activity.
Then just queue the activity for asynchronous load and wait for it to complete.
Then the logic which requires these three data pages can be run.
This way main requestor will wait only once.
Also, asynchronous activity provides reuse of logic for loading these data pages.
For example, if these data pages are required in another activity, then with asynchronous activity just one queue and wait is sufficient, but with Load-DataPage multiple queue and wait have to be used and order has to be maintained.
JPMorgan Chase & Company
US
Hi,
Load-DataPage method to queue a data page asynchronously.
Call-Async-Activity call an activity to be executed asynchronously. Pool Id is a token used to group activities executed asynchronously in the background.
CGI
US
But both do the same job as I mentioned in my original post. So trying to understand if one of these is more useful than the other.
JPMorgan Chase & Company
US
Hi Narayana,
Regarding your statement "Call-Async-Activity calls an activity asynchronously and has a pool ID parameter. Only methods available in the asynchronous activity are Load-DataPage, Connect-Wait. Can't do any additional processing in this activity other than loading data page."
The calling activity is not restricted for only methods of Load-DataPage & Connect-Wait methods, there might be different methods you can use.
CGI
US
when you say, "calling activity" probably you meant the activity in which the Call-Async-Activity method is used?
I was talking about the activity that you call using the call-Async-Acitivity method. This activity will be of type "Asynchronous". Pls refer to screen shot. Other methods can't be used in it. That is why I was asking what additional benefits you get with this method.
JPMorgan Chase & Company
US
Hi Narayana,
Please refer below pdn article
https://community.pega.com/use-activity-methods-procedurally-and-asynchronously-load-data#call
CGI
US
Sudhakar, I appreciate your response. I couldn't find the information I'm looking for at that URL.
I still feel that both Load-DataPage and Call-Async-Activity step methods are used to do the same thing. i.e., load a data page asynchronously. I couldn't understand if any of these two have more benefits than the other. It would be great if we can list down some behavior that we can achieve using one method and the other method cannot. Hope my point is clear.
American Express
US
I had the same question and you are right, there is no clarity on the exact difference benefits these two anywhere. I wish someone could provide a good explanation.
Pegasystems Inc.
IN
Load data page method may be useful in scenarios where you want to load a heavy data page ahead and use it later in your UI or processing, whereas call async activity wouldnt help in this scenario.
American Express
US
The question is if the only methods available within an Async activity is Load-DataPage and Connect-Wait, what is the real use of this if I can still use the same methods within a regular activity to perform an asynchronous operation? Why do we need an Async activity?
CGI
US
Looking for a convincing answer.
Accepted Solution
Updated: 8 May 2024 16:20 EDT
Pegasystems Inc.
IN
Call-Async-Activity was introduced to allow asynchronous execution of activity, in parallel to main requestor, in a different java thread.
Yes, the only use case supported currently is to load data pages asynchronously.
When compared with Load-DataPage, the advantage you get is that you can group asynchronous load of related data pages.
For example:
Suppose there are 3 data pages in an application D_CustomerSavingAccounts, D_CustomerLoanAccounts and D_CustomerSummary, and at some point all three of them are needed for processing some logic.
D_CustomerSavingAccounts, D_CustomerLoanAccounts are independent of each other, but D_CustomerSummary requires some data from both D_CustomerSavingAccounts, D_CustomerLoanAccounts.
These data pages can be made available using Load-DataPage in following way:
First queue both D_CustomerSavingAccounts, D_CustomerLoanAccounts for asynchronous load and wait till they are available.
Then queue D_CustomerSummary for asynchronous load and wait till it is available.
Then the logic which requires these three data pages can be run.
So, using Load-DataPage the main requestor has to wait twice.
Instead, if the logic of loading these data pages is moved to an asynchronous activity.
Then just queue the activity for asynchronous load and wait for it to complete.
Then the logic which requires these three data pages can be run.
Call-Async-Activity was introduced to allow asynchronous execution of activity, in parallel to main requestor, in a different java thread.
Yes, the only use case supported currently is to load data pages asynchronously.
When compared with Load-DataPage, the advantage you get is that you can group asynchronous load of related data pages.
For example:
Suppose there are 3 data pages in an application D_CustomerSavingAccounts, D_CustomerLoanAccounts and D_CustomerSummary, and at some point all three of them are needed for processing some logic.
D_CustomerSavingAccounts, D_CustomerLoanAccounts are independent of each other, but D_CustomerSummary requires some data from both D_CustomerSavingAccounts, D_CustomerLoanAccounts.
These data pages can be made available using Load-DataPage in following way:
First queue both D_CustomerSavingAccounts, D_CustomerLoanAccounts for asynchronous load and wait till they are available.
Then queue D_CustomerSummary for asynchronous load and wait till it is available.
Then the logic which requires these three data pages can be run.
So, using Load-DataPage the main requestor has to wait twice.
Instead, if the logic of loading these data pages is moved to an asynchronous activity.
Then just queue the activity for asynchronous load and wait for it to complete.
Then the logic which requires these three data pages can be run.
This way main requestor will wait only once.
Also, asynchronous activity provides reuse of logic for loading these data pages.
For example, if these data pages are required in another activity, then with asynchronous activity just one queue and wait is sufficient, but with Load-DataPage multiple queue and wait have to be used and order has to be maintained.
-
Sam mk Rohit Jain Shuvadeep Das Ravi Ramineni Ravali Hemant and 2 More