Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [ATL] Transformation of UML objects
[ATL] Transformation of UML objects [message #86641] Thu, 17 July 2008 12:33
Eclipse UserFriend
Originally posted by: david.ribeirocampelo.atosorigin.com

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
Previous Topic:UML2 API
Next Topic:[ATL] Can't find Java operation with variable arity
Goto Forum:
  


Current Time: Sat Apr 27 01:13:28 GMT 2024

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

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

Back to the top