how to match "packageImport" element in class diagram [message #987539] |
Tue, 27 November 2012 00:06  |
Eclipse User |
|
|
|
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 #1250815 is a reply to message #1229900] |
Wed, 19 February 2014 11:29  |
Eclipse User |
|
|
|
Hi,
For the package import you should have a rule like this...
rule CopyPackageImport {
from
s : UML!PackageImport(s.oclIsTypeOf(UML!PackageImport))
to
t : UML!PackageImport
(
--eAnnotations <- s.eAnnotations,
ownedComment <- s.ownedComment,
importedPackage <- s.importedPackage,
importingNamespace <- s.importingNamespace,
visibility <- s.visibility
)
}
then of course the element having the package import should have the following in its rule definition:
packageImport <- s.packageImport
Regards,
Ronan
|
|
|
Powered by
FUDForum. Page generated in 0.09566 seconds