Book a Demo

Author Topic: Code Generation in batch overwrites custom code  (Read 3641 times)

tk2014

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Code Generation in batch overwrites custom code
« on: May 28, 2014, 09:47:16 pm »
Hi all,

we are using EA 7, but I tried it out with EA 11 eval. version, too.

Is it expected behaviour that the Generate Source Code function overwrites own code in the files, if called with "Auto Generate Files" in a batch run over whole tree? Our workflow involves a transformation step from language independent model to the Java model. The Java model is deleted and created again after some changes in the original model. Could this be causing the problem?

We do no reverse synchronization in our workflow. Only we want to have some custom code in addition in the generated classes.

Thanks in advance for any hints, with best regards,
Torsten

tk2014

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Re: Code Generation in batch overwrites custom cod
« Reply #1 on: May 28, 2014, 10:05:14 pm »
I just found out about the option
Source Code Engineering -> Attribute/Operations ->
"On forward synch, prompt to delete code features not in model".

And it is necessary to select "Retain Existing File Paths" in the Code Generation dialog to preserve also existing contents.

Well, that does it. But it requires manual interventionin each of the hundreds of classes.   :-/

Best regards, Torsten

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Code Generation in batch overwrites custom cod
« Reply #2 on: May 29, 2014, 09:10:39 am »
The reverse of "On forward synch, prompt to delete code features not in model" is "Do not delete methods from code that aren't found in the model". I don't think that checkbox was what was causing your problem.

There are options to generate the entire file from scratch. The default is always to synchronize.