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:
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user