Reply To: RE: RE: RE: RE: source code generation

Now I need few days for the answer.

1. FinalState will be included to generation in the next version. InitialState will be not generated as it is only a PseudoState according to UML standard - it should specify the "real" state where we want to start.

2. Generation of Do action will be added in the next version.

3. Standard Actions will be added to generated code as comments in the next version. The code of these actions need to be specified in the Source Code tab.

4. It could be added in the next version or in one of next versions.

5. The name is generated by the folder name. After renaming the folder, the name in the generated code should change too. Changing the custom namespace of diagram should also work. In my test project it works, if it does not work for you, it would need further examination of the issue. I could also provide you an example project.

The default name of folders was changed in the current version to not contain a space by default to prevent the problems with naming in the generated source codes.

6. If we have two state Draft and Open, initial state leads to Draft and we have also a context class StateMachine with operations Open and WriteState, we can write the following code:

StateMachine sm = new StateMachine();

sm.WriteState(); // It writes the current state to the console, now it returns Draft


sm.WriteState(); // It writes the current state to the console, now it returns Open

I can prepare also a complete tutorial on this topic also with an example project.

7. Templates for state machine are not yet available for VB.NET and C++, only for C#.

I hope I helped you a bit. In case of any other questions feel free to let me know.

Dusan Rodina - 18 August 2017 23:50:11

New Comment

You can use these formatting tags: [b]bold[/b] [i]italic[/i] [u]underline[/u] [url][/url] [code]some code[/code] [quote]quoted text[/quote] [list]one list item per line[/list]