test399.txml 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. <?xml version="1.0"?>
  2. <!-- test that the event name matching works correctly, including prefix matching and the fact
  3. that the event attribute of transition may contain multiple event designators. -->
  4. <scxml initial="s0" version="1.0" conf:datamodel="" xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance">
  5. <state id="s0" initial="s01">
  6. <onentry>
  7. <send event="timeout" delay="2s"/>
  8. </onentry>
  9. <!-- this will catch the failure case -->
  10. <transition event="timeout" conf:targetfail=""/>
  11. <state id="s01">
  12. <onentry>
  13. <raise event="foo"/>
  14. </onentry>
  15. <!-- test that an event can match against a transition with multiple descriptors -->
  16. <transition event="foo bar" target="s02"/>
  17. </state>
  18. <state id="s02">
  19. <onentry>
  20. <raise event="bar"/>
  21. </onentry>
  22. <!-- test that an event can match the second descriptor as well -->
  23. <transition event="foo bar" target="s03"/>
  24. </state>
  25. <state id="s03">
  26. <onentry>
  27. <raise event="foo.zoo"/>
  28. </onentry>
  29. <!-- test that a prefix descriptor matches -->
  30. <transition event="foo bar" target="s04"/>
  31. </state>
  32. <state id="s04">
  33. <onentry>
  34. <raise event="foos"/>
  35. </onentry>
  36. <!-- test that only token prefixes match -->
  37. <transition event="foo" conf:targetfail=""/>
  38. <transition event="foos" target="s05"/>
  39. </state>
  40. <state id="s05">
  41. <onentry>
  42. <raise event="foo.zoo"/>
  43. </onentry>
  44. <!-- test that .* works at the end of a descriptor -->
  45. <transition event="foo.*" target="s06"/>
  46. </state>
  47. <state id="s06">
  48. <onentry>
  49. <raise event="foo"/>
  50. </onentry>
  51. <!-- test that "*" works by itself -->
  52. <transition event="*" conf:targetpass=""/>
  53. </state>
  54. </state>
  55. <conf:pass/>
  56. <conf:fail/>
  57. </scxml>