Book a Demo

Author Topic: How to generate code from state machine?  (Read 4566 times)

RainerQ

  • EA User
  • **
  • Posts: 122
  • Karma: +1/-0
    • View Profile
How to generate code from state machine?
« on: July 20, 2010, 10:23:28 pm »
Hi

before I start the "real work" I decide to first experiment with state machines / State diagrams / Code generation.

As it looks, this was a good idea, because with my simple state machine which I placed beneath a class I can't get EA to generate some code.

What must I do to actually generate code?
clicking on the classes context menus "Generate Code ..." isn't it :-(

Thanks for help and hints.

Regards
Rainer

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: How to generate code from state machine?
« Reply #1 on: July 20, 2010, 10:31:05 pm »
Rainer,

You know that this option is only available in certain EA editions right?

Geert

RainerQ

  • EA User
  • **
  • Posts: 122
  • Karma: +1/-0
    • View Profile
Re: How to generate code from state machine?
« Reply #2 on: July 20, 2010, 10:33:46 pm »
Hi Geert,

yes I know that and I do have the ultimate edition  :)

Regards
Rainer

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: How to generate code from state machine?
« Reply #3 on: July 20, 2010, 10:36:11 pm »
Then I don't know.
I guess you do have the state machine, nested in the class, and the state diagram, including all states and transitions nested in the state machine?

Seems like generate code should then do the trick.

Geert

RainerQ

  • EA User
  • **
  • Posts: 122
  • Karma: +1/-0
    • View Profile
Re: How to generate code from state machine?
« Reply #4 on: July 20, 2010, 10:38:40 pm »
Quote
I guess you do have the state machine, nested in the class, and the state diagram, including all states and transitions nested in the state machine?

Yes, exactly like that.

Regards
Rainer

RainerQ

  • EA User
  • **
  • Posts: 122
  • Karma: +1/-0
    • View Profile
Re: How to generate code from state machine?
« Reply #5 on: July 20, 2010, 11:10:08 pm »
... ok as it looks, this problem seems to be cause because the target file is existing already.

I just deleted the file (renamed it) and then generated the code for the class again. This time all operations, attributes + state machine code were generated.

But that doesn't help me at the moment, because my class "Target class" already contains code...

What must I do to "ADD" state machine code to a existing class?

Regards
Rainer

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: How to generate code from state machine?
« Reply #6 on: July 21, 2010, 08:55:19 am »
Behavioral code generation currently isn't available for code synchronization.  This is in our plans, but so far that is as far as it has gone.

RainerQ

  • EA User
  • **
  • Posts: 122
  • Karma: +1/-0
    • View Profile
Re: How to generate code from state machine?
« Reply #7 on: July 21, 2010, 04:15:18 pm »
Hello Simon,

thanks for the information. Now I know the reason to my problem and can think of a workaround. Probably I will let the behavioral code be generated to a dummy class and then copy it to the target class.

That should do until the "behavioral code synchronization" is implemented to EA - what I hope won't be in a too far away future ;-)

Regards
Rainer