commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Aarathi <aara...@gmail.com>
Subject SCXML: How to update the datamodel from inside a state's executable content?
Date Mon, 26 Apr 2010 15:54:05 GMT
*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?

Aarathi Rajamanickam

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message