- Docker
- OpenJDK 8 or higher
- Open a shell (git-bash on Windows) and change directories to the
examples/calculator/
directory. - Build project with:
./build-masl.sh
- Open a shell (git-bash on Windows) and change directories to the
examples/calculator/
directory. - To launch the compiled executable within the docker container, execute the
following:
On Windows:
docker run -it -v /$PWD:/workspace levistarrett/masl-exe bin/calculator_transient
winpty docker run -it -v /$PWD:/workspace levistarrett/masl-exe bin/calculator_transient
The process will launch, but nothing will happen until there's an external stimulus and the event queue will just idly wait. To explore further, launch with inspector enabled.
- Open a shell (git-bash on Windows) and change directories to the
examples/calculator/
directory. - To launch the compiled executable with inspector enabled, execute the following:
On Windows:
docker run -it -p 20000:20000 -p 30000:30000 -p 40000:40000 -v /$PWD:/workspace levistarrett/masl-exe bin/calculator_transient -util Inspector -inspector-port 0
winpty docker run -it -p 20000:20000 -p 30000:30000 -p 40000:40000 -v /$PWD:/workspace levistarrett/masl-exe bin/calculator_transient -util Inspector -inspector-port 0
The -p
docker parameters cause the ports 20000, 30000, and 40000 to be opened
between the host operating system and the process running within container.
Inpsector uses 3 TCP ports for various parts of its communication protocol. The
-util Inspector
flag tells the generated executable to dynamically load the
inspector libraries and the -inspector-port 0
tells the executable to listen
on the base ports (20000, 30000, and 40000) with an offset of 0.
NOTE: The commands to launch MASL executables can be long and clumsy. To streamline things, an alias command can be added to your shell configuration:
alias masl-exe="docker run -it -p 20000:20000 -p 30000:30000 -p 40000:40000 -v /\$PWD:/workspace levistarrett/masl-exe"
# Now, run the executable with:
masl-exe bin/calculator_transient -util Inspector -inspector-port 0
- Download the inspector Java application: Inspector JAR
- With the MASL executable application already running, launch inspector by
double clicking on the JAR file or running fom a command line with:
java -jar inspector-1.0.0-jar-with-dependencies.jar
The inspector will attach to your running process and you can start using it to interrogate the instance population, execute scenarios, single step through actions and more.
In the calculator model, try executing some of the "testcase" scenarios from the "scenarios" tab. Observe the output that is printed in the same shell where you launched inspector.
The MASL reference manuals can be found here: