We are generating XML content using a Pega XML Stream rule. The XML rule successfully produces the required XML string, but we need to convert this output into an actual .xml file and attach it to the work object/case.
Can someone please guide us on this, in case if we have any specific OOTB activity for this or any other approach if we can use.
I hope you are storing the output of xml stream into a property. If not, use property-set-xml to store it into a property. Now you just need to form a attachment page and then save it to data-work-attachfile. Then link it with the case. Pega will automatically handle the file type and file content with the Filename and pxAttachName you set in the attachment page.
Note- When you set value(xmlcotent) to pyAttachStream, you need to base64 encode using encode function and then set that value to pyAttachStream.
Thanks a lot
That worked- just wanted to check- do we have any ootb activity for populating Data-workattach-file and linking it to the case?
- or should we need to populate Data-workattach-file manually itself?
Build attachment page and call OOTB “AddAttachmentFromEmail” for each attachment
We have SaveAttachment activity. But it expects the file to be in service export directory.