About the validation graph
During database commit, PolicyCenter performs validation on the following items:
- Any validatable entity that PolicyCenter updated or inserted into the validation graph.
- Any validatable entity that refers to an entity that PolicyCenter updated, inserted, or removed from the validation graph.
PolicyCenter gathers the entities that reference a
changed entity into a virtual graph. This graph maps all the paths from
each type of entity to the top-level validatable entities like Account and ProducerCode. PolicyCenter queries
these paths in the database or in memory to determine which validatable
entities, if any, reference the entity that PolicyCenter inserted, updated, or
removed from the validation graph.
PolicyCenter determines the validation
graph by traversing the set of foreign keys and arrays that trigger validation.
For example, the data model marks the ProducerCodeRoles
array on ProducerCode
as triggering validation. Therefore, any changes made to a producer code
role causes PolicyCenter to validate
the producer code as well.
PolicyCenter follows foreign keys and
arrays that triggers validation through any links and arrays on the referenced
entities down the object tree. For example, you might end up with a path
like Policy → Contact → ContactAddress → Address.
Address, ContactAddress, and
Contact—as triggering validation and set Policy as
validatable.PolicyCenter stores this path in reverse
in the validation graph. Thus, if an address changes, PolicyCenter traverses
the tree in reverse order from address to contact address. It then moves
to the policy contact, and finally to policy (Address → ContactAddress → PolicyContact → Policy).
