Support Article
Attachment saved in Pega database instead of repository
SA-76254
Summary
An application is configured to store content in a repository. However, the attachment is saved in the Pega database instead of the repository, intermittently.
Error Messages
Not Applicable
Steps to Reproduce
- Configure a flow with processes to add attachments.
- Add an attachment with the same name.
Root Cause
This behavior is as per Pega product design.
In Step 4 of pzSaveToRepository, a check is performed if the file already exists in the repository. If the file exists, the 'Conflict' message rule is set which states, 'The specified file/folder already exists in the target repository. Please specify a different file/folder.'.
After this, the check jumps directly to Step 16, where it exits the activity. Unless there is no error, it does not remove the pyAttachStream of the record in the database (which occurs in Step 14, where the pyAttachStream only is removed on a successful save).
Resolution
Perform the following local-change:
Set the CreateProblemFlow parameter when adding the attachment such that a problem flow is generated if there is an error. An Administrator can delete and re-add the attachment as required. The pxCreatePDF activity has a step at the end, to set the param.CreateProblemFlow to true if there is an error.
An enhancement request, FDBK-30784, is created for consideration by Pega Product Management.
Published August 15, 2019 - 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.