I have a page list and in Flow Action, on Validate tab, I check this list.
Validation rule checks if any of list items have property .Approved != false. If it's false - show error message. Pega shows messages for each failed validation (if in my list 4 failed items, it shows me 4 same messages). Also, I can't set flag "Continue validation" to false, because it's disabled.
Validation schema(simplified): Flow Action -> Validate -> IsAllItemsApproved (for each Item in ItemsList call IsItemApproved) ->IsItemApproved (.Approved != false).
So, question is: how to show single error message if any of validation fails?
Solution given by Dileep_Incessant is better in terms of performance, as you will only pass the parameters to the existing functions instead of creating the new rules like activity. Also, you don't have to iterate on the pagelist and call the Obj-Validate. Say your list grows to a higher number of items, then iteration will take that longer, but the function will still take lesser time.
I have used both the functions mentioned by Dileep in my applications, though for a different scenario, and they work very well.
Moreover, the functions are still going to be called from the single validation rule, so it is a better option.