Question
CYBG
GB
Last activity: 18 Jul 2017 5:27 EDT
How to automatically attach a file to a work object?
Hi,
In our 7.1.8 application there is a point in a flow where we want to automatically attach a file from a network or local drive. I've looked at the Smart Shape "Attach Content" but it only allows attaching a binary file, and even then we can't specify an external file, only one that has already been uploaded, so I'm not sure what possible use it could be. The help isn't particularly helpful either as it is very different to the actual shape.
Is there an OOTB activity/function/flow action that can take a filename parameter and attach the file to a work object? Or is it a case that we have to manually create an attachment page and set the value of pxAttachName to be the path of the attachment? And even if we do that, what else do we need to do to get the data to actually upload?will the "SaveAllAttachments" activity do that?
And can someone at Pega tell us if they will ever update the help to include this information? I have not been able to find anything in the PRPC help that covers any aspect of automatic file attaching (outside of report PDFs).
Many thanks,
Mike.
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Accepted Solution
CYBG
GB
Hi All,
Thank you for your assistance. As a workaround I have found the following is giving me the functionality I require:
1. The contents of the new CSV file are written to a single property.
2. A new Data-WorkAttach-File page is created.
3. The property is encoded to Base64 and moved to the attachment page's pyAttachStream property.
4. The new attachment is saved and linked to the work object.
However, as a more practical solution I will be implementing an external table with the CSV data stored in rows that can be retrieved via a report definition and exported to Excel for a better user experience. Neither of these is ideal, but in the absence of proper automatic attachment fuctionality it will suffice.
Cheers again,
Mike.
Pegasystems Inc.
GB
I'm not quite sure I understand this sentence:
[...] it only allows attaching a binary file, and even then we can't specify an external file, only one that has already been uploaded
What do you mean by an 'external file' here (One located behind an arbitary URL for instance?) - if so : see this post: https://collaborate.pega.com/question/how-can-we-store-attachment-which-external-url-form-work-attch-url-our-local-server
This fetches a file an 'external' URL converts it into a Binary Array and then attaches to PRPC - I only tested it with PDF files - but it should work (or at least a very similar Activity could be built) for other filetypes as well...
Pegasystems Inc.
GB
So I was thinking about this question again - you need to attach a file to a work item during a flow - and I presume the OOTB mechanism - to add attachments (via an upload etc) on the standard Portals are not sufficient here ?
Or do you mean to attach a file without user-interaction here ? (You said 'automatically' in your description - is this what you mean?).
Thanks,
John
CYBG
GB
Hi John,
It's the latter - I'm looking to attach a file without user interaction.
A little background:
Users will process work items of type A in the usual manner. Every 30 seconds or so an agent will run and count the number of these work items that have reached a certain state. Once this count reaches 50 a job will run to produce a CSV file containing a summary of these 50 cases in a format suitable for a specific external system. A work object of type B will also be created and the CSV file attached to the work object, and the count reset back to zero. Users will be able to open work object B, download the CSV file locally and process them on the external system. This will occur several times each day. Obviously there will be a little more to it that that but that's the gist.
Cheers,
Mike.
Virtusa IT Consulting
AE
Hi Michael,
Have you tried using file listener? it can help you read a file from the specified location .
Thanks,
Habeeb Baig
CYBG
GB
Hi Habeeb,
Actually, I hadn't thought of that. I'll have a look and see if that can solve the issue.
Cheers,
Mike.
Accepted Solution
CYBG
GB
Hi All,
Thank you for your assistance. As a workaround I have found the following is giving me the functionality I require:
1. The contents of the new CSV file are written to a single property.
2. A new Data-WorkAttach-File page is created.
3. The property is encoded to Base64 and moved to the attachment page's pyAttachStream property.
4. The new attachment is saved and linked to the work object.
However, as a more practical solution I will be implementing an external table with the CSV data stored in rows that can be retrieved via a report definition and exported to Excel for a better user experience. Neither of these is ideal, but in the absence of proper automatic attachment fuctionality it will suffice.
Cheers again,
Mike.
Accenture
IN
CTS
IN
Hi Micheal,
I have the below requirement.
I have to send an email from an agent activity and email should have a csv file as an attachment.
I am using pega 6.1 SP2. I have used the activity pxConvertResults to csv ootb activity that is available in 7.x version.
My csv file is getting generated and it is being stored in service export path.
As per my analysis I need to use SendEmailWithAttachments OOTB activity to send an email with attachments.
The challenge I am facing is to copy the csv file content which is stored in server path into attachment page which is of class Data-EmailAttachments.
Could you please guide me here.
Regards,
Tarun