Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJuergen Haug2019-10-09 13:27:01 +0000
committerHenrik Rentz-Reichert2019-10-11 12:21:18 +0000
commitdc6f84b6d54721849d419d098436f4deb27f9b3b (patch)
tree34b0d7d63db56c173256df57d17ab62ba3982469 /plugins/org.eclipse.etrice.core.genmodel.fsm
parent105760a8e143d474638d3d1b3ee443a9ed666fc8 (diff)
downloadorg.eclipse.etrice-dc6f84b6d54721849d419d098436f4deb27f9b3b.tar.gz
org.eclipse.etrice-dc6f84b6d54721849d419d098436f4deb27f9b3b.tar.xz
org.eclipse.etrice-dc6f84b6d54721849d419d098436f4deb27f9b3b.zip
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