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
Name | Type | Description | Mandatory |
---|---|---|---|
allow_override | Attribute | Type of allowed override for the relationship. | False |
branch | Attribute | Type of branch support for the relatioinship, if not defined it will be determine based both peers. | False |
cardinality | Attribute | Defines how many objects are expected on the other side of the relationship. | False |
deprecation | Attribute | Mark relationship as deprecated and provide a user-friendly message to display | False |
description | Attribute | Short description of the relationship. | False |
direction | Attribute | Defines the direction of the relationship, Unidirectional relationship are required when the same model is on both side. | False |
hierarchical | Attribute | Internal attribute to track the type of hierarchy this relationship is part of, must match a valid Generic Kind | False |
identifier | Attribute | Unique identifier of the relationship within a model, identifiers must match to traverse a relationship on both direction. | False |
kind | Attribute | Defines the type of the relationship. | True |
label | Attribute | Human friendly representation of the name. Will be autogenerated if not provided | False |
max_count | Attribute | Defines the maximum objects allowed on the other side of the relationship. | False |
min_count | Attribute | Defines the minimum objects allowed on the other side of the relationship. | False |
name | Attribute | Relationship name, must be unique within a model and must be all lowercase. | True |
on_delete | Attribute | Default is no-action. If cascade, related node(s) are deleted when this node is deleted. | False |
optional | Attribute | Indicate if this relationship is mandatory or optional. | False |
order_weight | Attribute | Number used to order the relationship in the frontend (table and view). Lowest value will be ordered first. | False |
peer | Attribute | Type (kind) of objects supported on the other end of the relationship. | True |
read_only | Attribute | Set the relationship as read-only, users won't be able to change its value. | False |
state | Attribute | Expected state of the relationship after loading the schema | False |
Reference Guide
allow_override
Key | Value |
---|---|
Name | allow_override |
Kind | Text |
Description | Type of allowed override for the relationship. |
Optional | True |
Default Value | any |
Constraints | |
Accepted Values | none any |
branch
Key | Value |
---|---|
Name | branch |
Kind | Text |
Description | Type of branch support for the relatioinship, if not defined it will be determine based both peers. |
Optional | True |
Default Value | |
Constraints | |
Accepted Values | aware agnostic local |
cardinality
Key | Value |
---|---|
Name | cardinality |
Kind | Text |
Description | Defines how many objects are expected on the other side of the relationship. |
Optional | True |
Default Value | many |
Constraints | |
Accepted Values | one many |
deprecation
Key | Value |
---|---|
Name | deprecation |
Kind | Text |
Description | Mark relationship as deprecated and provide a user-friendly message to display |
Optional | True |
Default Value | |
Constraints | Length: min -, max 128 |
description
Key | Value |
---|---|
Name | description |
Kind | Text |
Description | Short description of the relationship. |
Optional | True |
Default Value | |
Constraints | Length: min -, max 128 |
direction
Key | Value |
---|---|
Name | direction |
Kind | Text |
Description | Defines the direction of the relationship, Unidirectional relationship are required when the same model is on both side. |
Optional | True |
Default Value | bidirectional |
Constraints | |
Accepted Values | bidirectional outbound inbound |
hierarchical
Key | Value |
---|---|
Name | hierarchical |
Kind | Text |
Description | Internal attribute to track the type of hierarchy this relationship is part of, must match a valid Generic Kind |
Optional | True |
Default Value | |
Constraints |
identifier
Key | Value |
---|---|
Name | identifier |
Kind | Text |
Description | Unique identifier of the relationship within a model, identifiers must match to traverse a relationship on both direction. |
Optional | True |
Default Value | |
Constraints | Regex: ^[a-z0-9\_]+$ Length: min -, max 128 |
inherited
Key | Value |
---|---|
Name | inherited |
Kind | Boolean |
Description | Internal value to indicate if the relationship was inherited from a Generic node. |
Optional | True |
Default Value | False |
Constraints |
kind
Key | Value |
---|---|
Name | kind |
Kind | Text |
Description | Defines the type of the relationship. |
Optional | False |
Default Value | Generic |
Constraints | |
Accepted Values | Generic Attribute Component Parent Group Hierarchy Profile |
label
Key | Value |
---|---|
Name | label |
Kind | Text |
Description | Human friendly representation of the name. Will be autogenerated if not provided |
Optional | True |
Default Value | |
Constraints | Length: min -, max 32 |
max_count
Key | Value |
---|---|
Name | max_count |
Kind | Number |
Description | Defines the maximum objects allowed on the other side of the relationship. |
Optional | True |
Default Value | 0 |
Constraints |
min_count
Key | Value |
---|---|
Name | min_count |
Kind | Number |
Description | Defines the minimum objects allowed on the other side of the relationship. |
Optional | True |
Default Value | 0 |
Constraints |
name
Key | Value |
---|---|
Name | name |
Kind | Text |
Description | Relationship name, must be unique within a model and must be all lowercase. |
Optional | False |
Default Value | |
Constraints | Regex: ^[a-z0-9\_]+$ Length: min 3, max 32 |
on_delete
Key | Value |
---|---|
Name | on_delete |
Kind | Text |
Description | Default is no-action. If cascade, related node(s) are deleted when this node is deleted. |
Optional | True |
Default Value | |
Constraints | |
Accepted Values | no-action cascade |
optional
Key | Value |
---|---|
Name | optional |
Kind | Boolean |
Description | Indicate if this relationship is mandatory or optional. |
Optional | True |
Default Value | False |
Constraints |
order_weight
Key | Value |
---|---|
Name | order_weight |
Kind | Number |
Description | Number used to order the relationship in the frontend (table and view). Lowest value will be ordered first. |
Optional | True |
Default Value | |
Constraints |
peer
Key | Value |
---|---|
Name | peer |
Kind | Text |
Description | Type (kind) of objects supported on the other end of the relationship. |
Optional | False |
Default Value | |
Constraints | Regex: ^[A-Z][a-zA-Z0-9]+$ |
read_only
Key | Value |
---|---|
Name | read_only |
Kind | Boolean |
Description | Set the relationship as read-only, users won't be able to change its value. |
Optional | True |
Default Value | False |
Constraints |
state
Key | Value |
---|---|
Name | state |
Kind | Text |
Description | Expected state of the relationship after loading the schema |
Optional | True |
Default Value | present |
Constraints | |
Accepted Values | present absent |
node
Key | Value |
---|---|
Name | node |
Kind | Object |
Description |