Implement action monitoring and tracing

- Modify transitions and actions so that
  action execution can be monitored.
- Extend StateMachineMonitor
- Add new ActionListener
- Relates to #149
This commit is contained in:
Janne Valkealahti
2016-10-27 06:58:23 +01:00
parent 83e59c2a60
commit cc2893c4b8
17 changed files with 369 additions and 27 deletions

View File

@@ -35,8 +35,8 @@ public class StateMachineConfig {
states
.withStates()
.initial("S1")
.state("S2")
.state("S3");
.state("S2", null, (c) -> {System.out.println("hello");})
.state("S3", (c) -> {System.out.println("hello");}, null);
}
@Override
@@ -45,6 +45,7 @@ public class StateMachineConfig {
transitions
.withExternal()
.source("S1").target("S2").event("E1")
.action((c) -> {System.out.println("hello");})
.and()
.withExternal()
.source("S2").target("S3").event("E2");