Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » [Eugenia] FixGenModel leaves empty model, how to track down problem?
[Eugenia] FixGenModel leaves empty model, how to track down problem? [message #524126] Tue, 30 March 2010 15:50 Go to next message
Christoph Wienands is currently offline Christoph WienandsFriend
Messages: 55
Registered: July 2009
Member
Hey guys,

I have the following EOL script in the FixGenModel.eol file:


for (feature in GenModel!GenFeature.all.select(f | f.ecoreFeature.id =
true))
{
feature.ecoreFeature.id.toString.println();
}


The problem is, after running it (via Eugenia -> 'Synchronize GenModel') I'm
left with an empty genmodel file:


<?xml version="1.0" encoding="UTF-8"?>
<xmi:XMI xmi:version="2.0"
xmlns:xmi="http://www.omg.org/XMI"/>


I have no idea what could cause this because I'm not manipulating any
elements. Does anybody know how I could debug this?

Thanks, Christoph
Re: [Eugenia] FixGenModel leaves empty model, how to track down problem? [message #524151 is a reply to message #524126] Tue, 30 March 2010 23:28 Go to previous messageGo to next message
Christoph Wienands is currently offline Christoph WienandsFriend
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
Re: [Eugenia] FixGenModel leaves empty model, how to track down problem? [message #524225 is a reply to message #524151] Wed, 31 March 2010 08:39 Go to previous message
Dimitrios Kolovos is currently offline Dimitrios KolovosFriend
Messages: 1776
Registered: July 2009
Senior Member
Hi Christoph,

I've reproduced this and it's definitely a bug. Could you please file a
bug report and post the link here so that we can keep track of this?

Cheers,
Dimitris

Christoph Wienands wrote:
> 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
>
>


--
Spread the word: http://www.eclipse.org/gmt/epsilon/spreadtheword
Follow Epsilon on Twitter: http://twitter.com/epsilonews
Re: [Eugenia] FixGenModel leaves empty model, how to track down problem? [message #588057 is a reply to message #524151] Wed, 31 March 2010 08:39 Go to previous message
Dimitrios Kolovos is currently offline Dimitrios KolovosFriend
Messages: 1776
Registered: July 2009
Senior Member
Hi Christoph,

I've reproduced this and it's definitely a bug. Could you please file a
bug report and post the link here so that we can keep track of this?

Cheers,
Dimitris

Christoph Wienands wrote:
> 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
>
>


--
Spread the word: http://www.eclipse.org/gmt/epsilon/spreadtheword
Follow Epsilon on Twitter: http://twitter.com/epsilonews
Previous Topic:[Eugenia] FixGenModel leaves empty model, how to track down problem?
Next Topic:evl validation not working with gmf mindmap example
Goto Forum:
  


Current Time: Thu Apr 25 07:03:21 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