Posted: 10 Sep 2016 10:19 EDT Last activity: 9 Nov 2016 10:03 EST
to make PRPC as a SOR including for attachment
I have a number of records in MIcrosoft excel. I also have attached PDF files in a folder for each of these records. I would like to get the records in PRPC along with the corresponding PDF files in order to be able to access, retrieve, and report. I can convert the excel data into csv files and upload to PRPC table from designer studio after creating the data type with the required properties (columns). However, the same steps would not work for the corresponding attachements of each records. Would you please suggest how PRPC stores and retrieves attachments in the above scenario?
I have csv that I can upload via data type, first I create the corressponding properties for each columns, and then upload it, the prpc creates an internal table for me mapping to the given data class. But I have PDF files for each row in for the table, that I need to store to each rows (right rows). I also would like to be able to retrieve the PDF files along with the rows in PRPC UI. If there were only data, that can be done via Report Defintion and Datapage as required, but how about the PDF files that need to be stored into each related rows and retrieve as needed. Appreciate further thoughts.
Designer Studio > Application > Distribution > Import.
This upload process will actually error (it is designed only for ZIP/JAR files in fact): but the upload should still work.
Once you have read your CSV / EXCEL file into PRPC and created the relevant records (or work items ; whatever); you should be able to iterate them (in a standard PRPC Activity) and get out the paths to your PDFs.
So long as your PDFs in are in the right place (relative paths are probably better here?) you should be able to read them into a Byte Array one at a time.
Then you could look at using the OOTB Activity 'Code-Pega-PDF.AttachToWork' (the 'PDFDocument' Param expects a Byte Array - exactly what we are reading in here) to attach each PDF to a work item.