On Tue, Mar 31, 2009 at 7:46 AM, Linda Erlenhov
<linda.erlen...@gmail.com> wrote:
> Hello again!
>
> I have a problem with my datamodel. Or rather the fetching of datas that are
> used in the datamodel.
> I have my editor for building statemachines graphical, this is then
> "translated" into a corresponding SCXML document that then is run "normally"
> with Apache commons. The person that uses the editor shoul amongst other
> things be able select if she/he has want´s some data to be set (integers or
> strings) when entering states.
> The GUI that communicates with the machine does this via an interface wich
> is the thing I´m writing now. The GUI can send subscriptions requests for
> data wich basically means that it wants to subscribe certain data and wants
> the interface to send it when the data is changed.
> How I solved the part of saving checking the data is somewhat irrelevant,
> the problem is when I want to fetch the data that is saved. Since the model
> doesn´t "tell" when data has changed I check whenever entering a state
> (onEntry Listner) but where do I check this.
> Where is this, the data, saved?
>
<snip/>

This still is all quite vague to me -- for example, not clear where
you put the data in the first place.

If you want to listen to data changes, listening to state changes may
not be the way to proceed (so I wouldn't use SCXMLListener for this
purpose). I can think of multiple potential options:

 * Avoid the need for any data synchronization / subscriptions
altogether - Back the state machine's root context with the actual
data store

 * Declaratively add <transition>s guarded on specific *.change events
- Has the benefit of capturing the associated actions in the SCXML
document itself (use the appropriate executable content on transition)

 * Use a custom Context implementation - This will allow you to
intercept data changes, à la pointcut at
oacs.Context#set(String,Object), and get notifications that way

-Rahul


> best regards
> //Linda
>

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

Reply via email to