parallel.xml 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. <?xml version="1.0" ?>
  2. <diagram
  3. xmlns="msdl.uantwerpen.be/sccd"
  4. author="Glenn De Jonghe"
  5. name="TestParallel">
  6. <description>
  7. Testing parallelism.
  8. </description>
  9. <inport name="test_input" />
  10. <outport name="test_output" />
  11. <class name="Class1" default="true">
  12. <scxml>
  13. <parallel id="parallel_1">
  14. <state id="orthogonal_1" initial="state_1">
  15. <state id="state_1">
  16. <onentry>
  17. <raise port="test_output" event="in_state_1" />
  18. </onentry>
  19. <transition port="test_input" event="to_state_2" target="../state_2"/>
  20. </state>
  21. <state id="state_2">
  22. <onentry>
  23. <raise port="test_output" event="in_state_2" />
  24. </onentry>
  25. <transition port="test_input" event="to_state_1" target="../state_1"/>
  26. </state>
  27. </state>
  28. <state id="orthogonal_2" initial="state_3">
  29. <state id="state_3">
  30. <onentry>
  31. <raise port="test_output" event="in_state_3" />
  32. </onentry>
  33. <transition port="test_input" event="to_state_4" target="../state_4"/>
  34. </state>
  35. <state id="state_4">
  36. <onentry>
  37. <raise port="test_output" event="in_state_4" />
  38. </onentry>
  39. <transition port="test_input" event="to_state_3" target="../state_3"/>
  40. </state>
  41. </state>
  42. </parallel>
  43. </scxml>
  44. </class>
  45. <test>
  46. <input>
  47. <event name="to_state_2" port="test_input" time="0"/>
  48. <event name="to_state_4" port="test_input" time="0"/>
  49. <event name="to_state_1" port="test_input" time="0"/>
  50. <event name="to_state_2" port="test_input" time="0"/>
  51. <event name="to_state_3" port="test_input" time="0"/>
  52. </input>
  53. <expected>
  54. <slot>
  55. <event name="in_state_1" port="test_output"/>
  56. <event name="in_state_3" port="test_output"/>
  57. </slot>
  58. <slot>
  59. <event name="in_state_2" port="test_output"/>
  60. </slot>
  61. <slot>
  62. <event name="in_state_4" port="test_output"/>
  63. </slot>
  64. <slot>
  65. <event name="in_state_1" port="test_output"/>
  66. </slot>
  67. <slot>
  68. <event name="in_state_2" port="test_output"/>
  69. </slot>
  70. <slot>
  71. <event name="in_state_3" port="test_output"/>
  72. </slot>
  73. </expected>
  74. </test>
  75. </diagram>