Previous Topic: Introducing the Diagrammer

Next Topic: Defining Relationships with the Diagrammer

Creating a Diagram

You defined Project in the previous chapter, and Employee was already defined before you started. In the following steps, you create an entity-relations diagram. On the diagram, you create the Task entity, and specify the relationships between the different entities.

To create and open a diagram:

  1. If the Model Editor is not open, open it.
  2. Make sure the object type field is set to Entity, then add the following triple:

    Project described by Project Diagram

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

  3. Select the Project Diagram object in the Model Editor, and click the Editor toolbar button:

    Creating a Diagram (1)

    Creating a Diagram (2)

    The Diagrammer opens, with the Select Diagram Type dialog over it:

    Creating a Diagram (3)

  4. Select Entity Relations and click OK.
  5. If necessary, move the Diagrammer window so that the Object Browser does not overlap it.
  6. If the Object Browser is not displaying entities, click the Entities toolbar button.

    Creating a Diagram (8)

  7. Drag the Project and Employee entities from the Object Browser to the Diagrammer window.

    The Diagrammer window should look something like this:

    Creating a Diagram (5)

  8. Drag the Employee node down and to the right, so that it does not overlap the Project node.

    Next, you add the Task entity to the diagram.

  9. Right-click below the Project entity.
  10. From the pop-up menu, choose Create Node, and then Entity.

    CA Plex adds the new node at the point where you clicked the mouse.

    The New Node dialog appears:

    Creating a Diagram (6)

    Note that the title bar on the dialog says Entity. The title bar shows you the type of node you are defining.

  11. Enter Task, and click OK.
  12. Position the nodes (by dragging) so that the diagram looks something like this:

    Creating a Diagram (7)