test504.txml 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. <?xml version="1.0"?>
  2. <!-- test that an external transition exits all states up the the LCCA -->
  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. <data conf:id="5" conf:expr="0"/> <!-- how often we have exited s2 -->
  10. </datamodel>
  11. <state id="s1">
  12. <onentry>
  13. <raise event="foo"/>
  14. <raise event="bar"/>
  15. </onentry>
  16. <transition target="p"/>
  17. </state>
  18. <state id="s2">
  19. <onexit>
  20. <conf:incrementID id="5"/>
  21. </onexit>
  22. <parallel id="p">
  23. <onexit>
  24. <conf:incrementID id="1"/>
  25. </onexit>
  26. <transition event="foo" target="ps1">
  27. <conf:incrementID id="4"/>
  28. </transition>
  29. <!-- make sure the transition on foo was actually taken -->
  30. <transition event="bar" conf:idVal="4=1" target="s3"/>
  31. <transition event="bar" conf:targetfail=""/>
  32. <state id="ps1">
  33. <onexit>
  34. <conf:incrementID id="2"/>
  35. </onexit>
  36. </state>
  37. <state id="ps2">
  38. <onexit>
  39. <conf:incrementID id="3"/>
  40. </onexit>
  41. </state>
  42. </parallel>
  43. </state>
  44. <state id="s3">
  45. <!-- make sure that p was exited twice -->
  46. <transition conf:idVal="1=2" target="s4"/>
  47. <transition conf:targetfail=""/>
  48. </state>
  49. <state id="s4">
  50. <!-- make sure that ps1 was exited twice -->
  51. <transition conf:idVal="2=2" target="s5"/>
  52. <transition conf:targetfail=""/>
  53. </state>
  54. <state id="s5">
  55. <!-- make sure that ps2 was exited twice -->
  56. <transition conf:idVal="3=2" target="s6"/>
  57. <transition conf:targetfail=""/>
  58. </state>
  59. <state id="s6">
  60. <!-- make sure that s1 was exited once -->
  61. <transition conf:idVal="5=1" conf:targetpass=""/>
  62. <transition conf:targetfail=""/>
  63. </state>
  64. <conf:pass/>
  65. <conf:fail/>
  66. </scxml>