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
2
votes
0 answers

Spring State Machine for managing multiple flows

This is not an ask for design suggestion :) I am trying to build a workflow engine which can handle manual actions from users. Since Spring-state machine has JPA configurations to build state machine so, I thought I would build multiple flows by…
Prabhat Ranjan
  • 400
  • 3
  • 17
2
votes
1 answer

How Do I get next state/event in Spring state Machine

1) I am processing a particular event from the transition, how Do I get the info about next event? 2) If I need to stop the transition from one state to another during the transition action, how Do I do that?
Vivek
  • 182
  • 1
  • 8
2
votes
0 answers

Reuse Submachine in Two StateMachines

I have been using Spring State-machines for a while now and I have come across a situation where there has been a need to re-use a sub-machine in two different state-machines. I realized that the same submachine cannot be used in the same…
2
votes
1 answer

StateMachine - actions on states change

I wrote the implementation of the state machine, using the Spring guide. But I can’t achieve any reaction for changing the state, although the states themselves change successfully. Perhaps I misunderstood the goal of the Beans class? I need to…
anabioze
  • 57
  • 1
  • 10
2
votes
2 answers

Fork and Join: a problem with parallel execution of two regions in spring state machine

I tried to use the "fork/join" structure for the parallel execution of the state machine in the regions of state "S2". Configuration of state machine was based on uml model. And I have a problem with parallel work of these two regions. First, the…
Brutus
  • 21
  • 3
2
votes
1 answer

Spring State Machine - Attaching static data to states

With spring state machine, we have states and events. I could not find any documentation on whether it is possible to attach static data to a state during configuration. For example, if there are the states S1 and S2 public void…
sat
  • 5,489
  • 10
  • 63
  • 81
2
votes
1 answer

Spring State Machine - How to navigate to an error final state if any action has an error

Let us say we have 3 states S1, S3, S3 and an error state E1. The S* states have actions that execute A1, A2, A3 respectively. If any of A1, A2, A3 results in an exception being thrown, the state machine should go to E1. Is there a way I can define…
sat
  • 5,489
  • 10
  • 63
  • 81
2
votes
1 answer

Spring-Statemachine: Access to PseudoStates, that are skipped

First of all, my primary goal is to illustrate a state machine diagram. The method StateMachineFactory#getStateMachine() builds a new instance of my stateMachine. The StateMachine has a lot of methods, such as getStates():…
theexiile1305
  • 417
  • 5
  • 18
2
votes
2 answers

How to handle events that were not processed by spring state machine

Let's say we've got the following state machine configuration: transitions.withExternal() .source(FIRST) .target(SECOND) .event(STEP_EVENT) .and() .source(SECOND) .target(EXIT) .event(EXIT_EVENT) Events list:…
Grigori
  • 35
  • 1
  • 5
2
votes
1 answer

Spring State Machine: How to get information that transition is not possible?

I would like to get something like an exception or any hint, when I send an event which is not possible in the current state of the machine. Instead of an exception, nothing happens. The only thing that I noticed…
sergej
  • 193
  • 1
  • 11
2
votes
0 answers

Spring state machine gui

Is there any customer-facing GUI interface for configuring Spring state machine flows. Papyrus is complicated to install and use. Need something more simple, however, somehow support integration with Spring to visually run and debug the state…
2
votes
2 answers

Spring state-machine: common transition

Is there a way to configure common external transition for multiple events? i.e. For all states X,Y,Z -> CANCELED on CANCEL event. Where X,Y,Z - sources, CANCELED - target state For CANCELED state run common internal transition on all events I…
Aliaksei Stadnik
  • 1,692
  • 3
  • 15
  • 32
2
votes
1 answer

Manual build of State machine

I have a statemachine using Spring, this is constructed using annotations @Configuration @EnableStateMachine class StateMachineConfiguration extends StateMachineConfigurerAdapter { (For the states/transitions) and a number of…
Taoist
  • 321
  • 1
  • 4
  • 11
2
votes
0 answers

Spring Statemachine Factory -stays in memory

I have used Spring state-machine in quite a complex scenario. I will explain my problem with the simplest part of the SM. Refer below image. This is my main state machine The state circled in red points to the following sub-machine So, as you can…
2
votes
2 answers

Correct Error Handling in Spring Statemachine

I am evaluating Spring Statemachine and would like to understand how to recover from a transition error. I defined an error action for an action executed during a transition. The execution of S1_TO_S2_ACTION causes an exception which is handled…
Oliver
  • 3,815
  • 8
  • 35
  • 63