commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Linda Erlenhov <>
Subject Re: [SCXML] getting set datats in the datamodel
Date Mon, 06 Apr 2009 14:35:15 GMT
Hello again!

I´m not sure how to explain what I want to do. The task I have is to build
an editor that you then can use to build simulations of applications. An
application can be a cd-player for instance. What already exists is an
editor for building GUI:s without coding (not build by me) and an engine
that runs this and via a protocol "talks" to an application. What I´m trying
to do is "attatch" my editor to the protocol instead of a "real life"
application. The problem is that I´m developing this very generic. I can not
know what kind of application the user want to simulate, the only thing I
have to run this from is the protocol specification and in that
specification it, for one thing,  says that I should be able to handle
dynamic data subscriptions.

In the cd-player case this could be that a track on the cd has ended and a
new has begun, if I have an subscription for the title of the song playing I
would then like to send it to the engine i was talking about.

So if I write a datamodel like (well, I don´t, it would be generated like
<data name=Data>
<Title id=1 type=String>text</Title>
<Track id=4 type=Integer>0</Track>

and then somewhere in the scema the person who build the simulation wants
"title" to change, this is then translated to:

<assign location="Data.title" expr="oh yeah!" />
as an example.

If i want to "read" what data.title:s expression is, how do I do that?

I used the:
for more examples, I´m not sure if you´re using the same standard, but it´s
an easy way to understand how the SCXML works.

> 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

Unfortunently this is not an option because the parts that use the
subscriptions are not written by me and already exists, I just want to
"communicate" with these parts.

>  * 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)

Not sure how this would work for the user of my editor.

>  * 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

This could possibly be of intrest, but I´m still not 100% sure on how the
context works. Where would these notifications "arrive"

best regards

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