[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.modeling.m2m] [ATL] Transformation of UML objects

Hi,

I have a metamodel(SysML) that extends UML, but I use too objects from UML.
I do a transformation of this model with ATL, I have rules for objects of my metamodel it's OK, but when I have rules for objects from UML, my transformation doesn't use they.




Model example :

<?xml version="1.0" encoding="UTF-8"?>
<sysML:ModelSYSML xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"; xmlns:sysML="http://www.topcased.org/1.0/sysML"; xmlns:uml="http://www.eclipse.org/uml2/2.1.0/UML"; xmi:id="idModel" name="DefaultName">
<packagedElement xmi:type="sysML:PackageSYSML" xmi:id="idPackage" name="DefaultName">
<ownedComment xmi:type="uml:Comment" xmi:id="__0q7IFMREd21utW8WAj9ug">
<body>this is a test</body>
</ownedComment>
</packagedElement>
</sysML:ModelSYSML>




My Transformation :


module EModelCopy;

create OUT : OUTMODEL from IN : INMODEL;

helper def : inElements : Set(INMODEL!"ecore::EObject") = INMODEL!"ecore::EObject".allInstancesFrom('IN');

rule Comment {
   from s : INMODEL!"uml::Comment" (thisModule.inElements->includes(s))
   to t : OUTMODEL!"uml::Comment" mapsTo s (
       body <- s.body.debug('test : '),
       eAnnotations <- s.eAnnotations,
       ownedComment <- s.ownedComment,
       annotatedElement <- s.annotatedElement)
}



Result :

<?xml version="1.0" encoding="ISO-8859-1"?>
<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"/>




The rule "Comment" isn't used. What can I do?

Thanks

David Ribeiro