after_0.xml 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <diagram author="Yentl Van Tendeloo" name="after_0">
  3. <description>
  4. Used for testing the AFTER(0) event---which should not block the deletion of the B instance.
  5. </description>
  6. <outport name="test_output" />
  7. <class name="A" default="true">
  8. <relationships>
  9. <association name="child" class="B" min="0" max="1"/>
  10. </relationships>
  11. <scxml initial="x">
  12. <state id="x">
  13. <onentry>
  14. <raise scope="cd" event="create_instance">
  15. <parameter expr="'child'"/>
  16. <parameter expr="'B'"/>
  17. </raise>
  18. <raise event="creating_instance" port="test_output" />
  19. </onentry>
  20. <transition event="instance_created" target="../ready" />
  21. </state>
  22. <state id="ready">
  23. <onentry>
  24. <raise scope="cd" event="start_instance">
  25. <parameter expr="'child[0]'"/>
  26. </raise>
  27. <raise event="starting_instance" port="test_output" />
  28. </onentry>
  29. <transition event="close" target="../done">
  30. <raise scope="cd" event="delete_instance">
  31. <parameter expr="'child[0]'"/>
  32. </raise>
  33. <raise event="deleting_instance" port="test_output" />
  34. </transition>
  35. </state>
  36. <state id="done" />
  37. </scxml>
  38. </class>
  39. <class name="B">
  40. <relationships>
  41. <association name="parent" class="A" min="1" max="1"/>
  42. </relationships>
  43. <scxml initial="z">
  44. <state id="z">
  45. <transition after="0" target="../closed">
  46. <raise scope="broad" event="close"/>
  47. <raise event="after_0" port="test_output" />
  48. </transition>
  49. </state>
  50. <state id="closed" />
  51. </scxml>
  52. </class>
  53. <test>
  54. <expected>
  55. <slot>
  56. <event name="creating_instance" port="test_output"/>
  57. </slot>
  58. <slot>
  59. <event name="starting_instance" port="test_output"/>
  60. </slot>
  61. <slot>
  62. <event name="after_0" port="test_output"/>
  63. </slot>
  64. <slot>
  65. <event name="deleting_instance" port="test_output"/>
  66. </slot>
  67. </expected>
  68. </test>
  69. </diagram>