Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenrik Rentz-Reichert2019-10-11 15:09:55 +0000
committerGerrit Code Review @ Eclipse.org2019-10-11 15:09:56 +0000
commitad0bc76a408854724e435312d0660d6ba6d9f7e1 (patch)
tree5b80458a1aa2488925db30f1239fbb69ad733601 /plugins/org.eclipse.etrice.core.genmodel.fsm
parent450084d29b75b624d81abf7b2bb3975fa9a77c79 (diff)
parentdc6f84b6d54721849d419d098436f4deb27f9b3b (diff)
downloadorg.eclipse.etrice-ad0bc76a408854724e435312d0660d6ba6d9f7e1.tar.gz
org.eclipse.etrice-ad0bc76a408854724e435312d0660d6ba6d9f7e1.tar.xz
org.eclipse.etrice-ad0bc76a408854724e435312d0660d6ba6d9f7e1.zip
Merge "Bug 551966 - [fsm] allow subgraphs without init transition"
Diffstat (limited to 'plugins/org.eclipse.etrice.core.genmodel.fsm')
-rw-r--r--plugins/org.eclipse.etrice.core.genmodel.fsm/src/org/eclipse/etrice/core/genmodel/fsm/ExtendedFsmGenBuilder.xtend14
1 files changed, 9 insertions, 5 deletions
diff --git a/plugins/org.eclipse.etrice.core.genmodel.fsm/src/org/eclipse/etrice/core/genmodel/fsm/ExtendedFsmGenBuilder.xtend b/plugins/org.eclipse.etrice.core.genmodel.fsm/src/org/eclipse/etrice/core/genmodel/fsm/ExtendedFsmGenBuilder.xtend
index a26ee681f..f0aca95f2 100644
--- a/plugins/org.eclipse.etrice.core.genmodel.fsm/src/org/eclipse/etrice/core/genmodel/fsm/ExtendedFsmGenBuilder.xtend
+++ b/plugins/org.eclipse.etrice.core.genmodel.fsm/src/org/eclipse/etrice/core/genmodel/fsm/ExtendedFsmGenBuilder.xtend
@@ -20,20 +20,20 @@ import org.eclipse.emf.ecore.EObject
import org.eclipse.emf.ecore.EStructuralFeature
import org.eclipse.etrice.core.fsm.fSM.FSMPackage
import org.eclipse.etrice.core.fsm.fSM.MessageFromIf
+import org.eclipse.etrice.core.fsm.fSM.ModelComponent
import org.eclipse.etrice.core.fsm.fSM.State
import org.eclipse.etrice.core.fsm.fSM.TransitionPoint
import org.eclipse.etrice.core.fsm.fSM.Trigger
import org.eclipse.etrice.core.fsm.fSM.TriggeredTransition
+import org.eclipse.etrice.core.fsm.util.FSMHelpers
import org.eclipse.etrice.core.genmodel.fsm.fsmgen.CommonTrigger
import org.eclipse.etrice.core.genmodel.fsm.fsmgen.FsmGenFactory
+import org.eclipse.etrice.core.genmodel.fsm.fsmgen.Graph
import org.eclipse.etrice.core.genmodel.fsm.fsmgen.GraphContainer
import org.eclipse.etrice.core.genmodel.fsm.fsmgen.Link
import org.eclipse.etrice.core.genmodel.fsm.fsmgen.Node
import static extension org.eclipse.etrice.core.genmodel.fsm.FsmGenExtensions.*
-import org.eclipse.etrice.core.fsm.util.FSMHelpers
-import org.eclipse.etrice.core.fsm.fSM.ModelComponent
-import org.eclipse.etrice.core.genmodel.fsm.fsmgen.Graph
class ExtendedFsmGenBuilder extends BasicFsmGenBuilder {
@@ -256,8 +256,12 @@ class ExtendedFsmGenBuilder extends BasicFsmGenBuilder {
// in the super state graph search for a transition which points to our parent state
val parentState = graph.eContainer as Node
val parentGraph = parentState.eContainer as Graph
- if (!parentGraph.links.filter[target==parentState].empty) {
- validationError("The state graph has transitions to history in its parent graph, thus it must have an initial transition", parentState.stateGraphNode, FSMPackage.Literals.STATE__SUBGRAPH);
+ val parentHasHistoryTransitions = parentGraph.links
+ .filter[target==parentState] // parent is target
+ .filter[source!=parentState] // parent is not source (self transition is fine)
+ .empty
+ if (!parentHasHistoryTransitions) {
+ validationError("The state graph has transitions to history in its parent graph (which are no self transitions), thus it must have an initial transition", parentState.stateGraphNode, FSMPackage.Literals.STATE__SUBGRAPH);
}
}

Back to the top