Model diagrams

Model diagrams

A Diagram is a graphical representation of a portion of the model or the entire model.
Using the Diagram, not only can you make a model more readable, but you can also create entities and references in a graphical manner, and organize them as graphical shapes.

Diagram may also be exposed to users of the applications via the model documentation.

The model diagram editor

The Model Diagram Editor shows a graphical representation of a portion of the model or the entire model.
Using this diagram, you can create entities and references in a graphical manner, and organize them as graphical shapes.

The diagram is organized in the following way:

  • The Diagram shows shapes representing entities and references.

  • The Toolbar allows you:

    • to zoom in and out in the diagram.

    • to select an automatic layout for the diagram and apply this layout by clicking the Auto Layout button.

    • to select the elements to show in the diagram (attributes, entities, labels or names, foreign attributes, etc.)

  • The Palette provides a set of tools:

    • Select allows you to select, move and organize shapes in the diagram. This selection tool allows multiple selection (hold Shift or Control, or Command on macOS).

    • Add Reference and Add Entity tools allow you to create objects.

    • Add Existing Entities allows you to create shapes for existing entities.

After choosing a tool in the palette, the cursor changes. Click the Diagram to use the tool. Note that after using an Add… tool, the tool selection reverts to Select.

It is important to understand that a diagram only displays shapes which are graphical representations of the entities and references. These shapes are not the real entities and reference, but graphical artifacts in the diagram:

  • When you double click on a shape from the diagram, you access the actual entity or reference via the shape representing it.

  • It is possible to remove a shape from the diagram without deleting the entity or reference.

  • You can have multiple shapes representing the same entity in a diagram. This is typically used for readability reasons. All these shapes point to the same entity.

  • If you delete an entity or reference, the shapes representing it automatically disappear from the diagrams.

Create diagrams

To create a diagram:

  1. Right-click the Diagrams node and select Add Diagram…. The Create New Diagram wizard opens.

  2. In the Create New Diagram wizard, check the Auto Fill option and then enter the following values:

    • Name: Internal name of the object.

    • Label: User-friendly label for this object. Note that as the Auto Fill box is checked, the Label is automatically filled in. Modifying this label is optional.

    • In the Description field, optionally enter a description for the Diagram. This description is intended for model designers.

  3. Click Finish to close the wizard. The Diagram editor opens.

    • In the Overview tab, you can change the Label and select an Icon for the diagram. Both appear in the model documentation, if you choose to expose the diagram in your application.

    • In the Diagram tab, you can work with entities and references using the diagram.

Work with diagrams

Work with entities and references

This section explains how to create and delete entities and references using the diagram.

To create an entity using the diagram:

  1. In the Palette, select Add Entity.

  2. Click the diagram. The Create New Entity wizard opens.
    Follow the entity creation procedure.

The entity is created and a shape corresponding to this entity is added to the diagram.
Note that you can also create, edit and delete attributes from the diagram. To do so, select an attribute or entity and use the context menu options.

To create a reference using the diagram:

  1. In the Palette, select Add Reference.

  2. Select the referencing entity in the diagram. Keep the mouse button pressed, and move the cursor to the referenced entity.

  3. Release the mouse button. The Create New Reference wizard opens. It is pre-filled based on the two entities.
    Follow the reference relationship creation procedure.

The reference is created and a shape corresponding to this reference is added to the diagram.

To delete a reference or an entity from the diagram:

  1. In the diagram, select the entity or reference you want to delete.

  2. Right-click and select Delete.

  3. Click OK in the Confirm Delete dialog.

The reference or entity, as well as the shape in the diagram disappear.

Deleting an entity or reference cannot be undone.

Work with shapes

This section explains how to create and delete shapes in the diagram without changing the underlying entities and references.

To add existing entities to the diagram:

  1. In the Palette, select Add Existing Entity.

  2. Click the diagram. The Selection Needed dialog opens showing the list of entities in the diagram.

  3. Select the entities to add to the diagram.

  4. Click OK. The shapes for the selected entities are added to the diagram.

You can repeat this operation if you want to add multiple shapes for an entity in the diagram.

To add existing references to the diagram:

  1. In the Palette, select Add Existing Reference.

  2. Select the referencing entity in the diagram. Keep the mouse button pressed, and move the cursor to the referenced entity.

  3. Release the mouse button. The Selection Needed dialog opens.

  4. Select all the references that must be added to the diagram.

  5. Click OK.

You can also add existing references by selecting Add Existing Reference from the entity contextual menu in the diagram.
When a new reference is added to the model from the Model Design View, it is automatically added to all diagrams that contains the related entities.

To remove a shape from the diagram:

  1. In the diagram, select the shape representing the entity of reference you want to delete.

  2. Right-click and select Remove Shape.

The shape disappears from the diagram. The entity or reference is not deleted.