Diagram types

Intermediate

How to limit which kinds of elements a diagram may contain: create a diagram type, choose its allowed node types, and use it on new and existing diagrams.

A diagram type says which kinds of elements a diagram may contain. Use one when a diagram should stick to a set of node types. A typical case is an ArchiMate viewpoint, which allows only certain elements.

Diagrams without a type stay Unconstrained: any element can go on them, as before.

1. Create a diagram type

  1. In the Model Navigator, open Metamodel ▸ Diagram Types and click +.
  2. Give it a Name and, if you like, a Description.
  3. Key (optional): a fixed identifier that stays the same in every language and must be unique in the model, for example the name of an ArchiMate viewpoint.
  4. Under Allowed node types, tick the types this diagram may hold. The list shows your type hierarchy:
    • Allowing a type also allows all its subtypes. They are marked included via ….
    • Abstract types are marked abstract. Allowing one is a quick way to allow all its concrete subtypes.
    • Use Filter types… to find a type in a long list.

You can file diagram types in folders and sort them, like other metamodel elements. The editor also shows which diagrams use the type.

2. Create a diagram of a type

Right-click Views in the Model Navigator and choose New Diagram of Type "…", or use the same command in the diagram type's editor. The plain + still creates an unconstrained diagram.

3. Give an existing diagram a type

  1. Select the diagram and open its Properties.
  2. Choose a type under Diagram type.

If the diagram holds elements the new type doesn't allow, Metapad lists them first. Confirm removes them from this diagram and sets the type. The elements stay in your model. Cancel changes nothing.

Choose Unconstrained to take the type away again.

Working on a typed diagram

  • The diagram's tab shows its type as a badge next to the name.
  • The Toolbox offers only the allowed node types.
  • Dropping an element from the Model Navigator, creating one, or pasting one that isn't allowed is refused with a message. When you paste several elements, the allowed ones are added and Metapad tells you how many it skipped.

Changing or deleting a diagram type

  • If you remove an allowed node type that diagrams already use, Metapad lists the placements that would be removed and asks before it goes ahead.
  • Lock Diagram Type (in its context menu) protects it from accidental edits and deletion until you unlock it.
  • Deleting a diagram type doesn't delete any diagram. Its diagrams keep their content and become unconstrained again. Undo brings the type back.

This content was written collaboratively with AI.