Lesson 1.7: 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
Procedure
- In the Project Explorer view, expand Account Operations, right-click the Cash check use case; then click .
- Type Cash check activity diagram and press Enter.
- Right-click in the diagram editor; then click .
- In the Project Explorer view, click the Partition element and, in the Properties view, type the name Teller. You created the Teller activity partition.
- In the Palette, double-click Initial and name the element Initial node.
- 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.
- In the Palette, double-click the Action element and name it Teller inputs required information.
- Click the Teller inputs required information action and drag it directly below the initial node.
- In the Palette, click Flow.
- 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:
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
- Right-click in the diagram editor; then click .
- In the Project Explorer view, click the Partition element and, in the Properties view, type the name System. You created the System activity partition.
- In the Palette, double-click Action and name the action Validates that credit account exists.
- 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.
- In the Palette, click Flow.
- 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:
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
Create transaction messages
About this task
To create the system logic that displays messages for invalid accounts, transaction summaries, and dishonored checks:
Procedure
Create the final activity node and its relationships
Procedure
Results
Your diagram should look similar to the following figure:
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
- Right-click in the diagram editor; then click .
- 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
Create the decision node that determines whether to cash a check
Procedure
- In the Palette, double-click Action and name the action Check OK to cash.
- In the diagram editor, place the element below and to the right of the Sufficient funds? element.
- In the Palette, click Flow.
- In the diagram editor, connect the Sufficient funds? element to the Check OK to cash action.
- To set the guard text for the new relationship, in the Properties view, on the General page, type issuing account balance > check amount.
- In the Palette, double-click Action and name the action Do not cash check.
- In the diagram editor, place the element below and to the left of the Sufficient funds? element.
- In the Palette, click Flow.
- In the diagram editor, connect the Sufficient funds? element to the Do not cash check action.
- In the Palette, click Flow.
- In the diagram editor, connect the Check OK to cash action to the Display transaction summary action.
- In the Palette, click Flow.
- 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:
(Optional) Create a link to the Cash Check activity diagram in the Account Operations use-case diagram
About this task
Procedure
- In the Project Explorer view, expand the Account Operations package and double-click the Account Operations Use Cases diagram.
- 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.