Book a Demo

Author Topic: Problem with Code Engeneering  (Read 5361 times)

TomPre

  • EA Novice
  • *
  • Posts: 12
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Problem with Code Engeneering
« on: October 19, 2006, 03:14:43 am »
Hi, I'm having a problem with code engeneering.
It happens when I'm changing a operation or attribute name(or even just the parameters in case of an operation) in the diagram, a new function or variable is generated in the header and source instead of the old ones being renamed. Is it possible to change something in the Code Generation Templates(perhaps via the guid), to make the program change the existing code instead of adding new code? Help will be very appreciated.

Tom
« Last Edit: October 19, 2006, 03:15:20 am by TomPre »

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Problem with Code Engeneering
« Reply #1 on: October 19, 2006, 03:06:44 pm »
You have two options (actually three if you count living with the current behaviour).

1. Open to the Attribute/Operations page of the options dialog.  (Tools | Options).  Once there check 'On forward synch promt to delete code features not in model'.  This will bring up a dialog that also allows you to tell EA how the signature has changed so that it can synchronize with it correctly.

2. Open up the build scripts dialog (Project | Build and Run | Package Build Scripts).  Once there check 'Use Live Code Generation'.  This will automatically generate the code for any changes made in that branch of the model.  A side effect of doing this is that you shouldn't need the prompt above for EA to rename operations.

TomPre

  • EA Novice
  • *
  • Posts: 12
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: Problem with Code Engeneering
« Reply #2 on: October 20, 2006, 12:06:36 am »
Thank you. Tried both answers and found the first to be good.  ;D

TomPre

  • EA Novice
  • *
  • Posts: 12
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: Problem with Code Engeneering
« Reply #3 on: October 20, 2006, 02:42:20 am »
Now I've got a new problem. If I write sth. in the function body(even if it's just a comment), only the header will get updated.

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Problem with Code Engeneering
« Reply #4 on: October 20, 2006, 04:48:36 am »
Do you mean that if the string "sth." (without the quotes) appears anywhere EA acts differently? If so this has to be a bug. And if so, what language(s) does this affect?
No, you can't have it!

TomPre

  • EA Novice
  • *
  • Posts: 12
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: Problem with Code Engeneering
« Reply #5 on: October 20, 2006, 06:23:52 am »
sorry that "sth." was short for something  ;D. What I  meant is that even if I just write one letter in the function body between "{ and }" the source file will not be updated only the header will. I'm using the C template. Don't know about other templates.

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Problem with Code Engeneering
« Reply #6 on: October 23, 2006, 06:31:08 pm »
It appears that C implementations are currently not synchronized at all.  We'll address this for a future build.

TomPre

  • EA Novice
  • *
  • Posts: 12
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: Problem with Code Engeneering
« Reply #7 on: November 03, 2006, 01:10:54 am »
Just wanted to add that if I change something in a typedef it is also not recognized properly and on reverse engeneering the enums and structs are being duplicated in the model as if the program would not recognize that they are already in it.
« Last Edit: November 03, 2006, 01:13:24 am by TomPre »

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Problem with Code Engeneering
« Reply #8 on: November 05, 2006, 01:03:03 pm »
I'd recommend sending examples in to sparx support.