test505.txml 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <?xml version="1.0"?>
  2. <!-- test that an internal transition does not exit 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 s1 -->
  6. <data conf:id="2" conf:expr="0"/> <!-- how often we have exited s11 -->
  7. <data conf:id="3" conf:expr="0"/> <!-- how often the transition for foo has been taken -->
  8. </datamodel>
  9. <state id="s1">
  10. <onentry>
  11. <raise event="foo"/>
  12. <raise event="bar"/>
  13. </onentry>
  14. <onexit>
  15. <conf:incrementID id="1"/>
  16. </onexit>
  17. <transition event="foo" type="internal" target="s11">
  18. <conf:incrementID id="3"/>
  19. </transition>
  20. <!-- make sure the transition on foo was actually taken -->
  21. <transition event="bar" conf:idVal="3=1" target="s2"/>
  22. <transition event="bar" conf:targetfail=""/>
  23. <state id="s11">
  24. <onexit>
  25. <conf:incrementID id="2"/>
  26. </onexit>
  27. </state>
  28. </state>
  29. <state id="s2">
  30. <!-- make sure that s1 was exited once -->
  31. <transition conf:idVal="1=1" target="s3"/>
  32. <transition conf:targetfail=""/>
  33. </state>
  34. <state id="s3">
  35. <!-- make sure that s11 was exited twice -->
  36. <transition conf:idVal="2=2" conf:targetpass=""/>
  37. <transition conf:targetfail=""/>
  38. </state>
  39. <conf:pass/>
  40. <conf:fail/>
  41. </scxml>