spring-statemachine-chart-exporter

Simple exporter for Spring State Machine to chart format.

License

License

GroupId

GroupId

com.nofacepress
ArtifactId

ArtifactId

spring-statemachine-chart-exporter
Last Version

Last Version

0.3.1
Release Date

Release Date

Type

Type

jar
Description

Description

spring-statemachine-chart-exporter
Simple exporter for Spring State Machine to chart format.
Project URL

Project URL

https://github.com/nofacepress/spring-statemachine-chart-exporter
Project Organization

Project Organization

No Face Press, LLC
Source Code Management

Source Code Management

https://github.com/nofacepress/spring-statemachine-chart-exporter

Download spring-statemachine-chart-exporter

How to add to project

<!-- https://jarcasting.com/artifacts/com.nofacepress/spring-statemachine-chart-exporter/ -->
<dependency>
    <groupId>com.nofacepress</groupId>
    <artifactId>spring-statemachine-chart-exporter</artifactId>
    <version>0.3.1</version>
</dependency>
// https://jarcasting.com/artifacts/com.nofacepress/spring-statemachine-chart-exporter/
implementation 'com.nofacepress:spring-statemachine-chart-exporter:0.3.1'
// https://jarcasting.com/artifacts/com.nofacepress/spring-statemachine-chart-exporter/
implementation ("com.nofacepress:spring-statemachine-chart-exporter:0.3.1")
'com.nofacepress:spring-statemachine-chart-exporter:jar:0.3.1'
<dependency org="com.nofacepress" name="spring-statemachine-chart-exporter" rev="0.3.1">
  <artifact name="spring-statemachine-chart-exporter" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.nofacepress', module='spring-statemachine-chart-exporter', version='0.3.1')
)
libraryDependencies += "com.nofacepress" % "spring-statemachine-chart-exporter" % "0.3.1"
[com.nofacepress/spring-statemachine-chart-exporter "0.3.1"]

Dependencies

compile (3)

Group / Artifact Type Version
com.nofacepress : csv-4180 jar 0.2.7
org.springframework.statemachine : spring-statemachine-core jar 2.0.2.RELEASE
org.springframework.boot : spring-boot-starter jar 2.0.4.RELEASE

test (1)

Group / Artifact Type Version
org.springframework.boot : spring-boot-starter-test jar 2.0.4.RELEASE

Project Modules

There are no modules declared in this project.

Spring State Machine Chart Exporter

This package write a state chart file based on information probed. at runtime, from a Spring State Machine/

Current exports include

  1. PlantUML state charts
  2. SCXML states and transitions
  3. Lucid Chart CSV file via File / Import Data / Process File

This was created to find errors when setting up the state machine. It is very easy to make a mistake, forget or connect the incorrect states.

It may also be useful for those that code first and document later.

Build status: build_status

Maven Setup

<dependency>
  <groupId>com.nofacepress</groupId>
  <artifactId>spring-statemachine-chart-exporter</artifactId>
  <version>0.3.1</version>
</dependency>

Getting started

Using it is easy.

// PlantUML
StateMachinePlantUMLExporter.export(machine, "MY State Machine", "statemachine.plantuml");
    	
// SCXML
StateMachineSCXMLExporter.export(machine, "statemachine.scxml");

// Lucid Chart
StateMachineLucidChartExporter.export(machine, "State Machine", "statemachine-lucid.csv");

See the test state machine setup in src/test for a full working demo.

Official Source Repository

Release Notes

Arranging charts in PlantUML

PlantUML does not currently have an option to auto-arrange the charts. In fact, the specification requires the arrows specify the direction. This is a difficult problem to solve, especially for such a tiny project.

The strategy is to plot states downward and when a node has more than one connection rotate from down, to right, to left, ... The downward precedence goes to the state with the longest path. It is simple but it works pretty well. In any event, the result is a text file which a human can tweak if needed.

com.nofacepress

noface.press LLC

Versions

Version
0.3.1
0.3.0
0.2.5
0.2.4
0.2.3