test191.txml 1.3 KB

12345678910111213141516171819202122232425262728293031323334
  1. <?xml version="1.0"?>
  2. <!-- we test that #_parent works as a target of <send> . a subscript is invoked and sends the event
  3. childToParent to its parent session (ths session) using #_parent as the target. If we get this event, we
  4. pass, otherwise we fail. The timer insures that some event is generated and that the test does not hang. -->
  5. <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">
  6. <state id="s0" >
  7. <onentry>
  8. <send event="timeout" delay="5s"/>
  9. </onentry>
  10. <invoke type="scxml" >
  11. <content>
  12. <!-- send an event to the parent session using #_parent as the target -->
  13. <scxml initial="sub0" version="1.0" conf:datamodel="" xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance">
  14. <state id="sub0">
  15. <onentry>
  16. <send event="childToParent" target="#_parent"/>
  17. </onentry>
  18. <transition target="subFinal"/>
  19. </state>
  20. <final id="subFinal"/>
  21. </scxml>
  22. </content>
  23. </invoke>
  24. <transition event="childToParent" conf:targetpass=""/>
  25. <transition event="*" conf:targetfail=""/>
  26. </state>
  27. <conf:pass/>
  28. <conf:fail/>
  29. </scxml>