Book a Demo

Author Topic: StateMachine Generate Code is disabled  (Read 6343 times)

PetPaul64

  • EA Novice
  • *
  • Posts: 11
  • Karma: +0/-0
    • View Profile
StateMachine Generate Code is disabled
« on: December 10, 2013, 12:33:09 am »
I'm using EA 9.0 Ultimate.

I'm trying to generate code from a StateMachine.

Therefor I create a Class-Object.
Then I add a StateMachine to the class using the Project Browser.
With the contextmenu of the class I'm able to generate the C# code for the class. But the code of the StateMachine has not been generated.

In the contextmenu of the StateMachine the option "Generate Code" is disabled.

Are there any preconditions I have to fullfill to be able to generate code from the StateMachine?

Anyone any idea what I have to do?

Thanks in advance

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: StateMachine Generate Code is disabled
« Reply #1 on: December 10, 2013, 01:19:41 am »
Which edition do you use? Code gen might not be available in all of them.

q.

PetPaul64

  • EA Novice
  • *
  • Posts: 11
  • Karma: +0/-0
    • View Profile
Re: StateMachine Generate Code is disabled
« Reply #2 on: December 11, 2013, 06:14:31 pm »
EA 9.0.908
Ultimate Edition

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: StateMachine Generate Code is disabled
« Reply #3 on: December 11, 2013, 10:10:51 pm »
According to http://www.sparxsystems.com/enterprise_architect_user_guide/9.3/software_engineering/code_generation_from_behaviora.html you can generate the code via the class or package. Seems to make sense as the state machine itself is only a code snippet inside the class' code.

The UI of EA is very "unique" rather than user-oriented. So probably you would expect the option not to appear at all instead of being greyed out.

q.

Dermot

  • EA Administrator
  • EA User
  • *****
  • Posts: 591
  • Karma: +7/-0
    • View Profile
Re: StateMachine Generate Code is disabled
« Reply #4 on: December 12, 2013, 02:58:15 pm »
The Ultimate Edition this does produce Code for the State Machine.
I suggest you try the EAExample model Class:

Project Models.Systems Engineering.Implementation Model.Software.C#.DataProcessor

Do a Generate Code for this and check your results.

The State Machine does not support the Code Generation option - only the Class does.

PetPaul64

  • EA Novice
  • *
  • Posts: 11
  • Karma: +0/-0
    • View Profile
Re: StateMachine Generate Code is disabled
« Reply #5 on: December 12, 2013, 09:06:20 pm »
I did try it with the EAExample model Class.

The Class for the DataProcessor was generated.
But neither the State Machine "SearchExternalMedia" nor the Acitivities "doAppendBuffer" were generated.

Any ohter ideas?

Thanks

Dermot

  • EA Administrator
  • EA User
  • *****
  • Posts: 591
  • Karma: +7/-0
    • View Profile
Re: StateMachine Generate Code is disabled
« Reply #6 on: December 16, 2013, 03:28:07 pm »
I suggest you check that the templates are showing correctly:
 -  Ctrl+Shift+P
 - Select C#
Under "Templates" select "State" - this should be showing the template script for generating a State.

PetPaul64

  • EA Novice
  • *
  • Posts: 11
  • Karma: +0/-0
    • View Profile
Re: StateMachine Generate Code is disabled
« Reply #7 on: December 17, 2013, 03:09:59 am »
I have gotten the templates and the template script for State, StateMachine and so on. But it seems to me that they won't be triggered in code generation.

Is there a place to deactivate them?
I have already reinstalled EA. But got no changes.

Further ideas?

Thanks