Reference Relationships
In a reference relationship, one concept instance references another concept instance.
A concept that is the target of a reference can itself refer to one or more other concepts. Reference relationships are not, however, hierarchical.
The relationship is defined by a
ConceptReference
property in the referring concept.
See Containment and Reference Concept Relationship Rules for rules governing the behavior of concepts linked by containment or reference. The table also helps you to choose which is the appropriate type of relationship for your needs.
Reference Example: Order with SalesRep and Customer
To configure a concept
Order
to reference a concept
SalesRep
, you add a
ConceptReference
property,
Rep
for example, whose value is the ID of concept
SalesRep
. The
Rep
property provides the link between the referring and referenced concepts:
Order
(Concept) —Rep
(property) —SalesRep
(Concept)
You can also define additional reference relationships such as:
Order
(Concept) —BackupRep
(property) —SalesRep
(Concept)Order
(Concept) —Lines
(property array) —LineItem
(Concept)Order
(Concept) —Cust
(property) —Customer
(Concept)Customer
(Concept) —Orders
(property) —SalesRep
(Concept)
Reference Examples: Self Reference
A concept definition can have a reference relationship to itself. This is generally because the instances of one concept definition can have reference relationships to other instances of the same definition. For example:
- A
ListItem
concept has anext
property which is a reference to aListItem
concept. - A
Person
concept has aspouse
property which is a reference to aPerson
concept. - A
Person
concept has achildren
property which is an array of references to Person concepts.
When a Contained or Referred Concept Instance is Deleted
There is an important difference in behavior when history is tracked for an array property, and when history is not tracked, or the property is not an array.
Effect of deleting a contained or referenced concept:
ContainedConcept or ConceptReference Property | Effect of deleting a Contained or Referenced Concept: |
---|---|
Single value property, regardless of history setting. | The value of the
ContainedConcept or
ConceptReference property becomes null.
|
Multiple-value property (array), with History is set to 0 or 1 (historical values are not tracked). | The array entry that held the deleted concept is removed, reducing the array size by one.
Note: Delete higher position numbers before lower position numbers to ensure the correct entries are deleted. The array entry that held the deleted concept is removed, reducing the array size by one, and reducing by one the index of every entry in the array at a higher index than the deleted one. (When deleting multiple entries at once, delete higher position numbers before lower position numbers to ensure the correct entries are deleted.)
|
Multiple-value property (array), whose History is set to 2 or more (historical values are tracked). | The array entry that held the deleted concept remains and its value is set to null, so that history can be tracked. |