Xmodeling Studio is an Eclipse Modeling Framework plug-in assisting the language engineers with the design and implementation executable DSLs and their corresponding execute engine taking in account the business operations and their data flow. It also gives the opportunity to the software engineer to integrate the language engineer's work to the Java environment of their choice.

  1. How to install?
  2. How to use it?
  3. The plug-in has been designed for a language engineer, and we consider at this point that you are the language engineer who is creating a language and its execution engine for a software engineer.

    Create an empty Xmodeling project:

    Create an Xmodeling Project from existing Ecore:

    Apply an Xmodeling transformation:

    Export the .jar file:

    Nothing special at this point, you would just have to export the content from the "src-gen" folder as a .jar file for the software engineer.

  4. The PDL example
  5. For the sake of simplicity, we have decided that the language engineer and the software engineer will be the same person in this example. You can download the .zip file of the project here.

    1. Language engineer part
    2. The references "start" and "end" from Process have "true" for "Containment".

      "next" and "previous" references have each other for the property "EOpposite"

      The annotation "Xmod_main" has to be given for the root object.
      The annotation "Xmod_exec" has to be given to the classes dealing with the business operations.
      These annotations are impacting the transformation and the code generation.

    3. Software engineer part
    4. At this point, the language engineer is supposed to export his work in a .jar file and the software engineer is supposed to import it in his java environment with the following java libraries:

      But in our example we stay inside our Xmodeling project.

      
            import java.util.HashMap;
            import PDL.Process;
      
            public class Main {
      
              public static void main( String [] args) {
      
                /* Init */
                Process proc;
                Calculus calcBusinness = new Calculus();
                Integer a = 3;
                HashMap<String, Object> hm;
      
                /* Body */
                proc = PDL.util.PDLXmodUtil.loadProcess("model/Process.xmi");
                hm = (HashMap<String, Object>)
                PDL.util.PDLXmodUtil.loadMap("hashmap.xml");
                hm.put("calcBusinness", calcBusinness);
                hm.put("a", a);
                PDL.util.PDLXmodUtil.setMap(hm);
                PDL.util.PDLXmodUtil.saveMap("hashmap.xml");
                proc.executeProcess();
              }
            }
          
      
            public class Calculus {
      
              public Integer addition(Integer val1, Integer val2) {
                Integer result = 0;
                result = val1 + val2;
                return result;
              }
      
              public Integer multiplication(Integer val1, Integer val2) {
                Integer result = 0;
                result = val1 * val2;
                return result;
              }
      
              public Integer square(Integer nil) {
                nil *= nil;
                return nil;
              }
      
              public Integer sqrt(Integer nil) {
                nil = new Double(Math.sqrt(nil)).intValue();
                return nil;
              }
      
              public Integer factorial(Integer val) {
                int res = 1;
                for (int i=1;i<=val;i++)
                  res = res*i;
                val = res;
                return val;
              }
            }