Spring Statemachine - Reference Documentation

Authors

Janne Valkealahti

2.1.0.M1

Copies of this document may be made for your own use and for distribution to others, provided that you do not charge any fee for such copies and further provided that each copy contains this Copyright Notice, whether distributed in print or electronically.


Table of Contents

Preface
I. Introduction
1. Background
2. Usage Scenarios
II. Getting started
3. System Requirements
4. Modules
5. Using Gradle
6. Using Maven
7. Developing your first Spring Statemachine application
III. What’s New
8. In 1.1
9. In 1.2
9.1. In 1.2.8
10. In 2.0
10.1. In 2.0.0
IV. Using Spring Statemachine
11. Statemachine Configuration
11.1. Using enable annotations
11.2. Configuring States
11.3. Configuring Hierarchical States
11.4. Configuring Regions
11.5. Configuring Transitions
11.6. Configuring Guards
11.7. Configuring Actions
11.7.1. State Actions
11.7.2. Transition Action Error Handling
11.7.3. State Action Error Handling
11.8. Configuring Pseudo States
11.8.1. Initial State
11.8.2. Terminate State
11.8.3. History State
11.8.4. Choice State
11.8.5. Junction State
11.8.6. Fork State
11.8.7. Join State
11.8.8. Exit/Entry Point States
11.9. Configuring Common Settings
11.10. Configuring Model
11.11. Things to Remember
12. State Machine ID
12.1. With @EnableStateMachine
12.2. With @EnableStateMachineFactory
12.3. With StateMachineModelFactory
13. State Machine Factories
13.1. Factory via Adapter
13.1.1. Adapter Factory Limitations
13.2. State Machine via Builder
14. Using Deferred Events
15. Using Scopes
16. Using Actions
16.1. SpEL Expressions with Actions
17. Using Guards
17.1. SpEL Expressions with Guards
18. Using Extended State
19. Using StateContext
19.1. Stages
20. Triggering Transitions
20.1. EventTrigger
20.2. TimerTrigger
21. Listening State Machine Events
21.1. Application Context Events
21.2. State Machine Listener
21.3. Limitations and Problems
22. Context Integration
22.1. Enabling Integration
22.2. Method Parameters
22.3. Transition Annotations
22.4. State Annotations
22.5. Event Annotation
22.6. State Machine Annotations
22.7. Extended State Annotation
23. State Machine Accessor
24. State Machine Interceptor
25. State Machine Security
25.1. Configuring Security
25.2. Securing Events
25.3. Securing Transitions
25.4. Securing Actions
25.5. Using Security Attributes and Expressions
25.5.1. Generic Attribute Usage
25.5.2. Generic Expression Usage
25.5.3. Event Attributes
25.5.4. Event Expressions
25.5.5. Transition Attributes
25.5.6. Transition Expressions
25.6. Understanding Security
26. State Machine Error Handling
27. State Machine Services
27.1. Using StateMachineService
28. Persisting State Machine
28.1. Using StateMachineContext
28.2. Using StateMachinePersister
28.3. Using Redis
28.4. Using StateMachineRuntimePersister
29. Spring Boot Support
29.1. Monitoring and Tracing
29.2. Repository Config
30. Monitoring State Machine
31. Using Distributed States
31.1. ZookeeperStateMachineEnsemble
32. Testing Support
33. Eclipse Modeling Support
33.1. Using UmlStateMachineModelFactory
33.1.1. StateMachineComponentResolver
33.2. Creating Model
33.3. Define States
33.4. Define Events
33.4.1. Defer Event
33.5. Define Transitions
33.6. Define Timers
33.7. Define Choice
33.8. Define Junction
33.9. Define Entry/Exit
33.10. Define History
33.10.1. Shallow
33.10.2. Deep
33.10.3. Default
33.11. Define Fork/Join
33.12. Define Actions
33.12.1. Initial Action
33.13. Define Guards
33.14. Define Bean Reference
33.15. Define SpEL Reference
33.16. Using Sub-Machine Reference
34. Repository Support
34.1. Repository Config
34.1.1. JPA
34.1.2. Redis
34.1.3. MongoDB
34.2. Repository Persistence
34.2.1. JPA
34.2.2. Redis
34.2.3. MongoDB
V. Recipes
35. Persist
36. Tasks
VI. State Machine Examples
37. Turnstile
38. Showcase
39. CD Player
40. Tasks
41. Washer
42. Persist
43. Zookeeper
44. Web
45. Scope
46. Security
47. Event Service
48. Deploy
49. Order Shipping
50. JPA Config
51. Data Persist
52. Monitoring
VII. FAQ
53. State Changes
54. Extended State
VIII. Appendices
A. Support Content
A.1. Classes Used in This Document
B. State Machine Concepts
B.1. Quick Example
B.2. Glossary
B.3. A State Machines Crash Course
B.3.1. States
B.3.2. Pseudo States
Initial
End
Choice
Junction
History
Fork
Join
Entry Point
Exit Point
B.3.3. Guard Conditions
B.3.4. Events
B.3.5. Transitions
Internal Transition
External vs. Local Transition
B.3.6. Actions
B.3.7. Hierarchical State Machines
B.3.8. Regions
C. Distributed State Machine Technical Paper
C.1. Abstract
C.2. Intro
C.3. Generic Concepts
C.4. ZookeeperStateMachinePersist
C.5. ZookeeperStateMachineEnsemble
C.6. Distributed Tolerance
C.6.1. Isolated Events
C.6.2. Parallel Events
C.6.3. Concurrent Extended State Variable Changes
C.6.4. Partition Tolerance
C.6.5. Crash and Join Tolerance
55. Developer Documentation
55.1. StateMachine Config Model