history_parallel_deep.xml 3.3 KB

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