Library to Dump/draw a state machine chart out of a Spring Statemachine
- Eclipse MDT UML2 (used by Papyrus UML and UML Designer) (incomplete, under development)
- SCXML (incomplete, under development)
- States dumped
- Transitions with event triggers dumped
- Sub machines dumped
- Regions dumped
- MDT UML2 output
- SCXML (not complete mapping)
- Guards dumped
- Pseudostate JOIN dumped
- Pseudostate FORK dumped
- Pseudostate CHOICE dumped
- Pseudostate JUNCTION dumped
- Actions not dumped
- Time triggers not dumped
- Lots of the Pseudostates not dumped with their specialization
- Tests are not yet real tests
- Put
net.workingdeveloper.java.spring.statemachine.dumper-*.jar
on your classpath - add these lines of code to your project source code:
- Eclipse MDT UML2 dumper:
// StateMachine<S, E> stateMachine is configured before this point
try {
SsmDumper dumper = new SsmMdtUml2Dumper<>(stateMachine);
File outputFile = new File("/path/to/output"); // ".uml" extension will be added by dumper
dumper.dump().save(outputFile);
} catch (IOException aE) {
aE.printStackTrace();
}
- SCXML dumper:
// StateMachine<S, E> stateMachine is configured before this point
try {
SsmDumper dumper = new SsmMdtUml2Dumper<>(stateMachine);
File outputFile = new File("/path/to/output"); // ".uml" extension will be added by dumper
dumper.dump().save(outputFile);
} catch (IOException aE) {
aE.printStackTrace();
}
- Run your application code that executes the above lines
- After the run has completed use UML Designer to open the generated
/path/to/output.uml
file and add a presentation (if you have choosen theSsmMdtUml2Dumper
class as dumper):- Create a workspace and project to copy the /path/to/output in: (Needs only be done for the first time, if you haven't a UML Designer project)
- Start UML Designer
- Choose your workspace e.g.
~/workspace/UMLdesigner
- Create a project e.g.
ssm_dumps
- Copy the
/path/to/output.uml
to the project e.g. to~/workspace/UMLdeisgner/ssm_dumps
- [...to be continued...]
- Create a workspace and project to copy the /path/to/output in: (Needs only be done for the first time, if you haven't a UML Designer project)
- MDT UML2
- SCXML