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: [scxml] How to update the datamodel from inside a state's executable content?
Date Mon, 26 Apr 2010 18:30:43 GMT
On Mon, Apr 26, 2010 at 12:09 PM, Aarathi <aarathi@gmail.com> wrote:
> *Details on how I use the commons scxml api:*
> My state's scxml looks like this -
>
> <state id="stateP">
>      <datamodel>
>              <data name="data1" expr="11" />
>      </datamodel>
> <transition event="stateP.SUCCESS" cond="_eventdata.data2
> eq data1" target="stateQ" />
> <transition event="stateP.FAILURE" target="stateR" />
> </state>
>
> I use the commons scxml with the "listener" pattern. So when  the
> "onEntry()" is called in the SCXMLWorkflowListener, it does something
> similar  to AbstractStateMachine ie hand off to a method with the same name
> as the stateName.
>
> So relating to the scxml above , I have a method stateP(). This method holds
> the executable content for that state. Typically, in stateP(), the value of
> data1 is changed and then control is handed off to an async call. When this
> async call returns it fires the events that the transitions need.
>
> *Question:*
> While evaluating the condition on the transition, the value of data1 is
> always what it was initialized to ie 11. The updates I make in the
> executable content in stateP() never kicks in. So obviously, the transition
> is never taken. What am I missing?
>

There are many occassions where we update data models in executable
content in our tests (such as, via <assign> or even programmatically)
so this seems specific to a particular usage pattern you have.

Please say a little more, perhaps with a snippet showing a simplified
stateP() impl, as to how you update data1 and what the said async call
looks like.

-Rahul

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


Mime
View raw message