history.xml 1.9 KB

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