We have got an optional page property within a another page.
In the validation of the outer page we want to call a Validate rule for the inner page, but if the page doesn't exist we don't want to raise an error as this is allowed.
We Is there any way to get this to work? To call the Validate rule for the embedded page we have to specify the page property. At this point Pega seems to create the Page - which is not the desired behaviour.
**Moderation Team has archived post**
This post has been archived for educational purposes. Contents and links will no longer be updated. If you have the same/similar question, please write a new post.
Could you do it through input qualified validation?
Perhaps have a boolean property 'HasContactPage' that is managed via a declare expression and dependent on presence of the contact page. Then have input qalified valiidation calling the ValidateContact rule if HasContactPage is true.
If (as i suspect you are) you are already using input qualified validation in the ValidateApplication rule ...then I think you would need to create a third validation rule to sit between the two (e.g ValidateContactWrapper) . Then always call ValidateContactWrapper from VAlidateApplication but this will only call ValidateContact if HasContactPage is true.
So .. unless the Declare Expression 'also' triggers the page creation .. you should be OK.
Probably neater to stick with doing the test in the calling activity though :-)