Step 3: Adding Messages
To draw the first message, use the Line tool to draw a straight horizontal line extending from the upper-right of the Controller participant's activation box to the Employee participant's. Select the Text tool (the button shows the letter T), double-click a blank spot in the canvas, and type changeme as the temporary message. Select the text object and position it as shown in Figure 9. Use the snap guides that appear for guidance.
Figure 9 Drawing the first message.
The new text is automatically centered, but it would look better left-aligned in our diagram. Select the text and click the left-alignment option in drop-down list of alignment options, as shown in Figure 10. When the alignment is complete, group the line and text into one object.
Figure 10 Aligning text.
Trace the diagram's execution sequence by copying the message and strategically pasting placeholder copies across the canvas between participants as shown in Figure 11. Select all the messages, right-click a blank spot on the canvas, and choose Distribute > Vertically. The messages are now spaced evenly, as shown in Figure 12.
Figure 11 Message placeholders laid out strategically between participants.
Figure 12 Distribute vertical space between messages.
In a sequence diagram, steps are ordered from the top down. The execution sequence we want is new, save, and insert, followed by a return. Ungroup each message and replace each "changeme" with the actual name of the message. (Delete the "changeme" text for the returns, as those are usually unlabeled.)
Add right-pointing arrowheads to the top three messages by selecting all three lines, clicking the Right-Arrow tool, and selecting the arrowhead shown in Figure 13. Use the Left-Arrow tool on the last message to give it a left-pointing arrowhead; then change its solid line to a dashed line by using the Dashes tool (located to the left of the Left-Arrow tool on the toolbar).
Figure 13 Giving messages direction.
At this stage, all we have yet to do is adjusting activations and cleaning up lifelines.