test229.txml 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?xml version="1.0"?>
  2. <!-- test that autofoward works. If the child process receives back a copy of the
  3. childToParent event that it sends to this doc, it sends eventReceived, signalling success. (Note
  4. that this doc is not required to process that event explicitly. It should be forwarded in any case.) Otherwise
  5. it eventually times out and the done.invoke signals 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" >
  8. <onentry>
  9. <send event="timeout" delay="3s"/>
  10. </onentry>
  11. <invoke type="http://www.w3.org/TR/scxml/" autoforward="true">
  12. <content>
  13. <!-- when invoked, send childToParent to parent.
  14. If it is forwarded back to us, send
  15. eventReceived to signal success and terminate.
  16. Otherwise wait for timer to expire and terminate. -->
  17. <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">
  18. <state id="sub0">
  19. <onentry>
  20. <send target="#_parent" event="childToParent"/>
  21. <send event="timeout" delay="3s"/>
  22. </onentry>
  23. <transition event="childToParent" target="subFinal">
  24. <send target="#_parent" event="eventReceived"/>
  25. </transition>
  26. <transition event="*" target="subFinal"/>
  27. </state>
  28. <final id="subFinal"/>
  29. </scxml>
  30. </content>
  31. </invoke>
  32. <transition event="childToParent"/>
  33. <transition event="eventReceived" conf:targetpass=""/>
  34. <transition event="*" conf:targetfail=""/>
  35. </state>
  36. <conf:pass/>
  37. <conf:fail/>
  38. </scxml>