Support Article
Screen flow hangs when attachment is downloaded
SA-101569
Summary
When using the 'pega.ui.HarnessActions.doAttachmentSingleClick' script to download attachments that are present within a screen flow, the system stops processing. This occurs in the Case Worker portal.
Error Messages
Not Applicable
Steps to Reproduce
- Create a screen flow.
- Create an assignment with a section within the screen flow.
- Add a button to the assignment's section that invokes the 'pega.ui.HarnessActions.doAttachmentSingleClick' script upon a click.
- Execute the screen flow.
- Navigate the flow to the point where the button with the script was added.
- Click the button.
- Click 'Continue' or 'Finish' in the flow.
Root Cause
When an attachment is downloaded using the pega.ui.HarnessActions.doAttachmentSingleClick() script function, internally the ATTACHMENT-DATA iFrame is used. When iFrames are involved, the ChangeTracker is invoked to communicate the data between different iFrames.
The Case Worker portal is a single-thread model; while the Manager or the Admin portal are multi-threaded. In the Manager or the Admin portal, the ChangeTracker is invoked on the top level frame. As a result, the system works correctly.
However, for the Case Worker portal, the ChangeTracker is invoked on a dummy iFrame that is created for download (that is, ATTACHMENT-DATA). Since this is a dummy iFrame, the ChangeTrackerMap object is not present. Hence, the script fails in the trackXThreadChanges script function and the screen freezes.
Resolution
Perform the following local-change:
- Modify the DisplayAttachment HTML rule where the ChangeTrackerMap is built for the dummy iFrame.
- Add the below line of code in the HTML Rule,
pega.ui.ChangeTrackerMap = {"getTracker":function(){}};
Published August 5, 2020 - Updated December 2, 2021
Have a question? Get answers now.
Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.