The Ordering model demonstrates the use of Alf as the action language within an executable model using State Machines. It includes the following diagrams:

  • Order Classes – A Class diagram of an Order consisting of multiple OrderLineItems, placed by a Customer, which may be paid using a CreditCard.
  • Order_Behavior – A State Machine diagram of the active Behavior of an Order.
  • CreditCardCharge_Behavior – A State Machine diagram of the active Behavior of a CreditCardCharge (this is just a stub for testing purposes).
  • Customer_Behavior – A State Machine diagram of the active Behavior of a Customer (this is just a stub for testing purposes).
  • Test – A Class diagram of a simple Test Class with a classifier behavior that acts as a test driver.

Alf is used to define the behavior of all Operations in the Order Classes model, entry Behaviors in all the state machines and the classifier behavior for Test. To view any of the Alf code, open the Alf editor window (select Windows > Alf) and then select the desired Operation, entry Behavior or Activity. The Alf code will appear in the window.


To run the test, do either of the following


  • Press the start button on the main toolbar.
  • Right-click OrderingSimConfig and select Simulation > Run.