test453.txml 688 B

12345678910111213141516171819202122
  1. <!-- test that we can use any ecmascript expression as a value expression.
  2. In this case, we just test that we can assign
  3. a function to a variable and then call it. -->
  4. <scxml datamodel="ecmascript" version="1.0" xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance">
  5. <datamodel>
  6. <data id="var1" expr="function(invar) {return invar + 1;}"/>
  7. </datamodel>
  8. <state id="s0">
  9. <onentry>
  10. <raise event="event1"/>
  11. </onentry>
  12. <!-- test that we can call the function -->
  13. <transition event="event1" cond="var1(2) == 3" conf:targetpass=""/>
  14. <transition event="*" conf:targetfail=""/>
  15. </state>
  16. <conf:pass/>
  17. <conf:fail/>
  18. </scxml>