| how to match href element in uml diagram [message #997301] |
Sat, 05 January 2013 04:06  |
Beatus Ding Messages: 18 Registered: November 2012 |
Junior Member |
|
|
I'm trying to transform UML Class Diagram to other models.I have trouble in accessing the href in the following format:
<packageImport xmi:id="_A78LYDdmEeKttLPFIKJkEA">
<importedPackage xmi:type="uml:Model" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#_0"/>
</packageImport>
I want to get the value of href in the importedPackage.According to the uml class meta-model,the type of importedPackage is "uml:Model",but my match rule package2entity cannot identify it,my rule like this
rule Model2Model{
from
s:UML!Model
to
t:UNIFY!Model(
id <- s.__xmiID__,
name<-s.name,
entities<-s.ownedElement
)
}
My packageimp2entity rule can identify the packageImport element,the rule listed below
rule packageimp2entity{
from s:UML!PackageImport(s.oclIsTypeOf(UML!PackageImport))
to t:UNIFY!Entity(
id<-s.__xmiID__,
subEntities <- s.importedPackage
)
}
But I don't know how to get the href value.Expression s.importedPackage can match an outside package,not the child element of packageImport.Any help will be appreciated.
|
|
|
| Re: how to match href element in uml diagram [message #997437 is a reply to message #997301] |
Mon, 07 January 2013 09:01   |
Hugo Bruneliere Messages: 447 Registered: July 2009 |
Senior Member |
|
|
Hello,
href is not an attribute or reference of the PackageImport element, it is an XMI serialization-specific feature that is not intended to be handled manually at the model level.
In order to know the model elements (and corresponding attributes/references) you can actually handle, you should take a look to the UML2 metamodel.
Generally, to avoid this kind of misunderstanding, I encourage you to open your metamodels and models with a model editor/browser rather than reading them in XMI (which can be often quite confusing). You can use the generic MoDisco Model Browser for instance.
Hugo
------------------------------------------
Hugo Bruneliere - R&D Engineer
AtlanMod research team (Inria, EMN & LINA)
Ecole des Mines de Nantes
Nantes - France
------------------------------------------
|
|
|
|
Powered by
FUDForum. Page generated in 0.04448 seconds