Hi Israel, you’re welcome, and your understanding is on the right track.
Extension points (your point 1)
Yes, when I mentioned implementing the extension points, I was referring exactly to those Repository API activities (e.g., pyNewFile, pyGetFile, pyListFiles, pyDelete, etc.).
In your implementation:
-
pyNewFile → call your company’s REST API to upload the file to your repository
-
pyGetFile → retrieve/download the file using the repository’s unique document ID
-
pyDelete → invoke your API to delete the file
-
pyListFiles → list/search documents, typically using metadata you stored along with the file
So yes — these activities become the integration layer between Pega and your external repository.
Repository definition (your point 2)
Your approach is correct:
-
Define a custom repository type (Embed-Repository-Type-Custom-<YourRepo>)
-
Register it (Code-Pega-List.pyRepoTypes)
-
Create the Repository rule
-
Configure the Application → Integration tab → Content source = Repository
Once this is set, Pega will use your custom repository instead of storing files in the DB.
What happens when attaching a file (important part)
This is where the confusion usually happens.
Even with a custom repository, Pega continues to work OOTB from a case attachment perspective:
However:
-
The binary (stream / pyAttachStream) is NOT persisted in the database
-
Instead, the file is stored in your external repository via pyNewFile
So effectively:
About the document ID (your question)
You are thinking in the right direction.
After uploading the file via your REST API, your repository will return a Unique ID.
You should:
Tip: You can extend Data-WorkAttach-File to store:
“Hook into the attach phase” (metadata clarification)
This is the part I was referring to in my previous post.
When a user uploads a file in Constellation:
-
File is selected in the UI
-
Pega triggers the repository APIs (pyNewFile)
-
Attachment record is created
If you need to send additional metadata to your repository (e.g., Case ID, business attributes, classification, etc.), you can:
-
Extend the attachment data model (Data-WorkAttach-File)
-
Populate these fields before calling pyNewFile
-
Pass them as part of your REST payload
This allows:
Key takeaway
-
Pega does not change its attachment model
-
You are simply replacing the storage layer
-
The integration happens at the Repository API level
-
Metadata handling is your responsibility (extension point + data model)