• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

Spring StateMachine - reaction to changing states

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I wrote the implementation of the state machine, using the Spring guide.

But I can’t achieve any reaction for changing the states, although the states themselves change successfully. Perhaps I misunderstood the goal of the Beans class? I need to achieve automatic execution of the closeDoor() and startMoving() methods when the corresponding state changes.

These messages in the methods on the console are not displayed:



Configuration:



Builder:



And the launch (the states are displayed correctly in the console, according to the events):



Dependency is only one.


What I'm doing wrong?
 
Andrey Mironov
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is a solution.

The problem was the simultaneous use of the @WithStateMachine annotation and Builder.getMachine(), which contradicted each other.
 
Marshal
Posts: 64710
226
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well done finding that solution
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!