commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mike Sparr - www.goomzee.com" <m...@goomzee.com>
Subject Re: [SCXML] Help with sending events
Date Fri, 24 Mar 2006 20:54:55 GMT
Hey,

I see you got that far.  You will create your own implementation of the
EventDispatcher interface and within, capture the event and place in object
stored in session (in memory hashmap).  That object that contains the event
can be accesses from your controller and you can fire an event based on the
event captured from the Send object.

Class that implements EventDispatcher

XXX implements EventDispatcher {
....
    public void send(String sendId, String target, String targetType,
            String event, Map params, Object hints, long delay,
            List externalNodes) {
         get event from here, place in object that your controller can
access, then call TriggerEvent from within there.
     }
... 

}

========

Your controller class can TriggerEvent:

            TriggerEvent[] te = { new
TriggerEvent(someStoredObject.getEvent(),
                    TriggerEvent.SIGNAL_EVENT) };


========

Sorry I cannot got into great details - Rahul Alkolkar, one of the authors
could help more.  Our implementation is rather proprietary but I think this
covers most of the generic functionality.  If you look at his SimpleXXXXX
classes they show you how to implement.

Best,


Mike




On 3/24/06 1:13 PM, "Mike Sparr - www.goomzee.com" <mike@goomzee.com> wrote:

> Below is an example of how we use SCXML.  You can declare the event in the
> <send> tag and it is sent.  Of course each implementation of the executor
> varies, but maybe this will help.
> 
> =====
> 
>   <state id="state_logoff" final="true">
> 
>     <transition event="menu" >
>       <send target="http://localhost:8080/goomzee" targettype="client"
> event="menu" delay="0" hints="" sendid="2345">
> <vxml version="2.0">
> 
> <form>
> 
> <field name="input">
> 
> <prompt>You are now logged off.  Goodbye</prompt>
> 
> </field>
> 
> <filled namelist="input">
> <submit next="http://localhost:8080/goomzee/Voice" namelist="input"/>
> 
> </filled>
> 
> </form>
> 
> </vxml>
>       </send>
>       <target next="state_welcome" />
>     </transition>
> 
>   </state>
> 
> =====
> 
> You could alternately not include body content within sent and declare the
> event as such:
> 
> <send target="http://localhost:8080/goomzee" targettype="client"
> event="menu" delay="0" hints="" sendid="2345" />
> 
> For this demo script, I have a welcome state which prompts for login/logoff.
> Then a login state and a logoff state that ultimately reverts back to
> welcome.  
> 
> =====
> 
> Mike
> 
> 
> 
> 
> 
> On 3/24/06 12:07 PM, "Shylaja.Kokoori@asu.edu" <Shylaja.Kokoori@asu.edu>
> wrote:
> 
>> Hi,
>> 
>> I am a graduate student developing a testing tool for an open source software
>> framework providing image-guided surgery applications
>> (http://www.igstk.org/).
>> State machines are used to ensure the stability of the components in this
>> framework. We are very interested in using SCXML engine for the test suite.
>> My problem is that, I am having trouble triggering the events in order to
>> make
>> transitions. Using the ³fireEvent² method I am able to achieve this, but I
>> would like to use <send> to send the events. Right now, although the send
>> gets
>> called during the scxml execution, the transition does not happen whether I
>> call it from the same session or externally.
>> 
>> My scxml file looks something like this:
>> 
>> <?xml version="1.0"?>
>> <scxml xmlns="http://www.w3.org/2005/07/SCXML"
>> version="1.0"
>>        initialstate="NullImageSpatialObjectState">
>> <state id="NullImageSpatialObjectState">
>> <transition event=" validImageSpatialObjectInput">
>> <target next="ValidImageSpatialObjectState"/>
>> </transition>
>> </state>
>>         ŠŠŠŠŠŠŠŠŠ
>> </scxml>
>> 
>> I am using 
>> <send  targettype="scxml" event="validImageSpatialObjectInput"/> to send the
>> validImageSpatialObjectInput event.
>> 
>> I am a little confused as to how <send> works.
>> 
>> Any help is appreciated.
>> 
>> Thank you,
>> shylaja
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: commons-user-help@jakarta.apache.org
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
> 



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


Mime
View raw message