You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Madhwaraj Rao <ma...@yahoo.com> on 2006/09/06 07:40:27 UTC

[SCXML] Need to resume a state machine (SCXML-19)

Hi,

I have the following use case:

A state machine defines states {S1, S2, S3, S4}.
This state machine can run from state S1 -> S3 and
would be waiting on an event to transition to S4. I
will persist the "state" of this state machine some
place and the state machine would be decomissioned.
At a later point in time, I want the ability of a
newly instantiated state machine to "resume" from
state S3.

I tried setting the SCXML.setInitialState(), but on
instantiating the engine, it invokes the OnEntry
actions and listeners on the resumed state. But this
is not desirable, as these actions would have been
executed earlier.

In short, I need an ability to suspend a state machine
and resume a new state machine from where the original
one left off.

Can you please point me to existing functionality that
can achieve this? I have raised a WISH List issue in
JIRA (SCXML-19).

Thanks
--
Raj

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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


Re: [SCXML] Need to resume a state machine (SCXML-19)

Posted by Nestor Urquiza <ne...@yahoo.com>.
My opinion is that commons-scxml could give two
methods:

get4Persistence()
insertFromPersistence()

They could manage to return or accept a Vector of
necessary objects like context, executor and scxml
objects necessary to both stop and resume the SCXML
Engine.

If a developer wants to use Hibernate, Serialization
or any other persistence method s/he can do it but is
not forced to. How you store and retrieve the objects
should be entire responsability of the System you
design and not of the SCXML Engine.

Just again my thoughts ;-)

Thanks,
-Nestor

--- Rahul Akolkar <ra...@gmail.com> wrote:

> On 9/7/06, Craig McClanahan <cr...@apache.org>
> wrote:
> <snip/>
> >
> > In a recent TSSJS thread on Seam, I saw a wish
> list item somewhat similar to
> > this one, for a web specific use case ... the
> ability to "checkpoint" all of
> > the state machines currently active for a user so
> that he or she can log out
> > and go home, and then be able to restore them all
> when the user logs on the
> > next morning.
> >
> <snap/>
> 
> Yes, save/restore scenarios are going to be
> important to handle.
> Moreover, I doubt there is going to be a
> one-size-fits-all solution,
> and folks are going to want to use muliple
> strategies (continuations,
> serialization etc.) to get at this. Sitthichai's
> suggestion in
> SCXML-20 [1] seems like a good way to proceed here.
> Any other insights
> welcome.
> 
> -Rahul
> 
> [1] https://issues.apache.org/jira/browse/SCXML-20
> 
> 
> >
> > Craig
> >
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> commons-user-help@jakarta.apache.org
> 
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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


Re: [SCXML] Need to resume a state machine (SCXML-19)

Posted by Rahul Akolkar <ra...@gmail.com>.
On 9/7/06, Craig McClanahan <cr...@apache.org> wrote:
<snip/>
>
> In a recent TSSJS thread on Seam, I saw a wish list item somewhat similar to
> this one, for a web specific use case ... the ability to "checkpoint" all of
> the state machines currently active for a user so that he or she can log out
> and go home, and then be able to restore them all when the user logs on the
> next morning.
>
<snap/>

Yes, save/restore scenarios are going to be important to handle.
Moreover, I doubt there is going to be a one-size-fits-all solution,
and folks are going to want to use muliple strategies (continuations,
serialization etc.) to get at this. Sitthichai's suggestion in
SCXML-20 [1] seems like a good way to proceed here. Any other insights
welcome.

-Rahul

[1] https://issues.apache.org/jira/browse/SCXML-20


>
> Craig
>

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


Re: [SCXML] Need to resume a state machine (SCXML-19)

Posted by Craig McClanahan <cr...@apache.org>.
On 9/6/06, Rahul Akolkar <ra...@gmail.com> wrote:
>
> On 9/6/06, Madhwaraj Rao <ma...@yahoo.com> wrote:
> > Hi,
> >
> > I have the following use case:
> >
> > A state machine defines states {S1, S2, S3, S4}.
> > This state machine can run from state S1 -> S3 and
> > would be waiting on an event to transition to S4. I
> > will persist the "state" of this state machine some
> > place and the state machine would be decomissioned.
> > At a later point in time, I want the ability of a
> > newly instantiated state machine to "resume" from
> > state S3.
> >
> > I tried setting the SCXML.setInitialState(), but on
> > instantiating the engine, it invokes the OnEntry
> > actions and listeners on the resumed state. But this
> > is not desirable, as these actions would have been
> > executed earlier.
> >
> > In short, I need an ability to suspend a state machine
> > and resume a new state machine from where the original
> > one left off.
> >
> > Can you please point me to existing functionality that
> > can achieve this? I have raised a WISH List issue in
> > JIRA (SCXML-19).
> >
> <snip/>
>
> There is no existing functionality that does this the way you describe
> above. There is merit to the WISH issue. We need to look closely at
> some of the standard persistance mechanisms, such as Java
> serialization, and add a few test cases for the model and executor
> instances. This is unlikely to happen overnight if left to me, but
> will remain on my TODO list.
>
> The programmatic approach of "setting current states" along the lines
> of what you're doing (per the patch you've attached to SCXML-19,
> thanks for that) may be a fine short term solution for individual
> applications (such as yours), but we need to do more at the level of
> the library itself.


In a recent TSSJS thread on Seam, I saw a wish list item somewhat similar to
this one, for a web specific use case ... the ability to "checkpoint" all of
the state machines currently active for a user so that he or she can log out
and go home, and then be able to restore them all when the user logs on the
next morning.


-Rahul


Craig


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

Re: [SCXML] Need to resume a state machine (SCXML-19)

Posted by Rahul Akolkar <ra...@gmail.com>.
On 9/6/06, Madhwaraj Rao <ma...@yahoo.com> wrote:
> Hi,
>
> I have the following use case:
>
> A state machine defines states {S1, S2, S3, S4}.
> This state machine can run from state S1 -> S3 and
> would be waiting on an event to transition to S4. I
> will persist the "state" of this state machine some
> place and the state machine would be decomissioned.
> At a later point in time, I want the ability of a
> newly instantiated state machine to "resume" from
> state S3.
>
> I tried setting the SCXML.setInitialState(), but on
> instantiating the engine, it invokes the OnEntry
> actions and listeners on the resumed state. But this
> is not desirable, as these actions would have been
> executed earlier.
>
> In short, I need an ability to suspend a state machine
> and resume a new state machine from where the original
> one left off.
>
> Can you please point me to existing functionality that
> can achieve this? I have raised a WISH List issue in
> JIRA (SCXML-19).
>
<snip/>

There is no existing functionality that does this the way you describe
above. There is merit to the WISH issue. We need to look closely at
some of the standard persistance mechanisms, such as Java
serialization, and add a few test cases for the model and executor
instances. This is unlikely to happen overnight if left to me, but
will remain on my TODO list.

The programmatic approach of "setting current states" along the lines
of what you're doing (per the patch you've attached to SCXML-19,
thanks for that) may be a fine short term solution for individual
applications (such as yours), but we need to do more at the level of
the library itself.

-Rahul


> Thanks
> --
> Raj
>

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