Ideally when you upload any files to Pega case, the file content is stored into Pega database table. In some business process, it is mandatory to attach files , images to case type. If these attachment are of big size [ BTW Pega allows max 25 MB file size as attachment] and every case accept good number of attachments, then it is not hard to guess that how much space these attachments will occupy in Pega Database. Due to this the database operation response could be slower.
Also if attachment is saved into Pega database , then you dont have much control over it. Like you can not see how many attachments a case has or what is the size of attachment for any case etc. Consider a use case of accessing/reading these attachments without login into Pega. It is not possible if attachments are stored into Pega database.
Considering all these issues, Pega allows to store all case attachments to cloud repositories like AWS S3 bucket, Jfrog Artifactory , Microsoft Azur etc. Currently Pega supports following Cloud repository for storing case attachments.
By configuring a repository, Pega store the case attachment to this repository but for end user there will be no change the way attachments are uploaded , downloaded and shown in case. Internally Pega will work with Repository to a upload, download and show the list of attachment for case item.
In this blog lets learn how to configure a AWS S3 repository with Pega and store case attachment into this repository.
Step 1:- Create Repository rule in Pega. Records->System Admin -> Repository- Create
Step 2:- Give name and description for the new repository rule.
Step 3:- Select type of repository, select Amazon S3 as repository type.
Step 4:- Configure below options
Bucket - Name of AWS S3 bucket [ Bucket is nothing but container in AWS which can
contain files or directory] . Check with your AWS Administrator to know about bucket
where Pega attachment will be stored. You can read my blog to know how to create a
bucket in AWS console - https://www.techpapers.online/post/create-new-bucket-in-aws
Authentication Profile - Used to give credential to access the bucket. Give some name
for Auth Profile and click on create option to create a new Auth profile.
Auth Profile needs Access Key ID and Secrete Access Key. You can read my blog on how to generate Access Key Id and Secrete Access keys for AWS S3 bucket - https://www.techpapers.online/post/how-to-generate-access-key-id-and-secret-access-key-in-aws
Step 5:- Save Auth Profile and configure the same Auth Profile in Repository rule.
Step 6:- Give "/" as value for root path value. Save the rule and Click on Test Connectivity button.
Step 7:- Configure this repository rule with Pega application. Open Application definition page.
Step 10:- Under Integration tab, configure the repository rule for Content Storage->Store Repository.
Step 11:- Click on Browse Button. Here you can select the folder under S3 bucket you want to store the pega attachment. This is useful when you want each Pega application store their files into different directory under same S3 Bucket. And create different buckets for different Pega environment like DevBucket, UATBucket and ProdBucket.
Step 12:- Save the application rule, Create a new case and upload a file. Login to AWS Console and you will see file is saved there.
AWS S3 Content showing the file uploaded, Oops name of file is changed , may be another blog i will write to explain this :)
Hope this blog will help you integrate Pega with AWS S3 to store case attachments. If you think this could be useful for others also, please share this blog with your friend and other developers. If you face any issue in implementation, do write us and we'll get back to you as soon as possible.
This blog site is for your kind of developers and architects, and if you want to discuss any issue, or design please drop us a chat or mail and we will surely connect with you.
Thanks a lot, keep reading, keep learning !
Thank you for posting it Rajesh. Very good explanation.
I have a doubt, After uploaded the attachment any ID it will return for each attachment? How can we differentiate if multiple attachments added to a case? While downloading we have to pass ID right to get the same attachment.