test411.txml 1.0 KB

123456789101112131415161718192021222324252627282930313233343536
  1. <?xml version="1.0"?>
  2. <!-- we test that states are added to the active states list as they are entered and before onentry handlers
  3. are executed. When s0's onentry handler fires we should not be in s01. But when s01's onentry handler
  4. fires, we should be in s01. Therefore event1 should not fire, but event2 should. Either event1 or
  5. timeout also indicates failure -->
  6. <scxml initial="s0" version="1.0" conf:datamodel="" xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance">
  7. <state id="s0" initial="s01">
  8. <onentry>
  9. <send event="timeout" delay="1s"/>
  10. <if conf:inState="s01">
  11. <raise event="event1"/>
  12. </if>
  13. </onentry>
  14. <transition event="timeout" conf:targetfail=""/>
  15. <transition event="event1" conf:targetfail=""/>
  16. <transition event="event2" conf:targetpass=""/>
  17. <state id="s01" >
  18. <onentry>
  19. <if conf:inState="s01">
  20. <raise event="event2"/>
  21. </if>
  22. </onentry>
  23. </state>
  24. </state> <!-- end s0 -->
  25. <conf:pass/>
  26. <conf:fail/>
  27. </scxml>