test533.txml 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. <?xml version="1.0"?>
  2. <!-- test that an internal transition whose source state is not compound does 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 p -->
  6. <data conf:id="2" conf:expr="0"/> <!-- how often we have exited ps1 -->
  7. <data conf:id="3" conf:expr="0"/> <!-- how often we have exited ps2 -->
  8. <data conf:id="4" 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="p"/>
  16. </state>
  17. <parallel id="p">
  18. <onexit>
  19. <conf:incrementID id="1"/>
  20. </onexit>
  21. <transition event="foo" type="internal" target="ps1">
  22. <conf:incrementID id="4"/>
  23. </transition>
  24. <!-- make sure the transition on foo was actually taken -->
  25. <transition event="bar" conf:idVal="4=1" target="s2"/>
  26. <transition event="bar" conf:targetfail=""/>
  27. <state id="ps1">
  28. <onexit>
  29. <conf:incrementID id="2"/>
  30. </onexit>
  31. </state>
  32. <state id="ps2">
  33. <onexit>
  34. <conf:incrementID id="3"/>
  35. </onexit>
  36. </state>
  37. </parallel>
  38. <state id="s2">
  39. <!-- make sure that p was exited twice -->
  40. <transition conf:idVal="1=2" target="s3"/>
  41. <transition conf:targetfail=""/>
  42. </state>
  43. <state id="s3">
  44. <!-- make sure that ps1 was exited twice -->
  45. <transition conf:idVal="2=2" target="s4"/>
  46. <transition conf:targetfail=""/>
  47. </state>
  48. <state id="s4">
  49. <!-- make sure that ps2 was exited twice -->
  50. <transition conf:idVal="3=2" conf:targetpass=""/>
  51. <transition conf:targetfail=""/>
  52. </state>
  53. <conf:pass/>
  54. <conf:fail/>
  55. </scxml>