资 源 简 介
This port is no longer maintained, please go to https://github.com/oxo42/stateless4j
New : Use it with maven !!!
Introduction
Create state machines and lightweight state machine-based workflows directly in java code:
```
Action callStartTimer = new Action() {
@Override
public void doIt() {
StartCallTimer();
}
};
Action callStopTimer = new Action() {
@Override
public void doIt() {
StopCallTimer();
}
};
StateMachine phoneCall = new StateMachine(State.OffHook);
phoneCall.Configure(State.OffHook)
.Permit(Trigger.CallDialed, State.Ringing);
phoneCall.Configure(State.Ringing)
.Permit(Trigger.HungUp, State.OffHook)
.Permit(Trigger.CallConnected, State.Connected);
phoneCall.Configure(State.Connected)
.OnEntry(callStartTimer)
.OnExit(callStopTimer)
.Permit(Trigger.LeftMessage, State.OffHook)
.Permit(Trigger.HungUp,