Document Agent is great, no doubt about it. I’ve hit some users cases where I’m struggling on the best practice to solve. Suggestions/Best Practices are greatly appreciated.
Reuse of doc agents across multiple attachment properties. For example, say I have an event scheduling/reconciliation app. In this app I need to upload multiple invoices. Overall, they are the same. They have info describing the invoice and then and ordered list of itemized costs. Right now I can easily have an embedded object I share between all of them, but I have to have multiple document agents. How can I reuse without just copying one to the other.
Same use case as above except have all the receipts in 1 attachments. Can I have doc agent work on multiple attachments and map each attachment to an embedded list?
There are A LOT of attachments that are NOT hooked to an attachment property. I could be passing/reading the stream in from an ECMS such as FileNet, Box or Scarepoint. Or I simply have a process with I attach the document on the Attachements widget. What is the best practice of working with these types of attachements if I need to grab information from them?
I’d avoid creating a separate Document Agent for every attachment property unless the documents are truly different. In most cases, the better pattern is to keep the extraction logic reusable and make the mapping layer flexible. So for invoices/receipts, I’d define a common extracted structure, process each document through the same agent flow, and then map the output into the embedded object or list that the case needs.
If you have multiple attachments in a single case, I’d treat them as a collection of documents and process them one by one, rather than trying to force one agent to directly write into multiple case properties in a single shot. That keeps the design simpler and avoids duplication.
For documents coming from CMS or the standard attachment widget, the key is to first get them into a consistent content path that Pega can read. Once the content is accessible, the same extraction pattern can be used regardless of source.
So in short: normalize the input, reuse the extraction, and map the output to the case