Next, add entry Behaviors to the ready and running States of the StopWatch State Machine.


To add an entry Behavior to the ready State


  1. Right click on the ready state in the StopWatch State Machine diagram and select Specification to open the State's Specification window.
  2. Click the Categorized View button to open the properties of the State in the categorized view (see the following figure).
  3. In the Entry category, click on Behavior Type and select OpaqueBehavior (see the following figure). A new Opaque Behavior will be created as the entry Behavior of the ready State.



  4. Click Close to close the Specification window. The ready State will have an empty entry Behavior, as shown in the figure below.



  5. Click on the entry Behavior in the ready State and, in the Alf editor window, type the Alf code shown in the figure below.



  6. When the code is correct, click on OK. The Alf code should now appear in the entry Behavior for the ready State, as shown in the figure below.


To add an entry Behavior to the running State


  1. Right click on the running state in the StopWatch State Machine diagram and select Specification to open the state's Specification window.
  2. Click the Categorized View button to open the properties of the State in the categorized view.
  3. In the Entry category, click on Behavior Type and select OpaqueBehavior to create a new Opaque Behavior as the entry Behavior of the running state.
  4. Click Close to close the Specification window.
  5. Click on the entry Behavior in the running State and, in the Alf editor window, type the Alf code shown in the figure below.


  6. When the code is correct, click Save. The Alf code should now appear in the entry Behavior for the running State, as shown in the figure below.


At this point the StopWatch has been completely modeled. You can now execute the StopWatch Class using Cameo Simulation Toolkit.

Next: Running the Stopwatch model