next up previous contents
Next: The Network News Reader Up: Notations Previous: Object Oriented Model

Subsections

Finite State Machine

  The notation used for the finite state machines has been taken from [Boo94]. Figure A.3 shows the symbols used in this thesis.


  
Abbildung A.3: Notation used for finite state machines
\begin{figure}
 \begin{center}
 \leavevmode
 
\epsfig {file=eps/fsm_notation.eps}

 \end{center}\end{figure}

A rounded box indicates a state displaying the state's name (underlined) and the actions possible in this state. An arc indicates a state transition that is triggered by an event. The arc's label indicates the name of the event and can show the events guard and the actions taken.

The start icon indicates the initial state of the state machine and the stop icon indicates the state machine's final state.

Example

Figure A.4 shows a simple automated teller machine as a state diagram.


  
Abbildung A.4: Example to the notation of finite state machines
\begin{figure}
 \begin{center}
 \leavevmode
 
\epsfig {file=eps/ex_fsm.eps}
 \end{center}\end{figure}

The automated teller machine is turned off in the initial state. As soon as the operator turns on the machine it goes into the Ready state and waits for customers inserting their creditcards. When a customer inserts his creditcard, the automated teller machine asks for the customers code.

If the customer enters a wrong code, the customer is given a new chance as long as the total number of retries is smaller than 3 (this is indicated by the events guard statement). If the customer enters a wrong code for the third time, the machine keeps the customer's creditcard and goes back into the ``Ready'' state. If the customer enters the correct code, the machine enters the ``Amount?'' state.

In the ``Amount?'' state the customer is asked to enter the amount of money he wishes to withdraw. As soon as the customer entered the amount of money to withdraw the machine ejects the customer's creditcard, commits the transaction (the money will be paid to the customer and withdrawn from his account) and goes back into the ``Ready'' state.

In the ``Enter Code'' and the ``Amount?'' states the customer is allowed to cancel the transaction. When the transaction is canceled the machine ejects the customer's creditcard.

As soon as the automated teller machine is turned off the state machine goes into the final state.


next up previous contents
Next: The Network News Reader Up: Notations Previous: Object Oriented Model
gschwind@infosys.tuwien.ac.at