Hello everyone!
I want to create a global acting boolean field in a domain model. This is used in a complex UI model. The boolean field is transient and a checkbox in the UI model. If it is active, all validation rules should become active; if it is not selected, the conditions are also ineffective. Important: The domain model includes other models with their own validation rules, which should also be affected by the selection of the new field.
Is this possible via configuration or do all conditions have to be adjusted? How do you have to deal with the included models that do not know the field in the surrounding model?
Rules in included models generally don’t have access to fields in including/surrounding models.
That means that your approach doesn’t work as you described.
Generally, if you want to keep following this approach you can think about the following:
All the document models have such a “global acting” field which works as a flag to enable/disable validation.
Whenever you include a document model, you have to add a computation rule that sets this field in the included model to the value of this field in the including model. I.e. the computation rules propagate the value into the include models.
Then you still need to prefix all validation rules with a condition on this respective field.
Thank you for your reply. I think this approach is correct and would work. But it seems complicated to me and makes it difficult to understand in large model structures. I implemented my use case by changing the UI and domain model.