Exercise 1.8: Creating the Cash Check activity diagram

In this exercise, you create the Cash Check activity diagram.

The Cash Check activity diagram illustrates the flow of events that occurs when the PiggyBank teller cashes a customer’s check. When the teller accepts a check from the customer, the teller inputs the transaction information into the PiggyBank application. The CityBank system then processes the transaction to ensure that the account exists and that there is sufficient money in the account to perform the transaction. If the transaction succeeds, the customer account is credited and the CityBank account is debited. If the transaction fails, a message is displayed to the customer.

Creating the PiggyBank Teller activity

The Cash check activity diagram models the steps that occur when the teller cashes a check. This procedure describes how to create the Teller activity partition.

To create the PiggyBank teller activity:
  1. In the Model Explorer view, expand Account Operations, right-click the Cash check use case; then click Add diagram > Activity Diagram.
  2. Type Cash check 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 Teller. You have created the Teller activity partition.
  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 is the starting point for your activity diagram.
  7. In the Palette, double-click the Action element and name it Teller inputs required information.
  8. Click and drag the new action model element to 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 drag it to the Teller inputs required information action element.

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

The teller activity partition.

Creating the system activity

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. You have now created the System activity partition.
  3. In the Palette, double-click the Action element and name it Validates that credit account exists.
  4. Click and drag the Validates that credit account exists element to the System activity partition, directly to the right of the Teller inputs required information action.
  5. In the Palette, click the Control Flow element.
  6. In the diagram editor, click the Teller inputs required information and drag the cursor to the Validates that credit account exists action element.
  7. In the Palette, click Control Node and click Decision.
  8. Place the decision node below the Validates that credit account exists action element, and name the element Valid credit account?.
  9. In the Palette, click the Control Flow element.
  10. In the diagram editor, click the Validates that credit account exists element and drag the cursor to the decision element.
  11. In the Palette, double-click the Action element and name the element Credit account by check 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 Credit account by check amount action element.
  14. To set the guard text for the new relationship, in the Properties Explorer view, on the General page, type [ credit account exists ].
  15. In the Palette, double-click the Action element and name the element Display invalid account information.
  16. Place the element below and to the left of the decision element. These two action elements form the valid and invalid transaction workflows.
  17. In the Palette, click the Control Flow element and connect the decision node to the Display invalid account information action element.
  18. In the Palette, double-click the Action element and name the element Display transaction summary.
  19. Place the element below the Credit account by check amount action element.
  20. In the Palette, double-click the Action element and name the element Display dishonored check message.
  21. Place the element below the Display invalid account 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 account information, the Display transaction summary, and the Display dishonored check message action element to the Activity Node Final element.

You have now created the system activity partition. Your diagram should look similar to the following figure: The system activity partition.

Creating the CityBank Teller activity

This procedure describes how to create the CityBank teller activity partition.

To create the Citybank teller 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 CityBank teller. You have created the CityBank teller activity partition.
  3. In the Palette, double-click the Decision Node element and name it sufficient funds?.
  4. In the Palette, double-click the Action element and name the element Check OK to cash.
  5. Place the element below and to the right of the decision node, and connect the decision node to the Check OK to cash element by using a control flow element.
  6. To set the guard text for the new relationship, in the Properties view, on the General page, type [ issuing account balance > check amount ].
  7. In the Palette, double-click the Action element and name the element Do not cash check.
  8. Place the element below and to the left of the decision node, and connect the decision node to the Do not cash check action element.
  9. In the Palette, click the Control Flow element and connect the Check OK to cash action element to the Display transaction summary element.
  10. In the Palette, click the Control Flow element and connect the Do not cash check action element to the Display dishonored check element.

The Cash Check activity diagram uses three activity partitions and two decision nodes to show the simple workflows that occur when a PiggyBank teller cashes a check. Your diagram should look similar to the following figure:The PiggyBank Cash Check activity diagram.

You have now completed the PiggyBank use case model. You can continue to Module 2: Creating the analysis model.

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