Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » ATL » how to match "packageImport" element in class diagram
how to match "packageImport" element in class diagram [message #987539] Tue, 27 November 2012 00:06 Go to next message
Beatus Ding is currently offline Beatus Ding
Messages: 18
Registered: November 2012
Junior Member
I'm trying to transform uml diagram to self-defined "unify" file with ATL.A simple class diagram like this
<?xml version="1.0" encoding="UTF-8"?>
<xmi:XMI xmi:version="20110701" xmlns:xmi="http://www.omg.org/spec/XMI/20110701" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:profile="http:///schemas/profile/_v1QCwDSdEeK5yc5OykOa7Q/6" xmlns:uml="http://www.eclipse.org/uml2/4.0.0/UML" xsi:schemaLocation="http:///schemas/profile/_v1QCwDSdEeK5yc5OykOa7Q/6 model.profile.uml#_v1Qp0DSdEeK5yc5OykOa7Q">
  <uml:Model xmi:id="_xY8XkDdlEeKttLPFIKJkEA" name="model">
    <packageImport xmi:id="_A78LYDdmEeKttLPFIKJkEA">
      <importedPackage xmi:type="uml:Model" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#_0"/>
    </packageImport>
  </uml:Model>
</xmi:XMI>

and the corresponding transformed "unify" file like this:
<?xml version="1.0" encoding="ISO-8859-1"?>
<unify:Model xmlns:unify="http://xxx/unify" unify:name="model" unify:id="_xY8XkDdlEeKttLPFIKJkEA">
  <unify:entity unify:id="_A78LYDdmEeKttLPFIKJkEA">
    <unify:subentity unify:type="uml:Model" unify:href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#_0"/>
  </unify:entity>
</unify:Model>

But now I don't know how to match the "packageImport" in the ATL rule,the same problem exists in "ownedAttribute" and "lowerValue" element(not list above).Who can give some suggestion,any help will be appreciated.
Re: how to match "packageImport" element in class diagram [message #987581 is a reply to message #987539] Tue, 27 November 2012 04:09 Go to previous messageGo to next message
Sylvain EVEILLARD is currently offline Sylvain EVEILLARD
Messages: 483
Registered: July 2009
Senior Member
You have to look at the UML metamodel.
The packageImport eReference is of type PackageImport.
So you can specify a rule on UML!PackageImport in order to transform it to what you want.
Re: how to match "packageImport" element in class diagram [message #987785 is a reply to message #987581] Wed, 28 November 2012 02:42 Go to previous message
Beatus Ding is currently offline Beatus Ding
Messages: 18
Registered: November 2012
Junior Member
I have the metamodel,but I donot know how to match the element in atl,can you give me a simple example,or can you recommend some references,thanks a lot~
Previous Topic:Convert Float to Double - by refInvokeOperation?
Next Topic:EDate in the transformations
Goto Forum:
  


Current Time: Mon May 20 13:18:53 EDT 2013

Powered by FUDForum. Page generated in 0.02010 seconds