commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rahul Akolkar <>
Subject Re: Problem with persisted SCXML
Date Thu, 09 Apr 2009 19:30:38 GMT
On Thu, Apr 9, 2009 at 9:11 AM, Antonio Toma <> wrote:
> Hi,
> I'm trying to set up a stateful application with the following pattern:
> 1) Create an SCXML object with custom actions from an XML string, and
> serialize it to a DB.
> 2) when a start event arrives, read the SCXML from 1), create an
> SCXMLExecutor and write it to a DB.
> 3) when an intermediate event arrives, read the SCXMLExecutor from 2)
> and trigger the intermediate event on it
> 4) if SCXMLExecutor.getCurrentStatus.isFinal() == false, write it back
> to the DB else goto 5)
> 5) remove the SCXMLExecutor and goto 2)

Seems reasonable.

> Now I have two questions:
> 1) Is there any example available I can use as a guideline?

We have JUnit tests that do such serialization round-trips (see in buried under src/test/java/). Its standard
serialization stuff.

> 2) In my first attempts it seems like custom actions are lost after
> persisting the SCXML to the DB
> (I mean that if I serialize the SCXML I read from DB and compare it to
> the original one, it is missing the actions I put in the <transition>
> tags). Any special direction for persisting an SCXML with custom
> actions?

If you're using the SCXMLSerializer class, it doesn't serialize custom
actions. Perhaps it could toString() custom actions in place but that
will require authors produce well-formed markup there.

If you are noticing unexpected functional changes, we will need more details.


> Any help appreciated.
> Thank you and regards.
> Antonio.

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

View raw message