Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [ATL]: a target model inconsistant with it's metamodel
[ATL]: a target model inconsistant with it's metamodel [message #742546] Thu, 20 October 2011 15:39
El Arbi Aboussoror is currently offline El Arbi AboussororFriend
Messages: 90
Registered: June 2010

I have defined an ATL module that suprisingly produces a new kind of models. In fact after execution I get a model that is not conform to it's metamodel !

My taget metamodel is ComGraph.ecore and this it's Emfatic description:
class ComGraph {
   val Element[*] elements;

class Element {
   attr String name;
class Node extends Element {
class Link extends Element {
   ref Node source;
   ref Node target;

My source metamodel is Scenario.ecore:
package Scenario;

import "platform:resource/diagnostic_SGS/metamodel/IFConfiguration.ecore";

class Scenario extends IFConfig.NamedElement{
   val IFConfig.Transition[*] firedTransitions;

And it is using a metaclass from the IFConfiguration.ecore :
package IFConfig;

class Transition {
   val Action[*] actions;
   attr Integer number;
class Action {
   attr String kind;

So the following transformation should create a ComGraph model:

-- @path ComGraph=/diagnostic_SGS/metamodel/ComGraph.ecore
-- @path Scenario=/diagnostic_SGS/metamodel/Scenario.ecore

module Scenario2ComGraph;
create OUT : ComGraph from IN : Scenario;

rule Scenario2ComGraph {
		sS : Scenario!Scenario
		tC : ComGraph!ComGraph (
			elements <- sS.firedTransitions

rule Transition2Element {
		sT : Scenario!Transition
		tC : ComGraph!Element (
			name <- sT.actions->first().kind

BUT after the execution I found my self with a surprising model with elements from both target AND SOURCE metamodel:
<?xml version="1.0" encoding="ISO-8859-1"?>
<comgraph:ComGraph xmi:version="2.0" xmlns:xmi="" xmlns:xsi="" xmlns:comgraph="" xmlns:ifconf="">
  <elements xsi:type="ifconf:Transition" number="1">
    <actions kind="DEBUG" value="402">
      <by name="Properties_p0"/>
    <actions kind="DEBUG" value="428">
      <by name="Properties_p0"/>

As you can see the ComGraph has elements of type Transition wich is not consistent with the ComGraph metamodel.

This my Eclipse configuraiton:

Eclipse Modeling Tools
Version: Helios Service Release 1
Build id: 20100917-0705
ATLAS Transformation Language (ATL)
Version: 3.1.1.v201009141132
Build id: 201009141132

[Updated on: Thu, 20 October 2011 15:49]

Report message to a moderator

Previous Topic:[ATL] Many imperative instructions inside a helper
Next Topic:[QVTo] Generate XMI with multiple namespaces
Goto Forum:

Current Time: Sun Feb 25 16:52:25 GMT 2024

Powered by FUDForum. Page generated in 0.01804 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top