commons-user mailing list archives

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

My scxml is defined like this:
                       <state id="stateA">
					<log expr="'Inside stateA'"/>
					<log expr="'Leaving stateA'"/>
				<transition event="gotoB" target="stateB"/>
			<final id="stateB">
					<log expr="'Inside stateB'"/>
					<log expr="'Leaving stateB'"/>

So, I initiate an SCXMLExecutor object, set all the requisites and call go()
, like this:

SCXMLExecutor engine = new SCXMLExecutor(getEvaluator(), new
				new SimpleErrorReporter());
		engine.addListener(getSCXML(), getListener());
		try {
		} catch (ModelException me) {

In the listener, I override the onEntry like this:

public void onEntry(TransitionTarget state) {
		System.out.println("Entering state " + state.getId());		

After I call go() on my executor, I see the stateA being entered and then
the state machine stops as its waiting for the "gotoB" event to transition
to the next state.

Now, I serialize this executor object to a file.Wait for a few seconds, then
deserialize it and then call fireEvent("gotoB") which is defined as:

public void fireEvent(String eventName) {
		try {
			executor.triggerEvent(new TriggerEvent(eventName,
			System.out.println("fired eventsuccessfully:"+eventName);
		} catch (ModelException e) {

I see in the log that my event was fired on the executor, but I do not see
the stateB being entered. So obviously during serialization/deserialization
some entities were lost on the executor object. Any idea what I should be
looking for?

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