test503.txml 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?xml version="1.0"?>
  2. <!-- test that a targetless transition does not exit and reenter its source state -->
  3. <scxml initial="s1" version="1.0" conf:datamodel="" xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance">
  4. <datamodel>
  5. <data conf:id="1" conf:expr="0"/> <!-- how often we have exited s2 -->
  6. <data conf:id="2" conf:expr="0"/> <!-- how often the targetless transition in s2 has been executed -->
  7. </datamodel>
  8. <state id="s1">
  9. <onentry>
  10. <raise event="foo"/>
  11. <raise event="bar"/>
  12. </onentry>
  13. <transition target="s2"/>
  14. </state>
  15. <state id="s2">
  16. <onexit>
  17. <conf:incrementID id="1"/>
  18. </onexit>
  19. <transition event="foo">
  20. <conf:incrementID id="2"/>
  21. </transition>
  22. <!-- make sure the transition on foo was actually taken -->
  23. <transition event="bar" conf:idVal="2=1" target="s3"/>
  24. <transition event="bar" conf:targetfail=""/>
  25. </state>
  26. <state id="s3">
  27. <!-- make sure that s2 was exited only once -->
  28. <transition conf:idVal="1=1" conf:targetpass=""/>
  29. <transition conf:targetfail=""/>
  30. </state>
  31. <conf:pass/>
  32. <conf:fail/>
  33. </scxml>