ER diagram view definition
Overview
With Next Design, you can define an ER diagram view that can express model structures and relationships between models in a diagram format.
By specifying the following notation method in the ER diagram view definition, diagrams with various designs can be expressed.
- Shape: Shape for each entity
- Connector: Relationship line between entities
The following types of shapes are available:
Shape type | Description |
---|---|
Title Only Shape | A title is added inside the shape. |
Title and Description | A body containing the title and description of the shape is attached. |
With Label | Adds a title to the outside of the shape. |
Container | Can have related models as nested shapes. |
Compartment | You can display multiple fields that you specify within a shape. |
Port | Can be placed on the edge of a shape as a contact point for a connector. |
Child Shape | Allows related models to be nested shapes. |
There is only one type of connector. By changing the style of the connector, you can make it have polylines or arrows.
Below, we will explain how to define an ER diagram view in the following order:
- Define the shape
- Define the connector
Define the shape
add shapes
To add a shape to a diagram's view definition, from the model editor:
- For operating instructions, please refer to the following content:
[Quickstart > Profile Definition > Define Diagram View > Add Shapes for Each Entity](../../quick-start/profile-definition/define-diagram-view#define-diagram-view--add- shape-by-each-entities)
- Among the shape types, [Port] and [Child Shape] cannot be added unless a parent shape is selected. For details, see "Adding a child shape" below.
Change the shape type or shape
To change the type or shape of a shape that has been added to a view definition, do the following from the model editor:
- Select the shape you want to change on the view.
- To change the shape type, click Add Shape > Node > Change Shape Type from the ribbon and click a type from the choices.
- To change the shape of the shape, click Add Shape > Style > Change Shape from the ribbon and click a shape from the selection.
- In addition to the standard built-in shapes, you can also use your own images as shapes.
- For more information, see [How To > Profile Definition > View Definition > Display Images in Diagrams](../../../how-to/profile-definition/view-definition/use-images-in-diagrams .md).
- Extra labels (such as model name) may remain visible after changing the shape type. In that case, please delete unnecessary labels according to "Change shape labels" below.
Change the default style of shapes
There are two ways to change the style of a shape:
- Change the style of individual models displayed on the diagram
- Change the default style of shapes defined per entity as view definitions in diagrams
This section describes the latter procedure. For the former, please refer to Modeling > Model Edit > Edit ER Diagram.
To change a shape's default style or size:
- Select the shape you want to change on the view.
- Change the shape's default style using the following UI:
- Ribbon [Add Shape] > [Style] > [Change Shape], [Quick Style], [Fill Color], [Line Color], [Font Color]
- Inspector Shape Definition tab > Style > Diagram, Color, Border Thickness, Show metamodel icon
- Change the default size of the shape using one of the following methods:
- Resize the selected shape and click the [Add Shape] > [Size] > [Set Default Size from Selected Shape] button on the ribbon.
- Enter the width in the upper row and the height in the lower row of [Add Shape] > [Size] > [Default Size] on the ribbon.
- Enter values in the Inspector Shape Definition tab > Default Size > Width, Height.
- Changing the default size of a shape does not change the size of selected or existing shapes.
- Shapes added after changing the default size will be the default size.
Change an entity's icon
To change the icon of an entity displayed in the model navigator or toolbox, do the following from the Inspector:
- Click View > Pane > Inspector from the ribbon to display the inspector on the right side of the screen.
- Select the shape you want to change on the view.
- Select Metamodel from the tabs at the top of the inspector.
- Click Select under Class > Icon and choose an icon from the Select icon dialog.
Change a shape's label
To change the fields that appear on a shape's title or body, follow these steps:
- Select the shape you want to change on the view.
- To change the field that appears in the shape's title or body, select the field you want to display from the Add Shape > Text > Title or Body pull-down list on the ribbon.
- To change the text alignment of the shape title or body, select [Add Shape] > [Text] > [Title] or [Align Left], [Center], [Align Right] under [Body] on the ribbon. ] to switch.
To add or remove labels from a shape, from the Inspector:
- Click View > Pane > Inspector from the ribbon to display the inspector on the right side of the screen.
- Select the shape you want to change on the view.
- Select Shape Definition from the tabs at the top of the inspector.
- To add a label, click the + button below the Label list.
- Select [Fields] and [Layout] in the [New Label] dialog, enter the text when no value is set in [Hint Text], and press the [OK] button.
- To delete a label, select the relevant line from the [Label] list and click the [-] button below the list.
Delete a shape
To remove a shape from a diagram's view definition and return the shape corresponding to an entity to an undefined state, follow these steps:
- Select the shape you want to delete on the view.
- Click Add Shape > Add Shape > Delete from the ribbon.
- All relevant shapes will be deleted from the view, but the model will remain. Adding the shapes again will cause them to reappear on the view.
- When you remove a shape from the view definition of an ER diagram, the connectors leading to that shape are also removed from the view definition.
Add child shapes
To enable editing of related elements of a model as nested shapes in an ER diagram, do the following from the model editor:
- Select the shape you want to have a nested shape on the view.
- Add child shapes using one of the following methods:
- Click [Add Shape] > [Add Shape] > [Add Shape] from the ribbon and click [Child Shape] from the list of shapes.
- Click [Profile] > [Diagram] > [Add Shape] from the ribbon, and then click [Child Shape] from the list of shapes.
- In the [New Shape] dialog, select the field that holds the related model from the [Target Field] pull-down list, and press the [OK] button.
- You can now drag and drop entities that can be added as related elements from the [Tool Box] into the shape.
- If there are multiple types of entities that can be added as related elements, you must add a child shape for each entity.
add port
To be able to place related elements of a model as ports on the edge of a shape in an ER diagram, from the model editor, do the following:
- Select the shape that will have the port on the view.
- Add ports using one of the following methods:
- Click [Add Shape] > [Add Shape] > [Add Shape] from the ribbon, and then click [Port] from the list of shapes.
- Click [Profile] > [Diagram] > [Add Shape] from the ribbon, and then click [Port] from the list of shapes.
- In the New Port dialog, select the field that holds the related model from the Target Field pull-down list.
- Next, select a possible location for the port in [Display Location].
- Next, select the port shape in [Diagram] and press the [OK] button.
- You can now drag and drop entities that can be added as related elements from the [Tool Box] to the edge of the shape.
- If you want to provide an input port and an output port, define two relationships in the metamodel and then add a port for each of those relationships.
Change compartment partitions
If the shape type is Compartment, any field can be displayed in the compartment below the title. To add fields to display on a parcel:
- Select the shape you want to change on the view.
- Click Add Shape > Label > Add Compartment from the ribbon.
- In the [New Compartment] dialog, select the field to add from [Fields] and press the [OK] button.
To change the order of fields displayed in a pane or remove them from the pane to hide them, from the Inspector:
- Click View > Pane > Inspector from the ribbon to display the inspector on the right side of the screen.
- Select the compartmented shape you want to change on the view.
- Select Shape Definition from the tabs at the top of the inspector.
- Select a field listed in [Compartments] and use the [↑] and [↓] buttons below the list to change the order, and the [-] button to remove it from the compartment.
Define a connector
Add a connector
If your metamodel already defines reference relationships between entities, add a connector definition as in the next step.
[Quickstart > Profile Definition > Define Diagram View > Add connectors for reference relationships between entities](../../quick-start/profile-definition/define-diagram-view#define-diagram-view- -add-connector-for-references-between-entities)
To add a reference relationship between entities and a connector definition at the same time when the reference relationship between entities is undefined, follow these steps:
- Select the two models on the ER diagram by holding down the ctrl key and clicking them.
- From the ribbon, click Profile > Diagram > Add Connector, click ▼ at the bottom, and click Add Reference and Connector.
- In the New ConnectorShape dialog, check the Connection Source and Connection Target to determine the direction of the relationship.
- Next, select [Icon] and set the [Style] items.
- Click the [OK] button in the dialog to add reference relationships and connector definitions between entities to the metamodel, and to add relationship lines on the ER diagram.
Change the default style of a connector
Similar to changing the style of a shape, there are two ways to change the style of a connector:
- Change the style of individual association lines displayed on the ER diagram
- Change the default style of connectors defined for each association as a view definition in the ER diagram
This section describes the latter procedure. For the former, see Modeling > Edit Model > Edit ER Diagram.
To change the default style of a connector, follow these steps:
- Select the connector you want to modify on the view.
- Change the default style of the connector using the following UI:
- Ribbon [Add Connector] > [Style] > [Connection Source], [Connection Target], [Connection Form], [Quick Style], [Fill Color], [Line Color]
- Inspector Shape Definition tab > Style > Connection Source, Connection Target, Connection Form, Color, Border Thickness, Line Style, Show metamodel icon
Change the connector label
To add a label to a connector, follow these steps:
- Select the connector you want to modify on the view.
- Click Add Connector > Add Label from the ribbon.
- Select [Fields] and [Layout] in the [New Label] dialog, enter the text when no value is set in [Hint Text], and press the [OK] button.
- Edit the connector's field values in the Inspector's Property tab.
To change or remove a connector's label, from the Inspector:
- Click View > Pane > Inspector from the ribbon to display the inspector on the right side of the screen.
- Select the connector you want to modify on the view.
- Select Shape Definition from the tabs at the top of the inspector.
- To change the connector's label, point to the appropriate row listed under Label and click the Edit Label button that appears at the far right of the row.
- Change [Fields] and [Layout] in the [Setting - Label] dialog and press the [OK] button.
- To delete a connector label, select the line listed under Label and click the - button below the list.
Change connector settings
To change settings such as the orientation of a connector connection, follow these steps from the Inspector:
- Click View > Pane > Inspector from the ribbon to display the inspector on the right side of the screen.
- Select the connector you want to modify on the view.
- Select Shape Definition from the tabs at the top of the inspector.
- Change the settings in the [Add Shape] group.
- For more information about connector settings, see Reference > Profile settings and modeling changes.
Delete a connector
To remove a connector from a diagram's view definition and return the associated connector to an undefined state, follow these steps:
- Select the connector you want to delete on the view.
- Click Add Connector > Add Shape > Delete from the ribbon.
- All applicable connectors will be deleted from the view, but the relationship will remain as a model. Re-adding the connector will cause those relationships to reappear on the view.