Headline

Model to Model transformations with Language:ATL

Motivation

Model to Model transformations with Language:ATL are exercised in this implementation. The metamodels used are given in Language:Ecore, models are in Language:XMI. Two different means of execution are shown. One based on loading the models with Technology:EMF and one directly relying on the ATL Framework. The implementation uses the Total scenario to show a exogenous model transformation. The second transformation, the Cut scenario, is a endogenous model transformation. Additionally, for the Cut scenario, the Language:ATL refinement mode is used, in which only those model elements are altered for which rules exist.

Illustration

The transformations used in this example are Model-To-Model Transformations. Therefore, all transformations use an model as input and create an model as an output. The Cut transformation uses the Company metamodel and an company that conforms to this metamodel and produces an model, that conforms to the company metamodel. The transformation is refining, which means that every element for which no rule is defined isn't modified in the target model. Therefore, the only rule of the transformation is the Employee2Employee rule.

Invalid Language supplied
This rule just takes an Employee (called s) and creates an Employee in the target model (called t), whose salary is the same as the salary of s divided by 2. The ComputeTotal transformation uses the Company metamodel and a company that conforms to this metamodel and creates an double value. Since ATL transformations are model to model transformations, a model representing the double value is used.
Invalid Language supplied
The rule creates a collection of the salary values of all employees in the source model and then takes the sum from the values in the collection.

Architecture

  • Company.ecore is the metamodels for companies
  • Total.ecore is a wrapper for a double value.
  • metamodels can be found in the "Metamodel" directory
  • The cut scenario is implementet in Cut.atl
  • Company.ecore is used for input and output
  • The total scenario is implemented in Total.atl
  • Company.ecore is used for input
  • Total.ecore is used for output
  • sampleCompany.xmi is the source model for all transformations
  • sampleCompany.xmi is in the "Models" directory

Usage

A Eclipse version with an installed ATL plugin is needed to execute the transformations (e.g. the EMF version with the installed ATL Framework).

Steps:

  • The project should be imported into Eclipse
  • It will provide a executable Java file called RunTransfoJava.java. It uses EMF to start the transformation.
  • Right click on the java file and select "Run As" -> "Java Application"
Comments:
  • The output models can be found in Models/Java.
  • The project might need to be refreshed, before Eclipse shows the results.


There are no revisions for this page.

User contributions

    This user never has never made submissions.

    User edits

    Syntax for editing wiki

    For you are available next options:

    will make text bold.

    will make text italic.

    will make text underlined.

    will make text striked.

    will allow you to paste code headline into the page.

    will allow you to link into the page.

    will allow you to paste code with syntax highlight into the page. You will need to define used programming language.

    will allow you to paste image into the page.

    is list with bullets.

    is list with numbers.

    will allow your to insert slideshare presentation into the page. You need to copy link to presentation and insert it as parameter in this tag.

    will allow your to insert youtube video into the page. You need to copy link to youtube page with video and insert it as parameter in this tag.

    will allow your to insert code snippets from @worker.

    Syntax for editing wiki

    For you are available next options:

    will make text bold.

    will make text italic.

    will make text underlined.

    will make text striked.

    will allow you to paste code headline into the page.

    will allow you to link into the page.

    will allow you to paste code with syntax highlight into the page. You will need to define used programming language.

    will allow you to paste image into the page.

    is list with bullets.

    is list with numbers.

    will allow your to insert slideshare presentation into the page. You need to copy link to presentation and insert it as parameter in this tag.

    will allow your to insert youtube video into the page. You need to copy link to youtube page with video and insert it as parameter in this tag.

    will allow your to insert code snippets from @worker.