Friday 20 September 2024

How to call activity Asynchronous in Pega

 In this post, we’ll explore how to utilize the `Call-Async-Activity` method. First, ensure that the activity type is set to "Asynchronous" in the security tab. This method allows us to load a data page asynchronously, but only two specific methods can be used within this activity( Load-DataPage and Connect-Wait)

In the example below, we employ the `Call-Async-Activity` method in conjunction with `Connect-Wait` to synchronize the asynchronous activity with the current requestor, while also setting the data page result to a parameter for output verification. We pass a pool ID when calling the async activity and use the same ID in `Connect-Wait` to ensure proper synchronization.

 

In the third step, we assign the output to a designated parameter.

The activity we are executing asynchronously focuses on loading a data page.

Below is the activity we called in Call-Async-Activity.

We have confirmed that the activity type is set to Asynchronous.

Using the tracer, we can observe that the activity executes in the background, and we find that the data page is readily available in the thread. This confirms that the results from the background thread can be accessed within the current requestor.

For further details, refer to the documentation: [Pega Documentation].

No comments:

Post a Comment