commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From RT <>
Subject Re: [scxml] stop and resume by serializing the executor does not work
Date Fri, 02 Jul 2010 23:04:04 GMT

I tried your suggestion -  executor.getCurrentStatus().getStates() - in a few
places and I noticed something interesting.

So, using the context explained in my prev email, (without the

1. state machine starts
2. onEntry() gets called for stateA - here I call the executable content for
this state - something similar to what AbstractStateMachine does
3. Executable content for StateA completes
4. After a few mins - trigger event "gotoB"
5. onEntry() gets called for stateB - before calling the executable content,
I inspect executor.getCurrentStatus().getStates(). Surprisingly, the only
active state here is "stateA". How is that possible? Does the
executor.currentStatus object get updated after the listeners kick-in?

My stop&resume logic with the serialized executor kind of depends on the
agreement that "stateB" would be in the list of activeStates while queried
in in the onEntry of a listener. Here's how:

a. onEntry() called for stateA
b. store stateA as the last known state of the state machine
c. save a serialized version of the executor to the database
d. invokeExecutableContentForA()
e. exit onEntry() handler

If the app crashed while in step c and we try to resume again
f. check the last known state in the database - in this case stateA
g. here I have a map that tells me what event I need to trigger - in this
case gotoB
h. deserialize the executor from the database
i. executor.triggerEvent("gotoB")

While debugging the flow of control in the executor after this triggerEvent
is called, I see that we try to find a match for a transition with this
event from the parent of stateA - not from stateA and thats why I never saw
any transitions happening.

View this message in context:
Sent from the Commons - User mailing list archive at

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message