On Wed, Jun 15, 2011 at 12:25 PM, Artem Vovk <vovk.ar...@googlemail.com> wrote:
> Second method works pretty good, Thanks!
>
> One more question, is there in scxml version using in apache commons a time 
> out functionality?
> I need something like:
> <state id="Awaiting">
>        <onentry>
>        Wait 5 sec  than go to state "end"
>        </onentry>
> </state>
>
<snip/>

Sure, use <send> with delay attribute and use the SimpleScheduler [1]
as the EventDispatcher implementation (or write similar if you want
something other than java.util.Timer).

-Rahul

[1] 
http://commons.apache.org/scxml/0.9/apidocs/org/apache/commons/scxml/env/SimpleScheduler.html


>
> On Jun 14, 2011, at 12:45 AM, Rahul Akolkar wrote:
>
>> On Mon, Jun 13, 2011 at 10:50 AM, Artem Vovk <vovk.ar...@googlemail.com> 
>> wrote:
>>> Hi,
>>>
>>>        I have a data model in my scxml file, that  defined as map:
>>>        <datamodel>
>>>                <data id="event" expr="{'key1' : 'value1', 'key2', 
>>> 'value2'}">
>>>        </datamodel>
>>>
>>>        I want to use this data as a constructor for sending data, but I 
>>> need to change values in this data:
>>>        something like that
>>>        <data id="event_new" expr="event_new = event, but change event[key1] 
>>> to new_value ">
>>>        Is this possible within scxml using jexl?
>>>
>> <snip/>
>>
>> Either using a <script> tag (unreleased, see J6 branch in SVN) or a
>> custom function as you mention below.
>>
>>
>>>        Another question, that may replace this functionality, is using 
>>> functions: can I define function in scxml using jexl?
>>>
>> <snap/>
>>
>> Yes, see bottom of this page, section on "Method invocation in expressions":
>>
>>  http://commons.apache.org/scxml/guide/contexts-evaluators.html
>>
>> -Rahul
>>
>>
>>>
>>> Cheers Artem
>>

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

Reply via email to