State Machine Framework StaMa experience

Hi again,

Has anyone experience with using the state machine I have found on http://stama.codeplex.com/
?

1 Like

Looks interesting. Thanks for the link.

Looks like a catch-22: No references, no trust. How can I give support?

1 Like

Huh? Is this the same Roland that appears as the coordinator of the StaMa project? What are you trying to say? Or is this spam? Sorry, but your statement makes no sense to me if you are a member of the StaMa project.

http://stama.codeplex.com/team/view

Yes, I am the coordinator.
Ok, my English is sh…
Look at the “Discussions” and “Issues” tab of StaMa on Codeplex: Almost no questions and no issues since several years. Are all users happy or is no one using it? As the project doesn’t contain documentation nor unit tests, probably the latter is the case, at least for commercial products. Therefore I’m asking how to support the only one user (njbuch) that shows his interest.

Independent of if there is documentation or not, it looks very interesting except the fact you need Visio.
Visio is not free and (in my opinion), using it is like a pain in the a!$.
Visio can do so much, and you can control any little attribute, but that’s it’s power and weakness. Having a little standalone app to define the state machines would make it better to use I think.

@ Roland Schneider - This project is VERY promising and I think it should have a formal role in netmf. Thanks for showing up here Roland.

The Visio part was a big hurdle and I tried with a trial. But any free tool would be a HUGE benefit. I think I have seen some open UML drawing programs based on generic frameworks.

The lack of documentation made the client refuse to use it.

So. I have never used it in a large project. (Sorry)

1 Like

Thanks, Reinhard and njbuch for appreciating the project.

Visio was the easiest way for me to get states and transitions drawn, printed and generated to code. The Visio shapes work if You know how to assemble the parts, but its not easy to start with. And Visio costs $.

In the past years I had a few contacts with Borland Together UML and Sparxsystems Enterprise Architect and considered to implement a converter from XMI export data to StaMa code. Are UML tools widespread used in NETMF projects? Not sure. The exported XMI content was already dramatically different between Together and EA, so a common converter tool for at least a small subset of UML tools is not realistic IMO. Together and EA didn’t precisely support the StaMa capabilities and on the other side provided a lot of modeling beyond the StaMa capabilities which will cause additional complexity for a converter tool. And they cost €. So this doesn’t look promising.

@ njbuch:
Which free UML drawing tools would You suggest?
What would be the basic documentation needed for using StaMa in a commercial project?
Would it be sufficient to document the library usage?
Is a description of the internal design needed?
Is a graphical editor needed?

@ Reinhard:
What functionality would “a little standalone app” require?
Any ideas which platform/base libraries or existing tools to use?

Personally I’d love to start creating a graphical editor with WPF from scratch, but it would be a project on its own and would consume months of spare time. Not sure if it would ever be finished so it doesn’t help here.

I have used UMLet Homepage - Free UML Tool a few times.

Export a pretty clean ascii file with diagram in it. Maybe that would be usable?

A graphical editor is not a must, but really nice when complexity grows.

Commercially, documentation wise, there should be no guessing, and lots of samples. So any developer can get started.I think library usage would be enough in first round.

I dont care about internal design as long as the lightweight promises are true :wink:

it’s funny, I was looking at this earlier today. The one thing I would want is to update it (if needed?) to focus on “current” VS2012 + Netmf 4.2 combination.

The tool would need to allow to design the state machine in an graphical editor with adding states, drag them around, connect them by drag and drop, …
and finally generate the code from it.
Since I like WPF too, I would most likely start from the scratch to write this.
In fact I made something similar already (dragging boxes and connect them), but its an commercial project at my full time job.

@ njbuch
Thanks for the link to the fancy Umlet tool. The user interaction concept is really impressive, but unfortunately doesn’t provide real nesting: Dragging the composite state leaves the nested states at their place. Looking into the .uxf file shows that all graphic objects are on the same single level. Mapping the .uxf content to a nested structure might be complex and not reliable.
Thanks also for the ranking of tasks.

