Model diagrams
This page explains how to work with model diagrams in the Application Builder.
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.
Diagrams may also be exposed to users of the applications via the model documentation. image::2024-07-16T07-42-23-684Z.png[]
The Model Diagram editor
The Model Diagram editor shows a graphical representation of a portion of the model or the entire model.
Using this editor, you can graphically create entities and references, and organize them as 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 on the diagram.
-
Select an automatic layout for the diagram and apply this layout by clicking the Auto Layout button.
-
Select the elements to show in the diagram (attributes, entities, labels or names, foreign attributes, etc.)
-
-
The Palette provides the following 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: 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. 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 references, 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:
-
Right-click the Diagrams node and select Add Diagram.
The Create New Diagram wizard opens. -
In the wizard, select the Auto Fill option and then enter the following values:
-
Name: internal name of the object.
-
Label: user-friendly label for this object. Since the Auto Fill checkbox is selected, the Label field is automatically filled in. Modifying this label is optional.
-
(Optional) In the Description field, enter a description for the diagram. This description is intended for model designers.
-
-
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:
-
In the Palette, select Add Entity.
-
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.
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:
-
In the Palette, select Add Reference.
-
Select the referencing entity in the diagram. Hold the mouse button down, and move the cursor to the referenced entity.
-
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:
-
In the diagram, select the entity or reference you want to delete.
-
Right-click and select Delete.
-
In the Confirm Delete dialog, click OK.
The reference or entity and 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:
-
In the Palette, select Add Existing Entity.
-
Click the diagram.
The Selection Needed dialog opens showing the list of entities in the diagram. -
Select the entities to add to the diagram.
-
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:
-
In the Palette, select Add Existing Reference.
-
Select the referencing entity in the diagram. Hold the mouse button down, and move the cursor to the referenced entity.
-
Release the mouse button.
The Selection Needed dialog opens. -
Select all the references that must be added to the diagram.
-
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 contain the related entities. |
To remove a shape from the diagram:
-
In the diagram, select the shape representing the entity of reference you want to delete.
-
Right-click and select Remove Shape.
The shape disappears from the diagram. The entity or reference is not deleted.