test331.txml 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <scxml version="1.0" conf:datamodel="" xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" initial="s0" name="machineName">
  3. <!-- test that _event.type is set correctly for internal, platform, and external events -->
  4. <datamodel>
  5. <data conf:id="1"/>
  6. </datamodel>
  7. <state id="s0">
  8. <onentry>
  9. <!-- internal event -->
  10. <raise event="foo"/>
  11. </onentry>
  12. <transition event="foo" target="s1">
  13. <assign conf:location="1" conf:eventType=""/>
  14. </transition>
  15. <transition event="*" target="fail"/>
  16. </state>
  17. <state id="s1">
  18. <transition conf:idQuoteVal="1=internal" target="s2"/>
  19. <transition conf:targetfail=""/>
  20. </state>
  21. <state id="s2">
  22. <onentry>
  23. <!-- this will generate an error, which is a platform event -->
  24. <assign conf:invalidLocation="" conf:expr="1"/>
  25. </onentry>
  26. <transition event="error" target="s3">
  27. <assign conf:location="1" conf:eventType=""/>
  28. </transition>
  29. <transition event="*" target="fail"/>
  30. </state>
  31. <state id="s3">
  32. <transition conf:idQuoteVal="1=platform" target="s4"/>
  33. <transition conf:targetfail=""/>
  34. </state>
  35. <state id="s4">
  36. <onentry>
  37. <!-- external event -->
  38. <send event="foo"/>
  39. </onentry>
  40. <transition event="foo" target="s5">
  41. <assign conf:location="1" conf:eventType=""/>
  42. </transition>
  43. <transition event="*" target="fail"/>
  44. </state>
  45. <state id="s5">
  46. <transition conf:idQuoteVal="1=external" conf:targetpass=""/>
  47. <transition conf:targetfail=""/>
  48. </state>
  49. <conf:pass/>
  50. <conf:fail/>
  51. </scxml>