Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Reference not properly loaded from XML file
Reference not properly loaded from XML file [message #637630] Mon, 08 November 2010 06:19 Go to next message
Tianfu Ma is currently offline Tianfu MaFriend
Messages: 6
Registered: October 2010
Junior Member
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 #637633 is a reply to message #637630] Mon, 08 November 2010 07:28 Go to previous messageGo to next message
Tianfu Ma is currently offline Tianfu MaFriend
Messages: 6
Registered: October 2010
Junior Member
I noticed that the model elements, losing their properties while loading, are dynamically created by code, when some property are set to their containers.

What is the proper way to deal with those automatically created elements?
Re: Reference not properly loaded from XML file [message #637676 is a reply to message #637633] Mon, 08 November 2010 09:33 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33218
Registered: July 2009
Senior Member
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.


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:EMT Transactions
Next Topic:inspecting an ecore
Goto Forum:
  


Current Time: Wed Sep 25 09:18:56 GMT 2024

Powered by FUDForum. Page generated in 0.03287 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top