commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rahul Akolkar" <rahul.akol...@gmail.com>
Subject Re: [SCXML] Question save/restore state of FSM
Date Tue, 01 Jul 2008 18:29:53 GMT
On 7/1/08, Daniel Schwager <Daniel.Schwager@dtnet.de> wrote:
> > >  B) i would like to save/restore my FSM (using the SCXML in
>  > >  EJB3-container with session beans)
>  > >
>
>
> > In order of preference:
>  >
>  > 1) Persist the SCXMLExecutor instance below, instead of merely the
>  root context.
>  >
>  > 2) Correctly set the states collection of the current executor status
>  > [ exec.getCurrentStatus().getStates() ] along with its root context
>  >
>
>
> Hi Rahul,
>
>  if i persist the SCXMLExecutor instance, I will also persist all the
>  injected codeeobjects like
>         Evaluator
>         ErrorReporter
>         Eventdispatcher
>         All Listeners
>
>  also. IMHO, it's better to choose your second way.
>
>  Now the code works:
>
<snip-code/>

In some scenarios ;-)

I will point out that this doesn't persist some interesting bits such
as (not a complete list):

 * Histories (i.e. if you use <history>)
 * Contexts other than the root context (i.e. if you use <cs:var> etc.)
 * Invokers (i.e. if you use <invoke>)

If you want to avoid persisting the "injected" bits, I'd suggest
"hollowing them out" before persisting, so:

 * Use removeListener(...) for addListener(...) before persisting
 * Use a lazy initializations (or inject by means available)
Evaluator, ErrorReporter. (or even set them to null before persisting)

This would be a more robust approach IMO.


>  Thanks very much
>
>  Regards
>  Danny from softwaredemo.de (running SCXML inside ;)
>
<snap/>

Cool, if you want to be listed in the "Who is using it?" section on
the Commons SCXML homepage [1] (see bottom of page), post (on this
list) a link and a descriptive sentence about the use to go with it.

-Rahul

[1] http://commons.apache.org/scxml/

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Mime
View raw message