@@ -1185,7 +1185,7 @@ include::samples/demo/eventservice/StateMachineConfig.java[tags=snippetC]
|
||||
|
||||
In below config we setup a `RedisConnectionFactory` which defaults to
|
||||
localhost and default ports. We also use `StateMachinePersist` with
|
||||
`RepositoryStateMachinePersist` implementation. These are then later
|
||||
`RepositoryStateMachinePersist` implementation. These are used
|
||||
in a `Controller` handling `REST` calls.
|
||||
|
||||
[source,java,indent=0]
|
||||
@@ -1313,4 +1313,6 @@ should see `COUNT` variable to increase with every call.
|
||||
image::images/sm-eventservice-4.png[width=500]
|
||||
|
||||
Order to implement actual logic to track user behaviour, you'd then
|
||||
define this in a various `Actions` in a state machine.
|
||||
define these in a various `Actions` in a state machine. You can
|
||||
associate different `Actions` with transitions, state entry's or state
|
||||
exits' and with various listener methods.
|
||||
|
||||
@@ -1425,13 +1425,19 @@ the interceptors are discussed in <<sm-interceptor>>.
|
||||
=== Using Redis
|
||||
Support for persisting State Machine into Redis is done via
|
||||
`RepositoryStateMachinePersist` which implements
|
||||
`StateMachinePersist`.
|
||||
`StateMachinePersist`. Specific implementation is a
|
||||
`RedisStateMachineContextRepository` whic uses `kryo` serialization to
|
||||
persist a `StateMachineContext` into `Redis`.
|
||||
|
||||
[TIP]
|
||||
====
|
||||
Check sample <<statemachine-examples-eventservice>> for detailed usage.
|
||||
====
|
||||
|
||||
`RedisStateMachineContextRepository` will need a
|
||||
`RedisConnectionFactory` for it to work and we recommend a
|
||||
`JedisConnectionFactory` for it as seeing from above example.
|
||||
|
||||
[[sm-distributed]]
|
||||
== Using Distributed States
|
||||
Distributed state is probably one of a most compicated concepts of a
|
||||
|
||||
@@ -214,7 +214,7 @@ public class StateMachineConfig {
|
||||
new RedisStateMachineContextRepository<States, Events>(connectionFactory);
|
||||
return new RepositoryStateMachinePersist<States, Events>(repository);
|
||||
}
|
||||
//end::snippetD[]
|
||||
//end::snippetD[]
|
||||
|
||||
@Bean
|
||||
public String stateChartModel() throws IOException {
|
||||
|
||||
Reference in New Issue
Block a user