Exercise 1.6: Creating the Display Balance activity diagram

In this exercise, you create the Display Balance activity diagram. The display balance activity diagram shows the internal flow of events when a customer or teller displays the balance of an account.

Use case diagrams show behaviors, and identify the actors and functions of a system, but they do not show any temporal information such as workflows or processes. Activity diagrams are the UML equivalent of a flowchart, as they show the temporal order of events in a larger process. An activity diagram describes the flow of events that occur in a use case.

The Display Balance activity diagram describes the workflow of displaying the balance in a given account. The customer and the teller can both perform this task. The CityBank actor, which is really a system, validates the transaction.

Creating the Customer/Teller activity

The Display Balance activity diagram models the steps that occur when the user clicks the Display Balance item on the main menu. This procedure describes how to create the Customer/Teller activity partition.

To create the Customer/Teller activity:
  1. In the Model Explorer view, expand Account Operations, right-click Display Balance then click Add diagram > Activity Diagram.
  2. Type Display Balance activity diagram and press Enter.
  3. In the diagram editor, right-click outside the diagram then click Add UML > Activity Partition.
  4. In the Model Explorer view, click the Partition element, and in the Properties view, type the name Customer/Teller.
  5. In the Palette, double-click the Initial element and name it Initial node.
  6. Click and drag the initial node element to the top left corner of the diagram editor. This node is the starting point for your activity diagram.
  7. In the Palette, double-click the Action element and type Customer/Teller selects Display Balance from menu.
  8. Click and drag the action element directly below the initial node.
  9. In the Palette, click the Control Flow element.
  10. In the diagram editor, place the cursor over the Initial Node element and click and drag it to the Customer/Teller selects Display balance from menu action element.

You have now modeled the workflow of the Customer/Teller activity. Your diagram should look similar to the following figure:

The Initial Node and Customer/Teller selects Display Balance from menu action element.

Creating the System activity

The Display Balance activity diagram models the steps that occur when the user clicks the Display Balance item on the main menu. This procedure describes how to create the System activity partition.

To create the System activity:
  1. In the diagram editor, right-click outside the diagram, then click Add UML > Activity Partition.
  2. In the Model Explorer view, click the Partition element and, in the Properties view, type the name System.
  3. In the Palette, double-click the Action element and name it Display accounts with balance.
  4. Click and drag the Display accounts with balance element to a position in the System activity partition.
  5. In the Palette, double-click the Activity Final element and name it Activity Final Node.
  6. Click and drag the Activity Final Node element to the bottom right corner of the diagram, in the System activity partition. This element is the end point of your activity diagram.
  7. In the Palette, click the Control Flow element.
  8. In the Diagram editor, place the cursor over the Display accounts with balance element and click and drag it to Activity Final Node element.
  9. In the Palette, click the Control Flow element.
  10. In the diagram editor, place the cursor over the Display accounts with balance element and click and drag it to Customer/Teller selects Display balance from menu action element.

You have now created the Display Balance activity diagram. Your diagram should look similar to the following figure:

The complete Display Balance activity diagram.

The Display Balance activity diagram uses two activity partitions to show the simple workflows that occur when the user clicks Display Balance from the main menu.

Terms of use | Feedback
(C) Copyright IBM Corporation 2004, 2005. All Rights Reserved.