Data Page Error Handling: Saving a Savable Data Page [LSA Data Excellence]
How should errors be handled when saving a Savable Data Page according to its Save Plan?
Errors encountered from non-Activity based Save options are published as "messages" on the Data Page. Should you use an Activity as your Save Plan, emulate this pattern.
Save Data Page actions configured in Flow Action Post-Processing publish messages on the Savable Data Page instances whose Save operations fail. These are propagated to the messages of the work page before control proceeds to the Post Processing Data Transform and/or Activity. The messages on the work page can be inspected to understand if errors have occurred from any of the Save operations.
If retained, these work page messages added by failed Save operations from Savable Data Pages will be sufficient to prevent the Flow Action from completing, triggering the normal Pega behavior to cancel deferred saves and revert control back to the current assignment. Depending on the number of Systems of Record involved, compensating actions may need to be performed in Post Processing if the data integrity across these systems has been violated by a mixture of successful and failed operations. See also the LSA Data Excellence Q&A for Savable Data Pages.
Save Data Page automations used in Flow rules to save Savable Data Pages will trigger the ProblemFlow activity for the Case Type (inheriting a default implementation that starts a FlowProblems flow) if the Save operation fails. This may be useful if the save failure can only be resolved by a specialist team needing a Case Management task to be assigned.
When procedurally calling the Save-DataPage method in an Activity, test pxDataPageHasErrors in the "Jump" configuration of the Save-DataPage step, ensuring the Data Page (or the relevant auto-populate property) is also referenced as the Step Page.
Discussion on this topic was sought from the LSA Data Excellence (Pega 8.4) webinar conducted in July 2020. The webinar and its full set of discussions that arose from it are available at LSA Data Excellence: Webinar, Questions & Answers.