history_deep.xml 3.3 KB

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