Document repository config changes

- Generic changes
- Document redis support
- Relates to #263
This commit is contained in:
Janne Valkealahti
2016-11-05 15:29:10 +00:00
parent ea6648ce0d
commit 797279a53c
2 changed files with 23 additions and 18 deletions

View File

@@ -44,6 +44,9 @@ framework.
|spring-statemachine-data-jpa
|Support module for `Spring Data JPA`.
|spring-statemachine-data-redis
|Support module for `Spring Data Redis`.
|spring-statemachine-zookeeper
|`Zookeeper` integration for a distributed state machine.

View File

@@ -2047,13 +2047,6 @@ image::images/papyrus-gs-15.png[width=400]
[[sm-repository]]
== Repository Config Support
[IMPORTANT]
====
Repository abstraction support is still work in progress and scheduled
to be complete in future milestones.
====
It is also possible to keep machine configuration in an external
storage where it will be loaded on demand instead of creating a static
configuration either using _JavaConfig_ or _UML_ based config. This
@@ -2061,9 +2054,10 @@ integration works via _Spring Data Repository_ abstraction.
We have created special `StateMachineModelFactory` implementation
called `RepositoryStateMachineModelFactory` which is able to use base
repository interfaces `StateRepository` and `TransitionRepository`
accompanied with base entity interfaces `RepositoryState` and
`RepositoryTransition` respectively.
repository interfaces `StateRepository`, `TransitionRepository`,
`ActionRepository` and `GuardRepository` accompanied with base entity
interfaces `RepositoryState`, `RepositoryTransition`,
`RepositoryAction` and `RepositoryGuard` respectively.
Due to way how _Entities_ and _Repositories_ work in a _Spring Data_,
from a user perspective read access can be fully abstracted as it is
@@ -2072,7 +2066,7 @@ know what is a real mapped _Entity_ class _Repository_ is working
with. Writing into a _Repository_ is always dependant of using a real
_Repository_ specific _Entity_ class. From machine configuration point
of view we don't need to know these, meaning we don't need to know
actual implementation whether that is _JPA_, _Mongo_ or anything else
actual implementation whether that is _JPA_, _Redis_ or anything else
what _Spring Data_ supports. Using a real _Repository_ related
_Entity_ class comes into play when you manually try to write new
states or transitions into a backed repository.
@@ -2081,13 +2075,11 @@ Actual out of a box implementations are documented in below sections.
[[sm-repository-jpa]]
=== JPA
Currently one repository implementation exists which uses _JPA_ to
access configured database.
Actual _Repository_ implementations for a _JPA_ are
`JpaStateRepository` and `JpaTransitionRepository` which are backed by
_Entity_ classes `JpaRepositoryState` and `JpaRepositoryTransition`
respectively.
`JpaStateRepository`, `JpaTransitionRepository`, `JpaActionRepository`
and `JpaGuardRepository` which are backed by
_Entity_ classes `JpaRepositoryState`, `JpaRepositoryTransition`,
`JpaRepositoryAction` and `JpaRepositoryGuard` respectively.
Generic way to update states and transition manually is shown below.
@@ -2097,5 +2089,15 @@ include::samples/DocsJpaRepositorySampleTests1.java[tags=snippetA]
----
Complete example can be found from sample
<<statemachine-examples-datajpa>>.
<<statemachine-examples-datajpa>>. This example is also showing how
repository can be pre-populated from existing _json_ file having a
definitions for entity classes.
[[sm-repository-redis]]
=== Redis
Actual _Repository_ implementations for a _Redis_ are
`RedisStateRepository`, `RedisTransitionRepository`, `RedisActionRepository`
and `RedisGuardRepository` which are backed by
_Entity_ classes `RedisRepositoryState`, `RedisRepositoryTransition`,
`RedisRepositoryAction` and `RedisRepositoryGuard` respectively.