associate_event.xml 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. <?xml version="1.0" ?>
  2. <diagram author="Glenn De Jonghe" name="TestAssociateEvent">
  3. <description>
  4. Testing the object manager
  5. </description>
  6. <inport name="test_input" />
  7. <outport name="test_output" />
  8. <class name="Class1" default="true">
  9. <relationships>
  10. <association class="Class2" name="test2_association" />
  11. <association class="Class2" name="test3_association" />
  12. </relationships>
  13. <scxml initial="start">
  14. <state id="start">
  15. <transition port="test_input" event="create" target="../wait">
  16. <raise scope="cd" event="create_instance">
  17. <parameter expr='"test2_association"'/>
  18. </raise>
  19. <raise port="test_output" event="request_send"/>
  20. </transition>
  21. </state>
  22. <state id="wait">
  23. <transition event="instance_created" target="../start">
  24. <parameter name="association_name" type="string"/>
  25. <raise port="test_output" event="instance_created"/>
  26. <raise scope="cd" event="start_instance">
  27. <parameter expr='"test2_association"'/>
  28. </raise>
  29. <raise target='"test2_association"' event="hello" />
  30. <raise scope="cd" event="associate_instance">
  31. <parameter expr='"test2_association"'/>
  32. <parameter expr='"test3_association"'/>
  33. </raise>
  34. </transition>
  35. </state>
  36. </scxml>
  37. </class>
  38. <class name="Class2" default="false">
  39. <scxml>
  40. <state id="start">
  41. <log>started</log>
  42. <transition event="hello" target=".">
  43. <raise port="test_output" event="second_working" />
  44. </transition>
  45. </state>
  46. </scxml>
  47. </class>
  48. <test>
  49. <input>
  50. <event name="create" port="test_input" time="0.0"/>
  51. </input>
  52. <expected>
  53. <slot>
  54. <event name="request_send" port="test_output"/>
  55. </slot>
  56. <slot>
  57. <event name="instance_created" port="test_output"/>
  58. </slot>
  59. <slot>
  60. <event name="second_working" port="test_output"/>
  61. </slot>
  62. </expected>
  63. </test>
  64. </diagram>