test506.txml 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <?xml version="1.0"?>
  2. <!-- test that an internal transition whose targets are not proper descendants of its source state
  3. behaves like an external transition -->
  4. <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">
  5. <datamodel>
  6. <data conf:id="1" conf:expr="0"/> <!-- how often we have exited s2 -->
  7. <data conf:id="2" conf:expr="0"/> <!-- how often we have exited s21 -->
  8. <data conf:id="3" conf:expr="0"/> <!-- how often the transition for foo has been taken -->
  9. </datamodel>
  10. <state id="s1">
  11. <onentry>
  12. <raise event="foo"/>
  13. <raise event="bar"/>
  14. </onentry>
  15. <transition target="s2"/>
  16. </state>
  17. <state id="s2" initial="s21">
  18. <onexit>
  19. <conf:incrementID id="1"/>
  20. </onexit>
  21. <transition event="foo" type="internal" target="s2">
  22. <conf:incrementID id="3"/>
  23. </transition>
  24. <!-- make sure the transition on foo was actually taken -->
  25. <transition event="bar" conf:idVal="3=1" target="s3"/>
  26. <transition event="bar" conf:targetfail=""/>
  27. <state id="s21">
  28. <onexit>
  29. <conf:incrementID id="2"/>
  30. </onexit>
  31. </state>
  32. </state>
  33. <state id="s3">
  34. <!-- make sure that s2 was exited twice -->
  35. <transition conf:idVal="1=2" target="s4"/>
  36. <transition conf:targetfail=""/>
  37. </state>
  38. <state id="s4">
  39. <!-- make sure that s21 was exited twice -->
  40. <transition conf:idVal="2=2" conf:targetpass=""/>
  41. <transition conf:targetfail=""/>
  42. </state>
  43. <conf:pass/>
  44. <conf:fail/>
  45. </scxml>