commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rahul Akolkar <>
Subject Re: [SCXML] Transition/Var question
Date Fri, 27 Feb 2009 11:49:18 GMT
On Fri, Feb 27, 2009 at 3:53 AM, Linda Erlenhov
<> wrote:
> Hello
> I have in my Transitions added "var" on the form:
>    <transition       cond="${cancelOutcome eq 'success'}" target="editExit">
>      <var            name="outcome"
>                      expr="cancel"/>
>    </transition>
> (This example is taken directly from the SCXML specification)
> In my statemachine (a version similar, but not derived from the
> AbstractStateMachine that is included) I have added an "onTransition"
> function in my listner that when I am on a transition should check if there
> is an "var" and in that case send it to XXXX.
> I´m having trouble fetching the "var". My thought is that that I should
> derive a new class from the transition class that includes the method
> "getVar" but I´ve looked through the API and I don´t understand how this
> method should be written. Can anybody help me?

This will be short since I'm on the road. One approach is to declare
the variable in the root context (<datamodel> child of <scxml>) so it
will be easier to introspect.

Along the lines of (note use of <assign> instead of <var> in <transition>):

<scxml ...>

        <data name="outcome"/>


    <state ...>
        <transition cond="${cancelOutcome eq 'success'}" target="editExit">
            <assign name="outcome" expr="cancel"/>


followed by introspection like so:



> Best Regards
> /Linda

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

View raw message