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 #588033] Tue, 30 March 2010 16:40 Go to next message
Christoph Wienands is currently offline Christoph Wienands
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 #588048 is a reply to message #588033] Tue, 30 March 2010 19:28 Go to previous message
Christoph Wienands is currently offline 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
Previous Topic:Possible bug in ETL/Emfatic?
Next Topic:[Eugenia] FixGenModel leaves empty model, how to track down problem?
Goto Forum:
  


Current Time: Sat Apr 19 16:06:47 EDT 2014

Powered by FUDForum. Page generated in 0.01702 seconds