Sparx Systems Forum

Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: PetPaul64 on December 10, 2013, 12:33:09 am

Title: StateMachine Generate Code is disabled
Post by: PetPaul64 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
Title: Re: StateMachine Generate Code is disabled
Post by: qwerty on December 10, 2013, 01:19:41 am
Which edition do you use? Code gen might not be available in all of them.

q.
Title: Re: StateMachine Generate Code is disabled
Post by: PetPaul64 on December 11, 2013, 06:14:31 pm
EA 9.0.908
Ultimate Edition
Title: Re: StateMachine Generate Code is disabled
Post by: qwerty 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.
Title: Re: StateMachine Generate Code is disabled
Post by: Dermot 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.
Title: Re: StateMachine Generate Code is disabled
Post by: PetPaul64 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
Title: Re: StateMachine Generate Code is disabled
Post by: Dermot 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.
Title: Re: StateMachine Generate Code is disabled
Post by: PetPaul64 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