history_parallel_deep.xml 3.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. <?xml version="1.0" ?>
  2. <diagram
  3. xmlns="msdl.uantwerpen.be/sccd"
  4. author="Glenn De Jonghe"
  5. name="TestHistoryParallelDeep">
  6. <description>
  7. Testing history deep.
  8. </description>
  9. <outport name="test_output" />
  10. <class name="Class1" default="true">
  11. <scxml>
  12. <parallel id="parallel">
  13. <state id="orthogonal" initial="wrapper">
  14. <parallel id="wrapper">
  15. <state id="state_1" initial="inner_1">
  16. <state id="inner_1">
  17. <transition event="to_inner_2" target="../inner_2"/>
  18. </state>
  19. <state id="inner_2"/>
  20. </state>
  21. <state id="state_2" initial="inner_3">
  22. <state id="inner_3">
  23. <transition event="to_inner_4" target="../inner_4"/>
  24. </state>
  25. <state id="inner_4"/>
  26. </state>
  27. <history id="history" type="deep"/>
  28. <transition event="to_outer" target="../outer"/>
  29. </parallel>
  30. <state id="outer">
  31. <transition event="to_history" target="../wrapper/history"/>
  32. </state>
  33. </state>
  34. <state id="orthogonal_tester" initial="start">
  35. <state id="start">
  36. <transition target="../step1">
  37. <raise event="to_inner_2" />
  38. <raise event="to_inner_4" />
  39. </transition>
  40. </state>
  41. <state id="step1">
  42. <transition cond="INSTATE('/parallel/orthogonal/wrapper/state_2/inner_4', '/parallel/orthogonal/wrapper/state_1/inner_2')"
  43. target="../step2">
  44. <raise port="test_output" event="check1" />
  45. <raise event="to_outer" />
  46. </transition>
  47. </state>
  48. <state id="step2">
  49. <transition cond="INSTATE('/parallel/orthogonal/outer')" target="../step3">
  50. <raise port="test_output" event="check2" />
  51. <raise event="to_history" />
  52. </transition>
  53. </state>
  54. <state id="step3">
  55. <transition cond="INSTATE('/parallel/orthogonal/wrapper/state_2/inner_4', '/parallel/orthogonal/wrapper/state_1/inner_2')" target="../end">
  56. <raise port="test_output" event="check3" />
  57. </transition>
  58. </state>
  59. <state id="end"/>
  60. </state>
  61. </parallel>
  62. </scxml>
  63. </class>
  64. <test>
  65. <expected>
  66. <slot>
  67. <event name="check1" port="test_output"/>
  68. </slot>
  69. <slot>
  70. <event name="check2" port="test_output"/>
  71. </slot>
  72. <slot>
  73. <event name="check3" port="test_output"/>
  74. </slot>
  75. </expected>
  76. </test>
  77. </diagram>