Skip to main content

Relationship

In a schema file, a relationship can be defined inside a node, a generic or a node extension.

Summary

Below is the list of all available options to define a Relationship in the schema

NameTypeDescriptionMandatory
allow_overrideAttributeType of allowed override for the relationship.False
branchAttributeType of branch support for the relatioinship, if not defined it will be determine based both peers.False
cardinalityAttributeDefines how many objects are expected on the other side of the relationship.False
descriptionAttributeShort description of the relationship.False
directionAttributeDefines the direction of the relationship, Unidirectional relationship are required when the same model is on both side.False
hierarchicalAttributeInternal attribute to track the type of hierarchy this relationship is part of, must match a valid Generic KindFalse
identifierAttributeUnique identifier of the relationship within a model, identifiers must match to traverse a relationship on both direction.False
kindAttributeDefines the type of the relationship.True
labelAttributeHuman friendly representation of the name. Will be autogenerated if not providedFalse
max_countAttributeDefines the maximum objects allowed on the other side of the relationship.False
min_countAttributeDefines the minimum objects allowed on the other side of the relationship.False
nameAttributeRelationship name, must be unique within a model and must be all lowercase.True
on_deleteAttributeDefault is no-action. If cascade, related node(s) are deleted when this node is deleted.False
optionalAttributeIndicate if this relationship is mandatory or optional.False
order_weightAttributeNumber used to order the relationship in the frontend (table and view). Lowest value will be ordered first.False
peerAttributeType (kind) of objects supported on the other end of the relationship.True
read_onlyAttributeSet the relationship as read-only, users won't be able to change its value.False
stateAttributeExpected state of the relationship after loading the schemaFalse

Reference Guide

allow_override

KeyValue
Nameallow_override
KindText
DescriptionType of allowed override for the relationship.
OptionalTrue
Default Valueany
Constraints
Accepted Valuesnone any

branch

KeyValue
Namebranch
KindText
DescriptionType of branch support for the relatioinship, if not defined it will be determine based both peers.
OptionalTrue
Default Value
Constraints
Accepted Valuesaware agnostic local

cardinality

KeyValue
Namecardinality
KindText
DescriptionDefines how many objects are expected on the other side of the relationship.
OptionalTrue
Default Valuemany
Constraints
Accepted Valuesone many

description

KeyValue
Namedescription
KindText
DescriptionShort description of the relationship.
OptionalTrue
Default Value
ConstraintsLength: min -, max 128

direction

KeyValue
Namedirection
KindText
DescriptionDefines the direction of the relationship, Unidirectional relationship are required when the same model is on both side.
OptionalTrue
Default Valuebidirectional
Constraints
Accepted Valuesbidirectional outbound inbound

hierarchical

KeyValue
Namehierarchical
KindText
DescriptionInternal attribute to track the type of hierarchy this relationship is part of, must match a valid Generic Kind
OptionalTrue
Default Value
Constraints

identifier

KeyValue
Nameidentifier
KindText
DescriptionUnique identifier of the relationship within a model, identifiers must match to traverse a relationship on both direction.
OptionalTrue
Default Value
ConstraintsRegex: ^[a-z0-9\_]+$
Length: min -, max 128

inherited

KeyValue
Nameinherited
KindBoolean
DescriptionInternal value to indicate if the relationship was inherited from a Generic node.
OptionalTrue
Default ValueFalse
Constraints

kind

KeyValue
Namekind
KindText
DescriptionDefines the type of the relationship.
OptionalFalse
Default ValueGeneric
Constraints
Accepted ValuesGeneric Attribute Component Parent Group Hierarchy Profile

label

KeyValue
Namelabel
KindText
DescriptionHuman friendly representation of the name. Will be autogenerated if not provided
OptionalTrue
Default Value
ConstraintsLength: min -, max 32

max_count

KeyValue
Namemax_count
KindNumber
DescriptionDefines the maximum objects allowed on the other side of the relationship.
OptionalTrue
Default Value0
Constraints

min_count

KeyValue
Namemin_count
KindNumber
DescriptionDefines the minimum objects allowed on the other side of the relationship.
OptionalTrue
Default Value0
Constraints

name

KeyValue
Namename
KindText
DescriptionRelationship name, must be unique within a model and must be all lowercase.
OptionalFalse
Default Value
ConstraintsRegex: ^[a-z0-9\_]+$
Length: min 3, max 32

on_delete

KeyValue
Nameon_delete
KindText
DescriptionDefault is no-action. If cascade, related node(s) are deleted when this node is deleted.
OptionalTrue
Default Value
Constraints
Accepted Valuesno-action cascade

optional

KeyValue
Nameoptional
KindBoolean
DescriptionIndicate if this relationship is mandatory or optional.
OptionalTrue
Default ValueFalse
Constraints

order_weight

KeyValue
Nameorder_weight
KindNumber
DescriptionNumber used to order the relationship in the frontend (table and view). Lowest value will be ordered first.
OptionalTrue
Default Value
Constraints

peer

KeyValue
Namepeer
KindText
DescriptionType (kind) of objects supported on the other end of the relationship.
OptionalFalse
Default Value
ConstraintsRegex: ^[A-Z][a-zA-Z0-9]+$

read_only

KeyValue
Nameread_only
KindBoolean
DescriptionSet the relationship as read-only, users won't be able to change its value.
OptionalTrue
Default ValueFalse
Constraints

state

KeyValue
Namestate
KindText
DescriptionExpected state of the relationship after loading the schema
OptionalTrue
Default Valuepresent
Constraints
Accepted Valuespresent absent

node

KeyValue
Namenode
KindObject
Description