[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[news.eclipse.modeling.m2m] Using ATL and UML2

I want to transform a UML2 model into another UML2 model.

This is my serialized input model:

<?xml version="1.0" encoding="UTF-8"?>
<uml:Model xmi:version="2.1" xmlns:xmi="http://schema.omg.org/spec/XMI/2.1"; 
xmlns:uml="http://www.eclipse.org/uml2/2.0.0/UML"; 
xmi:id="_2NzG8LYJEdutbczTT_VtmA" name="Model" viewpoint="">
  <packagedElement xmi:type="uml:Class" xmi:id="_V2TjgMy4EdugfsSOij4z8Q" 
name="A"/>
  <packagedElement xmi:type="uml:Class" xmi:id="_WcTMgMy4EdugfsSOij4z8Q" 
name="B"/>
</uml:Model>


This is my simple ATL transformation file:

module UML2toUML2;
create OUT : UML from IN : UML;

rule Model {
 from
  i : UML!Model
 to
  o : UML!Model (
   name  <- i.name
  )
}

rule Class {
 from
  i : UML!Class
 to
  o : UML!Class(
   name <- i.name,
   package <- i.package
  )
}


And there is my serialized Output:

<?xml version="1.0" encoding="ISO-8859-1"?>
<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xmlns:uml="http://www.eclipse.org/uml2/2.0.0/UML";>
  <uml:Model name="Model">
    <packagedElement xsi:type="uml:Class" 
href="/MultiplicityTransformation/UmlTracerTest/ClassDiagramOut.uml#/1"/>
    <packagedElement xsi:type="uml:Class" 
href="/MultiplicityTransformation/UmlTracerTest/ClassDiagramOut.uml#/2"/>
  </uml:Model>
  <uml:Class name="A"/>
  <uml:Class name="B"/>
</xmi:XMI>


What's the problem?
I think it is not a problem of the transformation specification in the ATL 
file, but a configuration problem.
Does anyone have experiences in using ATL with UML2 or have a simple example 
that works?
I'd be very thankful for any help...

regards
Timo