Posted: 26 Oct 2020 18:14 EDT Last activity: 28 Oct 2020 18:30 EDT
How to save data page?
What is a good design pattern to save data from a data page into a concrete class on 7.2.2? It looks like in 7.4 and up Pega offers additional support in the form for flow shapes, flow action options, and a utility to save data page data but I'm on 7.2.2 for now.
I'm able to read my data declaratively by using the property setting "refers to a data page" and it works great. I also need to update this data. During my experimental phase of the project I've used an utility shape that calls obj-save. This works but I'll have to put this shape in a lot of places throughout my flows to handle all of the use cases. There are a lot of paths to consider and I can't just find a common place to call it once. I'd like to avoid creating more procedural code. Is there a way to do this declaratively? Can I use an on-change to trigger the save?
***Edited by Moderator: Pooja to change content type from Discussion to Question, update product version***
You are right as of Pega 7.2.2 there is no savable data page concept.
You can save the record using declarative rules, but you need to consider how concurrent hits would be handled.
For example you mentioned a declare on change, the on change depends on certain properties and if they change an onchange activity is invoked. Now if a page has these properties and they are changed. Pega will fire the onchange to update the data every time any of the fields change.
You will have to manually write the logic to update/delete/add the logic
You can use a declare index instead. That way the data is stored in a table with no blob columns. And Pega handles the transactional logic for you.
Adding utility to your flow will surely work but may impede build for change principles.