Skip to main content

This content has been archived and is no longer being updated. Links may not function; however, this content may be relevant to outdated versions of the product.

Support Article

How to find end time for Agent with Child Requestors

SA-3937

Summary



We have Nightly Batch Payment Process Agent. There are more than hundreds of objects need to be processed. It takes more time to finish.

So that we come up with an approach to bubble 5 more child Requestors under the parent Agent Requestor to process invoices. This works fine. Further more, we have to start GDS Process Agent following after all the invoices paid by the Payment Process Agent. Here we have some important questions to complete our implementation?

1. Does SMA agent end time indicate correct time that is when all the child requestors finished there work?.
2. How to identify where are all the Agent child processes finished which are invoked by Queue Method in Agent activity?
3. It seems after bubbling Child Requestors, Parent Agent finishes itself. It is correct or not? Is that Parent Agent Process will wait until Child Requestors finish there work?
4. How to identify all launched Child Requestors are finished? Is there any API method or function available for this purpose?
5. How to report on the child requestors launched by Queue Method or Java Step with Public API method?



Resolution



Using queueBatchActivity("className", "activityName", paramPage) runs starts caller activity in a child requestor asynchronously, so the calling activity continues without pausing the parent activity. The user requirement here is to pause the parent activity untill all the child requestors are terminated.


This requirement can be achieved by using waitOnBatchActivity() method. Below is the sample code.
 
// Code starts
 
oLog.infoForced("just before calling queueBatchActivity");
 
Object obj1 = tools.getRequestor().queueBatchActivity("allSrs-Work", "queueBatchActivity", tools.getParameterPage(), null); // This version accepts 4 parameters and returns Object instance having child requestor information.
 
try{
 
tools.getRequestor().waitOnBatchActivity(obj1);
 
} catch(Exception ex){
 
oLog.error("exception on child : "+ex);
 
}
 
oLog.infoForced("just after calling queueBatchActivity");
 
//Code ends
 

Published January 31, 2016 - Updated October 8, 2020

Was this useful?

100% found this useful

Have a question? Get answers now.

Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.

Did you find this content helpful?

We'd prefer it if you saw us at our best.

Pega Community has detected you are using a browser which may prevent you from experiencing the site as intended. To improve your experience, please update your browser.

Close Deprecation Notice