Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
based on java signals.
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
.gitignore add idea files to git ignore
.project add maven support
pom.xml fresh new state machine


an useless library for refactor ur messy if/else business logic.


  • Java 6

Mini DSL

State start = createState("start");
start.enter = new Signal(String.class).add(callee, true, "beep", "<============= start enter helloWorld ===============>");
start.exec = new Signal(String.class).add(callee, true, "beep", "<============= i am in start state ===============>");
// new service state
State service = createState("service");
// add enter and exit signal
service.enter = new Signal(String.class).add(callee, true, "beep", "<============= service enter helloWorld ===============>");
service.exec = new Signal(String.class).add(callee, true, "beep", "<============= i am in service state ===============>");
service.exit = new Signal(String.class).add(callee, false, "beep", "<============= service exit byeWorld ===============>");
// new task state
State task = createState("task");
task.enter = new Signal(String.class).add(callee, true, "beep", "<============= task enter helloWorld ===============>");
// new end state
State end = createState("end");
end.exec = new Signal(String.class).add(callee, true, "beep", "<============= i am in end state ===============>");
// process transition"a > 5");"a <= 5");;;

Dot Support

Graphviz is open source graph visualization software.

install grapviz

on ubuntu or debian:

apt-get install graphviz


gen dot file


wow: folder will found :


Javascript Interpreter

  • use it in Transition class / when method,true or false?

Running Statemachine

exec the src/example Main to run a statemachine.

Architecture Overview

Statemachine is organized into two parts: a state machine and a java signals which is inspired by as3signals.each state has three inject point.(enter exec exit)u can use it do anything u want with signals.


  • Statemachine is not a "java like" java library. if u dont like this style. u can change it by urself.



Statemachine is licensed under the MIT License. (See LICENSE)

Something went wrong with that request. Please try again.