[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
[mdt-uml2.dev] FW: Question on UMLUTil
|
Hi,
Below is part of a
plugin code which converts emx file to
ecore.
org.eclipse.uml2.uml.Package Pkg =
EcoreUtil.getObjectByType(rset.getResource("c:\temp\test.uml",
true).getContents(),
UMLPackage.Literals.PACKAGE);
Map<String,
String> optionsMap = new HashMap<String, String>()
;
optionsMap.put(UML2EcoreConverter.OPTION__ANNOTATION_DETAILS,
UMLUtil.OPTION__PROCESS);
Collection ecoreElements =
UMLUtil.convertToEcore(pkg,optionsMap);
save("c:\temp\test.ecore",
ecoreElements);
When I run this code on following
snippet.
emx
snippet
<packagedElement xmi:type="uml:Class" xmi:id="_GFIhIAnAEd65K6q0HTJl7A"
name="ServiceInfo">
<ownedAttribute xmi:id="_I8GHMAnAEd65K6q0HTJl7A" name="serviceRendered"
visibility="public"
type="_HthxlwLEEd6ALd4GJZLpDQ"/>
<ownedAttribute xmi:id="_MHUGAAnAEd65K6q0HTJl7A" name="activityCounter"
visibility="public">
<eAnnotations xmi:id="_PacDoAnAEd65K6q0HTJl7A" source="http://www.eclipse.org/uml2/2.0.0/UML">
<details xmi:id="_PacDoQnAEd65K6q0HTJl7A"
key="@"/>
</eAnnotations>
<type xmi:type="uml:PrimitiveType"
href=""/>
<upperValue xmi:type="uml:LiteralUnlimitedNatural"
xmi:id="_NrSaMQnAEd65K6q0HTJl7A"
value="1"/>
<lowerValue xmi:type="uml:LiteralInteger"
xmi:id="_NrSaMAnAEd65K6q0HTJl7A"/>
</ownedAttribute>
<ownedAttribute xmi:id="_R24Q4AnAEd65K6q0HTJl7A" name="activityInfos"
visibility="public" type="_tBEmwAm_Ed65K6q0HTJl7A"
association="_R2vG8AnAEd65K6q0HTJl7A">
<upperValue xmi:type="uml:LiteralUnlimitedNatural"
xmi:id="_R24Q4gnAEd65K6q0HTJl7A"
value="10"/>
<lowerValue xmi:type="uml:LiteralInteger"
xmi:id="_R24Q4QnAEd65K6q0HTJl7A"/>
</ownedAttribute>
</packagedElement>
Note that the emx
snippet shows a child element of eAnnotation for a class
attribute .
Using the
eclipse plugin jar : org.eclipse.uml2.uml_2.2.2.v200811051031.jar which has
version v 1.75.2.1 of
UMLUtil.java , eAnnotations are lost when ecore file is
created.
This used to work in the previous version of plugin:
org.eclipse.uml2.uml_2.0.5.v200802262248.jar
Generated
Ecore Snippet // Result when
using
org.eclipse.uml2.uml_2.0.5.v200802262248.jar
<eClassifiers
xsi:type="ecore:EClass"
name="ServiceInfo">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="serviceRendered"
ordered="false"
lowerBound="1"
eType="#//ServiceAssetView/CommonDataTypes/CoreTypes/Alpha50"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="activityCounter"
ordered="false"
eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
<eAnnotations source="http://www.eclipse.org/uml2/2.0.0/UML">
<details
key="@"/>
</eAnnotations>
</eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EReference" name="activityInfos"
ordered="false"
upperBound="10"
eType="#//ServiceAssetView/BusinessObjects/ActivityInfo"/>
</eClassifiers>
Please let me
know what changes have to me made to get eAnnotations in ecore
file,
Regards,
Anju
This e-mail may contain confidential or privileged information. If you think you have received this e-mail in error, please advise the sender by reply e-mail and then delete this e-mail immediately. Thank you. Aetna