Questions tagged [spring-statemachine]
Spring Statemachine is a framework for application developers to use state machine concepts with Spring applications.
260
questions
0
votes
0
answers
20
views
Spring statemachine how to persist a machine with nested regions
I have statemachine with configuration mentioned at the end, which i want to persist in the database. I am following this tutorial https://docs.spring.io/spring-statemachine/docs/3.1.0/reference/#...
1
vote
1
answer
21
views
Spring Statemachine State Actions vs Transition actions
Spring statemachine provides following type of actions. Can someone please explain me which type of action should be used in which scenario? And, If an action fails then does statemachine move to next ...
0
votes
1
answer
54
views
How to add spring state machine listener on entity creation?
I have working state machine transition listeners configured: an action is invoked when entity's state changes from A to B. Now I need to invoke an action when entity is created with initial state A. ...
0
votes
1
answer
21
views
Spring statemachine's java configuration for order shipping example
Looking at the following example provided by spring statemachine documentation, it is loading the configuration from a UML file. Unfortunately, i am not familiar with UML so is there any link where ...
1
vote
1
answer
22
views
Spring State Machine use StateMachineTestPlan to test a withChoice transition
If I have a StateMachine set up as below:
transitionConfigurer
.withExternal()
.source(FIRST)
.event(EVENT_1)
.target(SECOND)
.and()
.withChoice()
.source(SECOND)
.first(THIRD, ...
1
vote
0
answers
63
views
Increase thread pool size in Spring StateMachine 3.0.1
We upgraded from Spring Statemachine 2.5.0 to Spring StateMachine 3.0.1 in our project. Our application run a series of processes, each process runs through its business logic within its own state ...
2
votes
2
answers
40
views
How to get the current substate and the parent state out of the Spring Statemachine?
I am running a hierachical Spring Statemachine and - after walking through the inital transitions into state UP with the default substate STOPPED - want to use statemachine.getState(). Trouble is, it ...
0
votes
1
answer
33
views
Spring Statemachine: how to handle two transitions that has the same source state?
How does Spring Statemachine handle two transitions that has the same source state?
For example:
Source State: ready
Event: start
One transition will be lead to the target state running, another one ...
0
votes
0
answers
36
views
Spring Statemachine accepting events in parent state but triggering transitions from child state
In my test application I have a nested statemachine in which the parent state can accept a certain event as an internal transition with a certain action, and a child state can accept the same event as ...
0
votes
0
answers
62
views
Does Spring StateMachine persister support MongoDB reactive
I am using version 3.0.1 of StateMachine, and following the datapersist recipe also looking at the code in GitHub.
My code is here, with the "meat" of the Config class pretty much a copy &...
0
votes
1
answer
92
views
How can I reset state machine to sub state machine?
Can you help me with this please?
I have states for employee { Start, S1 , S1_1_start, S1_1_end , S1_2_start, S1_2_end, S2, End }.
public void configure(StateMachineStateConfigurer<EmployeeStates, ...
0
votes
1
answer
47
views
After working with spring state machine breaks spring auto entity scan mecanism
After i added dependencies of spring state machine my entities seen as not managed type. After adding @EntityScan annotation and tell Spring where to find entities used in our application, spring ...
1
vote
2
answers
90
views
Correct way to use substatemachine in spring-statemachine
I'm not sure I clearly understand how to use substates.
I didn't find any good explained example of correct spring state machine configuration, so I would be glad if somebody can share it we me.
On ...
1
vote
0
answers
153
views
Deferred Event in Spring State Machine
I have been trying to implement the below State machine using the spring-state machine.
Please find the configurations below.
I have been using spring-state machine for one of my project.
public ...
0
votes
1
answer
107
views
Migrating spring-statemachine factory to reactive webflux
I am trying to migrate my app that uses the spring statemachine to use webflux. I was using
private final StateMachineFactory<State, Event> stateMachineFactory;
[...]
StateMachine<State,...
0
votes
1
answer
134
views
Spring State Machine - Change state based on conditions
I am trying to create a simple state machine as shown below
For this I have below config
@Override
public void configure(final StateMachineStateConfigurer<States, Events> states) throws ...
0
votes
0
answers
83
views
Resetting spring state machine results in infinite loop
I am exploring Spring state machine and was testing a scenario where state machine would run to completion after resetting from a specific state but it runs in an infinite loop. The below code is ...
1
vote
0
answers
242
views
Spring State Machine Sometimes Spams Retry Exhausted Error
I have setup what I think is a relatively simple Spring State Machine. Sometimes (maybe every time) something triggers an external event, I get a ton of these errors. Any idea what I am doing wrong?
I ...
1
vote
1
answer
60
views
Spring State Machine state transitions
In the application that I am working on there was a state transitions defined in following manner:
transitions.
withInternal().
source(State1).
event(Event1).
action(action1()).
and().
...
0
votes
2
answers
171
views
Spring StateMachineFactory getStateMachine returns currents state as initial state
I working with Spring State Machines. I followed the documentation and other stuff. I need to keep different state machines for each employee. But when called factory to get state machine each time ...
1
vote
0
answers
141
views
Spring State Machine UML
I am using papyrus to design a state machine and the using spring uml to import that model to java. I am trying to use time events dynamically. I am able to run it when it has a Literal integer and it ...
1
vote
1
answer
114
views
Spring Statemachine with JPA sample code and configuration
I am trying to use an RDBMS like MySQL to persist the spring statemachine. i.e. I need to store and retrieve the states of my entities which are controlled by spring statemachine.
I can't seem to find ...
1
vote
1
answer
128
views
How to check if the event triggers the state machine in Spring Statemachine?
Let me summarize my question as follows,
I know that the stateMachine.sendEvent(Event e) returns a boolean value representing if the event triggers a transition or not, but it also triggers the ...
0
votes
0
answers
38
views
Spring State Machine and Papyrus create default wait state
How can I design or create a default wait state in Papyrus (as a graphical model from which I then get the UML) and connect it with some HTTP listener, like it is WAIT_ON_NEW_ORDERshown on this Order ...
0
votes
1
answer
546
views
Start Spring State Machine with HTTP call
I want to trigger the Spring State Machine model loaded from Papyrus with an HTTP POST.
If I send let's say {"state_machine":"START"}over HTTP I would like to start the predefined ...
0
votes
2
answers
329
views
Could not autowire. No beans of 'StateMachineFactory<States, Events>' type found
@Configuration
@EnableStateMachineFactory
public class StateMachineConfig extends EnumStateMachineConfigurerAdapter
<States, Events> {
// configuring...
}
public enum Events {
...
2
votes
1
answer
71
views
Can I use timerOnce with StateMachineRuntimePersister?
I have a spring statemachine (version 3.0.1) with an own instance for each user. With every HTTP request the statemachine is acquired by a DefaultStateMachineService from a JpaStateMachineRepository. ...
0
votes
0
answers
62
views
Spring State Machine | Delete temp file
I have 2 APP using Spring State Machine and have defined different prcoesses in each. Using UmlStateMachineModelFactory to load uml diagram and build state machine.
1 APP is webapp running inside ...
1
vote
0
answers
149
views
Spring State Machine Modelling Tool Support in Intellij
I have just migrated from Eclipse to Intellij [we can use this only now].
We are having lot of Spring State Machine Model Diagrams (https://spring.io/projects/spring-statemachine) created via Papyrus ...
0
votes
1
answer
269
views
How to resume the spring state machine from the last state it was in just before the server went down?
Assuming I want to model an order on an e-commerce website using the SSM with states -(S1,S2,S3). A particular order was at S2 when the server got restarted. I want the order to be able to pick up ...
0
votes
0
answers
38
views
Configuring spring (uml) state machine (timers) for unit tests
Trying to unit testing spring UML state machine that has timers.
In real mode, some timers have been expected to be triggers after 180 seconds.
I am looking for some methods to override timer (...
1
vote
0
answers
270
views
Unable to inject Spring State machine within test context (No qualifying bean of type JpaStateMachineRepository)
I'm writing a test case to inject an instance of my Spring State Machine and input some events but nothing so far has made it start the context properly
State Machine Config
@Configuration
@...
0
votes
1
answer
125
views
Spring State Machine - JpaRepositoryStateMachine Not a managed type Error
I am facing a problem with the spring state machine with persist configuration while using it with the @EnableJpaRepositories DB configuration
Spring State Machine Configuration is like this:
(I have ...
2
votes
1
answer
245
views
Recommended approach when restoring a Spring State Machine instance
I am planning to use Spring State Machine to control an execution workflow. The system is expected to receive requests from multiple users and each user may be assigned to multiple workflows. My ...
0
votes
0
answers
25
views
Why spring state machine use another thread?
I have configuration:
@Override
public void configure(StateMachineConfigurationConfigurer<RequestState, RequestEvent> config) throws Exception {
config
.withConfiguration()
...
0
votes
0
answers
24
views
SpringBoot State Machine Action - Print statements not displaying after findById
I am currently dabbling with Spring Boot State Machine. I have an action which is coded as below.
public class ValidateOrderActions implements Action<OrderStatusEnum, OrderEventEnum>{
private ...
0
votes
0
answers
37
views
Spring state machine by triggering events from action it not moving to other state
public class PaymentMachineConfig extends StateMachineConfigurerAdapter<PaymentState, PaymentEvent> {
@Override
public void configure(StateMachineStateConfigurer<PaymentState, ...
1
vote
2
answers
489
views
How to restore a spring state machine in reactive model
I am migrating a spring state machine working code to version 3.0.0 to get benefit of reactive implementation and when I call to
stateMachinePersister.restore(stateMachine, buildKey(id))
I get the ...
1
vote
1
answer
354
views
Spring StateMachine How do I know if a transistion is rejected due to failed guard or action?
I have the same question as in the topic below, but I'm not so sure if my approach is wrong.
How do I know if a guard rejected a transistion
My app is a linear step-by-step strategy board game with ...
1
vote
1
answer
338
views
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 ...
1
vote
2
answers
362
views
resetStateMachine to set initial state and id
It seems that doing the following will make the id null
# before reset, this will log the id set when state machine was created using stateMachineFactory.getStateMachine(stateMachineId)
log.info(...
-1
votes
1
answer
75
views
Global transition/actions in Spring state machine
Is there a way in which I can define global transitions/actions on a Spring state machine?
The expectation is, I'll not be transitioning to any other state. But just accept the event and perform the ...
1
vote
0
answers
151
views
How to use Spring State Machine on the dynamic events
I would like to build a work flow where the state transitions are based on the contents of input events, which means the event can't be defined statically like enum. All input events have the same ...
0
votes
1
answer
810
views
Spring State Machine send-event returns true when guard is false
I'm implementing a state machine with Spring Boot SM. One of the transitions only happens when a Guard constraint is successful:
.withExternal().source(ProjectStatus.STATE2).target(StatutProjet.STATE3)...
1
vote
1
answer
358
views
Correct way of injecting a repository or service into Spring statemachine Action and Guard
I've been getting into Spring Statemachine and modelling the state of an Order with it. I read about Guards and Actions, and based on our requirements, a question came up.
What is the correct way of ...
0
votes
0
answers
93
views
Websphere | Spring State Machine | UML Error loading
I have created a Spring state machine and it works fine in tomcat server, but when i deploy the same into websphere 8.5.5.17, it gives me below error.
I created the process using Papyrus modeler with ...
0
votes
3
answers
267
views
Hierarchical states are not being persisted in the database
I am struggling to get the correct state of the hierarchical state machine from the database after persisting it.The parent machine has two states ("IN_ANALYSIS", "OPEN") and the ...
0
votes
1
answer
497
views
Spring State Machine with nested state machine
I want to run a state machine with different configuration inside of my 'primary' state machine.
I haven't found something relevant in the web and i do not have a lot experience in Spring State ...
1
vote
0
answers
93
views
Is there a way to build a state machine by rest api in spring statemachine?
Is there is a way to build a state machine by an external rest request?
This request should contain all the stateData, transitonData and configurationData.
How to pass the actions and guards by this ...