Questions tagged [spring-statemachine]

Spring Statemachine is a framework for application developers to use state machine concepts with Spring applications.

Spring Statemachine aims to provide following features:

  • Easy to use flat one level state machine for simple use cases.
  • Hierarchical state machine structure to ease complex state configuration.
  • State machine regions to provide even more complex state configurations.
  • Usage of triggers, transitions, guards and actions.
  • Type safe configuration adapter.
  • State machine event listeners.
  • Spring IOC integration to associate beans with a state machine.

See also

Spring Statemachine Project Page

283 questions
11
votes
1 answer

State machines for Entities in DDD and Dependency Injection context?

I've been studying Spring State Machine and State design pattern since I have to develop a microservice with Spring Boot and persisted objects with a lot of confused states that need to be cleared up, and I am looking for a clean design solution out…
10
votes
1 answer

what is different with Transitions external internal and local ? in Spring doc 11.5 Configuring Transitions

11.5 Configuring Transitions We support three different types of transitions, external, internal and local. Transitions are either triggered by a signal which is an event sent into a state machine or a timer. I donot konw what is different .
Hunter
  • 103
  • 1
  • 4
9
votes
1 answer

Alternatives to Spring State Machine

I have used Spring state machine with some basic Spring MVC application. I have to admit, it is pretty easy to configure and use. But it has many limitations as well, mainly because of it being in very early stages of development. I also came across…
ddanuj
  • 117
  • 2
  • 4
8
votes
1 answer

Spring State Machine - How many should I create?

When I receive a request on my API, I want to do a series of steps, each being a check or an enrichment. Each step could either succeed or fail. On Success, the next step should be carried out. On Failure, an end-step should be executed, and the…
7
votes
1 answer

How to get exception thrown during state transition using spring state machine

I am trying to understand, how an exception thrown by an action during a state transition is possible. I‘ve this simple state machine configured: transitions .withExternal() .source(State.A1) .target(State.A2) .event(Event.E1) …
Daniel
  • 835
  • 1
  • 7
  • 18
7
votes
1 answer

How to use Spring state machine for an Order object

I'm trying to use Spring State Machine in my project, because there is an object is Order with several state NEW PAID PACKAGED DELIVERED CANCELED RETURNED That object could be implement as following public class Order { private String id; …
Khoi Nguyen
  • 1,072
  • 2
  • 15
  • 32
7
votes
1 answer

Programmatically Build a State Machine

With the new Spring Statemachine project, can I create a state machine programmatically without using adapter classes available for JavaConfig and Spring @Configuration classes?
Gary Russell
  • 166,535
  • 14
  • 146
  • 179
6
votes
2 answers

How to create a StateMachine from a StateMachineConfigurer

I have an annotation based state machine configuration: @Component @Scope(BeanDefinition.SCOPE_PROTOTYPE) @EnableStateMachine(name = "machine1") public class Machine1 extends EnumStateMachineConfigurerAdapter { …
towi
  • 21,587
  • 28
  • 106
  • 187
6
votes
1 answer

Persisting & Restoring Current State in Spring Statemachine

I'm introducing Spring Statemachine into an existing project, with the hope of amalgamating and clarifying our business logic. We have various JPA entities with interconnected states and I'm having some trouble with setting a persisted state as the…
Alan
  • 81
  • 1
  • 5
5
votes
5 answers

Spring state machine bean detection not working

I'm currently building up a little sample project with Spring state machine. My configuration: @Configuration @EnableStateMachine public class StateMachineConfiguration extends EnumStateMachineConfigurerAdapter { @Override …
Daniel Eisenreich
  • 1,353
  • 3
  • 16
  • 32
5
votes
2 answers

Spring state machine in multithreaded environment

I have an event queue with n message listeners. When a message arrives, one message listener takes it and executes a new instance of a state machine. The problem I'm facing is that although multiple messages are handled in parallel, the state…
4
votes
1 answer

Fork and Join in spring state machine (Parallel execution)

I have an UML diagram as below : How to configure states and transitions in state machine from SI to END based on events.... public class Config14 extends EnumStateMachineConfigurerAdapter { @Override …
bollam_rohith
  • 334
  • 4
  • 17
4
votes
1 answer

Spring state machine with JPA persistence- Repository usage

I am trying to figure out how to easily use spring state machine including persistence with JPA. This is the problem I am dealing with: Incompatible data types - factory and persistence At a certain point in the program I would like to use the state…
4
votes
0 answers

Spring Flowable Vs State Machine, which one to use

I have a use case, where transaction goes through multiple states as below NEW (Initial) SUBMITTED (On submit event by user) APPROVALPENDING (There are can be multiple approvals to run in parallel, it can be auto approved through validation or can…
4
votes
1 answer

How to add dynamic parameters to spring state machine action?

I have this simple state machine configuration : @Configuration @EnableStateMachine public class SimpleStateMachineConfiguration extends StateMachineConfigurerAdapter { @Override public void…
louis amoros
  • 2,418
  • 3
  • 19
  • 40
1
2 3
18 19