In this example will see how to create a Simulation with UML Almighty using an ATM Model. (Check the Videos)
After installing the XMI file it take 10 minutes to finish the UML Almighty simulation (including the Prototype, the Executable UML and the UML Simulation itself).
The ATM Model is just a possible solution for this problem. The Simulation shows how different UML Diagrams fits with UML Almighty.
We will see two Use Cases in detail: ATM login and Perform a Deposit.
Use Case: ATM Login
The User/Customer stars a new Session where the user name and password are entered.
If the entry data match the Card the Panel of Transactions is displayed.
Use Case: New Deposit
Here the Customer start a new Session (insert a card and type user name and password) in the ATM machine and then Deposit an amount of money to his Account.
UML Class Diagram – UML Model
ATM class represent the real ATM machines. Each User (actor) start a Session in an ATM machine. This relation is an association class ATMLogin.
The ATMLogin has the user name and password. After enter the user name a Session is created. With a Session the User can perform different Transactions.
Each Card belongs to an Account of a Bank. The Bank perform the different Transactions. To simulate the Card insertion a list of Cards is displayed to select one.
The ATM machine has Log of operations. The ATM bills are manage by the InnerCash handler.
The process starts when the User enter the user name and password. Then select a Card (to simulate Card insertion).
After login succed the User has the Panel of Transactions to perform different tasks.
In this panel the User can perform: a Deposit, a Transfer, a Query or a Withdrawal.
If confirmed the Transaction is performed and then Panel of Transactions is displayed again.
The User can perform another Transaction or logout. The transaction process will be shown in detail with Sequence Diagrams.
The following pictures shows the GUI: User and Password which is the GUI for the instances of UML association class [ATMLogin].
This is the Web Page generated by UML Almighty for ATMLogin class, we named “GUI: User and Password” to the GUI of ATMLogin class.
From the GUI of ATMLogin the User can login into the ATM account.
Login Simulation Video
This is the Sequence Diagram for the Login process (check the video)
As we can see in the Sequence Diagram the login process returns (or starts) a new Session. From this Session the User can perform different operations.
Check the GUI: Panel of Transaction (picture above) to see the GUI for the instances of Session class.
The following is the Simulation Code for the UML Method [loginWith:] of Class ATMLogin
Method’s comments in green color.
As we can see in the Sequence Diagram the login process returns (or starts) a new Session.
When the user clicks Login button in the UML Almighty prompt a list of Cards (to simulate Card insertion).
When aCard is selected then [loginWith:] method is executed. This UML method belongs to ATMLogin class (check Sequence Diagram).
<aCard> argument is the Card selected by the User.
The method compares the password and user names of Card and ATMLogin (data entry in the web). If succed returns aSession (check simulation code).
This Session is displayed in other WebPage where the User can perform: Deposits, Transfers, and so on.
The following pictures shows the GUI: Panel of Transactions which is the GUI for the instances of UML class [Session].
The following picture shows the GUI for a Deposit. We named deposit GUI as GUI: Deposit Panel.
After data entry the User has to Confirm or Cancel the Deposit.
When the User click Save Object then the following page is displayed:
The following Sequence Diagram shows the Deposit process in the ATM system.
1. The User click NewDeposit in Panel of Transactions (SessionGUI)
2. A new Deposit is created and it is displayed in a Deposit Panel (DepositGUI). The User entry data (Deposit Panel 1).
3. The User Confirm or Cancel the Deposit (Deposit Panel 2)
4. The Bank perform the Transaction with Account (processDeposit:for: method).
5. The Panel of Transaction is displayed again with the result of last transaction. Now the User can perform other Transactions.
Simulation Code for the UML method #confirm in the Class Deposit
Simulation Code for the UML method #processDeposit:for: in the Class Bank
The following picture shows the Transaction result:
Simulation Video of a Deposit