test234.txml 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. <?xml version="1.0"?>
  2. <!-- test that only finalize markup in the invoking state runs. the first invoked process will
  3. return 2 in _event.data.aParam, while second invoked process sleeps without returning any events.
  4. Only the first finalize should execute. So when we get to s1 var1 should have value 2 but
  5. var2 should still be set to 1 -->
  6. <scxml initial="p0" version="1.0" conf:datamodel="" xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance">
  7. <datamodel>
  8. <data conf:id="1" conf:expr="1"/>
  9. <data conf:id="2" conf:expr="1"/>
  10. </datamodel>
  11. <parallel id="p0">
  12. <onentry>
  13. <send event="timeout" delay="3s"/>
  14. </onentry>
  15. <transition event="timeout" conf:targetfail=""/>
  16. <state id="p01">
  17. <invoke type="http://www.w3.org/TR/scxml/">
  18. <content>
  19. <scxml version="1.0" initial="subFinal1" conf:datamodel="" xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance">
  20. <final id="subFinal1">
  21. <onentry>
  22. <send target="#_parent" event="childToParent">
  23. <param name="aParam" conf:expr="2"/>
  24. </send>
  25. </onentry>
  26. </final>
  27. </scxml>
  28. </content>
  29. <finalize>
  30. <assign conf:location="1" conf:eventDataFieldValue="aParam"/>
  31. </finalize>
  32. </invoke>
  33. <transition event="childToParent" conf:idVal="1=2" target="s1"/>
  34. <transition event="childToParent" conf:targetfail=""/>
  35. </state>
  36. <state id="p02">
  37. <invoke type="http://www.w3.org/TR/scxml/">
  38. <content>
  39. <scxml version="1.0" initial="sub0" conf:datamodel="" xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance">
  40. <state id="sub0">
  41. <onentry>
  42. <send event="timeout" delay="2s"/>
  43. </onentry>
  44. <transition event="timeout" target="subFinal2"/>
  45. </state>
  46. <final id="subFinal2"/>
  47. </scxml>
  48. </content>
  49. <finalize>
  50. <assign conf:location="2" conf:eventDataFieldValue="aParam"/>
  51. </finalize>
  52. </invoke>
  53. </state>
  54. </parallel>
  55. <state id="s1">
  56. <transition conf:idVal="2=1" conf:targetpass=""/>
  57. <transition conf:targetfail=""/>
  58. </state>
  59. <conf:pass/>
  60. <conf:fail/>
  61. </scxml>