Discussion
Pegasystems Inc.
US
Last activity: 13 Nov 2024 10:15 EST
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 https://docs.pega.com/bundle/platform-88/page/platform/case-management/engaging-notifying-stakeholders.html
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