commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Anna Södling <anna.sodl...@passagen.se>
Subject Re: [SCXML] getting set datats in the datamodel
Date Mon, 27 Apr 2009 14:05:58 GMT
Hi,
Is there anyone who has any idea what to do about this? Even a little
hint would be appreciated, you don't have to solve the whole problem!
 
/Linda

<-----Ursprungligt Meddelande----->
From: Linda Erlenhov [user@commons.apache.org]
Sent: 23/4/2009 2:30:58 PM
To: Commons Users List
Subject: Re: [SCXML] getting set datats in the datamodel

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
>



<P><p><font face="Arial, Helvetica, sans-serif" size="2" style="font-size:13.5px">_______________________________________________________________<BR>
</font>
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message