You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am having a problem with getting an unexcepted current state name from the method "stateContext" of Listener life cycle.
=== Following is the example detail. let say
the configuration of FSM flow I created is something like this. A -> B -> C -> auditD -> auditE -> End
Also have defined a own Listener from where to update the state changes' log. the method from Listener class I choose to update logs is called "stateContext". because only from that method I can get more informaition such as headers after event is sent
I have three modules to get it ran all together. let say module X, Y, Z
X module is all about FSM code
Y module is the place(war) to call X module and to run only A -> B -> C ( here is like to get user's web form inputs )
Z module is the place(war) to call X module and to run auditD-> auditE-> End ( here is to starting auditing )
=== problem description
Input :
The current state after running FSM on Y module is "C"
after step1 above and on Z module continuing running the FSM and sending the events until the current state is auditE
Expected final state ouput after sending event on Z module should be "End". BUT it is "C"
A -> B -> C -> auditD -> auditE -> End ( this should be the result I expected )
A -> B -> C -> auditD -> auditE -> C ( this is actually result that happened and I unexpected )
The value I unexpected is on the method stateContext(StateContext<S, E> stateContext) from listener
stateContext.getStateMachine().getState(), it returns the state "C". But what I expected should be "End"
But there is another method from listener called "stateChanged", the current state is actually already changed to "End" as shown below
@OverRide
public void stateChanged(State<S, E> from, State<S, E> to) {
logger.debug("###genListener### stateChanged from {} to {}", from.getId(), to.getId());
}
to.getId() <--- this is actually shown the state "End" which is I expected and normal
I won't have such problem if I only have two modules like following
module_M (all FSM code)
module_N ( a web war )
I won't have such problem if I have three modules design but using the way of UML configuration
== what my FSM configuration code is following @OverRide
public void configure(StateMachineConfigurationConfigurer<AcctOpeningStockStates, AcctOpeningStockEvents> config) throws Exception {
config.withConfiguration().autoStartup(false);
config.withPersistence().runtimePersister(stateMachineRuntimePersister());
config.withMonitoring().monitor(stateMachineMonitor());
}
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I am having a problem with getting an unexcepted current state name from the method "stateContext" of Listener life cycle.
=== Following is the example detail. let say
the configuration of FSM flow I created is something like this. A -> B -> C -> auditD -> auditE -> End
Also have defined a own Listener from where to update the state changes' log. the method from Listener class I choose to update logs is called "stateContext". because only from that method I can get more informaition such as headers after event is sent
I have three modules to get it ran all together. let say module X, Y, Z
X module is all about FSM code
Y module is the place(war) to call X module and to run only A -> B -> C ( here is like to get user's web form inputs )
Z module is the place(war) to call X module and to run auditD-> auditE-> End ( here is to starting auditing )
=== problem description
Input :
Expected final state ouput after sending event on Z module should be "End". BUT it is "C"
A -> B -> C -> auditD -> auditE -> End ( this should be the result I expected )
A -> B -> C -> auditD -> auditE -> C ( this is actually result that happened and I unexpected )
The value I unexpected is on the method stateContext(StateContext<S, E> stateContext) from listener
stateContext.getStateMachine().getState(), it returns the state "C". But what I expected should be "End"
But there is another method from listener called "stateChanged", the current state is actually already changed to "End" as shown below
@OverRide
public void stateChanged(State<S, E> from, State<S, E> to) {
logger.debug("###genListener### stateChanged from {} to {}", from.getId(), to.getId());
}
to.getId() <--- this is actually shown the state "End" which is I expected and normal
I won't have such problem if I only have two modules like following
module_M (all FSM code)
module_N ( a web war )
I won't have such problem if I have three modules design but using the way of UML configuration
== what my FSM configuration code is following
@OverRide
public void configure(StateMachineConfigurationConfigurer<AcctOpeningStockStates, AcctOpeningStockEvents> config) throws Exception {
config.withConfiguration().autoStartup(false);
config.withPersistence().runtimePersister(stateMachineRuntimePersister());
config.withMonitoring().monitor(stateMachineMonitor());
}
Beta Was this translation helpful? Give feedback.
All reactions