< Previous | Next >

Lesson 1.6: Create the Transfer Money activity diagram

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

About this task

The Transfer Money activity diagram shows the workflow that occurs when either a customer or teller clicks Transfer Money on the main menu of the online user interface. 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 a message to state that the transaction is invalid.

Create the Customer/Teller activity partition

The Transfer Money activity diagram shows the steps that occur when a customer or teller clicks Transfer Money on the main menu of the online user interface. The Customer/Teller activity partition contains the actions that the customer or teller performs in this workflow.

Procedure

  1. In the Project 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. 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 Customer/Teller.
  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 element is the starting point of your activity diagram.
  7. In the Palette, double-click Action and name the action Customer/Teller selects Transfer Money from menu.
  8. In the diagram editor, click the Customer/Teller selects Transfer Money from menu 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 Customer/Teller selects Transfer Money from menu action.

Results

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

Customer/Teller activity partition.

Create the System activity partition

The Transfer Money activity diagram shows the steps that occur when a customer or teller clicks Transfer Money on the main menu of the online user interface. The System activity partition contains the actions that the system performs in this workflow.

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, name the partition System.
  3. In the Palette, double-click Action and name the action Validate accounts exist and transfer amount is < current balance.
  4. In the diagram editor, click the Validate accounts exist and transfer amount is < current balance action, and drag it directly to the right of the Customer/Teller selects Transfer Money from menu action.
  5. In the Palette, click Flow.
  6. In the diagram editor, click the Customer/Teller selects Transfer Money from menu action and drag the cursor to the Validate accounts exist and transfer amount is < current balance action.

Results

You created the activity partition and workflow for the system. You can now add the system logic that determines the system response when a teller or customer requests to transfer money.

Create the system logic to transfer money

About this task

The system logic states that a money transfer can occur if the transfer amount is less than the current balance of the bank account.

To create the system logic that transfers money if sufficient funds exist in the account:

Procedure

  1. In the Palette, click Control Node and click Create Decision.
  2. In the diagram editor, drag the decision element below the Validate accounts exist and transfer amount is < current balance action.
  3. In the Palette, click Flow.
  4. In the diagram editor, click theValidate accounts exist and transfer amount is < current balance action and drag the cursor to the decision element.
  5. In the Palette, double-click Action and name the action Debit Customer account and Credit customer account by transit amount.
  6. In the diagram editor, drag the Debit Customer account and Credit customer account by transit 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 Debit Customer account and Credit customer account by transit amount action.
  9. To set the guard text for the new relationship, in the Properties view, on the General page, type amount < current balance.

    Your diagram should look similar to the following figure:

    The system verifies that the guard condition is met, and debits the account.

    You can now add a step that displays a message that the transaction is invalid if the customer or teller attempts to transfer money that is more than the current balance of the bank account.

Create a message to display for an invalid transaction

Procedure

  1. In the Palette, double-click Action and name the action Display invalid transaction message.
  2. In the diagram editor, drag the Display invalid transaction message action below and to the left of the decision element.
  3. In the Palette, click Flow.
  4. In the diagram editor, click the decision element and drag the cursor to the Display invalid transaction message action.
  5. In the Palette, click Flow.
  6. In the diagram editor, click the Display invalid transaction message action and drag the cursor to the Customer/Teller selects Transfer Money action.

    Your diagram should look similar to the following figure:

    The guard condition is not met, and the system displays a message.

    You can now add an action to display a summary message for the transfer and add a final activity node to complete the diagram.

Create a summary message for a transaction

Procedure

  1. In the Palette, double-click Action and name the action Display transfer summary.
  2. In the diagram editor, drag the Display transfer summary action below the Debit Customer account action.
  3. In the Palette, click Flow.
  4. In the diagram editor, click the Debit Customer account action and drag the cursor to the Display transfer summary action.
  5. In the diagram editor, click the Activity Final node element and drag it to the bottom of the editor, into the System activity partition. This is the end point of your activity diagram.
  6. In the Palette, click Flow.
  7. In the diagram editor, click the Display invalid transaction message action and drag the cursor to the Activity Final node element.
  8. In the Palette, click Flow.
  9. In the diagram editor, click the Display transfer summary action and drag the cursor to the Activity Final node element.

Results

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

CityBank activity partition.

(Optional) Create a link to the Transfer Money 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 Transfer Money diagram. This link can increase the readability of the model by enabling you to move between the associated diagrams.

To create a link to the Transfer Money activity diagram:

Procedure

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

Results

To open the Transfer Money activity diagram, double-click the Transfer Money activity diagram link.
< Previous | Next >

Feedback