Author: jbeard Date: Mon Jul 19 14:55:09 2010 New Revision: 965513 URL: http://svn.apache.org/viewvc?rev=965513&view=rev Log: Corrected issue where table and switch techniques were broken by recent additions relating to the data module.
Modified: commons/sandbox/gsoc/2010/scxml-js/branches/SCXML-141-148/build.js commons/sandbox/gsoc/2010/scxml-js/branches/SCXML-141-148/src/xslt/backends/js/AbstractEnumeratedStatechartGenerator.xsl commons/sandbox/gsoc/2010/scxml-js/branches/SCXML-141-148/src/xslt/backends/js/AbstractStatechartGenerator.xsl commons/sandbox/gsoc/2010/scxml-js/branches/SCXML-141-148/src/xslt/backends/js/StatePatternStatechartGenerator.xsl Modified: commons/sandbox/gsoc/2010/scxml-js/branches/SCXML-141-148/build.js URL: http://svn.apache.org/viewvc/commons/sandbox/gsoc/2010/scxml-js/branches/SCXML-141-148/build.js?rev=965513&r1=965512&r2=965513&view=diff ============================================================================== --- commons/sandbox/gsoc/2010/scxml-js/branches/SCXML-141-148/build.js (original) +++ commons/sandbox/gsoc/2010/scxml-js/branches/SCXML-141-148/build.js Mon Jul 19 14:55:09 2010 @@ -56,8 +56,8 @@ require.def("build", //enums //we keep backward links of these var backends = { - //"switch" : true, - //"table" : true, + "switch" : true, + "table" : true, "state" : true } @@ -73,14 +73,12 @@ require.def("build", //paths to all of the SCXML files we want to compile var scxmlTests = { -/* KitchenSink_dataModule :"test/kitchen_sink/KitchenSink_dataModule.xml", KitchenSink :"test/kitchen_sink/KitchenSink.xml", KitchenSink_performance :"test/kitchen_sink/KitchenSink_performance.xml", KitchenSink_executableContent :"test/kitchen_sink/KitchenSink_executableContent.xml", ConditionalTransition :"test/conditional_transition/TestConditionalTransition.xml", InPredicate :"test/in_predicate/TestInPredicate.xml", -*/ EventSystemProperties :"test/event_system_properties/TestEventSystemProperties.xml", } @@ -108,13 +106,11 @@ require.def("build", var unitTestScripts = [ -/* "test/kitchen_sink/scripts/unitTest_dataModel", "test/kitchen_sink/scripts/unitTest", "test/kitchen_sink/scripts/unitTest_executableContent", "test/conditional_transition/scripts/unitTest", "test/in_predicate/scripts/unitTest", -*/ "test/event_system_properties/scripts/unitTest" ] Modified: commons/sandbox/gsoc/2010/scxml-js/branches/SCXML-141-148/src/xslt/backends/js/AbstractEnumeratedStatechartGenerator.xsl URL: http://svn.apache.org/viewvc/commons/sandbox/gsoc/2010/scxml-js/branches/SCXML-141-148/src/xslt/backends/js/AbstractEnumeratedStatechartGenerator.xsl?rev=965513&r1=965512&r2=965513&view=diff ============================================================================== --- commons/sandbox/gsoc/2010/scxml-js/branches/SCXML-141-148/src/xslt/backends/js/AbstractEnumeratedStatechartGenerator.xsl (original) +++ commons/sandbox/gsoc/2010/scxml-js/branches/SCXML-141-148/src/xslt/backends/js/AbstractEnumeratedStatechartGenerator.xsl Mon Jul 19 14:55:09 2010 @@ -36,7 +36,7 @@ <variable name="genNonBasicTriggerDispatcherExitBlockIteratorExpression" select="'currentConfiguration.map(function(state){return STATE_INT_ID_TO_OBJECT_MAP[state]})'"/> - + <variable name="eventToNameMap" select="'TRIGGER_ID_TO_NAME_MAP[e]'"/> <template name="genContextHooks"> //enumeration of states int id's @@ -203,6 +203,12 @@ <value-of select="$s/@id"/> </template> + <template name="genExternalTriggerDispatcherRunToCompletionEventValue"> + <param name="eventName"/> + + <value-of select="$eventName"/> + </template> + <template name="genStateHooks"/> <template name="genEnumeratedHooks"/> <template name="genTriggerIntEnum"/> Modified: commons/sandbox/gsoc/2010/scxml-js/branches/SCXML-141-148/src/xslt/backends/js/AbstractStatechartGenerator.xsl URL: http://svn.apache.org/viewvc/commons/sandbox/gsoc/2010/scxml-js/branches/SCXML-141-148/src/xslt/backends/js/AbstractStatechartGenerator.xsl?rev=965513&r1=965512&r2=965513&view=diff ============================================================================== --- commons/sandbox/gsoc/2010/scxml-js/branches/SCXML-141-148/src/xslt/backends/js/AbstractStatechartGenerator.xsl (original) +++ commons/sandbox/gsoc/2010/scxml-js/branches/SCXML-141-148/src/xslt/backends/js/AbstractStatechartGenerator.xsl Mon Jul 19 14:55:09 2010 @@ -420,7 +420,11 @@ this.<value-of select="$event/c:name"/> = function(data){ if(isInStableState){ - runToCompletion("<value-of select="$event/c:name"/>",data); + runToCompletion( + <call-template name="genExternalTriggerDispatcherRunToCompletionEventValue"> + <with-param name="eventName" select="$event/c:name"/> + </call-template> + ,data); }else{ return undefined; } @@ -492,7 +496,7 @@ //we set the event as a global, rather than passing it into the function invocation as a parameter, //because in cases of default events, the event object will be populated with previous event's data if(e !== <value-of select="$defaultEventLiteral"/> ){ - _event.name=e; + _event.name=<value-of select="$eventToNameMap"/>; _event.data=data; } <value-of select="$dispatchInvocation"/> @@ -836,6 +840,7 @@ <template name="genNonParallelSubstateConfigurationSetString"/> <template name="genInitialization"/> <template name="genTriggerDispatcherContext"/> + <template name="genExternalTriggerDispatcherRunToCompletionEventValue"/> </stylesheet> Modified: commons/sandbox/gsoc/2010/scxml-js/branches/SCXML-141-148/src/xslt/backends/js/StatePatternStatechartGenerator.xsl URL: http://svn.apache.org/viewvc/commons/sandbox/gsoc/2010/scxml-js/branches/SCXML-141-148/src/xslt/backends/js/StatePatternStatechartGenerator.xsl?rev=965513&r1=965512&r2=965513&view=diff ============================================================================== --- commons/sandbox/gsoc/2010/scxml-js/branches/SCXML-141-148/src/xslt/backends/js/StatePatternStatechartGenerator.xsl (original) +++ commons/sandbox/gsoc/2010/scxml-js/branches/SCXML-141-148/src/xslt/backends/js/StatePatternStatechartGenerator.xsl Mon Jul 19 14:55:09 2010 @@ -32,6 +32,8 @@ <variable name="genHistoryTriggerDispatcherInnerForEachStateReference" select="'state'"/> <variable name="genNonBasicTriggerDispatcherExitBlockIteratorExpression" select="'currentConfiguration'"/> + <variable name="eventToNameMap" select="'e'"/> + <template name="genStateHooks"> <param name="state"/> @@ -138,6 +140,12 @@ <text>this</text> </template> + <template name="genExternalTriggerDispatcherRunToCompletionEventValue"> + <param name="eventName"/> + + "<value-of select="$eventName"/>" + </template> + <template match="s:send"> <choose> <when test="@delay">