[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[news.eclipse.modeling.mdt.uml2.tools] Re: uml2 to ecore attribute transformation

Hi,

Please ask once again in the eclipse.modeling.mdt.uml2.uml "core" news 
group.

This one is for uml2 tools MDT component and intended to cover questions 
regarding GMF based diagram editors for UML.

Regards,
Michael



"Luis Pedro" <luis.pedro@xxxxxxxxxxxx> wrote in message 
news:ej9m86$m8v$2@xxxxxxxxxxxxxxxxxxxx
> Hi there,
> When generating a new EMF project from an UML2 model (.uml2) I'm not
> able to have the correct project if I'm having attributes in the
> classes. For example:
> In my uml2 xmi I have an attribute "capacity" with type "Integer" as
> follows:
>     <ownedAttribute xmi:id="_94wrjHMJEdu_reEnBA_uiA" name="capacity"
> visibility="package" isUnique="false">      <eAnnotations
> xmi:id="_94wrjXMJEdu_reEnBA_uiA">
>         <details xmi:id="_94wrjnMJEdu_reEnBA_uiA" key="isAttribute"
> value="true"/>      </eAnnotations>
>       <eAnnotations xmi:id="_94wrj3MJEdu_reEnBA_uiA"
> source="externalReference">        <details
> xmi:id="_94wrkHMJEdu_reEnBA_uiA"
> key="PetriNetsMM.ZGVzaWduOm5vZGU6OjpQcmltaXRpdmVUeXBlLkludGVnZXI="
> value=""/>
>         <references xmi:type="uml:PrimitiveType"
> href="PetriNetsMM.profile.uml2#_94wrZXMJEdu_reEnBA_uiA"/>
> </eAnnotations>
>       <type xmi:type="uml:PrimitiveType"
> href="PetriNetsMM.profile.uml2#_94wrZXMJEdu_reEnBA_uiA"/>
>       <lowerValue xmi:type="uml:LiteralString"
> xmi:id="_94wrkXMJEdu_reEnBA_uiA" value="1"/>    </ownedAttribute>
>
> My profile file looks like:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <uml:Profile xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI";
> xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore";
> xmlns:uml="http://www.eclipse.org/uml2/1.0.0/UML";
> xmi:id="_94wEUHMJEdu_reEnBA_uiA" name="PetriNetsMM">
>   <eAnnotations xmi:id="_94wEUXMJEdu_reEnBA_uiA" source="attributes">
>     <details xmi:id="_94wEUnMJEdu_reEnBA_uiA" key="version" value="0"/>
>   </eAnnotations>
>   <eAnnotations xmi:id="_94wEU3MJEdu_reEnBA_uiA" source="ePackages">
>     <contents xmi:type="ecore:EPackage"
> xmi:id="_94wEVHMJEdu_reEnBA_uiA" name="PetriNetsMM_0"
> nsURI="http:///PetriNetsMM_0_94p9sHMJEdu_reEnBA_uiA.profile.uml2";
> nsPrefix="PetriNetsMM_0">
>       <eClassifiers xmi:type="ecore:EDataType"
> xmi:id="_94wrYHMJEdu_reEnBA_uiA" name="PetriNetsMM__String"
> instanceClassName="PetriNetsMM__String"/>
>       <eClassifiers xmi:type="ecore:EDataType"
> xmi:id="_94wrYXMJEdu_reEnBA_uiA" name="PetriNetsMM__Integer"
> instanceClassName="PetriNetsMM__Integer"/>
>     </contents>
>   </eAnnotations>
>   <elementImport xmi:id="_94wrYnMJEdu_reEnBA_uiA"
> importedElement="_94wrZHMJEdu_reEnBA_uiA"/>
>   <elementImport xmi:id="_94wrY3MJEdu_reEnBA_uiA"
> importedElement="_94wrZXMJEdu_reEnBA_uiA"/>
>   <ownedMember xmi:type="uml:PrimitiveType"
> xmi:id="_94wrZHMJEdu_reEnBA_uiA" name="String"/>
>   <ownedMember xmi:type="uml:PrimitiveType"
> xmi:id="_94wrZXMJEdu_reEnBA_uiA" name="Integer"/>
> </uml:Profile>
>
> The most annoying thing is that, when creating the EMF project, it
> generates two .ecore files, one for the .uml2 project and another one
> for the profile file. One .ecore file will have only the data types, and
> the other will have my meta model with yet another strange thing: the
> attributes are generated as EReference instead of EAttribute.
>
> Any idea on how to solve this problem? Is there any special way of
> defining Class attributes for ECore metamodeling purposes?
>
> Thanks very much for you help in advance
>
> Luis Pedro