Skip to content
Snippets Groups Projects
Select Git revision
  • c0b7b3df22fc7584f9f5afbbfabe83425f6d598d
  • main default protected
  • E06_TextGeneration_Solution
  • E06_TextGeneration_Base
  • E05_Validation_Testing_Solution
  • E05_Validation_Testing_Base
  • E04_Transformation_Solution
  • E04_Transformation_Base
  • E03_GraphicalDSL_Solution
  • E03_GraphicalDSL_Base
  • E02_TextualDSL_Solution
  • E02_TextualDSL_Base
  • E01_Metamodel_Solution
  • E01_Metamodel_Base
14 results

transportation_network-mdsd-source

MDSD Example: Transportation Network - Sources

Exercise 03 - Graphical Domain Specific Language

This repository includes the resources of the third task of the MDSD Example "Transportation Network".

Task Description

The main task of the exercise is to create a graphical DSL (domain specific language ) for the domain of transportation networks.

Sirus is a development framework to create model editors from a given metamodel and a view specification. The view specification has a similar purpose as the grammars used in the last exercise and describes e.g. how model elements should be rendered, created, edited, or removed using the the editor. In contrast to Xtext no code is generated in Sirius because the view specification is interpreted at run-time. We will use Sirius to generate a graphical DSL for our transportation networks.

To start the exercise install Sirus and familiarize yourself with the Sirus editor development.

  1. Familiarize yourself with Sirius and its capabilities to create graphical model editors based on a given metamodel. Sirius has excellent tutorials12 and documentation3 that are a good starting points.

  2. Create a new Sirius project

    1. Open a new eclipse workspace and import your transportation network metamodel projects (Metamodel, Edit, and Editor) in that workspace. Do not use the same workspace as the previous exercise that includes the Xtext projects since Xtext, and Sirus need some further configuration to work together and we want to keep it simple in this exercise.
    2. Run the Metamodel Project as an Eclipse Application, like you did to test your metamodel in exercise 1. This will register your metamodel in the new Eclipse instance. In the new Eclipse instance create a new Viewpoint Specification Project and open the View Specification (description/*.odesign) file. Edit this file like it is explained in the tutorials to develop the graphical state machine editor
  3. Define a graphical modeling editor for your transportation network models by using the View Specification (description/*.odesign). The editor should be able to render, create, and edit all element types of the transportation network.

    1. Create a Editor to plan Transportation Networks
      1. Create a Transportation Network Viewer
        • Creates Nodes, Container, and Edges representing your Locations, POIs,RoadNetworks, and Roads.
        • If needed try add further (secondary) nodes representing your model elements to add mor information to the diagrams.
        • As a hint: You can a further layers (other than the mandatory Default one) to the viewer to make some information only visible on demand.
      2. Refine the Viewer ta an Editor
        • Add Tools for creating Locations, POIs,RoadNetworks, and Roads to the editor.
        • Add Tools for editing existing Information via e.g. Direct Lable Editing
    2. Add functionality to plan Routes and manage Vehicles to the editor.
      1. Add a new layer to the editor to manage routes and Vehicles
      2. Creates Nodes, Container, and Edges representing your Routess, and Vehicles in the Network.
      3. Add Tools for creating Routess, and Vehicles to the editor.
      4. Add Tools for editing existing Information via e.g. Direct Lable Editing or Dialog windows
    3. Try to implement the semantics that a present in your textual Editor. E.g.:
      • Road Network or Route should not self-connect to the same Location
      • Give a visual warning if a Location is isolated in the Network
      • Give a visual warning if there is no CompanyWarehouse in the Network
      • Numbers, like distances, should be plausible.
  4. To test the developed editor create a Modeling Project (not an normal general Project) with File\rightarrowNew\rightarrow``Other...in the same Eclipse instance (the one with theViewpoint Specification Project`). You have the right projekt type if there is a `*.aird` file in your project. Add some transportation network model files to it (e.g. use the ones from exercise 1). The editor should open by default. If not, `right-click` on the project (with the model files), click on `Create Representation` and choose your model file.

How To Run the Base Solution

  1. Import the stgroup.mdsd.transportation_network.metamodel.* projects in your Eclipse workspace.
  2. In the runtime Eclipse instance import the stgroup.mdsd.transportation_network.graphical_dsl, and model_examples projects.
  3. Open the dsl editor inside the *.aird filse or rigth-click on the model project and choose Create Representation to open a new editor instance.
  1. https://wiki.eclipse.org/Sirius/Tutorials/StarterTutorial

  2. https://wiki.eclipse.org/Sirius/Tutorials/AdvancedTutorial

  3. https://eclipse.dev/sirius/doc/