Skip to content

pdalfarr/spring-state-machine-chart-dumper

 
 

Repository files navigation

spring-state-machine-chart-dumper

Library to Dump/draw a state machine chart out of a Spring Statemachine

Supported Formats

Status of 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

Usage

  1. Put net.workingdeveloper.java.spring.statemachine.dumper-*.jar on your classpath
  2. 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();
     }
  1. Run your application code that executes the above lines
  2. 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 the SsmMdtUml2Dumper class as dumper):
    1. 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)
      1. Start UML Designer
      2. Choose your workspace e.g. ~/workspace/UMLdesigner
      3. Create a project e.g. ssm_dumps
    2. Copy the /path/to/output.uml to the project e.g. to ~/workspace/UMLdeisgner/ssm_dumps
    3. [...to be continued...]

Tools for viewing generated models

About

Library to Dump/draw an state machine chart out of a Spring Statemachine

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 99.8%
  • D 0.2%