statechart_enabledness.xml 719 B

123456789101112131415161718192021222324252627282930
  1. <?xml version="1.0" ?>
  2. <statechart>
  3. <datamodel>
  4. i = 0;
  5. </datamodel>
  6. <root>
  7. <parallel id="p">
  8. <state id="increment">
  9. <state id="a">
  10. <transition port="in" event="e" target="." cond='not INSTATE(["/p/status/done"])'>
  11. <raise port="out" event="inc"/>
  12. <code> i += 1; </code>
  13. </transition>
  14. </state>
  15. </state>
  16. <state id="status" initial="counting">
  17. <state id="counting">
  18. <transition cond="i == 2" target="../done"/>
  19. </state>
  20. <state id="done">
  21. <onentry>
  22. <raise port="out" event="done"/>
  23. </onentry>
  24. </state>
  25. </state>
  26. </parallel>
  27. </root>
  28. </statechart>