|
Re: [Eugenia] FixGenModel leaves empty model, how to track down problem? [message #588048 is a reply to message #588033] |
Tue, 30 March 2010 23:28 |
Christoph Wienands Messages: 55 Registered: July 2009 |
Member |
|
|
I narrowed down the issue a bit but still I'm at a loss. The problem
(deleting all the genmodel elements, including package) only seems to happen
when I access elements from the ECore namespace. For example:
for (feature in GenModel!GenFeature.all)
{
feature.ecoreFeature.println();
}
will cause the issue, whereas
for (feature in GenModel!GenFeature.all)
{
feature.println();
}
does not cause it. First I thought, maybe the underlying ECore metamodel
does not get loaded, but the output from println() clearly shows that the
ECore model element were loaded and can be accessed by EOL. I also created a
minimal example with one class and one ID attribute to make sure it's not my
complex metamodel.
Here are two more examples that work:
for (attr in ECore!EAttribute.all) {
attr.println();
}
for (feature in GenModel!GenFeature.all)
{
feature.println();
}
However, the next examples all fail:
for (feature in GenModel!GenFeature.all)
{
feature.name.toString.println();
}
for (feature in GenModel!GenFeature.all)
{
feature.isId.toString.println();
}
for (feature in GenModel!GenFeature.all)
{
feature.ecoreFeature.name.toString.println();
}
So it seems to me, as soon as EOL traverses from the GenModel feature to the
ECore attribute, something goes awefully wrong. As I said, during processing
the ECore model elements are there because I can see them in the println()
output. The issue seems to be afterwards, when the GenModel is saved back to
disk.
Just for reference, here is the minimal ECore example:
<?xml version="1.0" encoding="UTF-8"?>
<ecore:EPackage xmi:version="2.0"
xmlns:xmi="http://www.omg.org/XMI"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
xmi:id="_DfsvoTxQEd-dAr9hUABrmg"
name="My" nsURI="http://my.com/my" nsPrefix="my">
<eClassifiers xsi:type="ecore:EClass" xmi:id="_EecP0DxQEd-dAr9hUABrmg"
name="A">
<eStructuralFeatures xsi:type="ecore:EAttribute"
xmi:id="_Gw8d8DxQEd-dAr9hUABrmg"
name="ID" eType="ecore:EDataType
http://www.eclipse.org/emf/2002/Ecore#//EString"
iD="true"/>
</eClassifiers>
</ecore:EPackage>
Any ideas?
Thanks, Christoph
|
|
|
Powered by
FUDForum. Page generated in 0.03200 seconds