Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » New/Reload a .genmodel
New/Reload a .genmodel [message #429894] Wed, 06 May 2009 13:35 Go to next message
Jorge Dieguez is currently offline Jorge DieguezFriend
Messages: 48
Registered: July 2009
Location: France
Member

Hello All,

I'm generating a viewer from "ecore diagram -> ecore -> genmodel".

I have three classes i.e. A, B, C with references as follow:

A -> B (containment=true)

A -> C (containment=true)

B -> C (containment=False) thus, B and C child classes of A class

if I made:

A -> C (containment=false)

A -> C (containment=true(not changed)) and,

B -> C (containment=true) thus, C child of B and B child of A

these changes does not get reflected in the view if I reload genmodel i.e.
still depicting C and B as child classes of A. Also, If I try to save the
viewer then I get:
org.eclipse.emf.ecore.xmi.DanglingHREFException: The object
'wwww.impl.EClass2Impl@1426780 (EAttribute0: null)' is not contained in a
resource.

This is solved only if I create a new model.

Can you tell me when should or should not reload be used? what's the
rationale of reload?

Many thanks for your help,

Jorge


Jorge
Re: New/Reload a .genmodel [message #429896 is a reply to message #429894] Wed, 06 May 2009 13:39 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.
--------------020601000409050909070106
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit

Jorge,

Comments below.

Jorge Dieguez wrote:
> Hello All,
>
> I'm generating a viewer from "ecore diagram -> ecore -> genmodel".
>
> I have three classes i.e. A, B, C with references as follow:
>
> A -> B (containment=true)
>
> A -> C (containment=true)
>
> B -> C (containment=False) thus, B and C child classes of A class
Like Library, Book, Writer.
>
> if I made:
>
> A -> C (containment=false)
> A -> C (containment=true(not changed)) and,
>
> B -> C (containment=true) thus, C child of B and B child of A
>
> these changes does not get reflected in the view if I reload genmodel
> i.e. still depicting C and B as child classes of A.
The settings in the GenFeature will not change just because you change
the model. You have to make changes to the GenFeature Children and
Child Creation properties to have an impact on the view.
> Also, If I try to save the viewer then I get:
> org.eclipse.emf.ecore.xmi.DanglingHREFException: The object
> 'wwww.impl.EClass2Impl@1426780 (EAttribute0: null)' is not contained
> in a resource.
>
> This is solved only if I create a new model.
>
> Can you tell me when should or should not reload be used? what's the
> rationale of reload?
Reload preserves *all settings*. Those settings are computed when the
model is first created to produce what's likely to be the best choices
based on the structure of the model at that time. There's a feature
request to be able to reset the properties to their defaults:
<https://bugs.eclipse.org/bugs/show_bug.cgi?id=186455>

https://bugs.eclipse.org/bugs/show_bug.cgi?id=186455

Like so many things, it's not done yet.
>
> Many thanks for your help,
>
> Jorge
>

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

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-15"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Jorge,<br>
<br>
Comments below.<br>
<br>
Jorge Dieguez wrote:
<blockquote
cite="mid:7ba81dca8f25e482bc4b11c9642a3ccb$1@www.eclipse.org"
type="cite">Hello All,
<br>
<br>
I'm generating a viewer from "ecore diagram -&gt; ecore -&gt;
genmodel".
<br>
<br>
I have three classes i.e. A, B, C with references as follow:
<br>
<br>
A -&gt; B (containment=true)
<br>
<br>
A -&gt; C (containment=true)
<br>
<br>
B -&gt; C (containment=False) thus, B and C child classes of A class
<br>
</blockquote>
Like Library, Book, Writer.<br>
<blockquote
cite="mid:7ba81dca8f25e482bc4b11c9642a3ccb$1@www.eclipse.org"
type="cite"><br>
if I made:
<br>
<br>
A -&gt; C (containment=false) <br>
A -&gt; C (containment=true(not changed)) and,
<br>
<br>
B -&gt; C (containment=true) thus, C child of B and B child of A
<br>
<br>
these changes does not get reflected in the view if I reload genmodel
i.e. still depicting C and B as child classes of A.</blockquote>
The settings in the GenFeature will not change just because you change
the model.


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: New/Reload a .genmodel [message #429897 is a reply to message #429894] Wed, 06 May 2009 13:39 Go to previous messageGo to next message
Jorge Dieguez is currently offline Jorge DieguezFriend
Messages: 48
Registered: July 2009
Location: France
Member

Sorry for the error in the scenario, corrected bellow:

Jorge Dieguez wrote:

> Hello All,

> I'm generating a viewer from "ecore diagram -> ecore -> genmodel".

> I have three classes i.e. A, B, C with references as follow:

> A -> B (containment=true)

> A -> C (containment=true)

> B -> C (containment=False) thus, B and C child classes of A class

> if I made:

> A -> B (containment=true(not changed))

> A -> C (containment=false) and,

> B -> C (containment=true) thus, C child of B and B child of A

> these changes does not get reflected in the view if I reload genmodel i.e.
> still depicting C and B as child classes of A. Also, If I try to save the
> viewer then I get:
> org.eclipse.emf.ecore.xmi.DanglingHREFException: The object
> 'wwww.impl.EClass2Impl@1426780 (EAttribute0: null)' is not contained in a
> resource.

> This is solved only if I create a new model.

> Can you tell me when should or should not reload be used? what's the
> rationale of reload?

> Many thanks for your help,

> Jorge


Jorge
Re: New/Reload a .genmodel [message #429898 is a reply to message #429896] Wed, 06 May 2009 13:43 Go to previous message
Jorge Dieguez is currently offline Jorge DieguezFriend
Messages: 48
Registered: July 2009
Location: France
Member

Ed,

Many thanks for your explanation.

Jorge


Jorge
Previous Topic:IllegalValueException thrown directly on load of XML resource (and not stored as an XMI exception)
Next Topic:EList reference composition
Goto Forum:
  


Current Time: Thu Apr 25 00:26:26 GMT 2024

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

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

Back to the top