Invoking on stable configuration but sending on entry
Stefan Radomski <[email protected]>
| Newsgroups | gmane.comp.web.voice |
|---|---|
| Message-ID | <36F4C8AB-4AE8-427F-889A-464A7ADC4F61@tk.informatik.tu-darmstadt.de> |
Hey there,
as we continue to use SCXML for various applications, there is one deficiency that always bugged us. Consider that you have a state that will invoke something and you’d like to send some event to it right-away. You cannot use <send target=“#_invokeid”> in an onentry element as the invoker will not yet exist, it is only invoked when a stable configuration is reached (see procedure mainEventLoop in the draft). Thus forcing you to use a delay attribute.
<state id=“foo”>
<invoke type=“something” id=“something” />
<onentry>
<!— this will fail as the invoker does not yet exist -->
<send target=“#_something” event=“do.something” />
<!— this will work as we had an empty internal queue -->
<send target=“#_something” event=“do.something” delay=“1ms" />
</onentry>
</state>
Is anyone else bugged by this behavior and resorted to the delayed send idiom, is there something more straight-forward or did we misinterpret the SCXML draft at some point?
If this is indeed correct behavior, maybe we could specify that an invoker *must* raise some internal event after being successfully invoked?
Best regards
Stefan