aggregation relationship? [message #78716] |
Thu, 10 April 2008 16:20 |
Eclipse User |
|
|
|
Originally posted by: comouraf-lixo.yahoo.fr
Hi,
After using the transformation down below, I expected to have a Model
containing a StructuredComponent, which, in turn, should contain an
AssemblyPart, since the attributes "parts" and "ownedElement" below are
aggregation-type. However, the result was simply:
<MARTE.CoreElements.Foundations:Model name="MyModel"/>
<MARTE.GCM:StructuredComponent name="A"/>
<MARTE.GCM:AssemblyPart name="propA"/>
While I expected something like:
<MARTE.CoreElements.Foundations:Model name="MyModel">
<ownedElement xsi:type="MARTE.GCM:StructuredComponent" name="A">
<parts xsi:type="MARTE.GCM:AssemblyPart" name="propA"/>
</ownedElement>
</MARTE.CoreElements.Foundations:Model>
Can anyone tell me what I am doing wrong? The transformation is reproduced
below.
Thanks for any clue,
César
------------------------------------------------------------ -----------------------------
transformation UML2MarteTemplate(in uml : UML, out marte:Marte);
main( in umlmodel:UML::Model, out martemodel:Marte::Model) {
martemodel:= umlmodel.map umlmodel2martemodel();
}
mapping UML::Model::umlmodel2martemodel() : Marte::Model {
name:=self.name;
ownedElement:=self.ownedElement->select(oclIsKindOf(UML::Class))- > collect(oclAsType(UML::Class)).mapClass2StructuredComponent( );}mapping UML::Class::Class2StructuredComponent() : GCM::StructuredComponent { name:=self.name; parts:=self.ownedAttribute.map Property2Part()->asBag();}mapping UML::Property::Property2Part() : AssemblyPart { name:=self.name;}
|
|
|
Powered by
FUDForum. Page generated in 0.04650 seconds