instate.xml 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <?xml version="1.0" ?>
  2. <diagram author="Glenn De Jonghe" name="TestInstate">
  3. <description>
  4. Testing the INSTATE macro.
  5. </description>
  6. <outport name="test_output" />
  7. <class name="Class1" default="true">
  8. <scxml>
  9. <parallel id="parallel_1">
  10. <state id="orthogonal1" initial="state1">
  11. <state id="state1">
  12. <transition event="to_inner" target="../inner"/>
  13. </state>
  14. <state id="inner" initial="state2">
  15. <state id="state2">
  16. <transition event="to_state3" target="../state3"/>
  17. </state>
  18. <state id="state3"/>
  19. </state>
  20. </state>
  21. <state id="orthogonal2" initial="tester">
  22. <state id="tester">
  23. <transition cond="INSTATE('/parallel_1/orthogonal1/state1')" target=".">
  24. <raise port="test_output" event="check1"/>
  25. <raise event="to_inner"/>
  26. </transition>
  27. <transition cond="INSTATE('/parallel_1/orthogonal1/inner/state2')" target=".">
  28. <raise port="test_output" event="check2"/>
  29. <raise event="to_state3"/>
  30. </transition>
  31. <transition cond="INSTATE('/parallel_1/orthogonal1/inner/state3')" target="../stop">
  32. <raise port="test_output" event="check3"/>
  33. </transition>
  34. </state>
  35. <state id="stop"/>
  36. </state>
  37. </parallel>
  38. </scxml>
  39. </class>
  40. <test>
  41. <expected>
  42. <slot>
  43. <event name="check1" port="test_output"/>
  44. </slot>
  45. <slot>
  46. <event name="check2" port="test_output"/>
  47. </slot>
  48. <slot>
  49. <event name="check3" port="test_output"/>
  50. </slot>
  51. </expected>
  52. </test>
  53. </diagram>