Refreshing files and documents widget in Theme Cosmos

This document will explain about how to refresh files and documents widget in theme cosmos when attachments are added through flow actions and case processing.

Use case 1: Refreshing the widget when adding attachments using “pyAttachContent” control in a flow action without submitting the case

After adding the attachment and not submitting the case, the files and documents widget will not be refreshed as both the sections are present in different thread context.

To refresh the widget after the attachment before submitting the case, please follow the steps below:

  1. Open the property panel of attach control and navigate to Actions tab
  2. Add a click action and use “Run script”
  3. Add the " pega.desktop.infinity.refreshCaseSections" and pass the section name “pyCaseRelatedContent”. The widget will be refreshed.

Use case 2: Refreshing the widget when adding attachments from flow action after submitting the case

When the attachment is being added from a flow action, the section gets rendered in the primary ajax container. After adding the attachment, the widget will be not refreshed as both the sections are in different thread context.

To refresh the widget, please follow the steps below

  1. Navigate and open to pyCaseMainInner section of the case type

  2. Navigate to utils region and open “Case Related content”

3 Add the property “.pxUpdateDateTime Changes” condition on the refresh condition and submit.

This will refresh the widget after the attachment case has been submitted.

For more refresh strategies in theme cosmos, please see refer this document for more information

@durab Hi I am trying to refresh a section using “pega.desktop.infinity.refreshCaseSections”

and passing the Section Name and I am receiving the harness error.

Can you please suggest how to make this work without any error.

@durab

Option 2 has the disadvantage that it would force a refresh more times then you may want.

A third way of forcing a refresh, out-of-the-box supported in Theme-Cosmos, is posting to channel Documents a page where pyCaseContext = you work object pzInsKey.

To do this, create an activity with a step, use method ‘Publish-Notification’, set channel as ‘Documents’, and as a steppage use a page where pyCaseContext (a transient property) is filled with the pzInsKey of the workitem. Let the activity be run when adding the attachment.

The reason this works is that in section pyCaseRelatedContent there is a hook to this channel with a refresh mechanism.

Please pass the section name which you need to refresh. It looks like you are passing Review which is a harness.