transplantUML is a versatile tool built in Go, designed to convert SCXML (State Chart XML) files into any desired format using the Go templating engine. It empowers developers to easily transform state machine definitions into custom outputs such as code, documentation, or visualizations.
- SCXML Parsing: Reads and processes SCXML file.
- Go Templating Engine: Leverages the powerful Go templating system for flexible output generation.
- Customizable Outputs: Generate any desired format, such as source code, diagrams, or documentation, by providing the appropriate templates.
- Lightweight and Fast: Built with Go, ensuring speed and simplicity in deployment.
- Go (version 1.18 or later is recommended).
- A valid SCXML file as input.
- Custom templates written in Go's templating syntax.
- See the official documentation for more information.
-
Clone the repository:
git clone https://github.com/vincedupuis/transplantUML.git cd transplantUML
-
Build the project:
go build cmd/tpuml.go
-
Run the tool:
./tpuml -i statechart.scxml -t template.tmpl -o output.ext
-i
: Path to the SCXML file to be converted.-t
: Path to the Go template file defining the desired output format.-o
: Path where the generated file will be saved.
To convert an SCXML file into a plantUML diagram:
./tpuml -i example/coffee-machine.scxml -t assets/plantuml.tmpl -o coffee.puml
The resulting coffee.puml
file will contain a structured plantUML that can be visualized with PlantUML Online.