How PolicyCenter works with owned arrays
In the PolicyCenter data model, an owned array
is an array that is attached to a validatable entity and which has its
triggersValidation attribute set to true. PolicyCenter treats owned arrays in a special fashion.
PolicyCenter performs validation based on the validation graph. If an entity changes,
PolicyCenter follows all the arrays and foreign keys that reference that entity and for
which triggersValidation="true". It then walks up the graph to find the
validatable entities that ultimately references the changed entity. In the case of owned
arrays, PolicyCenter considers any change to the array as
a change to the parent entity.
Consider the following data model:
- Entity A has a foreign key to B
- Entity B has an owned array of C
- Array C has a foreign key to D
A → B → C[] → D
Suppose that you also mark both A → B and C → D as triggering validation. What happens with the B → C link?
- If the B → C array has its
triggersValidationelement set tofalse, changes to C cause PolicyCenter to validate B and A. This is because PolicyCenter treats the change as a change to B directly. A change to D does not cause PolicyCenter to validate anything. The graph stops at C. Because C is not actually changed, PolicyCenter does not consider B to have changed, and performs no validation. - If the B → C link has its
triggersValidationelement set totrue, changes to either C or D cause PolicyCenter to validate both B and A.
