Reference not properly loaded from XML file [message #637630] |
Mon, 08 November 2010 01:19  |
Eclipse User |
|
|
|
I am a newbie to Ecore. I'am learning it and trying to model a simple component model.
Here is my problem.
I created the model and wrote some code to define the model behavior. Everything works fine in default tree-based model editor, but after saving the model and reloading it, some reference element are not properly loaded. I provide some volatile things in the model but see no direct relation between the 'unloaded' reference element. All related code are generated and I am sure their property are set to changeable as 'true', derived/transient/volatile as false.
here is the xml file:
<?xml version="1.0" encoding="UTF-8"?>
<sscm:Package xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:sscm="http://www.unwiredgrain.com/simple-static-component-model/1.0" name="simpletest">
<operationInterfaces name="Bootie">
<cppTemplateParameters xsi:type="sscm:TypeTemplateParameter" name="T"/>
<operations name="dodo">
<typeTemplateArgument typeArgType="//@classifiers.0"/>
</operations>
<operations name="startup">
<typeTemplateArgument typeArgType="//@classifiers.2">
<subCppArguments xsi:type="sscm:TypeTemplateArgument" typeArgType="//@classifiers.1"/>
</typeTemplateArgument>
</operations>
</operationInterfaces>
<classifiers name="void"/>
<classifiers name="BigInteger"/>
<classifiers name="vector">
<cppTemplateParameters xsi:type="sscm:TypeTemplateParameter" name="T"/>
</classifiers>
</sscm:Package>
The element not properly loaded is:
<subCppArguments xsi:type="sscm:TypeTemplateArgument" typeArgType="//@classifiers.1"/>
They are simply not set.
Could anyone give me some possible reason why this may happen ??? The EMF book does not talk too much about the XML loading so I'm looking desperately to figure out the problem. Thanks in advance.
Tianfu Ma
|
|
|
|
Re: Reference not properly loaded from XML file [message #637676 is a reply to message #637633] |
Mon, 08 November 2010 04:33  |
Eclipse User |
|
|
|
Tianfu,
Comments below.
Tianfu Ma wrote:
> I noticed that the model elements, losing their properties while
> loading, are dynamically created by code, when some property are set
> to their containers.
Is this code that you wrote yourself?
>
> What is the proper way to deal with those automatically created elements?
Don't do such things in the model. If you want to do additional things
when some property is set, do that using specialized commands in the
item providers.
|
|
|
Powered by
FUDForum. Page generated in 0.24258 seconds