spring-statemachine

Spring Statemachine Factory -stays in memory

纵饮孤独 提交于 2019-12-11 01:33:49
问题 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 see, I have 3 actions. sendBasicTemplate, timeoutLogAction and processBasicTemplateReply. I will provide the related code segments and my configuration below. What I have observed during this process is that the state-machines created by the factory

Spring sub state machine Exit point to parent machine

匆匆过客 提交于 2019-12-10 11:36:20
问题 I have successfully implemented a state machine and also a sub machine with a reference from the initial. Now I'm stuck at a point where I cannot think about any way of linking an exit point to it. The links to my model is given. https://drive.google.com/open?id=0B9PT7E5L1ac9LTZlZWV5bWx1V1U https://drive.google.com/open?id=0B9PT7E5L1ac9RnR6UUtrMkRoZE0 If you look at it, I have referenced a sub-machine from "DirectQuery" State (marked in red in the parent machine- img2). Now I have a problem

How to restore state machine from context builded in runtime?

限于喜欢 提交于 2019-12-08 13:40:47
问题 I have a state machine @EnableStateMachine @Configuration public class StateMachineConfiguration extends EnumStateMachineConfigurerAdapter<Status, Event> { @Override public void configure(StateMachineStateConfigurer<Status, Event> states) throws Exception { states.withStates() .initial(Status.DRAFT) .states(EnumSet.allOf(Status.class)); } @Override public void configure(StateMachineTransitionConfigurer<Status, Event> transitions) throws Exception { transitions .withExternal() .target(Status

Spring State Machine timeout always execute when using connection factory

半世苍凉 提交于 2019-12-08 09:23:53
问题 This time I have a question about timeouts on the state machine. My scenario is like this, referring to the below image On entering StateBasic, I perform some action and the machine given by the Factory waits at WaitForTemplateResult till one of the events either VAS_QRY_RES or MAIN_QRY_RES. Now theres also a timeout which fires after 30seconds. So what happens now is the timeout is however fired even if VAS_QRY_RES or MAIN_QRY_RES comes. I studied this problem and the explanation I was able

java.lang.IllegalStateException: Bean factory must be instance of ListableBeanFactory, was null

痴心易碎 提交于 2019-12-07 09:20:10
问题 I'm creating a state machine object using the provided builder as follows: 10.2 State Machine via Builder I'm seeing the following exception: ERROR org.springframework.statemachine.support.StateMachineObjectSupport - Unable to initialize annotation handlers java.lang.IllegalStateException: Bean factory must be instance of ListableBeanFactory, was null The exception isn't preventing the state machine from functioning as expected. However, I would like to get down to the bottom of why I'm

java.lang.IllegalStateException: Bean factory must be instance of ListableBeanFactory, was null

佐手、 提交于 2019-12-05 16:24:25
I'm creating a state machine object using the provided builder as follows: 10.2 State Machine via Builder I'm seeing the following exception: ERROR org.springframework.statemachine.support.StateMachineObjectSupport - Unable to initialize annotation handlers java.lang.IllegalStateException: Bean factory must be instance of ListableBeanFactory, was null The exception isn't preventing the state machine from functioning as expected. However, I would like to get down to the bottom of why I'm seeing this. Anyone know how I can stop this exception from showing? Thanks. Managed to get a solution for

Spring StateMachine - Configure from Database

て烟熏妆下的殇ゞ 提交于 2019-12-04 20:52:24
In all examples I have looked up online, the StateMachine is configured statically @Override public void configure(StateMachineTransitionConfigurer<BookStates, BookEvents> transitions) throws Exception { transitions .withExternal() .source(BookStates.AVAILABLE) .target(BookStates.BORROWED) .event(BookEvents.BORROW) .and() .withExternal() .source(BookStates.BORROWED) .target(BookStates.AVAILABLE) .event(BookEvents.RETURN) .and() .withExternal() .source(BookStates.AVAILABLE) .target(BookStates.IN_REPAIR) .event(BookEvents.START_REPAIR) .and() .withExternal() .source(BookStates.IN_REPAIR) .target