Sinelabore Homepage

Generate production quality code from state diagrams created with DrawIO Desktop#

SinelaboreRT can generate state machine code from DrawIO desktop models using supported UML palette elements.

Quick Start#

Use the microwave example from the examples folder and regenerate code from a .drawio model.

java -cp "pathToCodegenJarFolder/*" codegen.Main -p drawio -l cx -o oven oven.drawio

Supported Elements#

  • Normal and hierarchical states
  • Deep/flat history ((H*), (H) in state names)
  • Initial and final states
  • Signal events (name, guard, action)
  • Choice and comments

Example Diagrams#

Supported DrawIO UML elements

Microwave state machine in DrawIO

How-To Notes#

  • Connect transitions on the light-green anchor points on state borders.
  • Enter guards on outgoing choice transitions in square brackets.
  • Use -t to select a specific diagram by name if needed.