This tutorial introduces the xOWL Infrastructure for building multi-view domain-specific modeling tools. The xOWL Graphical Modeling Infrastructure (GMI) enables you to declaratively specify visual modeling notations that can be compiled and interpreted by the xOWL Graphical Modeling Environment in order for it to provide graphical interfaces for the edition of models.
Throughout this tutorial, we refine the same example. We will define three visual notations corresponding to different perspectives on the same problem, build the corresponding metamodel and create the visual modeling environments.
Before starting, download the xOWL GMI at Codeplex. It contains the following elements:
  • compiler/XOWLGMICompiler.exe: the view and transformation compiler for the XOWL Graphical Modeling Infrastructure.
  • syntaxes/FunctionalOWL.xml: a Notepad++ style for the functional syntax of xOWL and OWL2.
  • syntaxes/GMITransform.xml: a Notepad++ style for the high-level transformation language.
  • syntaxes/GMIView.xml: a Notepad++ style for the view definition language.
  • environment/XOWLGMIEnvironment.jar: the jar used to launch the XMI GMI Environment.
  • environment/config.ini: the configuration file for the environment.

    To complete this tutorial, the following are prerequisites:

  • Java JRE 7
  • .Net Framework 2.0Notepad++ is not required; you can use any text editor. However, the package contains syntax highlighting profiles for the different languages used in this tutorial. In order to import a profile in Notepad++, click menu View > User-Defined Dialog … Then click on Import and select the corresponding XML file. The profile should now appear in the Language menu (usually at the bottom).

    Part 1 – Build the Workshop Layout Notation

    In this section we build the visual notation for a domain focusing on the physical layout of workstations inside a workshop and how they are connected with each others.

    Step 1 – First Minimal Notation

    Step 1.1: Within the download package, go to the environment/workbenches directory. In this directory, create the Layout.view file. The .view extension is used to know that this file contains the specification of a notation (a view).
    Step 1.2: Open this new Layout.view file with a text editor. In order to use the syntax highlighting profiles given in the package you will need Notepad++. Notepad++ recognizes the .view file extension and should automatically select the GMI View language profile when a .view file is opened.
    Step 1.3: Type in or copy the following text into the file:
    view "Workshop Layout" {
    	rules {
    	toolboxes {
    This code represents the structure of a view definition for xOWL. We define a new view called "Workshop Layout". The notational elements will be defined with grammar rules to be put in the rules block. The toolboxes block will contain the definition of the toolboxes accessible to the experts.
    Step 1.4: Grammar rules are written as
    Head -> <body> ;

    In this pattern Head is called a variable. It represents a notational element (or part of), defined by the rule’s body. Within this body, we can reuse other variables in order to compose parts of notational elements for the purpose of building bigger ones. We can also use predefined basic drawing elements, such as rectangles, text fields, etc. These are called terminals. All, these elements are organized in a rule’s body and composed using operators.

    Type in or copy the following rule in the “rules” block:

    AssemblyWorkstation -> [[] 139*64 |#E8B3E7|] ;

    With this rule we define a new notational element called AssemblyWorkstation that is defined as a simple rectangle. This rectangle is filled with the color described by the hexadecimal RGB code and will have no border. In this high-level language, shapes are noted with the [ ... ] constructs. The inner [] indicates this is a rectangle, () would indicate an ellipse. Then the size of the shape is noted as width * height. The color code being between two pipes, it represents the color used to fill the shape.

  • Last edited May 8, 2012 at 3:11 PM by lwouters, version 1


    No comments yet.