object_manager.xml 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <?xml version="1.0" ?>
  2. <diagram author="Glenn De Jonghe" name="TestObjectManager">
  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. </relationships>
  12. <scxml initial="start">
  13. <state id="start">
  14. <transition port="test_input" event="create" target="../wait">
  15. <raise scope="cd" event="create_instance">
  16. <parameter expr='"test2_association"'/>
  17. </raise>
  18. <raise port="test_output" event="request_send"/>
  19. </transition>
  20. </state>
  21. <state id="wait">
  22. <transition event="instance_created" target="../start">
  23. <parameter name="association_name" type="string"/>
  24. <raise port="test_output" event="instance_created"/>
  25. <raise scope="cd" event="start_instance">
  26. <parameter expr='"test2_association"'/>
  27. </raise>
  28. <raise target='"test2_association"' event="hello" />
  29. </transition>
  30. </state>
  31. </scxml>
  32. </class>
  33. <class name="Class2" default="false">
  34. <scxml>
  35. <state id="start">
  36. <log>started</log>
  37. <transition event="hello" target=".">
  38. <raise port="test_output" event="second_working" />
  39. </transition>
  40. </state>
  41. </scxml>
  42. </class>
  43. <test>
  44. <input>
  45. <event name="create" port="test_input" time="0.0"/>
  46. </input>
  47. <expected>
  48. <slot>
  49. <event name="request_send" port="test_output"/>
  50. </slot>
  51. <slot>
  52. <event name="instance_created" port="test_output"/>
  53. </slot>
  54. <slot>
  55. <event name="second_working" port="test_output"/>
  56. </slot>
  57. </expected>
  58. </test>
  59. </diagram>