How to define owned element types
Owned elements (subordinates) are elements that live inside a parent element and render in a compartment on diagrams — like attributes inside an entity.
1. Create the owned element type
Section titled “1. Create the owned element type”- In your M2 metamodel’s element type layer, create a new element type (e.g., “Attribute”)
- In its Properties, open Subordination and tick Is Subordinate. Elements of this type are then created inside an element of another type, not from the Palette, and the heading reads Subordination · subordinate
- Add properties to it (e.g., “Data Type” as an enumeration, “Is Required” as Boolean)
- Configure basic notation (fill colour, icon)
2. Configure the parent to accept owned elements
Section titled “2. Configure the parent to accept owned elements”- Select the parent element type (e.g., “Entity”)
- In the Properties panel, open Subordination. Under Subordinate Types, click + Add Subordinate Type. The button is available once at least one type in the metamodel is marked Is Subordinate
- Fill in the entry:
- ID — a unique identifier (e.g., “attributes”)
- Label — display name (e.g., “Attributes”)
- Classifier — the owned element type (e.g., “Attribute”)
- Display template — how each owned element renders (e.g.,
{name} : {Data Type})
3. Show them on diagram nodes
Section titled “3. Show them on diagram nodes”Each entry under Subordinate Types has a tick box, Show on diagram nodes. Tick it, and the parent’s nodes gain a compartment that lists its owned elements of that type, headed by the entry’s Label. Untick it to take the compartment away again; the owned elements stay in the model.
While it is ticked, Auto-adjust node height makes each node grow to fit its list. It is on when you first tick Show on diagram nodes.
4. Create owned elements at M1
Section titled “4. Create owned elements at M1”- In the Explorer, right-click an M1 element of the parent type
- Choose Add Attribute… (the menu names each subordinate type the parent accepts)
- Name the new element, then fill in its properties in the Properties panel
The owned element appears inside the parent’s compartment on diagrams.
Display template syntax
Section titled “Display template syntax”| Template | Example output |
|---|---|
{name} |
email |
{name} : {Data Type} |
email : String |
{name}{Is Required? [*]:} |
email* (if required) or email (if not) |