[solved] applied stereotype gone after save/load [message #643286] |
Mon, 06 December 2010 11:50 |
Thomas Neustupny Messages: 75 Registered: October 2009 |
Member |
|
|
I created a profile and a model and applied a stereotype programatically. Seems to work, the following XMI was saved:
<?xml version="1.0" encoding="UTF-8"?>
<xmi:XMI xmi:version="2.1"
xmlns:xmi="http://schema.omg.org/spec/XMI/2.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:myProfile="http:///schemas/myProfile/_vONbgPOuEd-ZR_t966HNrQ/0"
xmlns:uml="http://schema.omg.org/spec/UML/2.2" xsi:schemaLocation="http:///schemas/myProfile/_vONbgPOuEd-ZR_t966HNrQ/0 http://argouml.org/user-profiles/myProfile_defined_once.xmi#_vOqHcPOuEd-ZR_t966HNrQ http://schema.omg.org/spec/UML/2.2 http://www.eclipse.org/uml2/3.0.0/UML">
<uml:Model xmi:id="ID_myModel" name="myModel">
<packagedElement xmi:type="uml:Class" xmi:id="ID_myClass" name="myClass"/>
<profileApplication xmi:type="uml:ProfileApplication" xmi:id="ID_profileApplication" applyingPackage="ID_myModel">
<xmi:Extension extender="http://www.eclipse.org/emf/2002/Ecore">
<eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_k-TQ8PO5Ed-p9Nu3qLl7Zw" source="http://www.eclipse.org/uml2/2.0.0/UML">
<references xmi:type="ecore:EPackage" href="http://argouml.org/user-profiles/myProfile_defined_once.xmi#_vOqHcPOuEd-ZR_t966HNrQ"/>
</eAnnotations>
</xmi:Extension>
<appliedProfile xmi:type="uml:Profile" href="http://argouml.org/user-profiles/myProfile_defined_once.xmi#ID_myProfile"/>
</profileApplication>
</uml:Model>
<myProfile:myStereotype xmi:id="_phd6IPO5Ed-p9Nu3qLl7Zw" base_Class="ID_myClass"/>
</xmi:XMI>
But when I load this again (making sure that the profile is available in my resource set), resource.getContents() only returns the ModelImpl object, the (formerly existent) DynamicEObjectImpl object is gone. Obviously, it is not created when parsing the line
<myProfile:myStereotype xmi:id="_phd6IPO5Ed-p9Nu3qLl7Zw" base_Class="ID_myClass"/>
How can I get back the DynamicEObjectImpl object?
Loading is hard to debug, any hint where to put a breakpoint?
Thanks, Thomas
[Updated on: Sat, 11 December 2010 18:12] Report message to a moderator
|
|
|
|
Re: applied stereotype gone after save/load [message #644182 is a reply to message #643894] |
Thu, 09 December 2010 19:10 |
Thomas Neustupny Messages: 75 Registered: October 2009 |
Member |
|
|
Hi Rafael,
I don't think this is the problem, because I loaded the profile and put it in my resourceSet, I paste it here from my debug session (after loading the above):
resources=[org.eclipse.uml2.uml.internal.resource.XMI2UMLResourceImpl@161091e uri='http://argouml.org/profiles/uml22/default-uml22.xmi', org.eclipse.uml2.uml.internal.resource.XMI2UMLResourceImpl@1c3fd59 uri='http://argouml.tigris.org/euml/resource/default_uri.xmi', org.eclipse.uml2.uml.internal.resource.XMI2UMLResourceImpl@182e445 uri='http://argouml.org/user-profiles/myProfile_defined_once.xmi', org.eclipse.uml2.uml.internal.resource.UMLResourceImpl@155220e uri='pathmap://UML_METAMODELS/UML.metamodel.uml', org.eclipse.uml2.uml.internal.resource.UMLResourceImpl@124fb16 uri='pathmap://UML_PROFILES/Ecore.profile.uml', org.eclipse.uml2.uml.internal.resource.UMLResourceImpl@1420a24 uri='pathmap://UML_PROFILES/Standard.profile.uml', org.eclipse.uml2.uml.internal.resource.XMI2UMLResourceImpl@d573c7 uri='myModel_using_myProfile_defined_once.xmi']
The problem is, that when calling save(...) on my resource, it cannot find the DynamicEObjectImpl object, only my model object.
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.02973 seconds