< Previous | Next >

Lesson 1.7: Create the Cash Check activity diagram

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

About this task

The Cash Check activity diagram shows 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 banking application. The CityBank system then processes the transaction to ensure that the account exists and that sufficient money exists 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.

Create the Teller activity partition

The Teller activity partition separates the actions that the teller performs from the actions that other participants in the activity diagram perform. The teller initiates the activity by entering the required information in the banking application.

Procedure

  1. In the Project 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. Right-click in the diagram editor; then click Add UML > Partition.
  4. In the Project Explorer view, click the Partition element and, in the Properties view, type the name Teller. You created the Teller activity partition.
  5. In the Palette, double-click Initial and name the element Initial node.
  6. In the diagram editor, click the Initial node element and drag it to the top-left corner of the editor. This is the starting point of your activity diagram.
  7. In the Palette, double-click the Action element and name it Teller inputs required information.
  8. Click the Teller inputs required information action and drag it directly below the initial node.
  9. In the Palette, click Flow.
  10. In the diagram editor, click the Initial node element and drag the cursor to the Teller inputs required information action.

Results

You created the partition and workflow for the teller. Your diagram should look similar to the following figure:

Teller activity partition.

Create the System activity partition

About this task

The System activity partition separates the actions that the system performs from the actions that the teller performs in the activity diagram.

To create the System activity partition:

Procedure

  1. Right-click in the diagram editor; then click Add UML > Partition.
  2. In the Project Explorer view, click the Partition element and, in the Properties view, type the name System. You created the System activity partition.
  3. In the Palette, double-click Action and name the action Validates that credit account exists.
  4. Click the Validates that credit account exists action and drag it into the System activity partition, directly to the right of the Teller inputs required information action.
  5. In the Palette, click Flow.
  6. In the diagram editor, click the Teller inputs required information action and drag the cursor to the Validates that credit account exists action.

Results

You created the System activity partition. Your diagram should look similar to the following figure:

Teller and System activity partitions.

Create the system logic that determines whether to credit a bank account

About this task

You can now add the system logic that determines how the system responds when a teller inputs the required information.

To create the system logic that credits a bank account:

Procedure

  1. In the Palette, click Control Node and click Create Decision.
  2. In the diagram editor, drag the decision node below the Validates that credit account exists action, and name the decision element Valid credit account?.
  3. In the Palette, click Flow.
  4. In the diagram editor, click the Validates that credit account exists action and drag the cursor to the decision element.
  5. In the Palette, double-click Action and name the action Credit account by check amount.
  6. In the diagram editor, drag the Credit account by check amount action below and to the right of the decision element.
  7. In the Palette, click Flow.
  8. In the diagram editor, click the decision node and drag the cursor to the Credit account by check amount action.
  9. To set the guard text for the new relationship, in the Properties view, on the General page, type Credit account exists.

    You added the logic that credits the account if it exists. Your diagram should look similar to the following figure:

    System logic that validates and credits an account.

Create transaction messages

About this task

To create the system logic that displays messages for invalid accounts, transaction summaries, and dishonored checks:

Procedure

  1. In the Palette, double-click Action and name the action Display invalid account message.
  2. In the diagram editor, drag the Display invalid account message action below and to the left of the decision element. These two action elements form the valid and invalid transaction workflows.
  3. In the Palette, click Flow.
  4. In the diagram editor, click the decision node and drag the cursor to the Display invalid account message action.
  5. In the Palette, double-click Action and name the action Display transaction summary.
  6. In the diagram editor, drag the Display transaction summary action below the Credit account by check amount action.
  7. In the Palette, double-click Action and name the action Display dishonored check message.
  8. In the diagram editor, drag the Display dishonored check message action below the Display invalid account message action.

    You created all the actions that the System partition requires. Your diagram should look similar to the following figure:

    System activity partition that contains all required actions.

Create the final activity node and its relationships

Procedure

  1. In the Palette, click the Activity Final node element and drag it to the bottom of the diagram editor, in the System activity partition. This is the end point of your activity diagram.
  2. In the Palette, click Flow.
  3. In the diagram editor, connect the following elements:
    1. Connect the Display invalid account message action to the Activity Final node.
    2. Connect the Display transaction summary action to the Activity Final node.
    3. Connect the Display dishonored check message action to the Activity Final node.

Results

Your diagram should look similar to the following figure: Completed System activity partition.

Create the CityBank teller activity partition

About this task

The CityBank teller activity partition separates the actions that the CityBank teller performs from the other participants in the activity diagram.

To create the CityBank teller activity partition:

Procedure

  1. Right-click in the diagram editor; then click Add UML > Partition.
  2. In the Project Explorer view, click the Partition element and, in the Properties view, type the name CityBank teller. You created the CityBank teller activity partition.

Create the system logic that determines whether sufficient funds exist

Procedure

  1. In the Palette, click Control Node and click Create Decision.
  2. In the diagram editor, drag the decision element in the CityBank teller activity partition to the right of Credit account by check amount action and name the decision element Sufficient funds?.
  3. In the Palette, click Flow.
  4. In the diagram editor, connect the Credit account by check amount action to the Sufficient funds? element.

    You created a decision node. Your diagram should look similar to the following figure:

    "Display sufficient funds" decision element in the CityBank teller activity partition.

    You can now add the two possible outcomes of the decision node, which are to cash the check or to not cash the check.

Create the decision node that determines whether to cash a check

Procedure

  1. In the Palette, double-click Action and name the action Check OK to cash.
  2. In the diagram editor, place the element below and to the right of the Sufficient funds? element.
  3. In the Palette, click Flow.
  4. In the diagram editor, connect the Sufficient funds? element to the Check OK to cash action.
  5. To set the guard text for the new relationship, in the Properties view, on the General page, type issuing account balance > check amount.
  6. In the Palette, double-click Action and name the action Do not cash check.
  7. In the diagram editor, place the element below and to the left of the Sufficient funds? element.
  8. In the Palette, click Flow.
  9. In the diagram editor, connect the Sufficient funds? element to the Do not cash check action.
  10. In the Palette, click Flow.
  11. In the diagram editor, connect the Check OK to cash action to the Display transaction summary action.
  12. In the Palette, click Flow.
  13. In the diagram editor, connect the Do not cash check action to the Display dishonored check action.

Results

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.

(Optional) Create a link to the Cash Check activity diagram in the Account Operations use-case diagram

About this task

You can insert a link in the Account Operations use-case diagram that leads to the Cash Check activity diagram. This link can increase the readability of the model by enabling you to move between the associated diagrams.

Procedure

  1. In the Project Explorer view, expand the Account Operations package and double-click the Account Operations Use Cases diagram.
  2. In the Project Explorer view, click the Cash check activity diagram and drag it into the Account Operations Use Cases diagram, to the right of the Cash check use case.

Results

To open the Cash Check activity diagram, double-click the Cash check activity diagram link.

< Previous | Next >

Feedback