Meta-Modelling with eMoflon::Core
Learn how to use the EMF modelling framework with eMoflon::Core.

Sokoban (Japanese for warehouse keeper) is a cool puzzle game, in which you (the sokoban) have to push boxes to designated end positions.  The warehouse is typically littered with unmovable boulders to make things more challenging.  In this first part of our handbook, we’ll concentrate on modelling the concepts and relations required to describe this game using EMF and eMoflon::Core, which provides a few extra goodies to make working with EMF more easy and enjoyable.  eMoflon::Core is part of eMoflon::IBeX, which also supports event-based unidirectional and bidirectional model transformation via graph transformations, and eMoflon::TIE-GT, which allows you to generate standalone Java code from unidirectional model transformations.

To enjoy this handbook you should have very basic knowledge of Eclipse, Java, and more or less of meta-modelling in general (we won’t explain what exactly a meta-model is).

Prerequisites: Which way to go?

First off — you have to choose between two options:
  1. You want to work with a complete eMoflon::IBeX installation (makes sense if you plan to continue with the eMoflon::IBeX tutorials on unidirectional and bidirectional model transformation).  If this is the case, continue with the next section.
  1. You want to use a minimal installation that just contains eMoflon::Core (you’re not (yet) interested in our other handbooks).  If this is the case, skip the following section and continue here instead.

Prerequisites: Install eMoflon::IBeX (Option 1)

  1. Decide if you want to download a ready-to-go Eclipse with all you need pre-installed, or if you want to install everything yourself.  If you want to use such an Eclipse with “batteries included” then grab the appropriate zip for your platform and make sure you skip Steps 2 and 3.  We currently support MAC OS X, Windows, and Linux, and try to keep these zips as up-to-date as possible.  If anything seems outdated, please leave a comment here and we’ll update the zip(s).   If you choose to install everything yourself (perhaps in an existing Eclipse instance) then just continue with Step 2.
  1. Install Eclipse Modeling Tools (https://www.eclipse.org/downloads/packages/ → Eclipse Modeling Tools).  Make sure you take Eclipse Modeling.  We always try to support the very latest version of Eclipse so go ahead and take the latest.
  1. Install eMoflon::IBeX:
  • Click on HelpInstall New Software.
  • Paste this update site into the Eclipse Installation Manager
  • Select eMoflon IBeX::Democles and make sure that “Contact all update sites during install…” is selected. 
  • Before clicking on Next, you have to enable all newly added update sites.  To do this click on Manage, select all sites as indicated in the screenshot below, and click Apply and Close.  If you skip this step, the installation will fail due to missing dependencies.
  • Start the installation (you might have to select the eMoflon IBeX::Democles update site again in the drop-down menu)  by clicking Next.  This might take some time depending on your internet connection.  To speed things up you could try deactivating some standard Eclipse update sites (such as The Eclipse Project Updates), which you don’t need right now for the installation.
  • Restart Eclipse when you are asked to do so.
  1. Switch to the eMoflon perspective:
  • To confirm that the installation was successful, open the eMoflon perspective by choosing WindowOpen PerspectiveOther…
  • Choose eMoflon from the list and click Open.
  • If everything went well, your workspace should look like this (new features outlined in red).

If all that went well, skip to the section on PlantUML and Emfatic to continue.

Prerequisites: Install eMoflon::Core (Option 2)

  1. Install Eclipse Modeling Tools (https://www.eclipse.org/downloads/packages/ → Eclipse Modeling Tools).  Make sure you take Eclipse Modeling.  We always try to support the very latest version of Eclipse so go ahead and take the latest.
  1. Install eMoflon::Core:
  • Click on HelpInstall New Software.
  • Paste this update site into the Eclipse Installation Manager
  • Select eMoflon::Core and make sure that “Contact all update sites during install…” is selected. 
  • Before clicking on Next, you have to enable all newly added update sites.  To do this click on Manage, select all sites as indicated in the screenshot below, and click Apply and Close.  If you skip this step, the installation will fail due to missing dependencies.
  • Start the installation (you might have to select the eMoflon IBeX::Democles update site again in the drop-down menu)  by clicking Next.  This might take some time depending on your internet connection.  To speed things up you could try deactivating some standard Eclipse update sites (such as The Eclipse Project Updates), which you don’t need right now for the installation.
  • Restart Eclipse when you are asked to do so.
  1. Switch to the eMoflon perspective:
  • To confirm that the installation was successful, open the eMoflon perspective by choosing WindowOpen PerspectiveOther…
  • Choose eMoflon from the list and click Open.
  • Your workspace should now look like this (new features outlined in red).

Now, continue to the section on PlantUML and Emfatic. Some of the screenshots in the following may show additional toolbar entries, which are only available in eMoflon::IBeX. Don’t worry—you won’t need them in this tutorial!