commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbe...@apache.org
Subject svn commit: r984038 - in /commons/sandbox/gsoc/2010/scxml-js/trunk/src/xslt/backends/js: AbstractEnumeratedStatechartGenerator.xsl AbstractStatechartGenerator.xsl StatePatternStatechartGenerator.xsl
Date Tue, 10 Aug 2010 14:20:41 GMT
Author: jbeard
Date: Tue Aug 10 14:20:40 2010
New Revision: 984038

URL: http://svn.apache.org/viewvc?rev=984038&view=rev
Log:
This fixes a bug for the following situation: a transition originates at a composite state
inside of a parallel region, and ends at a state (composite or basic) inside of that same
parallel region.

Modified:
    commons/sandbox/gsoc/2010/scxml-js/trunk/src/xslt/backends/js/AbstractEnumeratedStatechartGenerator.xsl
    commons/sandbox/gsoc/2010/scxml-js/trunk/src/xslt/backends/js/AbstractStatechartGenerator.xsl
    commons/sandbox/gsoc/2010/scxml-js/trunk/src/xslt/backends/js/StatePatternStatechartGenerator.xsl

Modified: commons/sandbox/gsoc/2010/scxml-js/trunk/src/xslt/backends/js/AbstractEnumeratedStatechartGenerator.xsl
URL: http://svn.apache.org/viewvc/commons/sandbox/gsoc/2010/scxml-js/trunk/src/xslt/backends/js/AbstractEnumeratedStatechartGenerator.xsl?rev=984038&r1=984037&r2=984038&view=diff
==============================================================================
--- commons/sandbox/gsoc/2010/scxml-js/trunk/src/xslt/backends/js/AbstractEnumeratedStatechartGenerator.xsl
(original)
+++ commons/sandbox/gsoc/2010/scxml-js/trunk/src/xslt/backends/js/AbstractEnumeratedStatechartGenerator.xsl
Tue Aug 10 14:20:40 2010
@@ -204,6 +204,21 @@
 		]; 
 	</template>
 
+	<template name="genParallelSubstateAndCompositeConfigurationSetString">
+		<param name="s"/>
+		<param name="t"/>
+
+		currentConfiguration.splice(currentConfiguration.indexOf(statesExited[0].id),1,
+			<for-each select="$t/c:targets/c:target/c:targetState">
+				<variable name="targetStateId" select="."/>
+				<value-of select="$allStates[@id = $targetStateId]/@c:enumId"/>
+
+				<if test="not(position() = last())"> , </if>
+			</for-each>);
+		
+	</template>
+
+
 	<template name="genParallelSubstateConfigurationSetString">
 		<param name="s"/>
 		<param name="t"/>

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=984038&r1=984037&r2=984038&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
Tue Aug 10 14:20:40 2010
@@ -810,12 +810,15 @@
 			hasTakenDefaultTransition = true;
 		</if>
 
+		<variable name="precomputeExit" 
+			select="local-name($s) = 'initial' or local-name($s) = 'history' or 
+					( $s/@c:isBasic and 
+						( not($s/@c:isParallelSubstate) or 
+							($s/@c:isParallelSubstate and not($t/@c:exitsParallelRegion))))"/>
+
 		//exit states
 		<choose>
-			<when test="local-name($s) = 'initial' or local-name($s) = 'history' or 
-						( $s/@c:isBasic and 
-							( not($s/@c:isParallelSubstate) or 
-								($s/@c:isParallelSubstate and not($t/@c:exitsParallelRegion))))">
+			<when test="$precomputeExit">
 				<for-each select="$t/c:exitpath/c:state">
 					<value-of select="."/>.exitAction();
 				</for-each>
@@ -839,7 +842,13 @@
 
 		//update configuration
 		<choose>
-			<when test="$s/@c:isParallelSubstate and not($t/@c:exitsParallelRegion)">
+			<when test="$s/@c:isParallelSubstate and not($t/@c:exitsParallelRegion) and not($s/@c:isBasic)">
+				<call-template name="genParallelSubstateAndCompositeConfigurationSetString">
+					<with-param name="s" select="$s"/>
+					<with-param name="t" select="$t"/>
+				</call-template>
+			</when>
+			<when test="$s/@c:isParallelSubstate and not($t/@c:exitsParallelRegion) and $s/@c:isBasic">
 				<call-template name="genParallelSubstateConfigurationSetString">
 					<with-param name="s" select="$s"/>
 					<with-param name="t" select="$t"/>

Modified: commons/sandbox/gsoc/2010/scxml-js/trunk/src/xslt/backends/js/StatePatternStatechartGenerator.xsl
URL: http://svn.apache.org/viewvc/commons/sandbox/gsoc/2010/scxml-js/trunk/src/xslt/backends/js/StatePatternStatechartGenerator.xsl?rev=984038&r1=984037&r2=984038&view=diff
==============================================================================
--- commons/sandbox/gsoc/2010/scxml-js/trunk/src/xslt/backends/js/StatePatternStatechartGenerator.xsl
(original)
+++ commons/sandbox/gsoc/2010/scxml-js/trunk/src/xslt/backends/js/StatePatternStatechartGenerator.xsl
Tue Aug 10 14:20:40 2010
@@ -97,6 +97,18 @@
 		
 	</template>
 
+	<template name="genParallelSubstateAndCompositeConfigurationSetString">
+		<param name="s"/>
+		<param name="t"/>
+
+		currentConfiguration.splice(currentConfiguration.indexOf(statesExited[0]),1,
+			<for-each select="$t/c:targets/c:target/c:targetState">
+				<value-of select="."/>
+				<if test="not(position() = last())">,</if>
+			</for-each> 
+		); 
+	</template>
+
 	<template name="genParallelSubstateConfigurationSetString">
 		<param name="s"/>
 		<param name="t"/>



Mime
View raw message