Question


Hawaii Medical Service Association
US
Last activity: 9 Nov 2016 10:02 EST
Attachments in a separate table
Why does PRPC stores attachments in a separate table, not in work object table?
***Updated by Moderator: Vidyaranjan. Removed user added #helpme tag. Apologies for confusion, shouldn't have been an end-user option***


Pegasystems Inc.
IN


Hawaii Medical Service Association
US
Hello Krishna GCS,
Thank you for your reply. I have an addtional query about the retrieving the attachments. when we open work object that has attachment, we can open the attachments. However, how does PRPC retrieves the attachments separately when they are in a table in PRPC database or external database?


CGI Netherlands
NL
Hi Dyan,
When you try to open PEGA case attachments it queries the Link-Attachment table with the pega case and brings the list of attachments for that case in the user page "AttachmentList". Each link attachments specifies the property "pxLinkedRefTo" which contains the class and key of the real attachment. This class present in the first part of "pxLinkedRefTo" determines the Database table.
Hope this helps!


Hawaii Medical Service Association
US
Hello KRISHNAPRAKASH,
Thank you for your reply. I have one more scenario in which there are a number of records in an excel sheet, and there are corrresponding PDF files for each records in the excel sheet. The PDF files are stored in a directory. I would like to store the records and corresponding PDF files in a PRPC table, and be able to search and view or retrieve (download) from UI. Would you or anyone share the way we can achieve this. I appreciatefurther thoughts.


Hawaii Medical Service Association
US
I am still looking for the ideas , please.
Hi DyanG412 - you are probably better of creating a new post for your follow-up question for a more detailed scenario and it would be better (for searching etc) that we have separate topics per post.
Thanks,
John
Please also note: PRPC can store attachments completely separately (in a Content Management System for instance) from the Work Items - its just the default behaviour to use a separate 'internal' Attachment DB table for this purpose.
Accepted Solution
Also : to answer your original question - it makes sense to store attachments in a separate table from Work Items : not least because there is a one-to-many realtionship between Work Items and Attachments.
That is: A single Work Item may (and usually does) have many attachments; it wouldn't be flexible to keep opening up the Work Item Record, adding in a new Binary BLOBs (to represent the attachment data) and then re-saving the work item ; or (say) having a separate (but limited number of) columns for each Attachment.
I am just guessing the Possible reasons: