Skip to content
This repository has been archived by the owner on Sep 25, 2018. It is now read-only.

send without event or eventexpr should result in parse error #355

Open
mattoshry opened this issue Mar 31, 2015 · 0 comments
Open

send without event or eventexpr should result in parse error #355

mattoshry opened this issue Mar 31, 2015 · 0 comments

Comments

@mattoshry
Copy link
Collaborator

[1] is not crystal clear for all cases, but for type[expr] === 'http://www.w3.org/TR/scxml/#SCXMLEventProcessor' the spec does state the following about event and eventexpr:

"If the type is http://www.w3.org/TR/scxml/#SCXMLEventProcessor, either this attribute or 'event[expr]' must be present."

And after the table:

"A conformant SCXML document must specify exactly one of 'event', 'eventexpr' and ."

For #_internal (repro below) scion doesn't protest. For other sends which are delegated to the send manager, the manager can raise an error event into the internal event queue, but this can be detected partially at pre-exection / parse time. An @eventexpr that evaluates to empty/null/undefined could be detected at runtime.

[1] http://www.w3.org/TR/scxml/#send

<scxml xmlns="http://www.w3.org/2005/07/scxml"
  version="1.0">

<transition event="*">
  <log expr="'Ignoring unhandled input ' + _event.name" label="TEST"/>
</transition>

<state id="s1">
  <onentry>
    <send target="#_internal" />
  </onentry>
</state>

</scxml>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant