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: Terminate SCXML-Executor
Date Sat, 11 Jun 2011 12:36:01 GMT
On Fri, Jun 10, 2011 at 12:33 PM, Oksana Kolach <bosyj@gmx.de> wrote:
> Hello everybody,
>
> which possibilities exists to terminate an SCXML-Executor, that is running
> in an infinit loop?
>
<snip/>

SCXML does not provide any in-built safeguards against infinite loops.
Like most languages, its possible to write such loops (in this case,
as back and forth state transitions).


>
> Background:
>
> My SCXML-state machine contains a loop.
>
> If the SCXML-state machine is loaded by the executor and the executor is set
> to "go()", then the executor is never ending.
>
> To terminate this infinite loop after a certain time, I could start the
> executor into another java-thread and kill this thread after the time-limit
> is reached.
>
> But this solution is not the best one I think.
>
<snap/>

Right, I'd say the state machine is defective i.e. it raises the
question why it contains an infinite loop in the first place -- I'd
recommend analyzing that at a modeling level using the knowledge of
the domain and usecase to remove such loops in favor of any number of
alternatives (custom actions, facets of the external communications
module - send, invoke etc.).


>
> Has anyone a better idea?
>
> Exists there something like a watchdog-timer-method
> (http://en.wikipedia.org/wiki/Watchdog_timer)?
>
<snip/>

You could easily implement such in SCXML itself using delayed send
coupled with a near-root level transition that kicks the state machine
out of the loopy bits :-)

-Rahul


>
>
> Thanks in advance.
>
> O.K.
>
>

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


Mime
View raw message