Previous Topic: Choosing Between Editors

Next Topic: Defining Entities with the Diagrammer

Creating a Diagram

CA Plex supports many types of diagrams (including diagram types that you can make yourself), but this tutorial only shows you how to create an Entity Attributes diagram.

In the diagram you create in this chapter, you:

To create an Entity Attributes diagram

  1. Open the Model Editor.
  2. Enter the following triple:

    Project described by Project Diagram

    This creates the diagram object. Remember, you can drag the Project entity from the Object Browser to the Model Editor, rather than typing it in manually.

    PLEX--Creating a Diagram (1)

  3. In the Object Browser, select Diagram from the object type list.
  4. Select Project Diagram from the list, and click the Editor button on the Object Browser.

    The diagram opens with the Select Diagram Type dialog on top:

    PLEX--Creating a Diagram (2)

  5. Select Entity Attributes and click OK.

    You can now work in the diagram you just created. A diagram is like a canvas, on which you put nodes, sub-nodes, and links between nodes, to represent your data model.

    PLEX--Creating a Diagram (7)

  6. In the Object Browser, click the Entity button to display entities.
  7. Drag the Project entity from the Object Browser to the upper-left corner of the diagram.

    Notice that the diagram creates a node for the Project entity. Also notice that it has an asterisk (*) after the name:

    PLEX--Creating a Diagram (4)

    The asterisk indicates that the object has attributes that the diagram can show.

    Next, you will change a diagram setting so that it shows the attributes of all entities represented by it.

  8. From the Layout menu, choose Always Show Sub-Nodes.

    PLEX--Creating a Diagram (8)

  9. Click the Refresh button.

    The diagram now displays the attributes you defined for the Project entity in the chapter “Defining Entities.”

    PLEX--Creating a Diagram (6)

    Notice that the node automatically resized to show all of its attributes.

    The Project ID sub‑node has a lighter color to indicate that it is a key. You will see later in this chapter how the Diagrammer uses display characteristics to indicate foreign keys and other special attributes.