Readme

Apache License 2.0 Maven Central javadoc build issues discussions

Purpose

The tangly fsm is a finite state machine library. You can use it in productive projects and academic assignments. The component is using records and requires Java 17 or higher.

The library provides

  • Definition of hierarchical state machine descriptions. The machine states and transitions are generic classes. You provide an enumeration for the set of states, and an enumeration for the set of events triggering the machine. The builder pattern is used to create complex state machine definition declaratively,

  • Builder approach to construct finite state machine declaration being either classical state machines or hierarchical state machines

  • Lambda expressions based on standard API functional interfaces are used for guards and actions

  • Guard are bi-predicate lambda expressions with the context and event as parameters

  • Actions are bi-function lambda expressions with the context and event as parameters

  • A runtime engine processing events on a finite state machine description. Multiple instances of the same description can be instantiated. The class owning the state machine is passed as context to all guards and actions,

  • Support classes to implement listeners and logging are provided.

  • Documentation helper can generate a graphical representation of a state machine using the graph dot language. Various output formats are supported

  • Table representation

  • Dot graph representation

  • PlantUML UML finite hierarchical state machine representation

Download and Documentation

The library can be included in Maven as

    <dependency>
      <groupId>net.tangly</groupId>
      <artifactId>fsm</artifactId>
      <version>0.2.7</version>
    </dependency>

The library can be included in Gradle as

    implementation "net.tangly:fsm:0.2.7"

The documentation can be found under FSM documentation.

For any further questions, you can use the forum tangly-Discussions.

Contribution

The library can be built with Gradle

    gradle build