Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Strategy for updating the gmfgen model after having edited the ecore/ecore_diagram model
Strategy for updating the gmfgen model after having edited the ecore/ecore_diagram model [message #178680] Fri, 21 March 2008 16:22 Go to next message
Florian Hackenberger is currently offline Florian HackenbergerFriend
Messages: 123
Registered: July 2009
Senior Member
Hi!

I have a project where I need to edit the domain model during the
development process. In addition I have to customise the generated diagram
code using '@generated NOT' comments. Whenever I adapt the domain model,
manually update the genmodel, gmfgraph, gmfmap and gmftool models and
click 'Transform' on the Dashboard in order to regenerate the gmfgen model,
the code generator gets confused and throws away my customized code. Do I
have to update the gmfgen model manually as well? And why does it get
confused and throws away customised code if I regenerate the diagram code
after clicking on 'Transform'? BTW: I can reproduce the 'gets confused'
behaviour with a simple gmf model if it is a bug.

Cheers,
Florian
--
Florian Hackenberger
Re: Strategy for updating the gmfgen model after having edited the ecore/ecore_d [message #178842 is a reply to message #178680] Tue, 25 March 2008 08:23 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: marsha.rohrer.swisscom.com

Hi Florian,

I am in the same situation as you are (i.e. a lot of customized code). If
I have to update the ecore model I proceed as follows:
1. update ecore diagram
2. validate it to be sure the changes are correct
3. reload genmodel (right-click on genmodel -> Reload...)
4. re-generate the code from the genmodel you need (model and edit code in
my case)
5. do the changes to gmfgraph, gmftool, gmfmap if needed.
6. validate gmfmap to be sure all changes are correct.
7. re-generate the gmfgen (right-click on gmfmap -> Generate generator
model...)
8. re-generate the diagram code from the gmfgen

In my case all customizations annotated with @generated NOT stay
persistent.

Hope that helps,
Marsha
Re: Strategy for updating the gmfgen model after having edited the ecore/ecore_d [message #178900 is a reply to message #178842] Tue, 25 March 2008 15:17 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: 5d5.mail.ru

You may also use 'Hide @generated code' filter in Package Explorer to
quickly find customized java classes.

Marsha wrote:
> Hi Florian,
>
> I am in the same situation as you are (i.e. a lot of customized code).
> If I have to update the ecore model I proceed as follows:
> 1. update ecore diagram
> 2. validate it to be sure the changes are correct
> 3. reload genmodel (right-click on genmodel -> Reload...)
> 4. re-generate the code from the genmodel you need (model and edit code
> in my case)
> 5. do the changes to gmfgraph, gmftool, gmfmap if needed.
> 6. validate gmfmap to be sure all changes are correct.
> 7. re-generate the gmfgen (right-click on gmfmap -> Generate generator
> model...)
> 8. re-generate the diagram code from the gmfgen
>
> In my case all customizations annotated with @generated NOT stay
> persistent.
>
> Hope that helps,
> Marsha
>
Re: Strategy for updating the gmfgen model after having edited the ecore/ecore_d [message #179055 is a reply to message #178900] Wed, 26 March 2008 09:36 Go to previous messageGo to next message
Florian Hackenberger is currently offline Florian HackenbergerFriend
Messages: 123
Registered: July 2009
Senior Member
Dmitry Stadnik wrote:

> You may also use 'Hide @generated code' filter in Package Explorer to
> quickly find customized java classes.

> Marsha wrote:
>> In my case all customizations annotated with @generated NOT stay
>> persistent.

Thank you both for your suggestions. The procedure Marsha described is
actually what I did so far. My problem seems to be the result of a bug.
Whenever I regenerate a java file which is currently opened in an editor
window, the EMF code generator for gmfgen produces strange results.
I'll confirm the problem and file a bug.

Cheers,
Florian

--
Florian Hackenberger
Re: Strategy for updating the gmfgen model after having edited the ecore/ecore_d [message #179065 is a reply to message #179055] Wed, 26 March 2008 09:54 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: marsha.rohrer.swisscom.com

Hi Florian,

You are right, I forgot to mention that. I close all files every time I
re-generate the code. When a class is re-generated that was currently open
the code is quite a mess afterwards.

Greets,
Marsha
Re: Strategy for updating the gmfgen model after having edited the ecore/ecore_d [message #179191 is a reply to message #179065] Wed, 26 March 2008 13:56 Go to previous message
Florian Hackenberger is currently offline Florian HackenbergerFriend
Messages: 123
Registered: July 2009
Senior Member
Marsha wrote:
> You are right, I forgot to mention that. I close all files every time I
> re-generate the code. When a class is re-generated that was currently open
> the code is quite a mess afterwards.
I sent a request to reopen bug #200527 which accurately describes the issue
we have.

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

Thanks for your help!
Florian

--
Florian Hackenberger
Previous Topic:Layout?
Next Topic:Restrict the connection for the figures when they r in container
Goto Forum:
  


Current Time: Tue Apr 23 06:37:47 GMT 2024

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

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

Back to the top