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”)
- Add properties to it (e.g., “Data Type” as an enumeration, “Is Required” as Boolean)
- Configure basic notation (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, find the Notation > Subordinate Types section
- Add a subordinate type 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. Add a compartment
Section titled “3. Add a compartment”Still on the parent element type’s notation, add a compartment:
- Add a new compartment entry
- Set content type to
subordinates - Set subordinate type ID to the ID you defined above
- Set label and show label as desired
4. Create owned elements at M1
Section titled “4. Create owned elements at M1”- Select an M1 instance of the parent type
- Right-click > New Owned Element (or similar)
- Choose the subordinate type
- Name the element and fill in its properties
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) |