I'm looking for a tool that understands a DSL in which I can define my statechart that generates Java code or where the statechart in the DSL is runnable as is. The tool would ideally be written in Java and must support superstates and orthogonal regions by definition of Harel Statecharts (or equivalently UML 2 State Machines). Alternatively, what would be the best library or tool to write such a DSL with?
Yakindu looks good: http://www.statecharts.org
There is a Harel Statechart DSL written in Pharo Smalltalk and published in OBJEKTspektrum:
http://www.sigs-datacom.de/fileadmin/user_upload/zeitschriften/os/2011/04/krasemann_brauer_crasemann_OS_04_11.pdf
Alas, this is in German. However, the code is in English:
www.squeaksource.com/AuDSL3.html
The implementation of this DSL might easily be ported to Scala parser combinators, which means, it would become available for Java.
If you want to do the port, we would gladly help ([email protected]).
We just have not done it yet.
* added 2012-03-17 * The Scala port is ready now. It comes as a Scala Trait and thus can easily be inherited by your scala class that might be used by your Java program. You find it here: http://dl.dropbox.com/u/4548797/AuDSLinScala-src.zip
ThingML is a textual DSL that allows modelling UML-like state machines (including composite states, parallel regions, etc). From a ThingML specification, Java, C or JavaScript can be generated. A set of tutorials is available here
I have developed a library that I use to keep track of states and to move between states within an application, called JavaKI. This is based on the KI framework that is now part of the SproutCore JavaScript framework. Both are based on Harel charts.
Currently, JavaKI does not support history states, but you are welcome to implement this functionality if you need it. JavaKI is Java-based and licensed under the MIT license.
https://github.com/joachimhs/JavaKI
With JavaKI you defined your states and your state chart in "Plain Old Java".
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With