On Tue, May 4, 2010 at 2:23 AM, jocke eriksson <[email protected]> wrote: > Ok here is the scenario, send html request to a server, fire event found in > a http response header. What is the recommended way of solving that using > the send tag in scxml. This ugly solution is what i have now. > > > public final class SendAction extends Send { > > private static final long serialVersionUID = 1L; > > �...@override > public void execute(EventDispatcher evtDispatcher, ErrorReporter errRep, > SCInstance scInstance, Log appLog, Collection derivedEvents) > throws ModelException, SCXMLExpressionException { > scInstance.getRootContext().set("derivedEvents", derivedEvents); > super.execute(evtDispatcher, errRep, scInstance, appLog, > derivedEvents); > } > <snip/>
If you're working with the v0.9 release, this may be your best bet. However, before that -- how is the "derivedEvents" variable used? I don't see it below (say, in the namelist would've been one option). -Rahul > The state is this > > <sc:state id="auth"> > > <sc:onentry> > <ms:send > namelist="uid pin action" > targettype="'basichttp'" > target="' > http://localhost:8080/tms-web-1.3.3/ivr/mediaserver.action'" /> > </sc:onentry> > > <sc:transition event="auth.success" target="vm-play" /> > > <sc:transition event="auth.fail" target="exit" > > <ms:playaudio value="sp + 'vm-fail_auth.wav'" /> > </sc:transition> > > </sc:state> > > > But please give me an better option :). If possible without AsyncTrigger > > > 2010/5/3 Rahul Akolkar <[email protected]> > >> On Mon, May 3, 2010 at 9:12 AM, jocke eriksson <[email protected]> wrote: >> > I have an application that uses many custom actions, but now I'm trying >> to >> > use the dispatchers Send method. >> > My problem is that when I use the executor to trigger events, the machine >> > ends up in an loop. >> > How could one get a reference to the derived events collection from the >> send >> > action, to add events that way. >> <snip/> >> >> The EventDispatcher is meant for <send> and <cancel>, which are part >> of the external communications module. It does not provide ready >> access to the derived events collections, which is the internal state >> of the executing state machine. As you note above, that collection is >> available to custom actions. >> >> However, in v0.9, the semantics of skipping the 'target' and >> 'targettype' (latest WD: now known as 'type') attributes for a <send> >> has the effect of adding the event to the internal events collection >> (latest WD: the type has to be '#_internal' instead of empty or >> missing). >> >> -Rahul >> --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
