Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Problem with EFeatureMapEntry
Problem with EFeatureMapEntry [message #417652] Thu, 20 March 2008 13:50 Go to next message
Eclipse UserFriend
Originally posted by: nima.mazloumi.gmx.de

Hi,

I have defined the following model. Basically a Container may contain
Element1, Element2 and Element3 elements in any order. After gernerating
the editor I am not able to add any Element1-3 children. When I add them
manually in the XML and open it with the editor they are displayed in
the outline tree view.

Any idea what might be missing?

Thanks,
Nima

<eClassifiers xsi:type="ecore:EClass" name="Container"
eSuperTypes="#//UniqueElement">
<eStructuralFeatures xsi:type="ecore:EAttribute"
name="ContainerNodes" upperBound="-1"
eType="ecore:EDataType
http://www.eclipse.org/emf/2002/Ecore#//EFeatureMapEntry">
<eAnnotations
source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="group"/>
</eAnnotations>
</eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EReference" name="Element1"
upperBound="-1"
eType="#//Element1" volatile="true" transient="true"
containment="true">
<eAnnotations
source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="group" value="#ContainerNodes"/>
</eAnnotations>
</eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EReference" name="Element2"
upperBound="-1"
eType="#//Element2" volatile="true" transient="true"
containment="true">
<eAnnotations
source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="group" value="#ContainerNodes"/>
</eAnnotations>
</eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EReference" name="Element3"
upperBound="-1"
eType="#//Element3" volatile="true" transient="true"
containment="true">
<eAnnotations
source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="group" value="#ContainerNodes"/>
</eAnnotations>
</eStructuralFeatures>
</eClassifiers>
Re: Problem with EFeatureMapEntry [message #417656 is a reply to message #417652] Thu, 20 March 2008 15:02 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33140
Registered: July 2009
Senior Member
Nima,

Because we don't yet have validation for extended metadata, it's usually
best if your stuck to write a schema example that corresponds to what
you want. I get the sense that because you've not specified
kind->"element" in the other features it's not wanting to associate the
other features with the group.


Nima Mazloumi wrote:
> Hi,
>
> I have defined the following model. Basically a Container may contain
> Element1, Element2 and Element3 elements in any order. After
> gernerating the editor I am not able to add any Element1-3 children.
> When I add them manually in the XML and open it with the editor they
> are displayed in the outline tree view.
>
> Any idea what might be missing?
>
> Thanks,
> Nima
>
> <eClassifiers xsi:type="ecore:EClass" name="Container"
> eSuperTypes="#//UniqueElement">
> <eStructuralFeatures xsi:type="ecore:EAttribute"
> name="ContainerNodes" upperBound="-1"
> eType="ecore:EDataType
> http://www.eclipse.org/emf/2002/Ecore#//EFeatureMapEntry">
> <eAnnotations
> source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="kind" value="group"/>
> </eAnnotations>
> </eStructuralFeatures>
> <eStructuralFeatures xsi:type="ecore:EReference" name="Element1"
> upperBound="-1"
> eType="#//Element1" volatile="true" transient="true"
> containment="true">
> <eAnnotations
> source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="group" value="#ContainerNodes"/>
> </eAnnotations>
> </eStructuralFeatures>
> <eStructuralFeatures xsi:type="ecore:EReference" name="Element2"
> upperBound="-1"
> eType="#//Element2" volatile="true" transient="true"
> containment="true">
> <eAnnotations
> source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="group" value="#ContainerNodes"/>
> </eAnnotations>
> </eStructuralFeatures>
> <eStructuralFeatures xsi:type="ecore:EReference" name="Element3"
> upperBound="-1"
> eType="#//Element3" volatile="true" transient="true"
> containment="true">
> <eAnnotations
> source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="group" value="#ContainerNodes"/>
> </eAnnotations>
> </eStructuralFeatures>
> </eClassifiers>
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Problem with EFeatureMapEntry [message #417659 is a reply to message #417656] Thu, 20 March 2008 16:37 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: nima.mazloumi.gmx.de

Hi Ed,

this used to work with older EMF versions. And I used ecore xmi as well.
Can it be, that latest EMF behavior is different?

Thanks,
Nima
Re: Problem with EFeatureMapEntry [message #417665 is a reply to message #417659] Thu, 20 March 2008 18:44 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33140
Registered: July 2009
Senior Member
Nima,

Perhaps it did change. I don't recall any changes that would have
affected this, but definitely a group must correspond to an XML Schema
model group and hence the things in it must be elements. Does adding
this information fix the problem?


Nima Mazloumi wrote:
> Hi Ed,
>
> this used to work with older EMF versions. And I used ecore xmi as well.
> Can it be, that latest EMF behavior is different?
>
> Thanks,
> Nima


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Problem with EFeatureMapEntry [message #417672 is a reply to message #417665] Thu, 20 March 2008 19:25 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: nima.mazloumi.gmx.de

>Does adding this information fix the problem?
What would the corresponding ecore markup look like? Do I use annotation kind element?
Re: Problem with EFeatureMapEntry [message #417673 is a reply to message #417672] Thu, 20 March 2008 20:50 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33140
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------000106010603030406020800
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit

Nima,

<details key="kind" value="element"/>


Nima Mazloumi wrote:
> >Does adding this information fix the problem?
> What would the corresponding ecore markup look like? Do I use
> annotation kind element?


--------------000106010603030406020800
Content-Type: text/html; charset=ISO-8859-15
Content-Transfer-Encoding: 7bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-15"
http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Nima,<br>
<blockquote>&lt;details key="kind" value="element"/&gt;
<br>
</blockquote>
<br>
Nima Mazloumi wrote:
<blockquote cite="mid:frudlv$ksj$1@build.eclipse.org" type="cite">&gt;Does
adding this information fix the problem?
<br>
What would the corresponding ecore markup look like? Do I use
annotation kind element?
<br>
</blockquote>
<br>
</body>
</html>

--------------000106010603030406020800--


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Problem with EFeatureMapEntry [message #417694 is a reply to message #417673] Fri, 21 March 2008 13:22 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: nima.mazloumi.gmx.de

Hello Ed,

I tried this:

<eClassifiers xsi:type="ecore:EClass" name="Container">
...
<eStructuralFeatures xsi:type="ecore:EReference" name="Element1" upperBound="-1"
eType="#//Element1" volatile="true" transient="true" containment="true">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="group" value="#ContainerNodes"/>
<details key="kind" value="element"/>
</eAnnotations>
</eStructuralFeatures>
...
</eClassifiers>

as well as:

<eClassifiers xsi:type="ecore:EClass" name="Container">
...
<eStructuralFeatures xsi:type="ecore:EReference" name="Element1" upperBound="-1"
eType="#//Element1" volatile="true" transient="true" containment="true">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="group" value="#ContainerNodes"/>
</eAnnotations>
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="element"/>
</eAnnotations>
</eStructuralFeatures>
...
</eClassifiers>

as well as:

<eClassifiers xsi:type="ecore:EClass" name="Element1">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="element"/>
</eAnnotations>
</eClassifiers>

But none of them works. Something must have changed from EMF 2.1.x to 2.3.x.
Generating a new editor with my old model results to the same problem, that now no children can be created.

Any idea? I would like to avoid redefining everything now using XML Schema.

Thanks,
Nima
Re: Problem with EFeatureMapEntry [message #417697 is a reply to message #417694] Fri, 21 March 2008 15:31 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33140
Registered: July 2009
Senior Member
Nima,

It definitely won't be necessary to redefine in schema, but defining an
analogous example in schema and comparing the annotations would help.
Just glancing at XMI serialized Ecore snippets it's hart to see problems
jump out. If you care to send me the complete Ecore model, I can have a
look using the tools, to try to reproduce the problem.


Nima Mazloumi wrote:
> Hello Ed,
>
> I tried this:
>
> <eClassifiers xsi:type="ecore:EClass" name="Container">
> ...
> <eStructuralFeatures xsi:type="ecore:EReference" name="Element1"
> upperBound="-1"
> eType="#//Element1" volatile="true" transient="true"
> containment="true">
> <eAnnotations
> source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="group" value="#ContainerNodes"/>
> <details key="kind" value="element"/>
> </eAnnotations>
> </eStructuralFeatures>
> ...
> </eClassifiers>
>
> as well as:
>
> <eClassifiers xsi:type="ecore:EClass" name="Container">
> ...
> <eStructuralFeatures xsi:type="ecore:EReference" name="Element1"
> upperBound="-1"
> eType="#//Element1" volatile="true" transient="true"
> containment="true">
> <eAnnotations
> source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="group" value="#ContainerNodes"/>
> </eAnnotations>
> <eAnnotations
> source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="kind" value="element"/>
> </eAnnotations>
> </eStructuralFeatures>
> ...
> </eClassifiers>
>
> as well as:
>
> <eClassifiers xsi:type="ecore:EClass" name="Element1">
> <eAnnotations
> source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="kind" value="element"/>
> </eAnnotations>
> </eClassifiers>
>
> But none of them works. Something must have changed from EMF 2.1.x to
> 2.3.x.
> Generating a new editor with my old model results to the same problem,
> that now no children can be created.
>
> Any idea? I would like to avoid redefining everything now using XML
> Schema.
>
> Thanks,
> Nima


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:km3 -> ecore - bad practice in metamodeling?
Next Topic:using ecore-model in eclipse view
Goto Forum:
  


Current Time: Thu Apr 25 01:23:43 GMT 2024

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

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

Back to the top