How to notify users to refresh an outdated List View in Constellation UI

A list of objects often contains numerous rows, making it crucial to cache the table in the browser and refresh only when necessary.

In Traditional UI, refreshing the list is usually delegated to the end user by providing a ‘Refresh’ action on each table toolbar. Although this allows users to decide whether to refresh, it can result in multiple refresh buttons on a single page.

A more effective method involves using a messaging server to refresh only when back-end actions cause data desynchronization. This can be achieved in Traditional UI with the “on load” action available on the action set of a dynamic layout, which subscribes to a channel triggered by the messaging server via web socket upon receiving a publish action.

For more details - see Pegasystems Documentation

Constellation UI uses a similar architecture and provides a messaging server that makes the link between the subscribers (client browsers) and the publisher (Pega platform application). Instead of embedding a subscription channel into every section, the approach uses is to notify which data pages should be refreshed.

Here is a diagram of the sequence involved:

The only application change needed is to identify the right extension point to use and call the activity pxC11NPublishDatapageUpdate and pass the data page name as parameter. This API is available in Pega 8.8 and higher. Note that this approach will only work for list DP and does not work for single page DP. for more details see

https://docs.pega.com/bundle/platform/page/platform/data-integration/data-pages-constellation.html

Choosing the right extension point is critical - if the activity is called too often and there is no data change, the user will be prompted to refresh the list for no reason - if the activity is not called for all the possible actions, the user will see stale data. As such, the most important part is to select the right extension point,

For example, if you want to refresh the case history in Constellation, you can resave the pyAddWorkHistoryDefaults activity into your application layer and refresh the data page D_pyWorkHistory

Users will see the ‘refresh to click’ action when some changes have been made to the case

Note: Constellation UI doesn’t auto-refresh the data page, as it may affect users sorting or grouping data. It’s preferable to let users decide when to refresh the table.

For more details - you can watch the video below

Constellation 101 Series

Enjoyed this article? See more similar articles in Constellation 101 series.

@RichardMarsot this is a very helpful article to learn as well as try out the configuration. I see one problem here - if we are just using D_pyWorkHistory without parameter, event gets published to every Case Type instance in the system. We should update this article to filter out messages before publishing.

Also is there a feasibility to embed this in Case Type Settings page so that manual override of activity is avoided? Also I see message is not customizable. Are there extensions to do that?

@thots Hi Is there any work around for this issue ?

@RichardMarsot

If we want to translate the text “New records have been added. Click to refresh” via localizations. What do we need todo? We have tried several options, pyGenericFields, specific localization for a view etc. But nothing worked.

Please advice on how to proceed.

@SebastiaanH

You can override them as separate keys in localization map,

New records have been added. → “provide ur localized value”

Click to refresh. → “provide ur localized value”

@toshl

Could you tell me the localization file I need to update? I do not maintain a localization map myself. I rely on Pega updating and reading the correct localization files.

@RichardMarsotCan you update this documentation regarding the usage of “parameters” added in version 24.2 ? I believe we can use this to limit the refresh in a given context - case. Is this correct ? What should we pass to this parameter ?

@EngincanY

I found the pega rule “pyAddWorkHistoryDefaults”, you could use this rule as an example. They are expecting you to add the parameters in json format, in the example below they use:

“{"CaseInstanceKey":"” +.pzInsKey+ “"}”

@Lotted16772866 pyAddWorkHistoryDefaults rule can be used in Constellation UI to refresh specific data pages like D_pyWorkHistory by triggering the pxC11NPublishDatapageUpdate activity. By passing parameters in JSON format, such as {"CaseInstanceKey": "<CaseKey>"}, you can limit refresh notifications to specific case instances, improving precision and performance

I raised an SR for found out if the translation issue is a platform issue or in my application. The translation is missing in the functionality of Pega. It will be added in a next release

@SebastiaanH many thanks for having raised the issue. We can confirm that this fix is now in 23.1.4 where we updated ListView-fields localization.

Localization has been added for messages in ListView-fields when using Constellation, including the “New records have been added” indicator which prompts users to refresh their view.

The fix will also be included in the other minor releases that will come out early next year. Keep an eye out on the Pega Infinity Patch Calendar and the Resolved Issues documentation.

@RichardMarsot
What is needed to get this to work ?
besides a working Messaging service (and ConstellationMessageSvcHostPath DSS set) and the configuration above ?

I cannot see the “New records added…Click to refresh..” message…
Is the message even forwarded to the C11n portal/case ?
I have tried to also trigger the pxC11NPublishDatapageUpdate activity manually. Nothing happens. Tracing down to pzPushMessageTooC11NMsgSvc. No errors.

  1. Is there a way to debug, with browser dev tools ?
  2. What about client subscription is that something I have to worry about ?
    subscribe(eventType, subscriptionItem, subscriptionItemName, subscribeOnce, contextName)

We are using: 24.1.2

BR Henrik Westrell

@HenrikW17281399 please open an INC - a knowledge share article is not the place to escalate an issue.