commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rahul Akolkar <>
Subject Re: [SCXML] more Evaluator/Context questions
Date Thu, 05 Mar 2009 18:03:16 GMT
On Thu, Mar 5, 2009 at 11:33 AM, Linda Erlenhov
<> wrote:
> Hello!
> This is my plan:
> My guards are boolean expressions and the boolean variables that the
> expression consists of are updated in "onEntry"/"onExit". I use a listner
> for _when_ the update should be done.

Its better to model the state machine in as much completeness as
possible using an SCXML document. Investigate whether you actually
need to use a listener. See the canonical microwave samples or any
datamodel test cases for examples of updates during <onentry> and
<onexit>, here are the JEXL variants:

> The trouble is that I´m not shure _where/how_ the updating is done. Since
> this should be done during runtime a guess is that it is some kind of update
> in the context, but I have clearly not understood properly how this
> (context)  works.

The Java API merely serves to support the mechanics of SCXML
execution. Whether you need to understand it really depends on the
nature of the usecase. Often, <assign> is sufficient for updating data
model variables etc.

> So if I create a simple example then maybe someone could use it to explain
> this to me:
> The statemachine has three states. A, B and C. There are transitions between
> A & B both ways, and also transitions between B & C both ways. You can
> trigger events that are "go to A", "go to B" "go to C". You start in A. On
> the transition from B to A there is a guard for "been in C" that is set when
> you visit C. So you have to visit C atleast once before you enter state A
> the second time.
> A<=>B<=>C
> How/where do I set the "been in C" state to true when i enter the state?

IIUC, use the 'beenInC' variable below in the guard condition for
entering A the second time:

  <scxml ...>

      <data name="beenInC" expr="false"/>

    <state id="C">
        <assign name="beenInC" expr="true"/>




> Best Regards
> //Linda

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

View raw message