@ Reinhard
Compared to my first experiences with graphic platforms, WPF provides a tremendous set of functionality. I’ll think about a tool implementation using WPF.
But intend to start with below tasks.
And You would be welcome to participate and contribute with a generator tool. :slight_smile:

Next steps for StaMa:

  • A user guide that maps the general state machine concepts onto the StaMa implementation
  • A description how to use the Visio stuff
  • A description of the implementation concept
  • Check in unittests
1 Like

Hi again, I have a real world scenario, and I really want to use Stama for this. Tried a third time with download of the zip-file from codeplex, and are stuck, I have no clue what to do. :wall:

I hope your documentation effort is moving forward, and I am really looking forward to try this.

Ok, status, I managed to get it working.

I love it!!! :smiley:

This is so great to do complex state-diagrams, that would take a lot of experiments with timers and exceptions, now it just works, and changes are easy to implement without having to worry about a perfect encapsulation or model.

This is simply brilliant for small embedded devices and I wonder why this is not a part of NETMF in the core.

Visio is also a MS technology, can the drawing not be part of VS?

I am still a learner into state-diagramming, and have yet to completely get my head around all the concepts, and still looking for a little primer.

@ Roland - I could maybe help with some documentation?

Sorry for the late reply, the spam mail filter sorted out all notifications from ghielectronics.com.

Happy to hear You decided to give Visio a chance.
As mentioned before, currently Visio is the only option to generate the code from a visual diagram.
I agree it is not the ideal solution:

  • Visio is not free of charge.
  • Usage of (at least) state machine Shapes is often not self-explanatory.
  • The visual appearance of the states, regions and transitions deviates from UML standard.

You could add the .vsd file to the Visual Studio project (or solution) in order to have quick access. Make sure the “Build Action” in the file’s Properties panel is set to “None”.
Double clicking the .vsd file in Solution Explorer will open Visio as a separate application.
To generate code press Ctrl+G in Visio (see Add-Ins ribbon, StaMa submenu) and switch back to Visual Studio to see the .cs file update notification.

A really brief explanation of composite and orthogonal state machine concepts can be found at the Boost Meta State Machine documentation (see Concepts - 1.55.0 ).
The UML subchapter for state machines (see section 14 StateMachines in UML 2.5 ) is the official reference for the common wording.

@ Roland - So good to see you again, and thank you so much for getting back to me! :smiley:

You links are not working, I have managed to remove the ) and .) in the end, but can you correct the post not to confuse anyone - thanks.

I will do some studying, and get back with my feedback.

Thank you so much.

Anyone else in this forum, on this amazing bandwagon?

@ njbuch - I saw this a long time ago, and always wanted to try it!

We’re finally settling into our new house, and in a few weeks I should have the time to start programming again. I’ll look into using StaMa, I want to purchase and try MikroBus.Net, and a few other things…

1 Like

@ jasdev - just to clarify MikroBus .Net http://www.mikrobusnet.org/ is not related to StaMa

But it sounds great, looking forward to hear your comments and experiences with both things!

OK, specific question:

If I draw a fork (as instructed) and send the signal that triggers the fork, how do I access the two different state-machines?

The way I am handling it now, is having one machine-defition, that I instantiates twice, and then send two different signals to each of them. Which is clearly a workaround.

Niels,

fork transitions imply the state machine has orthogonal states. Orthogonal states are typically used to represent independent sub-parts or sub-activities of the system.

Your statement indicates You took a different approach: Instead of having orthogonal states You have multiple state machine instances representing the sub-parts or sub-activities of the system. And probably an additional master state machine that coordinates the sub-part state machines.

Breaking up the system this way may be completely reasonable, in particular if the sub-parts are dynamically created at runtime and their number is not known at design time.

However then You don’t have a fork transition in the sense of the state machine formalism.

See e.g. the attached figure illustrating two approaches (separated by blue line) for the design of the initialization synchronization of a system with multiple sub-parts.

Does this help?

Roland.