Skip to content

Basics: Editing the metamodel

Damiano Di Vincenzo edited this page Apr 26, 2021 · 5 revisions

Tutorial video

Tutorial video
Link

Creating or importing a whole model

By default you start with either with an empty meta-model or with your last openend meta-model.
You can import one or create an empty meta-model through the topbar (Metamodel -> Import -> Model -> ...)
importing model through topbar

Creating a classifier

On the left sidebar you can create a classifier (class or enumeration) by clicking their label.
You will see the result in the graph at coordinates {x: 0, y:0}

Inserting features (method 1)

Once a classifier is made hover on it to display a row with some commands, then choose a feature to add using the context-menu or confirm the pre-selected one using the "go" button.
vertex hover bar

Accessing the contextmenu of a classifier

This is a pre-requirement to many operations.
Hover on a classifier inside the graph to display a button with ... and click it, or right click the heading of the classifier.
This will open a context-menu that allows to edit the classifier.
context-menu vertex

Inserting features (method 2)

First you need to open the context-menu of the classifier Then go to Insert feature and choose the kind of sub-element you want to insert as a feature.

Accessing the contextmenu of a feature

It can be accessed by right-clicking the feature graphical notation inside the graph or through the related button labeled with ... that appear while hovering on the feature.

Example by right-clicking
feature removing by rightclick

Example by ... button
feature removing by button

Context-menu general remarks

While opening it through right-clicking, the item referred by the menù is always to foremost in DOM order. If there is a vertex, semantically bound to a classifier, containing some DOM nodes semantically bound to an operation owned by the classifier, containing DOM nodes semantically bound to a parameter, by right-clicking something inside that parameter the context-menù will refer to the parameter, since it is the foremost logical element found.
If the rightclick is on the return value of the operation, which is not a parameter but part of the operation, the context-menù will refer to the operation.
If the rightclick is on the class heading, which is not semantically bound to any feature, the context-menù will refer to the whole classifier.
Firefox has a bug with svg that might cause to render the menu incorrectly while clicking on the ... button, so while using firefox is strongly advised to right-click instead since this method is not affected by that bug.

Removing or reordering features

Through the context-menu of a feature

Changing type to a feature

This option is not yet present in context-menù, but there is a dropdown menù where you can choose the new type.

For attributes (M2 only)

Warning: if the class have M1-instances the values of that attribute on those instances might change to conform to the new type.
attribute change type

For references (M2 only)

For references is the same, but the options are filled with classes defined by the user instead of being static like the primitive type.
attribute change type
Warning: if the class have M1-instances with references linked, the M1-links that are now invalid will be deleted.
Mind that changing the reference type to a super-class of the current reference type will never cause invalid M1-links due to inheritance, so it will never delete links.

For reference in M1 or alternative mode for M2

When a reference holds a value that is pointing to some targets, an edge on the graph is generated.
M2-References always have exactly 1 edge pointing to a class, M1-References can have 0-N edges pointing to 0-N objects.
To change a value pointed by the reference (or his type if we are in M1), you can do the following:

  1. Select the edge you want to change with a single click and release.

  2. Single-click (or hold) on the dot appearing on the end extremity of the edge as highlighted by the image (if you take the source side it won't do anything)
    change edge 1
    change edge 2

  3. Single-click (or hold) on the new reference target (a M2-class or a valid object)
    If the target is valid, a green outline will appear, if the target is invalid the outline will be red.
    In M2 any class is a valid target, in M1 a target is valid if it is instance of the reference type defined in M2 or instance of one of his subclasses.
    change edge 3

Extending a class

Exactly like changing a reference target in m1

Deleting a reference value or a extend relationship

  1. Select the edge you want to change with a single click and release.
  2. Press your DEL or CANC key

Clone this wiki locally