This section contains a number of activities to prepare the definition of state machines for the interfaces in Section 3.
-
Create a folder "ComMAWorkshop" at a high level in your folder structure.
|
A deeply nested folder leads to avoid long path names which might create problems. |
-
Start Eclipse with the created folder ComMAWorkshop as workspace.
Import the vending machine project as follows:
-
Go to menu File/Import…, open folder General and select "Existing Projects into Workspace".
Hit the Next button. -
Select the "Select archive file" option and browse to select the VendingMachine.zip file.
The project should be selected (otherwise select it manually) and click Finish
The imported project contains:
-
A src folder with the Java implementation and a GUI of the vending machine.
-
File VendingMachine.types which defines a number of types, in addition to the predefined types such as bool, int, real, and string.
-
Folder IService which contains:
-
File IService.signature which defines the signature of the IService interface.
Note that the file imports the .types file. In general, the names of imported .types files must be different from the signature file name (to avoid potential name clashes in generated code). The doxygen-style tags in the comments will be used for document generation, as explained later. -
File IService.interface with a dummy state machine.
Note that there are warnings about unused messages from the signature. By means of the activities below, the state machine will gradually be completed for these messages. In general, a state machine describes the interface protocol from the viewpoint of server, i.e. which commands and signals can it receive in any state and which notifications it is allowed to send. Messages that are not specified are not allowed.
-
-
File VendingMachine.prj in which generator tasks will be specified. Files with this extension should always be placed in the main project folder.