A great source to get started. One question: It seems to me a bit strange to send an event from within an action, cause as far as i understood, the actions should be state-agonistic so that they can be reused in different transitions. Why arent't you using a guard for checking the amount? - Seems to me the cleaner approach.
I feel like the order of the transition config could be order in an easier to understand manner. If I am not mistaken, basically the configuration translates to: If the specified EVENT was called, and the state is SOURCE, then do this ACTION and change the state to the TARGET. So a better order would be: .event().source().action().target() I feel like this is much more readable. That aside, thanks a lot for the video! It made this overwhelming concept much easier.
Can we use Spring Statemachine for micro service based architecture where output of each service can considered as a state. If possible please share any example or reference.
Inside the build method you're calling repository to get the payment object. Then again, inside the interceptor, you're calling it again. Isn't this an additional overhead ? This seems like an unnecessary implementation ?
Hi John, Whenever I'm trying to run the Junit test for StateMachineConfigTest class I'm getting java.lang.NullPointerException for this line in my application: StateMachine sm = factory.getStateMachine(UUID.randomUUID()); I've Autowired the StateMachineFactory
Dear John, When I import the project from Github and I am getting the following compilation error Cannot access org.springframework.core.env.EnvironmentCapable On the following line. SpringApplication.run(MovieCatalogServiceApplication.class, args); github.com/springframeworkguru/mssc-ssm.git Note: I tried on different machines and also noticed that happens when I import other spring-boot projects out there.
@Spring Framework Guru - Excellent Tutorial on Spring State Machine. **btw noticed 1:00:51 - 1:05:40 - section on sendEvent() is a repeat.
Omg. This is the best explanation of Spring State Machine ever. Thanks for your professional videos on Spring!
thanks soooo much, this is exaclty what i need. Thanks god people like u exist and 'invest' thier time to distribute knowledge
Can you show others features from ssm, like guard, trigger, fork and join? Thank you and great job!
Thanks for sharing this. I'm sure you could develop an entire course around all the features of SSM. I look forward to it!
A great source to get started.
One question: It seems to me a bit strange to send an event from within an action, cause as far as i understood, the actions should be state-agonistic so that they can be reused in different transitions.
Why arent't you using a guard for checking the amount? - Seems to me the cleaner approach.
Very good demo explained the concepts clearly
There is now repository support in Spring SM.
Thumbs Up to this video. I was working on a use case and this video helped me with the needed information. Thank you!
I bought two of your courses on udemy because of this video. Keep up the great work
Thank you for the video ... Awesomely described and able to make a small project out of this. Again simply WOW 😊
I feel like the order of the transition config could be order in an easier to understand manner. If I am not mistaken, basically the configuration translates to:
If the specified EVENT was called, and the state is SOURCE, then do this ACTION and change the state to the TARGET. So a better order would be:
.event().source().action().target()
I feel like this is much more readable. That aside, thanks a lot for the video! It made this overwhelming concept much easier.
thanks, it helps me understand a lot.
Can we use Spring Statemachine for micro service based architecture where output of each service can considered as a state. If possible please share any example or reference.
In what context is this feature used within a SB application?
35:35 Unit test, can you do a tutorial on unit tests?
Can we mock spring statemachines?
Inside the build method you're calling repository to get the payment object. Then again, inside the interceptor, you're calling it again. Isn't this an additional overhead ? This seems like an unnecessary implementation ?
I am getting an error where I am unable to transition to Autorize. Can anyone share the code base link on github ?
Is it possible to use Spring Statemachine without spring? e.g. in Quarkus?
Where's the state stored? Do we need persistence, redis?
Very helpful. Thank you.
Hi John,
Whenever I'm trying to run the Junit test for StateMachineConfigTest class I'm getting java.lang.NullPointerException
for this line in my application:
StateMachine sm = factory.getStateMachine(UUID.randomUUID());
I've Autowired the StateMachineFactory
have you set the @EnableStateMachineFactories annotation on a class that is annotated with @Configuration?
@@marcodoe4690 Yes i have set. But i am still getting the same err.
BTW Spring 3 has some changes in SSM
Thank Guru for the nice video.
Dear John,
When I import the project from Github and I am getting the following compilation error
Cannot access org.springframework.core.env.EnvironmentCapable
On the following line.
SpringApplication.run(MovieCatalogServiceApplication.class, args);
github.com/springframeworkguru/mssc-ssm.git
Note: I tried on different machines and also noticed that happens when I import other spring-boot projects out there.
The explanation is nice, Can you please share the git repo ?
Naming of events seem a little loose. Shouldn't they all be noun-verb(in past tense)?
thanks, so help me and my command!
is there any problem if i use spring statemachine 2.5.1 with spring boot 2.7.x?
cool video, but can you upload this project on GitHub?
great!!