commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rahul Akolkar <>
Subject Re: FW: [SCXML] Some questions about the use of a state machine developed with SCXML
Date Thu, 24 Jun 2010 20:35:34 GMT
On Wed, Jun 23, 2010 at 8:11 AM, Jorge Moratinos <> wrote:
>  Hi,
> I've some questions about scxml, I'm developing an state machine, but in some cases I
called from SCXML a Custom Action, and that Custom Action must be running undergroud and sending
new events. My questions are:
> How can i send new events to the same state machine from the custom Actions?

The easiest way is to add an event to the internal event queue (or
derived events).

> What are the derivedEvents?

As a side-effect of processing an external events, executable content
may generate internal events to be handled in subsequent processing
steps. Thus, they are said to be derived as part of the reactive
behavior in response to other external events.

> It's posible call a custom action and let the state machine and the custom action running
at the same time?

Actions are supposed to execute fairly quickly (in theory, they must
execute in negligible time). Therefore, it is not recommend to have
long running custom actions. However, the significance of the time
required to process actions on the "health" of the state machine
execution depends on the usecase and expected frequency of external

While the execution of the action itself should be fairly quick, an
action may initiate long running processing (for example, by spawning
another thread). However, in general, in such cases, the semantics
align more with "do while" rather than "on entry/exit/transition" and
therefore, the SCXML <invoke> construct may be more appropriate than a
custom action. The semantics of <invoke> are more aligned with an
"activity" to be performed while in a state, rather than an action.


> thanks,
> Jorge Moratinos

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

View raw message