You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Mehdi KENNANI <me...@etu.upmc.fr> on 2009/07/31 22:47:21 UTC
[SCXML] Assign with the wildcard "*"
Hi all
I'm trying to use SCXML for a project (i have to realise an
implementation of the MMI w3C spec).
In my example, I want to assign the name of the event at a var.
Somethink like this :
<state id="getCity">
<transition event ="*" target="checkCity" name="evt">
<assign location="${Data(city,'root/mycity')}" expr="${event}" />
</transition>
</state>
Somebody know how can i do this ? and is it possible to do this ?
Mehdi
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org
Re: [SCXML] Assign with the wildcard "*"
Posted by Mehdi KENNANI <me...@etu.upmc.fr>.
That works really fine.
Thx a lot Rahul
Mehdi
Quoting Rahul Akolkar <ra...@gmail.com>:
> On Fri, Jul 31, 2009 at 4:47 PM, Mehdi
> KENNANI<me...@etu.upmc.fr> wrote:
>> Hi all
>>
>> I'm trying to use SCXML for a project (i have to realise an implementation
>> of the MMI w3C spec).
>>
>> In my example, I want to assign the name of the event at a var.
>>
>> Somethink like this :
>>
>> <state id="getCity">
>> <transition event ="*" target="checkCity" name="evt">
>> <assign location="${Data(city,'root/mycity')}" expr="${event}" />
>> </transition>
>> </state>
>>
>> Somebody know how can i do this ? and is it possible to do this ?
>>
> <snip/>
>
> In the latest release (v0.9), a little bit of work is required to do
> such a thing. Add the event name (a bit redundantly) as a property of
> the event payload when you create the TriggerEvent. Say that property
> is called "name", then it can be accessed in the <assign> above with
> the following expr attribute:
>
> expr="${_eventdata.name}"
>
> In subsequent (future) releases, this information will be available
> using the new "_event" variable specified in the latest SCXML Working
> Draft like so:
>
> expr="${_event.name}"
>
> There will be no need to rely on the payload to transmit the name at
> that point.
>
> -Rahul
>
>
>>
>> Mehdi
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org
Re: [SCXML] Assign with the wildcard "*"
Posted by Rahul Akolkar <ra...@gmail.com>.
On Fri, Jul 31, 2009 at 4:47 PM, Mehdi KENNANI<me...@etu.upmc.fr> wrote:
> Hi all
>
> I'm trying to use SCXML for a project (i have to realise an implementation
> of the MMI w3C spec).
>
> In my example, I want to assign the name of the event at a var.
>
> Somethink like this :
>
> <state id="getCity">
> <transition event ="*" target="checkCity" name="evt">
> <assign location="${Data(city,'root/mycity')}" expr="${event}" />
> </transition>
> </state>
>
> Somebody know how can i do this ? and is it possible to do this ?
>
<snip/>
In the latest release (v0.9), a little bit of work is required to do
such a thing. Add the event name (a bit redundantly) as a property of
the event payload when you create the TriggerEvent. Say that property
is called "name", then it can be accessed in the <assign> above with
the following expr attribute:
expr="${_eventdata.name}"
In subsequent (future) releases, this information will be available
using the new "_event" variable specified in the latest SCXML Working
Draft like so:
expr="${_event.name}"
There will be no need to rely on the payload to transmit the name at that point.
-Rahul
>
> Mehdi
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org