Spring Statemachine - Reference Documentation

Authors

Janne Valkealahti

1.2.13.RELEASE

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
9.2. In 1.2.9
IV. Using Spring Statemachine
10. Statemachine Configuration
10.1. Using enable annotations
10.2. Configuring States
10.3. Configuring Hierarchical States
10.4. Configuring Regions
10.5. Configuring Transitions
10.6. Configuring Guards
10.7. Configuring Actions
10.7.1. State Actions
10.7.2. Transition Action Error Handling
10.7.3. State Action Error Handling
10.8. Configuring Pseudo States
10.8.1. Initial State
10.8.2. Terminate State
10.8.3. History State
10.8.4. Choice State
10.8.5. Junction State
10.8.6. Fork State
10.8.7. Join State
10.8.8. Exit/Entry Point States
10.9. Configuring Common Settings
10.10. Configuring Model
10.11. Things to Remember
11. State Machine ID
11.1. With @EnableStateMachine
11.2. With @EnableStateMachineFactory
11.3. With StateMachineModelFactory
12. State Machine Factories
12.1. Factory via Adapter
12.1.1. Adapter Factory Limitations
12.2. State Machine via Builder
13. Using Deferred Events
14. Using Scopes
15. Using Actions
15.1. SpEL Expressions with Actions
16. Using Guards
16.1. SpEL Expressions with Guards
17. Using Extended State
18. Using StateContext
18.1. Stages
19. Triggering Transitions
19.1. EventTrigger
19.2. TimerTrigger
20. Listening State Machine Events
20.1. Application Context Events
20.2. State Machine Listener
20.3. Limitations and Problems
21. Context Integration
21.1. Enabling Integration
21.2. Method Parameters
21.3. Transition Annotations
21.4. State Annotations
21.5. Event Annotation
21.6. State Machine Annotations
21.7. Extended State Annotation
22. State Machine Accessor
23. State Machine Interceptor
24. State Machine Security
24.1. Configuring Security
24.2. Securing Events
24.3. Securing Transitions
24.4. Securing Actions
24.5. Using Security Attributes and Expressions
24.5.1. Generic Attribute Usage
24.5.2. Generic Expression Usage
24.5.3. Event Attributes
24.5.4. Event Expressions
24.5.5. Transition Attributes
24.5.6. Transition Expressions
24.6. Understanding Security
25. State Machine Error Handling
26. State Machine Services
26.1. Using StateMachineService
27. Persisting State Machine
27.1. Using StateMachineContext
27.2. Using StateMachinePersister
27.3. Using Redis
27.4. Using StateMachineRuntimePersister
28. Spring Boot Support
28.1. Monitoring and Tracing
28.2. Repository Config
29. Monitoring State Machine
30. Using Distributed States
30.1. ZookeeperStateMachineEnsemble
31. Testing Support
32. Eclipse Modeling Support
32.1. Using UmlStateMachineModelFactory
32.1.1. StateMachineComponentResolver
32.2. Creating Model
32.3. Define States
32.4. Define Events
32.4.1. Defer Event
32.5. Define Transitions
32.6. Define Timers
32.7. Define Choice
32.8. Define Junction
32.9. Define Entry/Exit
32.10. Define History
32.10.1. Shallow
32.10.2. Deep
32.10.3. Default
32.11. Define Fork/Join
32.12. Define Actions
32.12.1. Initial Action
32.13. Define Guards
32.14. Define Bean Reference
32.15. Define SpEL Reference
32.16. Using Sub-Machine Reference
33. Repository Support
33.1. Repository Config
33.1.1. JPA
33.1.2. Redis
33.1.3. MongoDB
33.2. Repository Persistence
33.2.1. JPA
33.2.2. Redis
33.2.3. MongoDB
V. Recipes
34. Persist
35. Tasks
VI. State Machine Examples
36. Turnstile
37. Showcase
38. CD Player
39. Tasks
40. Washer
41. Persist
42. Zookeeper
43. Web
44. Scope
45. Security
46. Event Service
47. Deploy
48. Order Shipping
49. JPA Config
50. Data Persist
51. Monitoring
VII. FAQ
52. State Changes
53. 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
54. Developer Documentation
54.1. StateMachine Config Model