Chapter 6. Calling EMF Java operations from Kermeta

Kermeta 2 is able to reuse the java code generated from an ecore model. Thus, if the generated code is customized through the GENERATED NOT annotations, this code will natively be used by kermeta. This provides a nice and elegant way to encapsualte java code in a model.

TODO illustrate that on a small sample.

6.1. Presentation/key points

This tutorial will detail the following points:

  1. create an EMF project with an ecore model that proposes some operations

    generate the java code from the ecore model

  2. add some custom code in the model operations

    use "generated NOT" annotation to make sure the code cannot be overidden when regenerating the model

  3. create a jar from this java project

    the current recommanded packaging method is to use maven and tycho

  4. create a kermeta project

    configure the project to use this java project and its eventual depdendencies

    call the operations in the model

  5. compile and run the kermeta application