Hello World
|
BRITNeY Suite
|
Simple Non-sensical Demonstration
|
Examples
|
Purpose of this Example
The Model
This small example models a hotel; you start outside, you get to the door and is greeted by a doorman, and finally you enter the lounge.
Declarations
The declarations set up the connection to BRITNeY. Everything happens in the "Animation setup" declaration group:
In this example, we assume that BRITNeY is running on the same machine as CPN Tools. You can take a look at all the 6 generated functors if you need to run BRITNeY on another computer that CPN Tools..
We just create two new objects in BRITNeY, dialog and msg. Each object is created by a Standard ML functor, which takes as parameter a descriptive name of the new object.
Action Parts
The real communication with BRITNeY happens in the action parts of the transitions Get Name and Say Hello (see the screenshot above).
The available actions for each object can be seen by evaluating open <object-name>
, e.g.:
The Get Name transition asks the user for his/her name using the dialog object. The Say Hello displays a dialog on the users screen with the text Hello <name>.
Simulation
- Start BRITNeY Suite
- Load HelloWorld.cpn into CPN Tools
- Use the Play tool on the Top page
- A dialog appears:
- Type in your name
- The model changes state:
- ...and a new dialog apperas:
- When you click Ok, the model ends in the final state:
Download
Next Step
For a more comprehensive example, you should now take a look at the Simple Protocol. Or you can skip it and go to drawing either the state-space for Dining Philosophers or Message Sequence Charts.
Version 26, Wed 12 Jul 2006 14:12:00
[tveon] - created Fri 09 Jul 2004 13:56:03
[mw]