history.xml 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <?xml version="1.0" ?>
  2. <diagram author="Glenn De Jonghe" name="TestHistory">
  3. <description>
  4. Testing the History state.
  5. </description>
  6. <inport name="test_input" />
  7. <outport name="test_output" />
  8. <class name="Class1" default="true">
  9. <scxml initial="composite_1">
  10. <state id="composite_1" initial="state_1">
  11. <state id="state_1">
  12. <onentry>
  13. <raise port="test_output" event="in_state_1" />
  14. </onentry>
  15. <transition port="test_input" event="to_state_2" target="../state_2"/>
  16. </state>
  17. <state id="state_2">
  18. <onentry>
  19. <raise port="test_output" event="in_state_2" />
  20. </onentry>
  21. </state>
  22. <history id="composite_history">
  23. <transition target="../state_1"/>
  24. </history>
  25. <transition port="test_input" event="to_state_3" target="../state_3"/>
  26. </state>
  27. <state id="state_3">
  28. <onentry>
  29. <raise port="test_output" event="in_state_3" />
  30. </onentry>
  31. <transition target="/composite_1/composite_history"/>
  32. </state>
  33. </scxml>
  34. </class>
  35. <test>
  36. <input>
  37. <event name="to_state_2" port="test_input" time="0.0"/>
  38. <event name="to_state_3" port="test_input" time="0.0"/>
  39. </input>
  40. <expected>
  41. <slot>
  42. <event name="in_state_1" port="test_output"/>
  43. </slot>
  44. <slot>
  45. <event name="in_state_2" port="test_output"/>
  46. </slot>
  47. <slot>
  48. <event name="in_state_3" port="test_output"/>
  49. </slot>
  50. <slot>
  51. <event name="in_state_2" port="test_output"/>
  52. </slot>
  53. </expected>
  54. </test>
  55. </diagram>