Exercise 1.7: Creating the Transfer Money activity diagram

In this exercise, you create the Transfer Money activity diagram.

The Transfer Money activity diagram describes the workflow that occurs when either the customer or the teller clicks Transfer Money on the main menu. The CityBank system processes the transaction to determine whether or not the accounts exist and whether or not the amount of money is less than 100 dollars, because a limit exists for how much money can be transferred in a single transaction. The CityBank system either completes the transaction or displays an invalid transaction message if the transaction is rejected.

Creating the Customer/Teller activity

The Transfer Money activity diagram models the steps that occur when the user clicks the Transfer Money 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 Transfer Money then click Add diagram > Activity Diagram.
  2. Type Transfer Money 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 element is the starting point for your activity diagram.
  7. In the Palette, double-click the Action element and type Customer/Teller selects Transfer Money from menu.
  8. Click and drag the new action model 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 Customer/Teller selects Transfer money 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 Customer/Teller activity partition of the Transfer Money activity diagram.

Creating the System activity

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

To create the System activity partition:
  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 type Validates accounts exist and transfer amount is < current balance.
  4. Click and drag the Display accounts with balance element in the System activity partition, directly to the right of the Customer/Teller selects transfer money from menu action.
  5. In the Palette, click the Control Flow element.
  6. In the diagram editor, click the Customer/Teller selects transfer money from menu and drag the cursor to the Validates accounts exist and transfer amount is < current balance action element.
  7. In the Palette, click Control Node and click Decision.
  8. Place the decision node below the Validate accounts exist and transfer amount is < current balance action element.
  9. In the Palette, click the Control Flow element.
  10. In the diagram editor, click Validate accounts exist and transfer amount is < current balance and drag the cursor to the decision element.
  11. In the Palette, double-click the Action element and name it Debit Customer account and Credit customer account by transit amount.
  12. Place the element below and to the right of the decision element.
  13. In the Palette, click the Control Flow element and connect the decision node to the Debit Customer account action element.
  14. To set the guard text for the new relationship, in the Properties Explorer view, on the General page, type [ amount < current balance ].
  15. In the Palette, double-click the Action element and name it Display invalid transaction method.
  16. Place the element below and to the left of the decision element.
  17. In the Palette, click the Control Flow element and connect the decision node to the Display invalid account action element.
  18. In the Palette, click the Control Flow element and connect the Display invalid action element to the Customer/Teller selects action element.
  19. In the Palette, double-click the Action element and name it Display transfer summary.
  20. Place the element below the Debit Customer account action element.
  21. In the Palette, click the Control Flow element and connect the Debit Customer account action element to the Display transfer summary action element.
  22. Click and drag the Activity Node Final element to the bottom of the diagram editor, in the System activity partition. This is the end point of your activity diagram.
  23. In the Palette, click the Control Flow element and connect the Display invalid transaction and the Display transfer sumary action element to the Activity Node Final element.

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

The CityBank activity partition.

The Transfer Money activity diagram has two activity partitions and a decision node that show the simple workflows that occur when the user selects Transfer Money from the main menu.

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