Author: jbeard
Date: Sun Nov 7 09:13:25 2010
New Revision: 1032233
URL: http://svn.apache.org/viewvc?rev=1032233&view=rev
Log:
Fixed behaviour of send with delay. GEN still broken and needs to be fixed.
cancel needs to be implemented as well.
Modified:
commons/sandbox/gsoc/2010/scxml-js/trunk/src/xslt/backends/js/AbstractStatechartGenerator.xsl
commons/sandbox/gsoc/2010/scxml-js/trunk/test/test_with_xsltproc.sh
Modified:
commons/sandbox/gsoc/2010/scxml-js/trunk/src/xslt/backends/js/AbstractStatechartGenerator.xsl
URL:
http://svn.apache.org/viewvc/commons/sandbox/gsoc/2010/scxml-js/trunk/src/xslt/backends/js/AbstractStatechartGenerator.xsl?rev=1032233&r1=1032232&r2=1032233&view=diff
==============================================================================
---
commons/sandbox/gsoc/2010/scxml-js/trunk/src/xslt/backends/js/AbstractStatechartGenerator.xsl
(original)
+++
commons/sandbox/gsoc/2010/scxml-js/trunk/src/xslt/backends/js/AbstractStatechartGenerator.xsl
Sun Nov 7 09:13:25 2010
@@ -527,15 +527,16 @@
<choose>
<when test="@delay">
- <!-- FIXME: this stuff needs to be fixed -->
- <!--
+ <!-- TODO: think about cancel -->
+ <!-- TODO: fix GEN -->
+ //send delayed event
window.setTimeout(function(){
- self.GEN("<value-of select="@event"/>");
+ self['<value-of
select="@event"/>'](null);
},<value-of select="number(@delay)*1000"/>);
- -->
</when>
<otherwise>
<!--FIXME: hook up data part of this -->
+ //send event
innerEventQueue.push(
<call-template
name="genExternalTriggerDispatcherRunToCompletionEventValue">
<with-param
name="eventName" select="$eventName"/>
Modified: commons/sandbox/gsoc/2010/scxml-js/trunk/test/test_with_xsltproc.sh
URL:
http://svn.apache.org/viewvc/commons/sandbox/gsoc/2010/scxml-js/trunk/test/test_with_xsltproc.sh?rev=1032233&r1=1032232&r2=1032233&view=diff
==============================================================================
--- commons/sandbox/gsoc/2010/scxml-js/trunk/test/test_with_xsltproc.sh
(original)
+++ commons/sandbox/gsoc/2010/scxml-js/trunk/test/test_with_xsltproc.sh Sun Nov
7 09:13:25 2010
@@ -1,6 +1,7 @@
#!/bin/sh
#cat prefix_events/TestPrefixEvents.xml | \
-cat simple2.xml | \
+#cat simple2.xml | \
+cat $1 | \
xsltproc ../src/xslt/ir-compiler/normalizeInitialStates.xsl - | \
xsltproc ../src/xslt/ir-compiler/generateUniqueStateIds.xsl - | \
xsltproc ../src/xslt/ir-compiler/generateUniqueInitialStateIds.xsl - | \
@@ -20,10 +21,11 @@ xsltproc ../src/xslt/ir-compiler/addEven
xsltproc ../src/xslt/ir-compiler/expandStarEvent.xsl - | \
#
xsltproc ../src/xslt/ir-compiler/numberStatesAndTransitions.xsl - | \
+#
xmlindent > tmp_IR.xml;
#uncomment to compile IR to js
-xsltproc ../build/StateTableStatechartGenerator_combined.xsl tmp_IR.xml >
out.js
+xsltproc ../target/StateTableStatechartGenerator_combined.xsl tmp_IR.xml >
out.js
#uncomment to prettify js. need to have beautify.js, beautify-cl.js and
beautify-html.js in this directory
#java -cp ../lib/java/js.jar org.mozilla.javascript.tools.shell.Main -debug
beautify-cl.js -i 4 out.js > out_pretty.js