Sparx Systems Forum

Enterprise Architect => Uml Process => Topic started by: Antek on April 23, 2009, 09:36:00 pm

Title: Nested state diagrams EA 7.5
Post by: Antek on April 23, 2009, 09:36:00 pm
Hello,


We are trying to generate C++ code from nested state diagrams, so far no much luck. Is it possible to generate the nested state diagram code inside a state diagram? Are there examples of working projects?
I'd like to make an example class with two states, on and off. Once in the on state the state automaticly goes in the idle state, from there it can go to the energySaving state.. I'd like to be able to generate C++ code from the class and its state diagrams (and nested state diagrams).

So far i'm only able to generate a class with the on/off state diagrams in it. Not the nested diagram.

Antek
Title: Re: Nested state diagrams EA 7.5
Post by: Nizam Mohamed on April 27, 2009, 05:21:53 pm
Code generation from nested substates is possible in EA7.5. Set the Submachine state as composite( refer http://www.sparxsystems.com/uml_tool_guide/uml_dictionary/compositeelements.html) to facilitate code generation for its sub-states. Please refer to "System Engineering Model -> Implementation Model" in the EAExample model for detailed illustration on behavioral modeling for code generation.
Title: Re: Nested state diagrams EA 7.5
Post by: Antek on May 04, 2009, 10:57:42 pm
Thanks for the fast reply, the links were very helpful. I' took a look at your examples and they seem to be generating code quite well. I've encountered a strange problem. Last week I generated an application by the use of state diagrams. The code generation for the state diagram worked, it contained sub states and they were all generated. Now I've tried to reopen the project files. I added one more state to a sub state diagram. After I generated the code EA 7.5 didn't generate any specific state diagram code at all, only the run, initialize, transaction functions. I've tried deleting the new state and regenerate my code. No success at all.. Any suggestions for this problem?
Title: Re: Nested state diagrams EA 7.5
Post by: Antek on May 06, 2009, 09:59:57 pm
I've tried reinstalling EA 7.5b. No success when generating source code from my project files. After that I tried to generate the C++ example in the EAExample project. EA 7.5 crashes when generating code from standard example. When it once worked before. We didn't change any settings nor touched the project files.
Any suggestions to get this working again? We are currently using EA 7.5 system engineering Trial edition.
Title: Re: Nested state diagrams EA 7.5
Post by: Antek on May 06, 2009, 10:29:37 pm
It seems that the trial version don't likes the month May. I've set my system date back to April and everything is working again. Am i able to use this workaround?
Title: Re: Nested state diagrams EA 7.5
Post by: Nizam Mohamed on May 26, 2009, 10:16:36 am
Hi Antek,  That was due to a sporadic initialization failure of the code generation engine. which was identified and has been fixed in the next build of EA7.5(845). Sorry for the inconvenience.