commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Wolfgang Rabl <wolfgang.r...@maven.at>
Subject Re: [SCXML] two scxml questions
Date Fri, 04 Jul 2008 15:14:11 GMT
Thank you for your answer

May i ask some further questions regarding datamodel manipulation...
its very easy to change the value of a variable by using <assign>, but 
how can i create a new one or delete an existing variable?
and if i have a data tree, how can i add or delete entries there? for 
example:

      <datamodel>
        <data name="test">
          <rooms>
		<room>kitchen</room>
		<room>bedroom</room>
          </rooms>
        </data>
      </datamodel>

now i want to add a new room "bath" or delete the kitchen, is that 
possible from within the scxml document? If not, how could that be done? 
By using a custom action or by Jexl Method invokation?

Oh and one more question, am i right that <SCRIPT> is not implemented in 
commonsSCXML?

thanks,
Wolfgang



Rahul Akolkar schrieb:
> On 7/2/08, Wolfgang Rabl <wolfgang.rabl@maven.at> wrote:
>   
>> Thank you for your quick reply!
>>
>>  well, i would be particular interested in b)
>>
>>  I allready tried using the event listeners and they work quite well, but my
>> problem here is the lack of information within the listener
>> functions(i.e.onEntry). I would like to pass over additional data from the
>> SCXML engine, not only the id of the current state.
>>
>>     
> <snip/>
>
> Custom actions are convenient for this, i.e. option (a).
>
>
>   
>>  It is possible to get access to the datamodel by using the TransitionTarget
>> Object that is passed into the function, but i have got a problem here: This
>> datamodel contains all the data specified in the scxml file, but only the
>> initial values. Even if something changes the values of the datamodel within
>> the scxml engine i can only get the old values in the listener functions.
>> Why is that so? Am I doing something wrong here? Whats the right way to get
>> access to the datamodel from the listener?
>>
>>     
> <snap/>
>
> That gives you the model (the state machine definition as it was
> authored), not the live instance (which needs to be accessed via the
> corresponding Context, a custom action will allow for that). There are
> Javadoc notes about this in some places, but clearly not all.
>
>
>   
>>  One more question:
>>  When i take a look at the interaction patterns statet in
>> http://commons.apache.org/scxml/guide/using-commons-scxml.html
>> ,  b) should map to "Listening to state machine progress".
>>     
> <snip/>
>
> Yes.
>
>
>   
>> Now i am not
>> quite sure about the first patter, the "Mapping states to activities". May
>> it be possible to explain this in other words than on that page?
>> Unfortunately i am not able to understand that explanation there.
>>
>>     
> <snap/>
>
> I don't have much email time today, but the RDC usecase [1] uses this
> pattern. Its open source, so all details are available if you want to
> look. The first two patterns are "lightweight" and don't really work
> too well for involved usecases IMO.
>
> -Rahul
>
> [1] http://commons.apache.org/scxml/usecases/scxml-in-rdc-group.html
>
>
>   
>>  Thank you,
>>  Wolfgang
>>
>>
>>     
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> For additional commands, e-mail: user-help@commons.apache.org
>
>
>
>   


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


Mime
View raw message