Hello again!
This seems to work, since we now can see that data has changed.
Unfortunately, we seem to have missed out an important part of the
question. In addition to being notified when a data value is set, we
also would like to be able to "get/recieve" the new data value aswell as the
name (in this case numdat) so that we can display it to the screen in our
interface.
And, in this example we only have one data value, NumDat. However, it
is possible to define several data values insade the DynamicData-tag.
Can we still just write <assign name="DynamicData"
expr="DynamicData"/> after the first assign tag, or do we also have to
define what data value has been changed?
Sincerely,

Linda


> <snip/>
>
> Yup, I see what you are running into. Unfortunately for the specific
> usage pattern here, the two <assign> variations have different
> semantics as follows:
>
> 1)  <assign name="..." expr="..."/>
> is a set operation, which produces a Context#set(...) call
>
> 2) <assign location="..." expr="..."/>
> is really a mutation operation, it retrieves the XML <data> tree
> (stored as a DOM node in memory) and manipulates it -- there is no
> call to Context#set(...)
>
>
> >> How do I notify when my DynamicData has changed?
> >>
> <snap/>
>
> ISTR that you prefer to not use custom actions. With those
> constraints, one option (since you are generating all the SCXML) is to
> accomodate for the above variation via the SCXML markup itself -- so
> you could generate a redundant identity assignment to trigger the
> Context#set(...) call like so:
>
> <!-- assignment below taken from example above -->
> <assign location="Data(DynamicData,'NumDat')"
> expr="Data(DynamicData,'NumDat')+1"/>
> <!-- followed by assignment that triggers the set call with the new value
> -->
> <assign name="DynamicData" expr="DynamicData"/>
>
> -Rahul
>

Reply via email to