Setup Development Environment

This page describes how to setup the development environment for ScenarioTools.

Eclipse Setup

Install the latest Eclipse 4 “Modeling Tools” package (http://www.eclipse.org/downloads/).
Install Graphviz 2.28.0 for PDF-Export (You may have to set the PAHT variable manually)

Start Eclipse and install Papyrus.
(Help -> Install Modeling Components -> select Papyrus -> Finish -> follow the installation dialog)

installPapyrus

Workspace Setup

Switch to the Plug-in Development perspective.
(Window ->  Open Perspective -> Other… -> Plug-in Development)

Clone Repositories

Open Git Repositories View.
(Window -> Show View -> Other… -> Git -> Git Repositories)

Clone the following Git repositories:

  • https://bitbucket.org/jgreenyer/tgg-interpreter.git
  • https://bitbucket.org/jgreenyer/scenariotools.git

If you have a BitBucket.org account use https://USERNAME@bitbucket.org/… additionally and fill out the user and password part.

CloneScenariotools

Import Projects and Working Sets

Download the following zip file base-projectSet and unzip it. Then import the file via:
(File -> Import… -> Team -> Team Project Set -> choose the unziped psf-file)

RECOMMENDED

In the view menu of your project/package explorer (usually the small triangle),
you can set to view as top-level elements working sets. This should group the workspace plug-ins
(ScenarioTools, ScenarioTools.MSD, TGG)
Maybe you have to activate the working sets in the section below ‘Configure Working Sets…’ first.

OPTIONAL

We are working on a Simulation Graph, it’s a history view that supports the working during the simulation. Therefore the history view displays the current explored stategraph. With a simple double-click you can jump through the stategraph.

Install Zest: (Help -> Install new Software… -> Work with: Luna – http://download.eclipse.org/releases/luna/ -> Modeling -> Graphical Editing Framework Zest Visualization Toolkit SDK)
Download the following zip file baseHistoryView-projectSet and unzip it. Then import the additionally projects via:
(File -> Import… -> Team -> Team Project Set -> choose the unziped psf-file)

Simulation Graph

Regenerate Code

In case you need to regenerate ScenarioTools code from genmodels:
You need the plug-ins

  • org.eclipse.emf.ecore
  • org.eclipse.uml2.uml

to be present in you workspace.
Import them as follows:
Go to the plug-ins view (should be a selectable tab on the left in the plug-in development perspective). There, you find and select the two plug-ins, right-click->Import As->source project.

Configure an Eclipse Runtime-workspace.

Open the Run Configurations and create a new Eclipse Application configuration.
(Run->Run Configurations…->select “Eclipse Application”->right-click->New)

Give it a name and set the VM-Arguments to:
-Xms40m -Xmx512m -XX:PermSize=256m -XX:MaxPermSize=256m
(Arguments-Tab, VM-Arguments text area.)
You can leave all other runtime workbench settings on default.

MAC-users with 64-bit Java:
Set the VM-Argument -d32

Run-Time Workspace Setup

Start the run-time workspace that you have configured as described above.
Import an example project e.g. “org.scenariotools.msd.examples.railcab”
Go to the plug-ins view. There, you find and select the plug-in, right-click->Import As->source project.
You can again set working sets to be shown as top-level elements.
To perform UML-to-ECore transformations you also need to import

  • org.eclipse.emf.ecore
  • org.eclipse.uml2.uml

as source projects as described above.

Run Simulation

You should now be able to start a scenario simulation:
in the main menu select Run->Debug Configurations…
Then you find in the column on the left “ScenarioTools Simulation”.
Select it and press the “New launch configuration” Button.
On the right you should now be able to browse for a “Scenario run configuration Model Resource”.
Select for example

  • org.scenariotools.msd.examples.railcab/ecore-model-DriveOntoTrackSection/instance-system-2tracksections-1railcab/DriveOntoTrackSection.scenariorunconfiguration
  • org.scenariotools.msd.examples.railcab/ecore-model-WarnRailCabsOnTrack/instance-system-static/WarnRailCabOnTrack.scenariorunconfiguration

you can now hit “Debug”.

Switch to the ScenarioTools MSD Simulation Perspective:
(Select Window -> Open Perspective ->Other… -> ScenarioTools MSD Simulation Perspective)

If you select an element in the Debug View, the MessageEvent Selection View shows enabled, violating etc. events that can be executed.