Generate code from Astah* activity diagrams

In the latest version of the SinelaboreRT code generator support for activity diagrams was added for astah* users. astah* is a UML modeling tool written in Java and can therefore run on various platforms like Windows or Mac. In opposite to some other tools it provides a Java API for direct access of the model file. Therefore it is not necessary to export the model (e.g. in XMI format) but the SinelaboreRT code generator can directly access the model file. This makes the development cycle very fast. Give it a try!

The following figure shows an extended version of the microwave oven example. A simple hardware selftest function was added to the transition leaving the initial state. In case this test is ok the software enters the normal operation states. Otherwise an error state.

The hardware selftest function was modelled as activity. The activity itself is trivial but enough to show the new possibilities. The code of each action forming the activity is available in the properties dialog of the actions. Take a look into the manual what other diagram elements can be used.

To generate code from the activity diagram use the following commands (command line on a Mac):

java -Djava.ext.dirs=“../../bin/”:“/Applications/astah community/astah community.app/Contents/Java/” -Djava.awt.headless=true -jar ../../bin/codegen.jar -l cx -A -v -p ASTAH -o oven -t “final:oven:selftest”

The -D options tells java where to look for the jar files. The new option -A enables code generation for activity diagrams.

In case of questions, problems or suggestions please contact us.

Have fun! Peter