Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenrik Rentz-Reichert2017-01-30 13:45:07 -0500
committerHenrik Rentz-Reichert2017-02-06 12:15:13 -0500
commita36986ec4918dfbda538ff0a1eda596ad362df11 (patch)
tree7062042ffe2934652ed9b296d225f8911a668db0
parentcde1fd1da9779f46e87e5c3258c6a5f2de809553 (diff)
downloadorg.eclipse.etrice-a36986ec4918dfbda538ff0a1eda596ad362df11.tar.gz
org.eclipse.etrice-a36986ec4918dfbda538ff0a1eda596ad362df11.tar.xz
org.eclipse.etrice-a36986ec4918dfbda538ff0a1eda596ad362df11.zip
Bug 511330 - [core.genmodel.fsm] introduce simplified generator model for state machines
- first draft of model - model transformation - consistency checker - various test cases Change-Id: I57fbc3205b636a7dbe63070552d79c98b90b18d5
-rw-r--r--plugins/org.eclipse.etrice.core.fsm/src/org/eclipse/etrice/core/fsm/util/FSMHelpers.java32
-rw-r--r--plugins/org.eclipse.etrice.core.genmodel.fsm2/.classpath9
-rw-r--r--plugins/org.eclipse.etrice.core.genmodel.fsm2/.gitignore2
-rw-r--r--plugins/org.eclipse.etrice.core.genmodel.fsm2/.project34
-rw-r--r--plugins/org.eclipse.etrice.core.genmodel.fsm2/.settings/org.eclipse.jdt.core.prefs7
-rw-r--r--plugins/org.eclipse.etrice.core.genmodel.fsm2/META-INF/MANIFEST.MF18
-rw-r--r--plugins/org.eclipse.etrice.core.genmodel.fsm2/about.html28
-rw-r--r--plugins/org.eclipse.etrice.core.genmodel.fsm2/build.properties10
-rw-r--r--plugins/org.eclipse.etrice.core.genmodel.fsm2/model/fsmgen.ecore65
-rw-r--r--plugins/org.eclipse.etrice.core.genmodel.fsm2/model/fsmgen.genmodel44
-rw-r--r--plugins/org.eclipse.etrice.core.genmodel.fsm2/plugin.properties4
-rw-r--r--plugins/org.eclipse.etrice.core.genmodel.fsm2/plugin.xml17
-rw-r--r--plugins/org.eclipse.etrice.core.genmodel.fsm2/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/CommonTrigger.java126
-rw-r--r--plugins/org.eclipse.etrice.core.genmodel.fsm2/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/FsmGenFactory.java87
-rw-r--r--plugins/org.eclipse.etrice.core.genmodel.fsm2/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/FsmGenPackage.java1033
-rw-r--r--plugins/org.eclipse.etrice.core.genmodel.fsm2/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/Graph.java100
-rw-r--r--plugins/org.eclipse.etrice.core.genmodel.fsm2/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/GraphContainer.java79
-rw-r--r--plugins/org.eclipse.etrice.core.genmodel.fsm2/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/GraphItem.java51
-rw-r--r--plugins/org.eclipse.etrice.core.genmodel.fsm2/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/Link.java145
-rw-r--r--plugins/org.eclipse.etrice.core.genmodel.fsm2/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/Node.java171
-rw-r--r--plugins/org.eclipse.etrice.core.genmodel.fsm2/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/impl/CommonTriggerImpl.java329
-rw-r--r--plugins/org.eclipse.etrice.core.genmodel.fsm2/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/impl/FsmGenFactoryImpl.java150
-rw-r--r--plugins/org.eclipse.etrice.core.genmodel.fsm2/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/impl/FsmGenPackageImpl.java539
-rw-r--r--plugins/org.eclipse.etrice.core.genmodel.fsm2/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/impl/GraphContainerImpl.java238
-rw-r--r--plugins/org.eclipse.etrice.core.genmodel.fsm2/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/impl/GraphImpl.java301
-rw-r--r--plugins/org.eclipse.etrice.core.genmodel.fsm2/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/impl/GraphItemImpl.java163
-rw-r--r--plugins/org.eclipse.etrice.core.genmodel.fsm2/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/impl/LinkImpl.java471
-rw-r--r--plugins/org.eclipse.etrice.core.genmodel.fsm2/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/impl/NodeImpl.java487
-rw-r--r--plugins/org.eclipse.etrice.core.genmodel.fsm2/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/util/FsmGenAdapterFactory.java210
-rw-r--r--plugins/org.eclipse.etrice.core.genmodel.fsm2/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/util/FsmGenSwitch.java217
-rw-r--r--plugins/org.eclipse.etrice.core.genmodel.fsm2/src/org/eclipse/etrice/core/genmodel/fsm/FsmGenBuilder.xtend163
-rw-r--r--plugins/org.eclipse.etrice.core.genmodel.fsm2/src/org/eclipse/etrice/core/genmodel/fsm/FsmGenChecker.xtend119
-rw-r--r--plugins/org.eclipse.etrice.core.genmodel.fsm2/src/org/eclipse/etrice/core/genmodel/fsm/FsmGenExtensions.xtend71
-rw-r--r--plugins/org.eclipse.etrice.core.genmodel.fsm2/src/org/eclipse/etrice/core/genmodel/fsm/ILogger.java45
-rw-r--r--plugins/org.eclipse.etrice.core.genmodel.fsm2/src/org/eclipse/etrice/core/genmodel/fsm/NullLogger.java50
-rw-r--r--plugins/org.eclipse.etrice.core.genmodel.fsm2/xtend-gen/org/eclipse/etrice/core/genmodel/fsm/FsmGenBuilder.java349
-rw-r--r--plugins/org.eclipse.etrice.core.genmodel.fsm2/xtend-gen/org/eclipse/etrice/core/genmodel/fsm/FsmGenChecker.java211
-rw-r--r--plugins/org.eclipse.etrice.core.genmodel.fsm2/xtend-gen/org/eclipse/etrice/core/genmodel/fsm/FsmGenExtensions.java154
-rw-r--r--plugins/org.eclipse.etrice.core.genmodel/plugin.properties2
-rw-r--r--plugins/org.eclipse.etrice.ui.behavior.fsm/src/org/eclipse/etrice/ui/behavior/fsm/support/FSMSupportUtil.java7
-rw-r--r--tests/org.eclipse.etrice.core.fsm.tests/org.eclipse.etrice.core.fsm.tests.launch2
-rw-r--r--tests/org.eclipse.etrice.core.genmodel.fsm.tests/.classpath8
-rw-r--r--tests/org.eclipse.etrice.core.genmodel.fsm.tests/.gitignore2
-rw-r--r--tests/org.eclipse.etrice.core.genmodel.fsm.tests/.project34
-rw-r--r--tests/org.eclipse.etrice.core.genmodel.fsm.tests/.settings/org.eclipse.jdt.core.prefs7
-rw-r--r--tests/org.eclipse.etrice.core.genmodel.fsm.tests/META-INF/MANIFEST.MF15
-rw-r--r--tests/org.eclipse.etrice.core.genmodel.fsm.tests/build.properties4
-rw-r--r--tests/org.eclipse.etrice.core.genmodel.fsm.tests/models/FlatFSMExample.room52
-rw-r--r--tests/org.eclipse.etrice.core.genmodel.fsm.tests/models/FlatInheritedFSMExample.room73
-rw-r--r--tests/org.eclipse.etrice.core.genmodel.fsm.tests/models/HierFSMExample.room58
-rw-r--r--tests/org.eclipse.etrice.core.genmodel.fsm.tests/models/HierInheritedFSMExample.room105
-rw-r--r--tests/org.eclipse.etrice.core.genmodel.fsm.tests/org.eclipse.etrice.core.genmodel.fsm.tests.launch43
-rw-r--r--tests/org.eclipse.etrice.core.genmodel.fsm.tests/output/HierInheritedFSMExample.fsmgen294
-rw-r--r--tests/org.eclipse.etrice.core.genmodel.fsm.tests/src/org/eclipse/etrice/core/genmodel/fsm/tests/FSMGenModelTestsActivator.java37
-rw-r--r--tests/org.eclipse.etrice.core.genmodel.fsm.tests/src/org/eclipse/etrice/core/genmodel/fsm/tests/FsmGenTestBase.xtend46
-rw-r--r--tests/org.eclipse.etrice.core.genmodel.fsm.tests/src/org/eclipse/etrice/core/genmodel/fsm/tests/TestFlatFSM.xtend78
-rw-r--r--tests/org.eclipse.etrice.core.genmodel.fsm.tests/src/org/eclipse/etrice/core/genmodel/fsm/tests/TestFlatInheritedFSM.xtend70
-rw-r--r--tests/org.eclipse.etrice.core.genmodel.fsm.tests/src/org/eclipse/etrice/core/genmodel/fsm/tests/TestHierFSM.xtend82
-rw-r--r--tests/org.eclipse.etrice.core.genmodel.fsm.tests/src/org/eclipse/etrice/core/genmodel/fsm/tests/TestHierInheritedFSM.xtend69
-rw-r--r--tests/org.eclipse.etrice.core.genmodel.fsm.tests/xtend-gen/org/eclipse/etrice/core/genmodel/fsm/tests/.gitignore5
-rw-r--r--tests/org.eclipse.etrice.core.genmodel.fsm.tests/xtend-gen/org/eclipse/etrice/core/genmodel/fsm/tests/FsmGenTestBase.java80
-rw-r--r--tests/org.eclipse.etrice.core.genmodel.fsm.tests/xtend-gen/org/eclipse/etrice/core/genmodel/fsm/tests/TestFlatFSM.java160
-rw-r--r--tests/org.eclipse.etrice.core.genmodel.fsm.tests/xtend-gen/org/eclipse/etrice/core/genmodel/fsm/tests/TestFlatInheritedFSM.java124
-rw-r--r--tests/org.eclipse.etrice.core.genmodel.fsm.tests/xtend-gen/org/eclipse/etrice/core/genmodel/fsm/tests/TestHierFSM.java166
-rw-r--r--tests/org.eclipse.etrice.core.room.tests/META-INF/MANIFEST.MF1
-rw-r--r--tests/org.eclipse.etrice.core.room.tests/src/org/eclipse/etrice/core/TestAnnotations.java2
-rw-r--r--tests/org.eclipse.etrice.core.room.tests/src/org/eclipse/etrice/core/TestBase.java5
-rw-r--r--tests/org.eclipse.etrice.core.room.tests/src/org/eclipse/etrice/core/TestBindings.java2
-rw-r--r--tests/org.eclipse.etrice.core.room.tests/src/org/eclipse/etrice/core/TestBug505406.java2
-rw-r--r--tests/org.eclipse.etrice.core.room.tests/src/org/eclipse/etrice/core/TestCases.java2
-rw-r--r--tests/org.eclipse.etrice.core.room.tests/src/org/eclipse/etrice/core/TestDynamicActors.java2
-rw-r--r--tests/org.eclipse.etrice.core.room.tests/src/org/eclipse/etrice/core/TestEnumerations.java2
-rw-r--r--tests/org.eclipse.etrice.core.room.tests/src/org/eclipse/etrice/core/TestFragments.java2
-rw-r--r--tests/org.eclipse.etrice.core.room.tests/src/org/eclipse/etrice/core/TestNames.xtend16
-rw-r--r--tests/org.eclipse.etrice.core.room.tests/xtend-gen/org/eclipse/etrice/core/TestNames.java6
75 files changed, 7774 insertions, 20 deletions
diff --git a/plugins/org.eclipse.etrice.core.fsm/src/org/eclipse/etrice/core/fsm/util/FSMHelpers.java b/plugins/org.eclipse.etrice.core.fsm/src/org/eclipse/etrice/core/fsm/util/FSMHelpers.java
index 55f79201d..f4c7abedf 100644
--- a/plugins/org.eclipse.etrice.core.fsm/src/org/eclipse/etrice/core/fsm/util/FSMHelpers.java
+++ b/plugins/org.eclipse.etrice.core.fsm/src/org/eclipse/etrice/core/fsm/util/FSMHelpers.java
@@ -77,6 +77,38 @@ public class FSMHelpers extends BaseHelpers {
}
/**
+ * returns the actual state machine of this model class. I.e. the own state machine if it has
+ * one or otherwise the first state machine in the super class hierarchy
+ */
+ public StateGraph getActualStateMachine(ModelComponent mc) {
+ // we go up in the inheritance hierarchy until we find a model class with a state machine
+ while (mc!=null) {
+ if (mc.getStateMachine()!=null) {
+ return mc.getStateMachine();
+ }
+
+ mc = mc.getBase();
+ }
+
+ return null;
+ }
+
+ public StateGraph getSuperStateMachine(ModelComponent mc) {
+ StateGraph stateMachine = getActualStateMachine(mc);
+
+ // this component is not necessarily the one that was passed in
+ mc = getModelComponent(stateMachine);
+
+ // now return the actual state machine of the base class...
+ if (mc!=null && mc.getBase()!=null) {
+ return getActualStateMachine(mc.getBase());
+ }
+
+ // ...or null if no such one
+ return null;
+ }
+
+ /**
* Returns the parent {@link ModelComponent} of a {@link StateGraphItem}.
*
* @param item a {@link StateGraphItem}
diff --git a/plugins/org.eclipse.etrice.core.genmodel.fsm2/.classpath b/plugins/org.eclipse.etrice.core.genmodel.fsm2/.classpath
new file mode 100644
index 000000000..2e1084dde
--- /dev/null
+++ b/plugins/org.eclipse.etrice.core.genmodel.fsm2/.classpath
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src-gen"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="src" path="xtend-gen"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/plugins/org.eclipse.etrice.core.genmodel.fsm2/.gitignore b/plugins/org.eclipse.etrice.core.genmodel.fsm2/.gitignore
new file mode 100644
index 000000000..d567ba01e
--- /dev/null
+++ b/plugins/org.eclipse.etrice.core.genmodel.fsm2/.gitignore
@@ -0,0 +1,2 @@
+bin
+target
diff --git a/plugins/org.eclipse.etrice.core.genmodel.fsm2/.project b/plugins/org.eclipse.etrice.core.genmodel.fsm2/.project
new file mode 100644
index 000000000..7c4b2da7e
--- /dev/null
+++ b/plugins/org.eclipse.etrice.core.genmodel.fsm2/.project
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.etrice.core.genmodel.fsm2</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.xtext.ui.shared.xtextBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.eclipse.xtext.ui.shared.xtextNature</nature>
+ </natures>
+</projectDescription>
diff --git a/plugins/org.eclipse.etrice.core.genmodel.fsm2/.settings/org.eclipse.jdt.core.prefs b/plugins/org.eclipse.etrice.core.genmodel.fsm2/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 000000000..f42de363a
--- /dev/null
+++ b/plugins/org.eclipse.etrice.core.genmodel.fsm2/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,7 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
+org.eclipse.jdt.core.compiler.compliance=1.7
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.7
diff --git a/plugins/org.eclipse.etrice.core.genmodel.fsm2/META-INF/MANIFEST.MF b/plugins/org.eclipse.etrice.core.genmodel.fsm2/META-INF/MANIFEST.MF
new file mode 100644
index 000000000..6378ea07a
--- /dev/null
+++ b/plugins/org.eclipse.etrice.core.genmodel.fsm2/META-INF/MANIFEST.MF
@@ -0,0 +1,18 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %pluginName
+Bundle-SymbolicName: org.eclipse.etrice.core.genmodel.fsm2;singleton:=true
+Bundle-Version: 1.0.0.qualifier
+Bundle-ClassPath: .
+Bundle-RequiredExecutionEnvironment: JavaSE-1.7
+Export-Package: org.eclipse.etrice.core.genmodel.fsm,
+ org.eclipse.etrice.core.genmodel.fsm.fsmgen,
+ org.eclipse.etrice.core.genmodel.fsm.fsmgen.impl,
+ org.eclipse.etrice.core.genmodel.fsm.fsmgen.util
+Require-Bundle: org.eclipse.core.runtime,
+ org.eclipse.emf.ecore;visibility:=reexport,
+ org.eclipse.etrice.core.common;visibility:=reexport,
+ org.eclipse.etrice.core.fsm;visibility:=reexport
+Bundle-ActivationPolicy: lazy
+Bundle-Vendor: %providerName
+Bundle-Localization: plugin
diff --git a/plugins/org.eclipse.etrice.core.genmodel.fsm2/about.html b/plugins/org.eclipse.etrice.core.genmodel.fsm2/about.html
new file mode 100644
index 000000000..c258ef55d
--- /dev/null
+++ b/plugins/org.eclipse.etrice.core.genmodel.fsm2/about.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
+<title>About</title>
+</head>
+<body lang="EN-US">
+<h2>About This Content</h2>
+
+<p>June 5, 2006</p>
+<h3>License</h3>
+
+<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise
+indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available
+at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
+
+<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
+being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
+apply to your use of any object code in the Content. Check the Redistributor's license that was
+provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
+indicated below, the terms and conditions of the EPL still apply to any source code in the Content
+and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
+
+</body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.etrice.core.genmodel.fsm2/build.properties b/plugins/org.eclipse.etrice.core.genmodel.fsm2/build.properties
new file mode 100644
index 000000000..697ca9645
--- /dev/null
+++ b/plugins/org.eclipse.etrice.core.genmodel.fsm2/build.properties
@@ -0,0 +1,10 @@
+#
+
+bin.includes = .,\
+ model/,\
+ META-INF/,\
+ plugin.xml,\
+ plugin.properties
+jars.compile.order = .
+source.. = src-gen/
+output.. = bin/
diff --git a/plugins/org.eclipse.etrice.core.genmodel.fsm2/model/fsmgen.ecore b/plugins/org.eclipse.etrice.core.genmodel.fsm2/model/fsmgen.ecore
new file mode 100644
index 000000000..189242078
--- /dev/null
+++ b/plugins/org.eclipse.etrice.core.genmodel.fsm2/model/fsmgen.ecore
@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ecore:EPackage xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="fsmgen" nsURI="http://www.eclipse.org/etrice/generator/fsm2"
+ nsPrefix="fsmgen">
+ <eClassifiers xsi:type="ecore:EClass" name="GraphContainer">
+ <eStructuralFeatures xsi:type="ecore:EReference" name="graph" eType="#//Graph"
+ containment="true"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="component" eType="ecore:EClass ../../org.eclipse.etrice.core.fsm/model/generated/FSM.ecore#//ModelComponent"/>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="Graph">
+ <eOperations name="toString" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="body" value="StringBuilder result = new StringBuilder();&#xD;&#xA;result.append(&quot;StateGraph {\n&quot;);&#xD;&#xA;for (Node n : getNodes()) {&#xD;&#xA;&#x9;result.append(&quot; &quot; + n.toString() + &quot;\n&quot;);&#xD;&#xA;}&#xD;&#xA;for (Link l : getLinks()) {&#xD;&#xA;&#x9;result.append(&quot; &quot; + l.toString() + &quot;\n&quot;);&#xD;&#xA;}&#xD;&#xA;result.append(&quot;}&quot;);&#xD;&#xA;return result.toString();"/>
+ </eAnnotations>
+ </eOperations>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="nodes" upperBound="-1"
+ eType="#//Node" containment="true" eOpposite="#//Node/graph"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="links" upperBound="-1"
+ eType="#//Link" containment="true" eOpposite="#//Link/graph"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="stateGraph" eType="ecore:EClass ../../org.eclipse.etrice.core.fsm/model/generated/FSM.ecore#//StateGraph"/>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="GraphItem">
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="inherited" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"
+ defaultValueLiteral="false"/>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="Node" eSuperTypes="#//GraphItem">
+ <eOperations name="toString" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="body" value="String type = &quot;?&quot;;&#xD;&#xA;if (getStateGraphNode() instanceof &lt;%org.eclipse.etrice.core.fsm.fSM.RefinedState%>) {&#xD;&#xA;&#x9;type = &quot;RefinedState&quot;;&#xD;&#xA;}&#xD;&#xA;else if (getStateGraphNode() instanceof &lt;%org.eclipse.etrice.core.fsm.fSM.SimpleState%>) {&#xD;&#xA;&#x9;type = &quot;SimpleState&quot;;&#xD;&#xA;}&#xD;&#xA;else if (getStateGraphNode() instanceof &lt;%org.eclipse.etrice.core.fsm.fSM.TrPoint%>) {&#xD;&#xA;&#x9;type = &quot;TrPoint&quot;;&#xD;&#xA;}&#xD;&#xA;else if (getStateGraphNode() instanceof &lt;%org.eclipse.etrice.core.fsm.fSM.ChoicePoint%>) {&#xD;&#xA;&#x9;type = &quot;ChoicePoint&quot;;&#xD;&#xA;}&#xD;&#xA;return &quot;Node &quot; + getStateGraphNode().getName() + &quot; (&quot; + type + &quot;)&quot;;"/>
+ </eAnnotations>
+ </eOperations>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="graph" eType="#//Graph"
+ eOpposite="#//Graph/nodes"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="subgraph" eType="#//Graph"
+ containment="true"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="outgoing" upperBound="-1"
+ eType="#//Link" eOpposite="#//Link/source"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="incoming" upperBound="-1"
+ eType="#//Link" eOpposite="#//Link/target"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="stateGraphNode" eType="ecore:EClass ../../org.eclipse.etrice.core.fsm/model/generated/FSM.ecore#//StateGraphNode"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="caughtTriggers" upperBound="-1"
+ eType="#//CommonTrigger" containment="true"/>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="Link" eSuperTypes="#//GraphItem">
+ <eOperations name="toString" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="body" value="if (getTransition() instanceof &lt;%org.eclipse.etrice.core.fsm.fSM.InitialTransition%>) {&#xD;&#xA;&#x9;return &quot;Link initial -> &quot; + getTarget().toString() + &quot; (InitialTransition)&quot;;&#xD;&#xA;}&#xD;&#xA;else if (getTransition() instanceof &lt;%org.eclipse.etrice.core.fsm.fSM.NonInitialTransition%>) {&#xD;&#xA;&#x9;return &quot;Link &quot; + getSource().toString() + &quot; -> &quot; + getTarget().toString() + &quot; (InitialTransition)&quot;;&#xD;&#xA;}&#xD;&#xA;else if (getTransition() instanceof &lt;%org.eclipse.etrice.core.fsm.fSM.RefinedTransition%>) {&#xD;&#xA;&#x9;return &quot;RefinedTransition&quot;;&#xD;&#xA;}&#xD;&#xA;return &quot;?&quot;;"/>
+ </eAnnotations>
+ </eOperations>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="graph" eType="#//Graph"
+ eOpposite="#//Graph/links"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="source" eType="#//Node"
+ eOpposite="#//Node/outgoing"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="target" eType="#//Node"
+ eOpposite="#//Node/incoming"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="transition" eType="ecore:EClass ../../org.eclipse.etrice.core.fsm/model/generated/FSM.ecore#//TransitionBase"/>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="CommonTrigger">
+ <eStructuralFeatures xsi:type="ecore:EReference" name="msg" eType="ecore:EClass http://www.eclipse.org/emf/2002/Ecore#//EObject"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="ifitem" eType="ecore:EClass ../../org.eclipse.etrice.core.fsm/model/generated/FSM.ecore#//AbstractInterfaceItem"/>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="trigger" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="transitions" upperBound="-1"
+ eType="ecore:EClass ../../org.eclipse.etrice.core.fsm/model/generated/FSM.ecore#//TriggeredTransition"/>
+ </eClassifiers>
+</ecore:EPackage>
diff --git a/plugins/org.eclipse.etrice.core.genmodel.fsm2/model/fsmgen.genmodel b/plugins/org.eclipse.etrice.core.genmodel.fsm2/model/fsmgen.genmodel
new file mode 100644
index 000000000..5db5718c9
--- /dev/null
+++ b/plugins/org.eclipse.etrice.core.genmodel.fsm2/model/fsmgen.genmodel
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<genmodel:GenModel xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
+ xmlns:genmodel="http://www.eclipse.org/emf/2002/GenModel" modelDirectory="/org.eclipse.etrice.core.genmodel.fsm2/src-gen"
+ modelPluginID="org.eclipse.etrice.core.genmodel.fsm2" modelName="Fsmgen" rootExtendsClass="org.eclipse.emf.ecore.impl.MinimalEObjectImpl$Container"
+ importerID="org.eclipse.emf.importer.ecore" complianceLevel="7.0" copyrightFields="false"
+ usedGenPackages="../../org.eclipse.etrice.core.common/src-gen/org/eclipse/etrice/core/common/Base.genmodel#//base ../../org.eclipse.etrice.core.fsm/model/generated/FSM.genmodel#//fSM"
+ operationReflection="true" importOrganizing="true">
+ <foreignModel>fsmgen.ecore</foreignModel>
+ <genPackages prefix="FsmGen" basePackage="org.eclipse.etrice.core.genmodel.fsm"
+ disposableProviderFactory="true" fileExtensions="fsmgen2" ecorePackage="fsmgen.ecore#/">
+ <genClasses ecoreClass="fsmgen.ecore#//GraphContainer">
+ <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference fsmgen.ecore#//GraphContainer/graph"/>
+ <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference fsmgen.ecore#//GraphContainer/component"/>
+ </genClasses>
+ <genClasses ecoreClass="fsmgen.ecore#//Graph">
+ <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference fsmgen.ecore#//Graph/nodes"/>
+ <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference fsmgen.ecore#//Graph/links"/>
+ <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference fsmgen.ecore#//Graph/stateGraph"/>
+ </genClasses>
+ <genClasses ecoreClass="fsmgen.ecore#//GraphItem">
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute fsmgen.ecore#//GraphItem/inherited"/>
+ </genClasses>
+ <genClasses ecoreClass="fsmgen.ecore#//Node">
+ <genFeatures property="None" notify="false" createChild="false" ecoreFeature="ecore:EReference fsmgen.ecore#//Node/graph"/>
+ <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference fsmgen.ecore#//Node/subgraph"/>
+ <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference fsmgen.ecore#//Node/outgoing"/>
+ <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference fsmgen.ecore#//Node/incoming"/>
+ <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference fsmgen.ecore#//Node/stateGraphNode"/>
+ <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference fsmgen.ecore#//Node/caughtTriggers"/>
+ </genClasses>
+ <genClasses ecoreClass="fsmgen.ecore#//Link">
+ <genFeatures property="None" notify="false" createChild="false" ecoreFeature="ecore:EReference fsmgen.ecore#//Link/graph"/>
+ <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference fsmgen.ecore#//Link/source"/>
+ <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference fsmgen.ecore#//Link/target"/>
+ <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference fsmgen.ecore#//Link/transition"/>
+ </genClasses>
+ <genClasses ecoreClass="fsmgen.ecore#//CommonTrigger">
+ <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference fsmgen.ecore#//CommonTrigger/msg"/>
+ <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference fsmgen.ecore#//CommonTrigger/ifitem"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute fsmgen.ecore#//CommonTrigger/trigger"/>
+ <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference fsmgen.ecore#//CommonTrigger/transitions"/>
+ </genClasses>
+ </genPackages>
+</genmodel:GenModel>
diff --git a/plugins/org.eclipse.etrice.core.genmodel.fsm2/plugin.properties b/plugins/org.eclipse.etrice.core.genmodel.fsm2/plugin.properties
new file mode 100644
index 000000000..5f7d8ec87
--- /dev/null
+++ b/plugins/org.eclipse.etrice.core.genmodel.fsm2/plugin.properties
@@ -0,0 +1,4 @@
+#
+
+pluginName = Fine State Machine Generator Model
+providerName = Eclipse eTrice
diff --git a/plugins/org.eclipse.etrice.core.genmodel.fsm2/plugin.xml b/plugins/org.eclipse.etrice.core.genmodel.fsm2/plugin.xml
new file mode 100644
index 000000000..727a0557a
--- /dev/null
+++ b/plugins/org.eclipse.etrice.core.genmodel.fsm2/plugin.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.0"?>
+
+<!--
+-->
+
+<plugin>
+
+ <extension point="org.eclipse.emf.ecore.generated_package">
+ <!-- @generated fsmgen -->
+ <package
+ uri="http://www.eclipse.org/etrice/generator/fsm2"
+ class="org.eclipse.etrice.core.genmodel.fsm.fsmgen.FsmGenPackage"
+ genModel="model/fsmgen.genmodel"/>
+ </extension>
+
+</plugin>
diff --git a/plugins/org.eclipse.etrice.core.genmodel.fsm2/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/CommonTrigger.java b/plugins/org.eclipse.etrice.core.genmodel.fsm2/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/CommonTrigger.java
new file mode 100644
index 000000000..96f972400
--- /dev/null
+++ b/plugins/org.eclipse.etrice.core.genmodel.fsm2/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/CommonTrigger.java
@@ -0,0 +1,126 @@
+/**
+ */
+package org.eclipse.etrice.core.genmodel.fsm.fsmgen;
+
+import org.eclipse.emf.common.util.EList;
+
+import org.eclipse.emf.ecore.EObject;
+
+import org.eclipse.etrice.core.fsm.fSM.AbstractInterfaceItem;
+import org.eclipse.etrice.core.fsm.fSM.TriggeredTransition;
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>Common Trigger</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * </p>
+ * <ul>
+ * <li>{@link org.eclipse.etrice.core.genmodel.fsm.fsmgen.CommonTrigger#getMsg <em>Msg</em>}</li>
+ * <li>{@link org.eclipse.etrice.core.genmodel.fsm.fsmgen.CommonTrigger#getIfitem <em>Ifitem</em>}</li>
+ * <li>{@link org.eclipse.etrice.core.genmodel.fsm.fsmgen.CommonTrigger#getTrigger <em>Trigger</em>}</li>
+ * <li>{@link org.eclipse.etrice.core.genmodel.fsm.fsmgen.CommonTrigger#getTransitions <em>Transitions</em>}</li>
+ * </ul>
+ *
+ * @see org.eclipse.etrice.core.genmodel.fsm.fsmgen.FsmGenPackage#getCommonTrigger()
+ * @model
+ * @generated
+ */
+public interface CommonTrigger extends EObject {
+ /**
+ * Returns the value of the '<em><b>Msg</b></em>' reference.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Msg</em>' reference isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Msg</em>' reference.
+ * @see #setMsg(EObject)
+ * @see org.eclipse.etrice.core.genmodel.fsm.fsmgen.FsmGenPackage#getCommonTrigger_Msg()
+ * @model
+ * @generated
+ */
+ EObject getMsg();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.etrice.core.genmodel.fsm.fsmgen.CommonTrigger#getMsg <em>Msg</em>}' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Msg</em>' reference.
+ * @see #getMsg()
+ * @generated
+ */
+ void setMsg(EObject value);
+
+ /**
+ * Returns the value of the '<em><b>Ifitem</b></em>' reference.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Ifitem</em>' reference isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Ifitem</em>' reference.
+ * @see #setIfitem(AbstractInterfaceItem)
+ * @see org.eclipse.etrice.core.genmodel.fsm.fsmgen.FsmGenPackage#getCommonTrigger_Ifitem()
+ * @model
+ * @generated
+ */
+ AbstractInterfaceItem getIfitem();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.etrice.core.genmodel.fsm.fsmgen.CommonTrigger#getIfitem <em>Ifitem</em>}' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Ifitem</em>' reference.
+ * @see #getIfitem()
+ * @generated
+ */
+ void setIfitem(AbstractInterfaceItem value);
+
+ /**
+ * Returns the value of the '<em><b>Trigger</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Trigger</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Trigger</em>' attribute.
+ * @see #setTrigger(String)
+ * @see org.eclipse.etrice.core.genmodel.fsm.fsmgen.FsmGenPackage#getCommonTrigger_Trigger()
+ * @model
+ * @generated
+ */
+ String getTrigger();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.etrice.core.genmodel.fsm.fsmgen.CommonTrigger#getTrigger <em>Trigger</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Trigger</em>' attribute.
+ * @see #getTrigger()
+ * @generated
+ */
+ void setTrigger(String value);
+
+ /**
+ * Returns the value of the '<em><b>Transitions</b></em>' reference list.
+ * The list contents are of type {@link org.eclipse.etrice.core.fsm.fSM.TriggeredTransition}.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Transitions</em>' reference list isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Transitions</em>' reference list.
+ * @see org.eclipse.etrice.core.genmodel.fsm.fsmgen.FsmGenPackage#getCommonTrigger_Transitions()
+ * @model
+ * @generated
+ */
+ EList<TriggeredTransition> getTransitions();
+
+} // CommonTrigger
diff --git a/plugins/org.eclipse.etrice.core.genmodel.fsm2/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/FsmGenFactory.java b/plugins/org.eclipse.etrice.core.genmodel.fsm2/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/FsmGenFactory.java
new file mode 100644
index 000000000..f210ab049
--- /dev/null
+++ b/plugins/org.eclipse.etrice.core.genmodel.fsm2/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/FsmGenFactory.java
@@ -0,0 +1,87 @@
+/**
+ */
+package org.eclipse.etrice.core.genmodel.fsm.fsmgen;
+
+import org.eclipse.emf.ecore.EFactory;
+
+/**
+ * <!-- begin-user-doc -->
+ * The <b>Factory</b> for the model.
+ * It provides a create method for each non-abstract class of the model.
+ * <!-- end-user-doc -->
+ * @see org.eclipse.etrice.core.genmodel.fsm.fsmgen.FsmGenPackage
+ * @generated
+ */
+public interface FsmGenFactory extends EFactory {
+ /**
+ * The singleton instance of the factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ FsmGenFactory eINSTANCE = org.eclipse.etrice.core.genmodel.fsm.fsmgen.impl.FsmGenFactoryImpl.init();
+
+ /**
+ * Returns a new object of class '<em>Graph Container</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return a new object of class '<em>Graph Container</em>'.
+ * @generated
+ */
+ GraphContainer createGraphContainer();
+
+ /**
+ * Returns a new object of class '<em>Graph</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return a new object of class '<em>Graph</em>'.
+ * @generated
+ */
+ Graph createGraph();
+
+ /**
+ * Returns a new object of class '<em>Graph Item</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return a new object of class '<em>Graph Item</em>'.
+ * @generated
+ */
+ GraphItem createGraphItem();
+
+ /**
+ * Returns a new object of class '<em>Node</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return a new object of class '<em>Node</em>'.
+ * @generated
+ */
+ Node createNode();
+
+ /**
+ * Returns a new object of class '<em>Link</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return a new object of class '<em>Link</em>'.
+ * @generated
+ */
+ Link createLink();
+
+ /**
+ * Returns a new object of class '<em>Common Trigger</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return a new object of class '<em>Common Trigger</em>'.
+ * @generated
+ */
+ CommonTrigger createCommonTrigger();
+
+ /**
+ * Returns the package supported by this factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the package supported by this factory.
+ * @generated
+ */
+ FsmGenPackage getFsmGenPackage();
+
+} //FsmGenFactory
diff --git a/plugins/org.eclipse.etrice.core.genmodel.fsm2/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/FsmGenPackage.java b/plugins/org.eclipse.etrice.core.genmodel.fsm2/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/FsmGenPackage.java
new file mode 100644
index 000000000..1f0af0438
--- /dev/null
+++ b/plugins/org.eclipse.etrice.core.genmodel.fsm2/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/FsmGenPackage.java
@@ -0,0 +1,1033 @@
+/**
+ */
+package org.eclipse.etrice.core.genmodel.fsm.fsmgen;
+
+import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EOperation;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.EReference;
+
+/**
+ * <!-- begin-user-doc -->
+ * The <b>Package</b> for the model.
+ * It contains accessors for the meta objects to represent
+ * <ul>
+ * <li>each class,</li>
+ * <li>each feature of each class,</li>
+ * <li>each operation of each class,</li>
+ * <li>each enum,</li>
+ * <li>and each data type</li>
+ * </ul>
+ * <!-- end-user-doc -->
+ * @see org.eclipse.etrice.core.genmodel.fsm.fsmgen.FsmGenFactory
+ * @model kind="package"
+ * @generated
+ */
+public interface FsmGenPackage extends EPackage {
+ /**
+ * The package name.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ String eNAME = "fsmgen";
+
+ /**
+ * The package namespace URI.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ String eNS_URI = "http://www.eclipse.org/etrice/generator/fsm2";
+
+ /**
+ * The package namespace name.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ String eNS_PREFIX = "fsmgen";
+
+ /**
+ * The singleton instance of the package.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ FsmGenPackage eINSTANCE = org.eclipse.etrice.core.genmodel.fsm.fsmgen.impl.FsmGenPackageImpl.init();
+
+ /**
+ * The meta object id for the '{@link org.eclipse.etrice.core.genmodel.fsm.fsmgen.impl.GraphContainerImpl <em>Graph Container</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.etrice.core.genmodel.fsm.fsmgen.impl.GraphContainerImpl
+ * @see org.eclipse.etrice.core.genmodel.fsm.fsmgen.impl.FsmGenPackageImpl#getGraphContainer()
+ * @generated
+ */
+ int GRAPH_CONTAINER = 0;
+
+ /**
+ * The feature id for the '<em><b>Graph</b></em>' containment reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int GRAPH_CONTAINER__GRAPH = 0;
+
+ /**
+ * The feature id for the '<em><b>Component</b></em>' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int GRAPH_CONTAINER__COMPONENT = 1;
+
+ /**
+ * The number of structural features of the '<em>Graph Container</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int GRAPH_CONTAINER_FEATURE_COUNT = 2;
+
+ /**
+ * The number of operations of the '<em>Graph Container</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int GRAPH_CONTAINER_OPERATION_COUNT = 0;
+
+ /**
+ * The meta object id for the '{@link org.eclipse.etrice.core.genmodel.fsm.fsmgen.impl.GraphImpl <em>Graph</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.etrice.core.genmodel.fsm.fsmgen.impl.GraphImpl
+ * @see org.eclipse.etrice.core.genmodel.fsm.fsmgen.impl.FsmGenPackageImpl#getGraph()
+ * @generated
+ */
+ int GRAPH = 1;
+
+ /**
+ * The feature id for the '<em><b>Nodes</b></em>' containment reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int GRAPH__NODES = 0;
+
+ /**
+ * The feature id for the '<em><b>Links</b></em>' containment reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int GRAPH__LINKS = 1;
+
+ /**
+ * The feature id for the '<em><b>State Graph</b></em>' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int GRAPH__STATE_GRAPH = 2;
+
+ /**
+ * The number of structural features of the '<em>Graph</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int GRAPH_FEATURE_COUNT = 3;
+
+ /**
+ * The operation id for the '<em>To String</em>' operation.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int GRAPH___TO_STRING = 0;
+
+ /**
+ * The number of operations of the '<em>Graph</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int GRAPH_OPERATION_COUNT = 1;
+
+ /**
+ * The meta object id for the '{@link org.eclipse.etrice.core.genmodel.fsm.fsmgen.impl.GraphItemImpl <em>Graph Item</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.etrice.core.genmodel.fsm.fsmgen.impl.GraphItemImpl
+ * @see org.eclipse.etrice.core.genmodel.fsm.fsmgen.impl.FsmGenPackageImpl#getGraphItem()
+ * @generated
+ */
+ int GRAPH_ITEM = 2;
+
+ /**
+ * The feature id for the '<em><b>Inherited</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int GRAPH_ITEM__INHERITED = 0;
+
+ /**
+ * The number of structural features of the '<em>Graph Item</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int GRAPH_ITEM_FEATURE_COUNT = 1;
+
+ /**
+ * The number of operations of the '<em>Graph Item</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int GRAPH_ITEM_OPERATION_COUNT = 0;
+
+ /**
+ * The meta object id for the '{@link org.eclipse.etrice.core.genmodel.fsm.fsmgen.impl.NodeImpl <em>Node</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.etrice.core.genmodel.fsm.fsmgen.impl.NodeImpl
+ * @see org.eclipse.etrice.core.genmodel.fsm.fsmgen.impl.FsmGenPackageImpl#getNode()
+ * @generated
+ */
+ int NODE = 3;
+
+ /**
+ * The feature id for the '<em><b>Inherited</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int NODE__INHERITED = GRAPH_ITEM__INHERITED;
+
+ /**
+ * The feature id for the '<em><b>Graph</b></em>' container reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int NODE__GRAPH = GRAPH_ITEM_FEATURE_COUNT + 0;
+
+ /**
+ * The feature id for the '<em><b>Subgraph</b></em>' containment reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int NODE__SUBGRAPH = GRAPH_ITEM_FEATURE_COUNT + 1;
+
+ /**
+ * The feature id for the '<em><b>Outgoing</b></em>' reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int NODE__OUTGOING = GRAPH_ITEM_FEATURE_COUNT + 2;
+
+ /**
+ * The feature id for the '<em><b>Incoming</b></em>' reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int NODE__INCOMING = GRAPH_ITEM_FEATURE_COUNT + 3;
+
+ /**
+ * The feature id for the '<em><b>State Graph Node</b></em>' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int NODE__STATE_GRAPH_NODE = GRAPH_ITEM_FEATURE_COUNT + 4;
+
+ /**
+ * The feature id for the '<em><b>Caught Triggers</b></em>' containment reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int NODE__CAUGHT_TRIGGERS = GRAPH_ITEM_FEATURE_COUNT + 5;
+
+ /**
+ * The number of structural features of the '<em>Node</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int NODE_FEATURE_COUNT = GRAPH_ITEM_FEATURE_COUNT + 6;
+
+ /**
+ * The operation id for the '<em>To String</em>' operation.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int NODE___TO_STRING = GRAPH_ITEM_OPERATION_COUNT + 0;
+
+ /**
+ * The number of operations of the '<em>Node</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int NODE_OPERATION_COUNT = GRAPH_ITEM_OPERATION_COUNT + 1;
+
+ /**
+ * The meta object id for the '{@link org.eclipse.etrice.core.genmodel.fsm.fsmgen.impl.LinkImpl <em>Link</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.etrice.core.genmodel.fsm.fsmgen.impl.LinkImpl
+ * @see org.eclipse.etrice.core.genmodel.fsm.fsmgen.impl.FsmGenPackageImpl#getLink()
+ * @generated
+ */
+ int LINK = 4;
+
+ /**
+ * The feature id for the '<em><b>Inherited</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int LINK__INHERITED = GRAPH_ITEM__INHERITED;
+
+ /**
+ * The feature id for the '<em><b>Graph</b></em>' container reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int LINK__GRAPH = GRAPH_ITEM_FEATURE_COUNT + 0;
+
+ /**
+ * The feature id for the '<em><b>Source</b></em>' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int LINK__SOURCE = GRAPH_ITEM_FEATURE_COUNT + 1;
+
+ /**
+ * The feature id for the '<em><b>Target</b></em>' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int LINK__TARGET = GRAPH_ITEM_FEATURE_COUNT + 2;
+
+ /**
+ * The feature id for the '<em><b>Transition</b></em>' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int LINK__TRANSITION = GRAPH_ITEM_FEATURE_COUNT + 3;
+
+ /**
+ * The number of structural features of the '<em>Link</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int LINK_FEATURE_COUNT = GRAPH_ITEM_FEATURE_COUNT + 4;
+
+ /**
+ * The operation id for the '<em>To String</em>' operation.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int LINK___TO_STRING = GRAPH_ITEM_OPERATION_COUNT + 0;
+
+ /**
+ * The number of operations of the '<em>Link</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int LINK_OPERATION_COUNT = GRAPH_ITEM_OPERATION_COUNT + 1;
+
+ /**
+ * The meta object id for the '{@link org.eclipse.etrice.core.genmodel.fsm.fsmgen.impl.CommonTriggerImpl <em>Common Trigger</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.etrice.core.genmodel.fsm.fsmgen.impl.CommonTriggerImpl
+ * @see org.eclipse.etrice.core.genmodel.fsm.fsmgen.impl.FsmGenPackageImpl#getCommonTrigger()
+ * @generated
+ */
+ int COMMON_TRIGGER = 5;
+
+ /**
+ * The feature id for the '<em><b>Msg</b></em>' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int COMMON_TRIGGER__MSG = 0;
+
+ /**
+ * The feature id for the '<em><b>Ifitem</b></em>' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int COMMON_TRIGGER__IFITEM = 1;
+
+ /**
+ * The feature id for the '<em><b>Trigger</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int COMMON_TRIGGER__TRIGGER = 2;
+
+ /**
+ * The feature id for the '<em><b>Transitions</b></em>' reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int COMMON_TRIGGER__TRANSITIONS = 3;
+
+ /**
+ * The number of structural features of the '<em>Common Trigger</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int COMMON_TRIGGER_FEATURE_COUNT = 4;
+
+ /**
+ * The number of operations of the '<em>Common Trigger</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int COMMON_TRIGGER_OPERATION_COUNT = 0;
+
+
+ /**
+ * Returns the meta object for class '{@link org.eclipse.etrice.core.genmodel.fsm.fsmgen.GraphContainer <em>Graph Container</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for class '<em>Graph Container</em>'.
+ * @see org.eclipse.etrice.core.genmodel.fsm.fsmgen.GraphContainer
+ * @generated
+ */
+ EClass getGraphContainer();
+
+ /**
+ * Returns the meta object for the containment reference '{@link org.eclipse.etrice.core.genmodel.fsm.fsmgen.GraphContainer#getGraph <em>Graph</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the containment reference '<em>Graph</em>'.
+ * @see org.eclipse.etrice.core.genmodel.fsm.fsmgen.GraphContainer#getGraph()
+ * @see #getGraphContainer()
+ * @generated
+ */
+ EReference getGraphContainer_Graph();
+
+ /**
+ * Returns the meta object for the reference '{@link org.eclipse.etrice.core.genmodel.fsm.fsmgen.GraphContainer#getComponent <em>Component</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the reference '<em>Component</em>'.
+ * @see org.eclipse.etrice.core.genmodel.fsm.fsmgen.GraphContainer#getComponent()
+ * @see #getGraphContainer()
+ * @generated
+ */
+ EReference getGraphContainer_Component();
+
+ /**
+ * Returns the meta object for class '{@link org.eclipse.etrice.core.genmodel.fsm.fsmgen.Graph <em>Graph</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for class '<em>Graph</em>'.
+ * @see org.eclipse.etrice.core.genmodel.fsm.fsmgen.Graph
+ * @generated
+ */
+ EClass getGraph();
+
+ /**
+ * Returns the meta object for the containment reference list '{@link org.eclipse.etrice.core.genmodel.fsm.fsmgen.Graph#getNodes <em>Nodes</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the containment reference list '<em>Nodes</em>'.
+ * @see org.eclipse.etrice.core.genmodel.fsm.fsmgen.Graph#getNodes()
+ * @see #getGraph()
+ * @generated
+ */
+ EReference getGraph_Nodes();
+
+ /**
+ * Returns the meta object for the containment reference list '{@link org.eclipse.etrice.core.genmodel.fsm.fsmgen.Graph#getLinks <em>Links</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the containment reference list '<em>Links</em>'.
+ * @see org.eclipse.etrice.core.genmodel.fsm.fsmgen.Graph#getLinks()
+ * @see #getGraph()
+ * @generated
+ */
+ EReference getGraph_Links();
+
+ /**
+ * Returns the meta object for the reference '{@link org.eclipse.etrice.core.genmodel.fsm.fsmgen.Graph#getStateGraph <em>State Graph</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the reference '<em>State Graph</em>'.
+ * @see org.eclipse.etrice.core.genmodel.fsm.fsmgen.Graph#getStateGraph()
+ * @see #getGraph()
+ * @generated
+ */
+ EReference getGraph_StateGraph();
+
+ /**
+ * Returns the meta object for the '{@link org.eclipse.etrice.core.genmodel.fsm.fsmgen.Graph#toString() <em>To String</em>}' operation.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the '<em>To String</em>' operation.
+ * @see org.eclipse.etrice.core.genmodel.fsm.fsmgen.Graph#toString()
+ * @generated
+ */
+ EOperation getGraph__ToString();
+
+ /**
+ * Returns the meta object for class '{@link org.eclipse.etrice.core.genmodel.fsm.fsmgen.GraphItem <em>Graph Item</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for class '<em>Graph Item</em>'.
+ * @see org.eclipse.etrice.core.genmodel.fsm.fsmgen.GraphItem
+ * @generated
+ */
+ EClass getGraphItem();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.etrice.core.genmodel.fsm.fsmgen.GraphItem#isInherited <em>Inherited</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Inherited</em>'.
+ * @see org.eclipse.etrice.core.genmodel.fsm.fsmgen.GraphItem#isInherited()
+ * @see #getGraphItem()
+ * @generated
+ */
+ EAttribute getGraphItem_Inherited();
+
+ /**
+ * Returns the meta object for class '{@link org.eclipse.etrice.core.genmodel.fsm.fsmgen.Node <em>Node</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for class '<em>Node</em>'.
+ * @see org.eclipse.etrice.core.genmodel.fsm.fsmgen.Node
+ * @generated
+ */
+ EClass getNode();
+
+ /**
+ * Returns the meta object for the container reference '{@link org.eclipse.etrice.core.genmodel.fsm.fsmgen.Node#getGraph <em>Graph</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the container reference '<em>Graph</em>'.
+ * @see org.eclipse.etrice.core.genmodel.fsm.fsmgen.Node#getGraph()
+ * @see #getNode()
+ * @generated
+ */
+ EReference getNode_Graph();
+
+ /**
+ * Returns the meta object for the containment reference '{@link org.eclipse.etrice.core.genmodel.fsm.fsmgen.Node#getSubgraph <em>Subgraph</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the containment reference '<em>Subgraph</em>'.
+ * @see org.eclipse.etrice.core.genmodel.fsm.fsmgen.Node#getSubgraph()
+ * @see #getNode()
+ * @generated
+ */
+ EReference getNode_Subgraph();
+
+ /**
+ * Returns the meta object for the reference list '{@link org.eclipse.etrice.core.genmodel.fsm.fsmgen.Node#getOutgoing <em>Outgoing</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the reference list '<em>Outgoing</em>'.
+ * @see org.eclipse.etrice.core.genmodel.fsm.fsmgen.Node#getOutgoing()
+ * @see #getNode()
+ * @generated
+ */
+ EReference getNode_Outgoing();
+
+ /**
+ * Returns the meta object for the reference list '{@link org.eclipse.etrice.core.genmodel.fsm.fsmgen.Node#getIncoming <em>Incoming</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the reference list '<em>Incoming</em>'.
+ * @see org.eclipse.etrice.core.genmodel.fsm.fsmgen.Node#getIncoming()
+ * @see #getNode()
+ * @generated
+ */
+ EReference getNode_Incoming();
+
+ /**
+ * Returns the meta object for the reference '{@link org.eclipse.etrice.core.genmodel.fsm.fsmgen.Node#getStateGraphNode <em>State Graph Node</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the reference '<em>State Graph Node</em>'.
+ * @see org.eclipse.etrice.core.genmodel.fsm.fsmgen.Node#getStateGraphNode()
+ * @see #getNode()
+ * @generated
+ */
+ EReference getNode_StateGraphNode();
+
+ /**
+ * Returns the meta object for the containment reference list '{@link org.eclipse.etrice.core.genmodel.fsm.fsmgen.Node#getCaughtTriggers <em>Caught Triggers</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the containment reference list '<em>Caught Triggers</em>'.
+ * @see org.eclipse.etrice.core.genmodel.fsm.fsmgen.Node#getCaughtTriggers()
+ * @see #getNode()
+ * @generated
+ */
+ EReference getNode_CaughtTriggers();
+
+ /**
+ * Returns the meta object for the '{@link org.eclipse.etrice.core.genmodel.fsm.fsmgen.Node#toString() <em>To String</em>}' operation.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the '<em>To String</em>' operation.
+ * @see org.eclipse.etrice.core.genmodel.fsm.fsmgen.Node#toString()
+ * @generated
+ */
+ EOperation getNode__ToString();
+
+ /**
+ * Returns the meta object for class '{@link org.eclipse.etrice.core.genmodel.fsm.fsmgen.Link <em>Link</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for class '<em>Link</em>'.
+ * @see org.eclipse.etrice.core.genmodel.fsm.fsmgen.Link
+ * @generated
+ */
+ EClass getLink();
+
+ /**
+ * Returns the meta object for the container reference '{@link org.eclipse.etrice.core.genmodel.fsm.fsmgen.Link#getGraph <em>Graph</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the container reference '<em>Graph</em>'.
+ * @see org.eclipse.etrice.core.genmodel.fsm.fsmgen.Link#getGraph()
+ * @see #getLink()
+ * @generated
+ */
+ EReference getLink_Graph();
+
+ /**
+ * Returns the meta object for the reference '{@link org.eclipse.etrice.core.genmodel.fsm.fsmgen.Link#getSource <em>Source</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the reference '<em>Source</em>'.
+ * @see org.eclipse.etrice.core.genmodel.fsm.fsmgen.Link#getSource()
+ * @see #getLink()
+ * @generated
+ */
+ EReference getLink_Source();
+
+ /**
+ * Returns the meta object for the reference '{@link org.eclipse.etrice.core.genmodel.fsm.fsmgen.Link#getTarget <em>Target</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the reference '<em>Target</em>'.
+ * @see org.eclipse.etrice.core.genmodel.fsm.fsmgen.Link#getTarget()
+ * @see #getLink()
+ * @generated
+ */
+ EReference getLink_Target();
+
+ /**
+ * Returns the meta object for the reference '{@link org.eclipse.etrice.core.genmodel.fsm.fsmgen.Link#getTransition <em>Transition</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the reference '<em>Transition</em>'.
+ * @see org.eclipse.etrice.core.genmodel.fsm.fsmgen.Link#getTransition()
+ * @see #getLink()
+ * @generated
+ */
+ EReference getLink_Transition();
+
+ /**
+ * Returns the meta object for the '{@link org.eclipse.etrice.core.genmodel.fsm.fsmgen.Link#toString() <em>To String</em>}' operation.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the '<em>To String</em>' operation.
+ * @see org.eclipse.etrice.core.genmodel.fsm.fsmgen.Link#toString()
+ * @generated
+ */
+ EOperation getLink__ToString();
+
+ /**
+ * Returns the meta object for class '{@link org.eclipse.etrice.core.genmodel.fsm.fsmgen.CommonTrigger <em>Common Trigger</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for class '<em>Common Trigger</em>'.
+ * @see org.eclipse.etrice.core.genmodel.fsm.fsmgen.CommonTrigger
+ * @generated
+ */
+ EClass getCommonTrigger();
+
+ /**
+ * Returns the meta object for the reference '{@link org.eclipse.etrice.core.genmodel.fsm.fsmgen.CommonTrigger#getMsg <em>Msg</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the reference '<em>Msg</em>'.
+ * @see org.eclipse.etrice.core.genmodel.fsm.fsmgen.CommonTrigger#getMsg()
+ * @see #getCommonTrigger()
+ * @generated
+ */
+ EReference getCommonTrigger_Msg();
+
+ /**
+ * Returns the meta object for the reference '{@link org.eclipse.etrice.core.genmodel.fsm.fsmgen.CommonTrigger#getIfitem <em>Ifitem</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the reference '<em>Ifitem</em>'.
+ * @see org.eclipse.etrice.core.genmodel.fsm.fsmgen.CommonTrigger#getIfitem()
+ * @see #getCommonTrigger()
+ * @generated
+ */
+ EReference getCommonTrigger_Ifitem();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.etrice.core.genmodel.fsm.fsmgen.CommonTrigger#getTrigger <em>Trigger</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Trigger</em>'.
+ * @see org.eclipse.etrice.core.genmodel.fsm.fsmgen.CommonTrigger#getTrigger()
+ * @see #getCommonTrigger()
+ * @generated
+ */
+ EAttribute getCommonTrigger_Trigger();
+
+ /**
+ * Returns the meta object for the reference list '{@link org.eclipse.etrice.core.genmodel.fsm.fsmgen.CommonTrigger#getTransitions <em>Transitions</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the reference list '<em>Transitions</em>'.
+ * @see org.eclipse.etrice.core.genmodel.fsm.fsmgen.CommonTrigger#getTransitions()
+ * @see #getCommonTrigger()
+ * @generated
+ */
+ EReference getCommonTrigger_Transitions();
+
+ /**
+ * Returns the factory that creates the instances of the model.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the factory that creates the instances of the model.
+ * @generated
+ */
+ FsmGenFactory getFsmGenFactory();
+
+ /**
+ * <!-- begin-user-doc -->
+ * Defines literals for the meta objects that represent
+ * <ul>
+ * <li>each class,</li>
+ * <li>each feature of each class,</li>
+ * <li>each operation of each class,</li>
+ * <li>each enum,</li>
+ * <li>and each data type</li>
+ * </ul>
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ interface Literals {
+ /**
+ * The meta object literal for the '{@link org.eclipse.etrice.core.genmodel.fsm.fsmgen.impl.GraphContainerImpl <em>Graph Container</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.etrice.core.genmodel.fsm.fsmgen.impl.GraphContainerImpl
+ * @see org.eclipse.etrice.core.genmodel.fsm.fsmgen.impl.FsmGenPackageImpl#getGraphContainer()
+ * @generated
+ */
+ EClass GRAPH_CONTAINER = eINSTANCE.getGraphContainer();
+
+ /**
+ * The meta object literal for the '<em><b>Graph</b></em>' containment reference feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EReference GRAPH_CONTAINER__GRAPH = eINSTANCE.getGraphContainer_Graph();
+
+ /**
+ * The meta object literal for the '<em><b>Component</b></em>' reference feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EReference GRAPH_CONTAINER__COMPONENT = eINSTANCE.getGraphContainer_Component();
+
+ /**
+ * The meta object literal for the '{@link org.eclipse.etrice.core.genmodel.fsm.fsmgen.impl.GraphImpl <em>Graph</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.etrice.core.genmodel.fsm.fsmgen.impl.GraphImpl
+ * @see org.eclipse.etrice.core.genmodel.fsm.fsmgen.impl.FsmGenPackageImpl#getGraph()
+ * @generated
+ */
+ EClass GRAPH = eINSTANCE.getGraph();
+
+ /**
+ * The meta object literal for the '<em><b>Nodes</b></em>' containment reference list feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EReference GRAPH__NODES = eINSTANCE.getGraph_Nodes();
+
+ /**
+ * The meta object literal for the '<em><b>Links</b></em>' containment reference list feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EReference GRAPH__LINKS = eINSTANCE.getGraph_Links();
+
+ /**
+ * The meta object literal for the '<em><b>State Graph</b></em>' reference feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EReference GRAPH__STATE_GRAPH = eINSTANCE.getGraph_StateGraph();
+
+ /**
+ * The meta object literal for the '<em><b>To String</b></em>' operation.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EOperation GRAPH___TO_STRING = eINSTANCE.getGraph__ToString();
+
+ /**
+ * The meta object literal for the '{@link org.eclipse.etrice.core.genmodel.fsm.fsmgen.impl.GraphItemImpl <em>Graph Item</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.etrice.core.genmodel.fsm.fsmgen.impl.GraphItemImpl
+ * @see org.eclipse.etrice.core.genmodel.fsm.fsmgen.impl.FsmGenPackageImpl#getGraphItem()
+ * @generated
+ */
+ EClass GRAPH_ITEM = eINSTANCE.getGraphItem();
+
+ /**
+ * The meta object literal for the '<em><b>Inherited</b></em>' attribute feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute GRAPH_ITEM__INHERITED = eINSTANCE.getGraphItem_Inherited();
+
+ /**
+ * The meta object literal for the '{@link org.eclipse.etrice.core.genmodel.fsm.fsmgen.impl.NodeImpl <em>Node</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.etrice.core.genmodel.fsm.fsmgen.impl.NodeImpl
+ * @see org.eclipse.etrice.core.genmodel.fsm.fsmgen.impl.FsmGenPackageImpl#getNode()
+ * @generated
+ */
+ EClass NODE = eINSTANCE.getNode();
+
+ /**
+ * The meta object literal for the '<em><b>Graph</b></em>' container reference feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EReference NODE__GRAPH = eINSTANCE.getNode_Graph();
+
+ /**
+ * The meta object literal for the '<em><b>Subgraph</b></em>' containment reference feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EReference NODE__SUBGRAPH = eINSTANCE.getNode_Subgraph();
+
+ /**
+ * The meta object literal for the '<em><b>Outgoing</b></em>' reference list feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EReference NODE__OUTGOING = eINSTANCE.getNode_Outgoing();
+
+ /**
+ * The meta object literal for the '<em><b>Incoming</b></em>' reference list feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EReference NODE__INCOMING = eINSTANCE.getNode_Incoming();
+
+ /**
+ * The meta object literal for the '<em><b>State Graph Node</b></em>' reference feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EReference NODE__STATE_GRAPH_NODE = eINSTANCE.getNode_StateGraphNode();
+
+ /**
+ * The meta object literal for the '<em><b>Caught Triggers</b></em>' containment reference list feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EReference NODE__CAUGHT_TRIGGERS = eINSTANCE.getNode_CaughtTriggers();
+
+ /**
+ * The meta object literal for the '<em><b>To String</b></em>' operation.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EOperation NODE___TO_STRING = eINSTANCE.getNode__ToString();
+
+ /**
+ * The meta object literal for the '{@link org.eclipse.etrice.core.genmodel.fsm.fsmgen.impl.LinkImpl <em>Link</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.etrice.core.genmodel.fsm.fsmgen.impl.LinkImpl
+ * @see org.eclipse.etrice.core.genmodel.fsm.fsmgen.impl.FsmGenPackageImpl#getLink()
+ * @generated
+ */
+ EClass LINK = eINSTANCE.getLink();
+
+ /**
+ * The meta object literal for the '<em><b>Graph</b></em>' container reference feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EReference LINK__GRAPH = eINSTANCE.getLink_Graph();
+
+ /**
+ * The meta object literal for the '<em><b>Source</b></em>' reference feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EReference LINK__SOURCE = eINSTANCE.getLink_Source();
+
+ /**
+ * The meta object literal for the '<em><b>Target</b></em>' reference feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EReference LINK__TARGET = eINSTANCE.getLink_Target();
+
+ /**
+ * The meta object literal for the '<em><b>Transition</b></em>' reference feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EReference LINK__TRANSITION = eINSTANCE.getLink_Transition();
+
+ /**
+ * The meta object literal for the '<em><b>To String</b></em>' operation.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EOperation LINK___TO_STRING = eINSTANCE.getLink__ToString();
+
+ /**
+ * The meta object literal for the '{@link org.eclipse.etrice.core.genmodel.fsm.fsmgen.impl.CommonTriggerImpl <em>Common Trigger</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.etrice.core.genmodel.fsm.fsmgen.impl.CommonTriggerImpl
+ * @see org.eclipse.etrice.core.genmodel.fsm.fsmgen.impl.FsmGenPackageImpl#getCommonTrigger()
+ * @generated
+ */
+ EClass COMMON_TRIGGER = eINSTANCE.getCommonTrigger();
+
+ /**
+ * The meta object literal for the '<em><b>Msg</b></em>' reference feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EReference COMMON_TRIGGER__MSG = eINSTANCE.getCommonTrigger_Msg();
+
+ /**
+ * The meta object literal for the '<em><b>Ifitem</b></em>' reference feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EReference COMMON_TRIGGER__IFITEM = eINSTANCE.getCommonTrigger_Ifitem();
+
+ /**
+ * The meta object literal for the '<em><b>Trigger</b></em>' attribute feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute COMMON_TRIGGER__TRIGGER = eINSTANCE.getCommonTrigger_Trigger();
+
+ /**
+ * The meta object literal for the '<em><b>Transitions</b></em>' reference list feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EReference COMMON_TRIGGER__TRANSITIONS = eINSTANCE.getCommonTrigger_Transitions();
+
+ }
+
+} //FsmGenPackage
diff --git a/plugins/org.eclipse.etrice.core.genmodel.fsm2/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/Graph.java b/plugins/org.eclipse.etrice.core.genmodel.fsm2/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/Graph.java
new file mode 100644
index 000000000..375b761f9
--- /dev/null
+++ b/plugins/org.eclipse.etrice.core.genmodel.fsm2/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/Graph.java
@@ -0,0 +1,100 @@
+/**
+ */
+package org.eclipse.etrice.core.genmodel.fsm.fsmgen;
+
+import org.eclipse.emf.common.util.EList;
+
+import org.eclipse.emf.ecore.EObject;
+
+import org.eclipse.etrice.core.fsm.fSM.StateGraph;
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>Graph</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * </p>
+ * <ul>
+ * <li>{@link org.eclipse.etrice.core.genmodel.fsm.fsmgen.Graph#getNodes <em>Nodes</em>}</li>
+ * <li>{@link org.eclipse.etrice.core.genmodel.fsm.fsmgen.Graph#getLinks <em>Links</em>}</li>
+ * <li>{@link org.eclipse.etrice.core.genmodel.fsm.fsmgen.Graph#getStateGraph <em>State Graph</em>}</li>
+ * </ul>
+ *
+ * @see org.eclipse.etrice.core.genmodel.fsm.fsmgen.FsmGenPackage#getGraph()
+ * @model
+ * @generated
+ */
+public interface Graph extends EObject {
+ /**
+ * Returns the value of the '<em><b>Nodes</b></em>' containment reference list.
+ * The list contents are of type {@link org.eclipse.etrice.core.genmodel.fsm.fsmgen.Node}.
+ * It is bidirectional and its opposite is '{@link org.eclipse.etrice.core.genmodel.fsm.fsmgen.Node#getGraph <em>Graph</em>}'.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Nodes</em>' containment reference list isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Nodes</em>' containment reference list.
+ * @see org.eclipse.etrice.core.genmodel.fsm.fsmgen.FsmGenPackage#getGraph_Nodes()
+ * @see org.eclipse.etrice.core.genmodel.fsm.fsmgen.Node#getGraph
+ * @model opposite="graph" containment="true"
+ * @generated
+ */
+ EList<Node> getNodes();
+
+ /**
+ * Returns the value of the '<em><b>Links</b></em>' containment reference list.
+ * The list contents are of type {@link org.eclipse.etrice.core.genmodel.fsm.fsmgen.Link}.
+ * It is bidirectional and its opposite is '{@link org.eclipse.etrice.core.genmodel.fsm.fsmgen.Link#getGraph <em>Graph</em>}'.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Links</em>' containment reference list isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Links</em>' containment reference list.
+ * @see org.eclipse.etrice.core.genmodel.fsm.fsmgen.FsmGenPackage#getGraph_Links()
+ * @see org.eclipse.etrice.core.genmodel.fsm.fsmgen.Link#getGraph
+ * @model opposite="graph" containment="true"
+ * @generated
+ */
+ EList<Link> getLinks();
+
+ /**
+ * Returns the value of the '<em><b>State Graph</b></em>' reference.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>State Graph</em>' reference isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>State Graph</em>' reference.
+ * @see #setStateGraph(StateGraph)
+ * @see org.eclipse.etrice.core.genmodel.fsm.fsmgen.FsmGenPackage#getGraph_StateGraph()
+ * @model
+ * @generated
+ */
+ StateGraph getStateGraph();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.etrice.core.genmodel.fsm.fsmgen.Graph#getStateGraph <em>State Graph</em>}' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>State Graph</em>' reference.
+ * @see #getStateGraph()
+ * @generated
+ */
+ void setStateGraph(StateGraph value);
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @model annotation="http://www.eclipse.org/emf/2002/GenModel body='StringBuilder result = new StringBuilder();\r\nresult.append(\"StateGraph {\\n\");\r\nfor (Node n : getNodes()) {\r\n\tresult.append(\" \" + n.toString() + \"\\n\");\r\n}\r\nfor (Link l : getLinks()) {\r\n\tresult.append(\" \" + l.toString() + \"\\n\");\r\n}\r\nresult.append(\"}\");\r\nreturn result.toString();'"
+ * @generated
+ */
+ String toString();
+
+} // Graph
diff --git a/plugins/org.eclipse.etrice.core.genmodel.fsm2/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/GraphContainer.java b/plugins/org.eclipse.etrice.core.genmodel.fsm2/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/GraphContainer.java
new file mode 100644
index 000000000..8c62122d2
--- /dev/null
+++ b/plugins/org.eclipse.etrice.core.genmodel.fsm2/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/GraphContainer.java
@@ -0,0 +1,79 @@
+/**
+ */
+package org.eclipse.etrice.core.genmodel.fsm.fsmgen;
+
+import org.eclipse.emf.ecore.EObject;
+
+import org.eclipse.etrice.core.fsm.fSM.ModelComponent;
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>Graph Container</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * </p>
+ * <ul>
+ * <li>{@link org.eclipse.etrice.core.genmodel.fsm.fsmgen.GraphContainer#getGraph <em>Graph</em>}</li>
+ * <li>{@link org.eclipse.etrice.core.genmodel.fsm.fsmgen.GraphContainer#getComponent <em>Component</em>}</li>
+ * </ul>
+ *
+ * @see org.eclipse.etrice.core.genmodel.fsm.fsmgen.FsmGenPackage#getGraphContainer()
+ * @model
+ * @generated
+ */
+public interface GraphContainer extends EObject {
+ /**
+ * Returns the value of the '<em><b>Graph</b></em>' containment reference.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Graph</em>' containment reference isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Graph</em>' containment reference.
+ * @see #setGraph(Graph)
+ * @see org.eclipse.etrice.core.genmodel.fsm.fsmgen.FsmGenPackage#getGraphContainer_Graph()
+ * @model containment="true"
+ * @generated
+ */
+ Graph getGraph();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.etrice.core.genmodel.fsm.fsmgen.GraphContainer#getGraph <em>Graph</em>}' containment reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Graph</em>' containment reference.
+ * @see #getGraph()
+ * @generated
+ */
+ void setGraph(Graph value);
+
+ /**
+ * Returns the value of the '<em><b>Component</b></em>' reference.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Component</em>' reference isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Component</em>' reference.
+ * @see #setComponent(ModelComponent)
+ * @see org.eclipse.etrice.core.genmodel.fsm.fsmgen.FsmGenPackage#getGraphContainer_Component()
+ * @model
+ * @generated
+ */
+ ModelComponent getComponent();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.etrice.core.genmodel.fsm.fsmgen.GraphContainer#getComponent <em>Component</em>}' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Component</em>' reference.
+ * @see #getComponent()
+ * @generated
+ */
+ void setComponent(ModelComponent value);
+
+} // GraphContainer
diff --git a/plugins/org.eclipse.etrice.core.genmodel.fsm2/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/GraphItem.java b/plugins/org.eclipse.etrice.core.genmodel.fsm2/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/GraphItem.java
new file mode 100644
index 000000000..b8cf1abc8
--- /dev/null
+++ b/plugins/org.eclipse.etrice.core.genmodel.fsm2/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/GraphItem.java
@@ -0,0 +1,51 @@
+/**
+ */
+package org.eclipse.etrice.core.genmodel.fsm.fsmgen;
+
+import org.eclipse.emf.ecore.EObject;
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>Graph Item</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * </p>
+ * <ul>
+ * <li>{@link org.eclipse.etrice.core.genmodel.fsm.fsmgen.GraphItem#isInherited <em>Inherited</em>}</li>
+ * </ul>
+ *
+ * @see org.eclipse.etrice.core.genmodel.fsm.fsmgen.FsmGenPackage#getGraphItem()
+ * @model
+ * @generated
+ */
+public interface GraphItem extends EObject {
+ /**
+ * Returns the value of the '<em><b>Inherited</b></em>' attribute.
+ * The default value is <code>"false"</code>.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Inherited</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Inherited</em>' attribute.
+ * @see #setInherited(boolean)
+ * @see org.eclipse.etrice.core.genmodel.fsm.fsmgen.FsmGenPackage#getGraphItem_Inherited()
+ * @model default="false"
+ * @generated
+ */
+ boolean isInherited();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.etrice.core.genmodel.fsm.fsmgen.GraphItem#isInherited <em>Inherited</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Inherited</em>' attribute.
+ * @see #isInherited()
+ * @generated
+ */
+ void setInherited(boolean value);
+
+} // GraphItem
diff --git a/plugins/org.eclipse.etrice.core.genmodel.fsm2/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/Link.java b/plugins/org.eclipse.etrice.core.genmodel.fsm2/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/Link.java
new file mode 100644
index 000000000..a37801846
--- /dev/null
+++ b/plugins/org.eclipse.etrice.core.genmodel.fsm2/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/Link.java
@@ -0,0 +1,145 @@
+/**
+ */
+package org.eclipse.etrice.core.genmodel.fsm.fsmgen;
+
+import org.eclipse.etrice.core.fsm.fSM.TransitionBase;
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>Link</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * </p>
+ * <ul>
+ * <li>{@link org.eclipse.etrice.core.genmodel.fsm.fsmgen.Link#getGraph <em>Graph</em>}</li>
+ * <li>{@link org.eclipse.etrice.core.genmodel.fsm.fsmgen.Link#getSource <em>Source</em>}</li>
+ * <li>{@link org.eclipse.etrice.core.genmodel.fsm.fsmgen.Link#getTarget <em>Target</em>}</li>
+ * <li>{@link org.eclipse.etrice.core.genmodel.fsm.fsmgen.Link#getTransition <em>Transition</em>}</li>
+ * </ul>
+ *
+ * @see org.eclipse.etrice.core.genmodel.fsm.fsmgen.FsmGenPackage#getLink()
+ * @model
+ * @generated
+ */
+public interface Link extends GraphItem {
+ /**
+ * Returns the value of the '<em><b>Graph</b></em>' container reference.
+ * It is bidirectional and its opposite is '{@link org.eclipse.etrice.core.genmodel.fsm.fsmgen.Graph#getLinks <em>Links</em>}'.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Graph</em>' container reference isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Graph</em>' container reference.
+ * @see #setGraph(Graph)
+ * @see org.eclipse.etrice.core.genmodel.fsm.fsmgen.FsmGenPackage#getLink_Graph()
+ * @see org.eclipse.etrice.core.genmodel.fsm.fsmgen.Graph#getLinks
+ * @model opposite="links" transient="false"
+ * @generated
+ */
+ Graph getGraph();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.etrice.core.genmodel.fsm.fsmgen.Link#getGraph <em>Graph</em>}' container reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Graph</em>' container reference.
+ * @see #getGraph()
+ * @generated
+ */
+ void setGraph(Graph value);
+
+ /**
+ * Returns the value of the '<em><b>Source</b></em>' reference.
+ * It is bidirectional and its opposite is '{@link org.eclipse.etrice.core.genmodel.fsm.fsmgen.Node#getOutgoing <em>Outgoing</em>}'.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Source</em>' reference isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Source</em>' reference.
+ * @see #setSource(Node)
+ * @see org.eclipse.etrice.core.genmodel.fsm.fsmgen.FsmGenPackage#getLink_Source()
+ * @see org.eclipse.etrice.core.genmodel.fsm.fsmgen.Node#getOutgoing
+ * @model opposite="outgoing"
+ * @generated
+ */
+ Node getSource();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.etrice.core.genmodel.fsm.fsmgen.Link#getSource <em>Source</em>}' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Source</em>' reference.
+ * @see #getSource()
+ * @generated
+ */
+ void setSource(Node value);
+
+ /**
+ * Returns the value of the '<em><b>Target</b></em>' reference.
+ * It is bidirectional and its opposite is '{@link org.eclipse.etrice.core.genmodel.fsm.fsmgen.Node#getIncoming <em>Incoming</em>}'.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Target</em>' reference isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Target</em>' reference.
+ * @see #setTarget(Node)
+ * @see org.eclipse.etrice.core.genmodel.fsm.fsmgen.FsmGenPackage#getLink_Target()
+ * @see org.eclipse.etrice.core.genmodel.fsm.fsmgen.Node#getIncoming
+ * @model opposite="incoming"
+ * @generated
+ */
+ Node getTarget();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.etrice.core.genmodel.fsm.fsmgen.Link#getTarget <em>Target</em>}' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Target</em>' reference.
+ * @see #getTarget()
+ * @generated
+ */
+ void setTarget(Node value);
+
+ /**
+ * Returns the value of the '<em><b>Transition</b></em>' reference.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Transition</em>' reference isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Transition</em>' reference.
+ * @see #setTransition(TransitionBase)
+ * @see org.eclipse.etrice.core.genmodel.fsm.fsmgen.FsmGenPackage#getLink_Transition()
+ * @model
+ * @generated
+ */
+ TransitionBase getTransition();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.etrice.core.genmodel.fsm.fsmgen.Link#getTransition <em>Transition</em>}' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Transition</em>' reference.
+ * @see #getTransition()
+ * @generated
+ */
+ void setTransition(TransitionBase value);
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @model annotation="http://www.eclipse.org/emf/2002/GenModel body='if (getTransition() instanceof <%org.eclipse.etrice.core.fsm.fSM.InitialTransition%>) {\r\n\treturn \"Link initial -> \" + getTarget().toString() + \" (InitialTransition)\";\r\n}\r\nelse if (getTransition() instanceof <%org.eclipse.etrice.core.fsm.fSM.NonInitialTransition%>) {\r\n\treturn \"Link \" + getSource().toString() + \" -> \" + getTarget().toString() + \" (InitialTransition)\";\r\n}\r\nelse if (getTransition() instanceof <%org.eclipse.etrice.core.fsm.fSM.RefinedTransition%>) {\r\n\treturn \"RefinedTransition\";\r\n}\r\nreturn \"?\";'"
+ * @generated
+ */
+ String toString();
+
+} // Link
diff --git a/plugins/org.eclipse.etrice.core.genmodel.fsm2/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/Node.java b/plugins/org.eclipse.etrice.core.genmodel.fsm2/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/Node.java
new file mode 100644
index 000000000..f1a803871
--- /dev/null
+++ b/plugins/org.eclipse.etrice.core.genmodel.fsm2/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/Node.java
@@ -0,0 +1,171 @@
+/**
+ */
+package org.eclipse.etrice.core.genmodel.fsm.fsmgen;
+
+import org.eclipse.emf.common.util.EList;
+
+import org.eclipse.etrice.core.fsm.fSM.StateGraphNode;
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>Node</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * </p>
+ * <ul>
+ * <li>{@link org.eclipse.etrice.core.genmodel.fsm.fsmgen.Node#getGraph <em>Graph</em>}</li>
+ * <li>{@link org.eclipse.etrice.core.genmodel.fsm.fsmgen.Node#getSubgraph <em>Subgraph</em>}</li>
+ * <li>{@link org.eclipse.etrice.core.genmodel.fsm.fsmgen.Node#getOutgoing <em>Outgoing</em>}</li>
+ * <li>{@link org.eclipse.etrice.core.genmodel.fsm.fsmgen.Node#getIncoming <em>Incoming</em>}</li>
+ * <li>{@link org.eclipse.etrice.core.genmodel.fsm.fsmgen.Node#getStateGraphNode <em>State Graph Node</em>}</li>
+ * <li>{@link org.eclipse.etrice.core.genmodel.fsm.fsmgen.Node#getCaughtTriggers <em>Caught Triggers</em>}</li>
+ * </ul>
+ *
+ * @see org.eclipse.etrice.core.genmodel.fsm.fsmgen.FsmGenPackage#getNode()
+ * @model
+ * @generated
+ */
+public interface Node extends GraphItem {
+ /**
+ * Returns the value of the '<em><b>Graph</b></em>' container reference.
+ * It is bidirectional and its opposite is '{@link org.eclipse.etrice.core.genmodel.fsm.fsmgen.Graph#getNodes <em>Nodes</em>}'.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Graph</em>' container reference isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Graph</em>' container reference.
+ * @see #setGraph(Graph)
+ * @see org.eclipse.etrice.core.genmodel.fsm.fsmgen.FsmGenPackage#getNode_Graph()
+ * @see org.eclipse.etrice.core.genmodel.fsm.fsmgen.Graph#getNodes
+ * @model opposite="nodes" transient="false"
+ * @generated
+ */
+ Graph getGraph();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.etrice.core.genmodel.fsm.fsmgen.Node#getGraph <em>Graph</em>}' container reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Graph</em>' container reference.
+ * @see #getGraph()
+ * @generated
+ */
+ void setGraph(Graph value);
+
+ /**
+ * Returns the value of the '<em><b>Subgraph</b></em>' containment reference.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Subgraph</em>' containment reference isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Subgraph</em>' containment reference.
+ * @see #setSubgraph(Graph)
+ * @see org.eclipse.etrice.core.genmodel.fsm.fsmgen.FsmGenPackage#getNode_Subgraph()
+ * @model containment="true"
+ * @generated
+ */
+ Graph getSubgraph();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.etrice.core.genmodel.fsm.fsmgen.Node#getSubgraph <em>Subgraph</em>}' containment reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Subgraph</em>' containment reference.
+ * @see #getSubgraph()
+ * @generated
+ */
+ void setSubgraph(Graph value);
+
+ /**
+ * Returns the value of the '<em><b>Outgoing</b></em>' reference list.
+ * The list contents are of type {@link org.eclipse.etrice.core.genmodel.fsm.fsmgen.Link}.
+ * It is bidirectional and its opposite is '{@link org.eclipse.etrice.core.genmodel.fsm.fsmgen.Link#getSource <em>Source</em>}'.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Outgoing</em>' reference list isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Outgoing</em>' reference list.
+ * @see org.eclipse.etrice.core.genmodel.fsm.fsmgen.FsmGenPackage#getNode_Outgoing()
+ * @see org.eclipse.etrice.core.genmodel.fsm.fsmgen.Link#getSource
+ * @model opposite="source"
+ * @generated
+ */
+ EList<Link> getOutgoing();
+
+ /**
+ * Returns the value of the '<em><b>Incoming</b></em>' reference list.
+ * The list contents are of type {@link org.eclipse.etrice.core.genmodel.fsm.fsmgen.Link}.
+ * It is bidirectional and its opposite is '{@link org.eclipse.etrice.core.genmodel.fsm.fsmgen.Link#getTarget <em>Target</em>}'.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Incoming</em>' reference list isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Incoming</em>' reference list.
+ * @see org.eclipse.etrice.core.genmodel.fsm.fsmgen.FsmGenPackage#getNode_Incoming()
+ * @see org.eclipse.etrice.core.genmodel.fsm.fsmgen.Link#getTarget
+ * @model opposite="target"
+ * @generated
+ */
+ EList<Link> getIncoming();
+
+ /**
+ * Returns the value of the '<em><b>State Graph Node</b></em>' reference.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>State Graph Node</em>' reference isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>State Graph Node</em>' reference.
+ * @see #setStateGraphNode(StateGraphNode)
+ * @see org.eclipse.etrice.core.genmodel.fsm.fsmgen.FsmGenPackage#getNode_StateGraphNode()
+ * @model
+ * @generated
+ */
+ StateGraphNode getStateGraphNode();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.etrice.core.genmodel.fsm.fsmgen.Node#getStateGraphNode <em>State Graph Node</em>}' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>State Graph Node</em>' reference.
+ * @see #getStateGraphNode()
+ * @generated
+ */
+ void setStateGraphNode(StateGraphNode value);
+
+ /**
+ * Returns the value of the '<em><b>Caught Triggers</b></em>' containment reference list.
+ * The list contents are of type {@link org.eclipse.etrice.core.genmodel.fsm.fsmgen.CommonTrigger}.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Caught Triggers</em>' containment reference list isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Caught Triggers</em>' containment reference list.
+ * @see org.eclipse.etrice.core.genmodel.fsm.fsmgen.FsmGenPackage#getNode_CaughtTriggers()
+ * @model containment="true"
+ * @generated
+ */
+ EList<CommonTrigger> getCaughtTriggers();
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @model annotation="http://www.eclipse.org/emf/2002/GenModel body='String type = \"?\";\r\nif (getStateGraphNode() instanceof <%org.eclipse.etrice.core.fsm.fSM.RefinedState%>) {\r\n\ttype = \"RefinedState\";\r\n}\r\nelse if (getStateGraphNode() instanceof <%org.eclipse.etrice.core.fsm.fSM.SimpleState%>) {\r\n\ttype = \"SimpleState\";\r\n}\r\nelse if (getStateGraphNode() instanceof <%org.eclipse.etrice.core.fsm.fSM.TrPoint%>) {\r\n\ttype = \"TrPoint\";\r\n}\r\nelse if (getStateGraphNode() instanceof <%org.eclipse.etrice.core.fsm.fSM.ChoicePoint%>) {\r\n\ttype = \"ChoicePoint\";\r\n}\r\nreturn \"Node \" + getStateGraphNode().getName() + \" (\" + type + \")\";'"
+ * @generated
+ */
+ String toString();
+
+} // Node
diff --git a/plugins/org.eclipse.etrice.core.genmodel.fsm2/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/impl/CommonTriggerImpl.java b/plugins/org.eclipse.etrice.core.genmodel.fsm2/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/impl/CommonTriggerImpl.java
new file mode 100644
index 000000000..3561d43f5
--- /dev/null
+++ b/plugins/org.eclipse.etrice.core.genmodel.fsm2/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/impl/CommonTriggerImpl.java
@@ -0,0 +1,329 @@
+/**
+ */
+package org.eclipse.etrice.core.genmodel.fsm.fsmgen.impl;
+
+import java.util.Collection;
+
+import org.eclipse.emf.common.notify.Notification;
+
+import org.eclipse.emf.common.util.EList;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.InternalEObject;
+
+import org.eclipse.emf.ecore.impl.ENotificationImpl;
+import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
+
+import org.eclipse.emf.ecore.util.EObjectResolvingEList;
+
+import org.eclipse.etrice.core.fsm.fSM.AbstractInterfaceItem;
+import org.eclipse.etrice.core.fsm.fSM.TriggeredTransition;
+
+import org.eclipse.etrice.core.genmodel.fsm.fsmgen.CommonTrigger;
+import org.eclipse.etrice.core.genmodel.fsm.fsmgen.FsmGenPackage;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>Common Trigger</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * </p>
+ * <ul>
+ * <li>{@link org.eclipse.etrice.core.genmodel.fsm.fsmgen.impl.CommonTriggerImpl#getMsg <em>Msg</em>}</li>
+ * <li>{@link org.eclipse.etrice.core.genmodel.fsm.fsmgen.impl.CommonTriggerImpl#getIfitem <em>Ifitem</em>}</li>
+ * <li>{@link org.eclipse.etrice.core.genmodel.fsm.fsmgen.impl.CommonTriggerImpl#getTrigger <em>Trigger</em>}</li>
+ * <li>{@link org.eclipse.etrice.core.genmodel.fsm.fsmgen.impl.CommonTriggerImpl#getTransitions <em>Transitions</em>}</li>
+ * </ul>
+ *
+ * @generated
+ */
+public class CommonTriggerImpl extends MinimalEObjectImpl.Container implements CommonTrigger {
+ /**
+ * The cached value of the '{@link #getMsg() <em>Msg</em>}' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getMsg()
+ * @generated
+ * @ordered
+ */
+ protected EObject msg;
+
+ /**
+ * The cached value of the '{@link #getIfitem() <em>Ifitem</em>}' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getIfitem()
+ * @generated
+ * @ordered
+ */
+ protected AbstractInterfaceItem ifitem;
+
+ /**
+ * The default value of the '{@link #getTrigger() <em>Trigger</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getTrigger()
+ * @generated
+ * @ordered
+ */
+ protected static final String TRIGGER_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getTrigger() <em>Trigger</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getTrigger()
+ * @generated
+ * @ordered
+ */
+ protected String trigger = TRIGGER_EDEFAULT;
+
+ /**
+ * The cached value of the '{@link #getTransitions() <em>Transitions</em>}' reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getTransitions()
+ * @generated
+ * @ordered
+ */
+ protected EList<TriggeredTransition> transitions;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected CommonTriggerImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass() {
+ return FsmGenPackage.Literals.COMMON_TRIGGER;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EObject getMsg() {
+ if (msg != null && msg.eIsProxy()) {
+ InternalEObject oldMsg = (InternalEObject)msg;
+ msg = eResolveProxy(oldMsg);
+ if (msg != oldMsg) {
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.RESOLVE, FsmGenPackage.COMMON_TRIGGER__MSG, oldMsg, msg));
+ }
+ }
+ return msg;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EObject basicGetMsg() {
+ return msg;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setMsg(EObject newMsg) {
+ EObject oldMsg = msg;
+ msg = newMsg;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, FsmGenPackage.COMMON_TRIGGER__MSG, oldMsg, msg));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public AbstractInterfaceItem getIfitem() {
+ if (ifitem != null && ifitem.eIsProxy()) {
+ InternalEObject oldIfitem = (InternalEObject)ifitem;
+ ifitem = (AbstractInterfaceItem)eResolveProxy(oldIfitem);
+ if (ifitem != oldIfitem) {
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.RESOLVE, FsmGenPackage.COMMON_TRIGGER__IFITEM, oldIfitem, ifitem));
+ }
+ }
+ return ifitem;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public AbstractInterfaceItem basicGetIfitem() {
+ return ifitem;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setIfitem(AbstractInterfaceItem newIfitem) {
+ AbstractInterfaceItem oldIfitem = ifitem;
+ ifitem = newIfitem;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, FsmGenPackage.COMMON_TRIGGER__IFITEM, oldIfitem, ifitem));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String getTrigger() {
+ return trigger;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setTrigger(String newTrigger) {
+ String oldTrigger = trigger;
+ trigger = newTrigger;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, FsmGenPackage.COMMON_TRIGGER__TRIGGER, oldTrigger, trigger));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EList<TriggeredTransition> getTransitions() {
+ if (transitions == null) {
+ transitions = new EObjectResolvingEList<TriggeredTransition>(TriggeredTransition.class, this, FsmGenPackage.COMMON_TRIGGER__TRANSITIONS);
+ }
+ return transitions;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object eGet(int featureID, boolean resolve, boolean coreType) {
+ switch (featureID) {
+ case FsmGenPackage.COMMON_TRIGGER__MSG:
+ if (resolve) return getMsg();
+ return basicGetMsg();
+ case FsmGenPackage.COMMON_TRIGGER__IFITEM:
+ if (resolve) return getIfitem();
+ return basicGetIfitem();
+ case FsmGenPackage.COMMON_TRIGGER__TRIGGER:
+ return getTrigger();
+ case FsmGenPackage.COMMON_TRIGGER__TRANSITIONS:
+ return getTransitions();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @SuppressWarnings("unchecked")
+ @Override
+ public void eSet(int featureID, Object newValue) {
+ switch (featureID) {
+ case FsmGenPackage.COMMON_TRIGGER__MSG:
+ setMsg((EObject)newValue);
+ return;
+ case FsmGenPackage.COMMON_TRIGGER__IFITEM:
+ setIfitem((AbstractInterfaceItem)newValue);
+ return;
+ case FsmGenPackage.COMMON_TRIGGER__TRIGGER:
+ setTrigger((String)newValue);
+ return;
+ case FsmGenPackage.COMMON_TRIGGER__TRANSITIONS:
+ getTransitions().clear();
+ getTransitions().addAll((Collection<? extends TriggeredTransition>)newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void eUnset(int featureID) {
+ switch (featureID) {
+ case FsmGenPackage.COMMON_TRIGGER__MSG:
+ setMsg((EObject)null);
+ return;
+ case FsmGenPackage.COMMON_TRIGGER__IFITEM:
+ setIfitem((AbstractInterfaceItem)null);
+ return;
+ case FsmGenPackage.COMMON_TRIGGER__TRIGGER:
+ setTrigger(TRIGGER_EDEFAULT);
+ return;
+ case FsmGenPackage.COMMON_TRIGGER__TRANSITIONS:
+ getTransitions().clear();
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID) {
+ switch (featureID) {
+ case FsmGenPackage.COMMON_TRIGGER__MSG:
+ return msg != null;
+ case FsmGenPackage.COMMON_TRIGGER__IFITEM:
+ return ifitem != null;
+ case FsmGenPackage.COMMON_TRIGGER__TRIGGER:
+ return TRIGGER_EDEFAULT == null ? trigger != null : !TRIGGER_EDEFAULT.equals(trigger);
+ case FsmGenPackage.COMMON_TRIGGER__TRANSITIONS:
+ return transitions != null && !transitions.isEmpty();
+ }
+ return super.eIsSet(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public String toString() {
+ if (eIsProxy()) return super.toString();
+
+ StringBuffer result = new StringBuffer(super.toString());
+ result.append(" (trigger: ");
+ result.append(trigger);
+ result.append(')');
+ return result.toString();
+ }
+
+} //CommonTriggerImpl
diff --git a/plugins/org.eclipse.etrice.core.genmodel.fsm2/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/impl/FsmGenFactoryImpl.java b/plugins/org.eclipse.etrice.core.genmodel.fsm2/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/impl/FsmGenFactoryImpl.java
new file mode 100644
index 000000000..292f423a6
--- /dev/null
+++ b/plugins/org.eclipse.etrice.core.genmodel.fsm2/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/impl/FsmGenFactoryImpl.java
@@ -0,0 +1,150 @@
+/**
+ */
+package org.eclipse.etrice.core.genmodel.fsm.fsmgen.impl;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EPackage;
+
+import org.eclipse.emf.ecore.impl.EFactoryImpl;
+
+import org.eclipse.emf.ecore.plugin.EcorePlugin;
+
+import org.eclipse.etrice.core.genmodel.fsm.fsmgen.*;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model <b>Factory</b>.
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class FsmGenFactoryImpl extends EFactoryImpl implements FsmGenFactory {
+ /**
+ * Creates the default factory implementation.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static FsmGenFactory init() {
+ try {
+ FsmGenFactory theFsmGenFactory = (FsmGenFactory)EPackage.Registry.INSTANCE.getEFactory(FsmGenPackage.eNS_URI);
+ if (theFsmGenFactory != null) {
+ return theFsmGenFactory;
+ }
+ }
+ catch (Exception exception) {
+ EcorePlugin.INSTANCE.log(exception);
+ }
+ return new FsmGenFactoryImpl();
+ }
+
+ /**
+ * Creates an instance of the factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public FsmGenFactoryImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public EObject create(EClass eClass) {
+ switch (eClass.getClassifierID()) {
+ case FsmGenPackage.GRAPH_CONTAINER: return createGraphContainer();
+ case FsmGenPackage.GRAPH: return createGraph();
+ case FsmGenPackage.GRAPH_ITEM: return createGraphItem();
+ case FsmGenPackage.NODE: return createNode();
+ case FsmGenPackage.LINK: return createLink();
+ case FsmGenPackage.COMMON_TRIGGER: return createCommonTrigger();
+ default:
+ throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier");
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public GraphContainer createGraphContainer() {
+ GraphContainerImpl graphContainer = new GraphContainerImpl();
+ return graphContainer;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Graph createGraph() {
+ GraphImpl graph = new GraphImpl();
+ return graph;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public GraphItem createGraphItem() {
+ GraphItemImpl graphItem = new GraphItemImpl();
+ return graphItem;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Node createNode() {
+ NodeImpl node = new NodeImpl();
+ return node;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Link createLink() {
+ LinkImpl link = new LinkImpl();
+ return link;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public CommonTrigger createCommonTrigger() {
+ CommonTriggerImpl commonTrigger = new CommonTriggerImpl();
+ return commonTrigger;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public FsmGenPackage getFsmGenPackage() {
+ return (FsmGenPackage)getEPackage();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @deprecated
+ * @generated
+ */
+ @Deprecated
+ public static FsmGenPackage getPackage() {
+ return FsmGenPackage.eINSTANCE;
+ }
+
+} //FsmGenFactoryImpl
diff --git a/plugins/org.eclipse.etrice.core.genmodel.fsm2/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/impl/FsmGenPackageImpl.java b/plugins/org.eclipse.etrice.core.genmodel.fsm2/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/impl/FsmGenPackageImpl.java
new file mode 100644
index 000000000..d401065fe
--- /dev/null
+++ b/plugins/org.eclipse.etrice.core.genmodel.fsm2/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/impl/FsmGenPackageImpl.java
@@ -0,0 +1,539 @@
+/**
+ */
+package org.eclipse.etrice.core.genmodel.fsm.fsmgen.impl;
+
+import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EOperation;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.EReference;
+
+import org.eclipse.emf.ecore.impl.EPackageImpl;
+
+import org.eclipse.etrice.core.fsm.fSM.FSMPackage;
+
+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.FsmGenPackage;
+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.GraphItem;
+import org.eclipse.etrice.core.genmodel.fsm.fsmgen.Link;
+import org.eclipse.etrice.core.genmodel.fsm.fsmgen.Node;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model <b>Package</b>.
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class FsmGenPackageImpl extends EPackageImpl implements FsmGenPackage {
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private EClass graphContainerEClass = null;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private EClass graphEClass = null;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private EClass graphItemEClass = null;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private EClass nodeEClass = null;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private EClass linkEClass = null;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private EClass commonTriggerEClass = null;
+
+ /**
+ * Creates an instance of the model <b>Package</b>, registered with
+ * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package
+ * package URI value.
+ * <p>Note: the correct way to create the package is via the static
+ * factory method {@link #init init()}, which also performs
+ * initialization of the package, or returns the registered package,
+ * if one already exists.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.emf.ecore.EPackage.Registry
+ * @see org.eclipse.etrice.core.genmodel.fsm.fsmgen.FsmGenPackage#eNS_URI
+ * @see #init()
+ * @generated
+ */
+ private FsmGenPackageImpl() {
+ super(eNS_URI, FsmGenFactory.eINSTANCE);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private static boolean isInited = false;
+
+ /**
+ * Creates, registers, and initializes the <b>Package</b> for this model, and for any others upon which it depends.
+ *
+ * <p>This method is used to initialize {@link FsmGenPackage#eINSTANCE} when that field is accessed.
+ * Clients should not invoke it directly. Instead, they should simply access that field to obtain the package.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #eNS_URI
+ * @see #createPackageContents()
+ * @see #initializePackageContents()
+ * @generated
+ */
+ public static FsmGenPackage init() {
+ if (isInited) return (FsmGenPackage)EPackage.Registry.INSTANCE.getEPackage(FsmGenPackage.eNS_URI);
+
+ // Obtain or create and register package
+ FsmGenPackageImpl theFsmGenPackage = (FsmGenPackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof FsmGenPackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new FsmGenPackageImpl());
+
+ isInited = true;
+
+ // Initialize simple dependencies
+ FSMPackage.eINSTANCE.eClass();
+
+ // Create package meta-data objects
+ theFsmGenPackage.createPackageContents();
+
+ // Initialize created meta-data
+ theFsmGenPackage.initializePackageContents();
+
+ // Mark meta-data to indicate it can't be changed
+ theFsmGenPackage.freeze();
+
+
+ // Update the registry and return the package
+ EPackage.Registry.INSTANCE.put(FsmGenPackage.eNS_URI, theFsmGenPackage);
+ return theFsmGenPackage;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EClass getGraphContainer() {
+ return graphContainerEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getGraphContainer_Graph() {
+ return (EReference)graphContainerEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getGraphContainer_Component() {
+ return (EReference)graphContainerEClass.getEStructuralFeatures().get(1);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EClass getGraph() {
+ return graphEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getGraph_Nodes() {
+ return (EReference)graphEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getGraph_Links() {
+ return (EReference)graphEClass.getEStructuralFeatures().get(1);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getGraph_StateGraph() {
+ return (EReference)graphEClass.getEStructuralFeatures().get(2);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EOperation getGraph__ToString() {
+ return graphEClass.getEOperations().get(0);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EClass getGraphItem() {
+ return graphItemEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getGraphItem_Inherited() {
+ return (EAttribute)graphItemEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EClass getNode() {
+ return nodeEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getNode_Graph() {
+ return (EReference)nodeEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getNode_Subgraph() {
+ return (EReference)nodeEClass.getEStructuralFeatures().get(1);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getNode_Outgoing() {
+ return (EReference)nodeEClass.getEStructuralFeatures().get(2);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getNode_Incoming() {
+ return (EReference)nodeEClass.getEStructuralFeatures().get(3);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getNode_StateGraphNode() {
+ return (EReference)nodeEClass.getEStructuralFeatures().get(4);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getNode_CaughtTriggers() {
+ return (EReference)nodeEClass.getEStructuralFeatures().get(5);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EOperation getNode__ToString() {
+ return nodeEClass.getEOperations().get(0);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EClass getLink() {
+ return linkEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getLink_Graph() {
+ return (EReference)linkEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getLink_Source() {
+ return (EReference)linkEClass.getEStructuralFeatures().get(1);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getLink_Target() {
+ return (EReference)linkEClass.getEStructuralFeatures().get(2);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getLink_Transition() {
+ return (EReference)linkEClass.getEStructuralFeatures().get(3);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EOperation getLink__ToString() {
+ return linkEClass.getEOperations().get(0);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EClass getCommonTrigger() {
+ return commonTriggerEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getCommonTrigger_Msg() {
+ return (EReference)commonTriggerEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getCommonTrigger_Ifitem() {
+ return (EReference)commonTriggerEClass.getEStructuralFeatures().get(1);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getCommonTrigger_Trigger() {
+ return (EAttribute)commonTriggerEClass.getEStructuralFeatures().get(2);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getCommonTrigger_Transitions() {
+ return (EReference)commonTriggerEClass.getEStructuralFeatures().get(3);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public FsmGenFactory getFsmGenFactory() {
+ return (FsmGenFactory)getEFactoryInstance();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private boolean isCreated = false;
+
+ /**
+ * Creates the meta-model objects for the package. This method is
+ * guarded to have no affect on any invocation but its first.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void createPackageContents() {
+ if (isCreated) return;
+ isCreated = true;
+
+ // Create classes and their features
+ graphContainerEClass = createEClass(GRAPH_CONTAINER);
+ createEReference(graphContainerEClass, GRAPH_CONTAINER__GRAPH);
+ createEReference(graphContainerEClass, GRAPH_CONTAINER__COMPONENT);
+
+ graphEClass = createEClass(GRAPH);
+ createEReference(graphEClass, GRAPH__NODES);
+ createEReference(graphEClass, GRAPH__LINKS);
+ createEReference(graphEClass, GRAPH__STATE_GRAPH);
+ createEOperation(graphEClass, GRAPH___TO_STRING);
+
+ graphItemEClass = createEClass(GRAPH_ITEM);
+ createEAttribute(graphItemEClass, GRAPH_ITEM__INHERITED);
+
+ nodeEClass = createEClass(NODE);
+ createEReference(nodeEClass, NODE__GRAPH);
+ createEReference(nodeEClass, NODE__SUBGRAPH);
+ createEReference(nodeEClass, NODE__OUTGOING);
+ createEReference(nodeEClass, NODE__INCOMING);
+ createEReference(nodeEClass, NODE__STATE_GRAPH_NODE);
+ createEReference(nodeEClass, NODE__CAUGHT_TRIGGERS);
+ createEOperation(nodeEClass, NODE___TO_STRING);
+
+ linkEClass = createEClass(LINK);
+ createEReference(linkEClass, LINK__GRAPH);
+ createEReference(linkEClass, LINK__SOURCE);
+ createEReference(linkEClass, LINK__TARGET);
+ createEReference(linkEClass, LINK__TRANSITION);
+ createEOperation(linkEClass, LINK___TO_STRING);
+
+ commonTriggerEClass = createEClass(COMMON_TRIGGER);
+ createEReference(commonTriggerEClass, COMMON_TRIGGER__MSG);
+ createEReference(commonTriggerEClass, COMMON_TRIGGER__IFITEM);
+ createEAttribute(commonTriggerEClass, COMMON_TRIGGER__TRIGGER);
+ createEReference(commonTriggerEClass, COMMON_TRIGGER__TRANSITIONS);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private boolean isInitialized = false;
+
+ /**
+ * Complete the initialization of the package and its meta-model. This
+ * method is guarded to have no affect on any invocation but its first.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void initializePackageContents() {
+ if (isInitialized) return;
+ isInitialized = true;
+
+ // Initialize package
+ setName(eNAME);
+ setNsPrefix(eNS_PREFIX);
+ setNsURI(eNS_URI);
+
+ // Obtain other dependent packages
+ FSMPackage theFSMPackage = (FSMPackage)EPackage.Registry.INSTANCE.getEPackage(FSMPackage.eNS_URI);
+
+ // Create type parameters
+
+ // Set bounds for type parameters
+
+ // Add supertypes to classes
+ nodeEClass.getESuperTypes().add(this.getGraphItem());
+ linkEClass.getESuperTypes().add(this.getGraphItem());
+
+ // Initialize classes, features, and operations; add parameters
+ initEClass(graphContainerEClass, GraphContainer.class, "GraphContainer", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEReference(getGraphContainer_Graph(), this.getGraph(), null, "graph", null, 0, 1, GraphContainer.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getGraphContainer_Component(), theFSMPackage.getModelComponent(), null, "component", null, 0, 1, GraphContainer.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+
+ initEClass(graphEClass, Graph.class, "Graph", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEReference(getGraph_Nodes(), this.getNode(), this.getNode_Graph(), "nodes", null, 0, -1, Graph.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getGraph_Links(), this.getLink(), this.getLink_Graph(), "links", null, 0, -1, Graph.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getGraph_StateGraph(), theFSMPackage.getStateGraph(), null, "stateGraph", null, 0, 1, Graph.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+
+ initEOperation(getGraph__ToString(), ecorePackage.getEString(), "toString", 0, 1, IS_UNIQUE, IS_ORDERED);
+
+ initEClass(graphItemEClass, GraphItem.class, "GraphItem", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEAttribute(getGraphItem_Inherited(), ecorePackage.getEBoolean(), "inherited", "false", 0, 1, GraphItem.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+
+ initEClass(nodeEClass, Node.class, "Node", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEReference(getNode_Graph(), this.getGraph(), this.getGraph_Nodes(), "graph", null, 0, 1, Node.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getNode_Subgraph(), this.getGraph(), null, "subgraph", null, 0, 1, Node.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getNode_Outgoing(), this.getLink(), this.getLink_Source(), "outgoing", null, 0, -1, Node.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getNode_Incoming(), this.getLink(), this.getLink_Target(), "incoming", null, 0, -1, Node.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getNode_StateGraphNode(), theFSMPackage.getStateGraphNode(), null, "stateGraphNode", null, 0, 1, Node.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getNode_CaughtTriggers(), this.getCommonTrigger(), null, "caughtTriggers", null, 0, -1, Node.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+
+ initEOperation(getNode__ToString(), ecorePackage.getEString(), "toString", 0, 1, IS_UNIQUE, IS_ORDERED);
+
+ initEClass(linkEClass, Link.class, "Link", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEReference(getLink_Graph(), this.getGraph(), this.getGraph_Links(), "graph", null, 0, 1, Link.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getLink_Source(), this.getNode(), this.getNode_Outgoing(), "source", null, 0, 1, Link.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getLink_Target(), this.getNode(), this.getNode_Incoming(), "target", null, 0, 1, Link.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getLink_Transition(), theFSMPackage.getTransitionBase(), null, "transition", null, 0, 1, Link.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+
+ initEOperation(getLink__ToString(), ecorePackage.getEString(), "toString", 0, 1, IS_UNIQUE, IS_ORDERED);
+
+ initEClass(commonTriggerEClass, CommonTrigger.class, "CommonTrigger", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEReference(getCommonTrigger_Msg(), ecorePackage.getEObject(), null, "msg", null, 0, 1, CommonTrigger.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getCommonTrigger_Ifitem(), theFSMPackage.getAbstractInterfaceItem(), null, "ifitem", null, 0, 1, CommonTrigger.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getCommonTrigger_Trigger(), ecorePackage.getEString(), "trigger", null, 0, 1, CommonTrigger.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getCommonTrigger_Transitions(), theFSMPackage.getTriggeredTransition(), null, "transitions", null, 0, -1, CommonTrigger.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+
+ // Create resource
+ createResource(eNS_URI);
+ }
+
+} //FsmGenPackageImpl
diff --git a/plugins/org.eclipse.etrice.core.genmodel.fsm2/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/impl/GraphContainerImpl.java b/plugins/org.eclipse.etrice.core.genmodel.fsm2/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/impl/GraphContainerImpl.java
new file mode 100644
index 000000000..b33af29c1
--- /dev/null
+++ b/plugins/org.eclipse.etrice.core.genmodel.fsm2/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/impl/GraphContainerImpl.java
@@ -0,0 +1,238 @@
+/**
+ */
+package org.eclipse.etrice.core.genmodel.fsm.fsmgen.impl;
+
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.notify.NotificationChain;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.InternalEObject;
+
+import org.eclipse.emf.ecore.impl.ENotificationImpl;
+import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
+
+import org.eclipse.etrice.core.fsm.fSM.ModelComponent;
+
+import org.eclipse.etrice.core.genmodel.fsm.fsmgen.FsmGenPackage;
+import org.eclipse.etrice.core.genmodel.fsm.fsmgen.Graph;
+import org.eclipse.etrice.core.genmodel.fsm.fsmgen.GraphContainer;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>Graph Container</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * </p>
+ * <ul>
+ * <li>{@link org.eclipse.etrice.core.genmodel.fsm.fsmgen.impl.GraphContainerImpl#getGraph <em>Graph</em>}</li>
+ * <li>{@link org.eclipse.etrice.core.genmodel.fsm.fsmgen.impl.GraphContainerImpl#getComponent <em>Component</em>}</li>
+ * </ul>
+ *
+ * @generated
+ */
+public class GraphContainerImpl extends MinimalEObjectImpl.Container implements GraphContainer {
+ /**
+ * The cached value of the '{@link #getGraph() <em>Graph</em>}' containment reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getGraph()
+ * @generated
+ * @ordered
+ */
+ protected Graph graph;
+
+ /**
+ * The cached value of the '{@link #getComponent() <em>Component</em>}' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getComponent()
+ * @generated
+ * @ordered
+ */
+ protected ModelComponent component;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected GraphContainerImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass() {
+ return FsmGenPackage.Literals.GRAPH_CONTAINER;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Graph getGraph() {
+ return graph;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public NotificationChain basicSetGraph(Graph newGraph, NotificationChain msgs) {
+ Graph oldGraph = graph;
+ graph = newGraph;
+ if (eNotificationRequired()) {
+ ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FsmGenPackage.GRAPH_CONTAINER__GRAPH, oldGraph, newGraph);
+ if (msgs == null) msgs = notification; else msgs.add(notification);
+ }
+ return msgs;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setGraph(Graph newGraph) {
+ if (newGraph != graph) {
+ NotificationChain msgs = null;
+ if (graph != null)
+ msgs = ((InternalEObject)graph).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - FsmGenPackage.GRAPH_CONTAINER__GRAPH, null, msgs);
+ if (newGraph != null)
+ msgs = ((InternalEObject)newGraph).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - FsmGenPackage.GRAPH_CONTAINER__GRAPH, null, msgs);
+ msgs = basicSetGraph(newGraph, msgs);
+ if (msgs != null) msgs.dispatch();
+ }
+ else if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, FsmGenPackage.GRAPH_CONTAINER__GRAPH, newGraph, newGraph));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public ModelComponent getComponent() {
+ if (component != null && component.eIsProxy()) {
+ InternalEObject oldComponent = (InternalEObject)component;
+ component = (ModelComponent)eResolveProxy(oldComponent);
+ if (component != oldComponent) {
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.RESOLVE, FsmGenPackage.GRAPH_CONTAINER__COMPONENT, oldComponent, component));
+ }
+ }
+ return component;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public ModelComponent basicGetComponent() {
+ return component;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setComponent(ModelComponent newComponent) {
+ ModelComponent oldComponent = component;
+ component = newComponent;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, FsmGenPackage.GRAPH_CONTAINER__COMPONENT, oldComponent, component));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
+ switch (featureID) {
+ case FsmGenPackage.GRAPH_CONTAINER__GRAPH:
+ return basicSetGraph(null, msgs);
+ }
+ return super.eInverseRemove(otherEnd, featureID, msgs);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object eGet(int featureID, boolean resolve, boolean coreType) {
+ switch (featureID) {
+ case FsmGenPackage.GRAPH_CONTAINER__GRAPH:
+ return getGraph();
+ case FsmGenPackage.GRAPH_CONTAINER__COMPONENT:
+ if (resolve) return getComponent();
+ return basicGetComponent();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void eSet(int featureID, Object newValue) {
+ switch (featureID) {
+ case FsmGenPackage.GRAPH_CONTAINER__GRAPH:
+ setGraph((Graph)newValue);
+ return;
+ case FsmGenPackage.GRAPH_CONTAINER__COMPONENT:
+ setComponent((ModelComponent)newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void eUnset(int featureID) {
+ switch (featureID) {
+ case FsmGenPackage.GRAPH_CONTAINER__GRAPH:
+ setGraph((Graph)null);
+ return;
+ case FsmGenPackage.GRAPH_CONTAINER__COMPONENT:
+ setComponent((ModelComponent)null);
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID) {
+ switch (featureID) {
+ case FsmGenPackage.GRAPH_CONTAINER__GRAPH:
+ return graph != null;
+ case FsmGenPackage.GRAPH_CONTAINER__COMPONENT:
+ return component != null;
+ }
+ return super.eIsSet(featureID);
+ }
+
+} //GraphContainerImpl
diff --git a/plugins/org.eclipse.etrice.core.genmodel.fsm2/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/impl/GraphImpl.java b/plugins/org.eclipse.etrice.core.genmodel.fsm2/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/impl/GraphImpl.java
new file mode 100644
index 000000000..7a682f0ee
--- /dev/null
+++ b/plugins/org.eclipse.etrice.core.genmodel.fsm2/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/impl/GraphImpl.java
@@ -0,0 +1,301 @@
+/**
+ */
+package org.eclipse.etrice.core.genmodel.fsm.fsmgen.impl;
+
+import java.lang.reflect.InvocationTargetException;
+import java.util.Collection;
+
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.notify.NotificationChain;
+
+import org.eclipse.emf.common.util.EList;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.InternalEObject;
+
+import org.eclipse.emf.ecore.impl.ENotificationImpl;
+import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
+
+import org.eclipse.emf.ecore.util.EObjectContainmentWithInverseEList;
+import org.eclipse.emf.ecore.util.InternalEList;
+import org.eclipse.etrice.core.fsm.fSM.StateGraph;
+import org.eclipse.etrice.core.genmodel.fsm.fsmgen.FsmGenPackage;
+import org.eclipse.etrice.core.genmodel.fsm.fsmgen.Graph;
+import org.eclipse.etrice.core.genmodel.fsm.fsmgen.Link;
+import org.eclipse.etrice.core.genmodel.fsm.fsmgen.Node;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>Graph</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * </p>
+ * <ul>
+ * <li>{@link org.eclipse.etrice.core.genmodel.fsm.fsmgen.impl.GraphImpl#getNodes <em>Nodes</em>}</li>
+ * <li>{@link org.eclipse.etrice.core.genmodel.fsm.fsmgen.impl.GraphImpl#getLinks <em>Links</em>}</li>
+ * <li>{@link org.eclipse.etrice.core.genmodel.fsm.fsmgen.impl.GraphImpl#getStateGraph <em>State Graph</em>}</li>
+ * </ul>
+ *
+ * @generated
+ */
+public class GraphImpl extends MinimalEObjectImpl.Container implements Graph {
+ /**
+ * The cached value of the '{@link #getNodes() <em>Nodes</em>}' containment reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getNodes()
+ * @generated
+ * @ordered
+ */
+ protected EList<Node> nodes;
+
+ /**
+ * The cached value of the '{@link #getLinks() <em>Links</em>}' containment reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getLinks()
+ * @generated
+ * @ordered
+ */
+ protected EList<Link> links;
+
+ /**
+ * The cached value of the '{@link #getStateGraph() <em>State Graph</em>}' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getStateGraph()
+ * @generated
+ * @ordered
+ */
+ protected StateGraph stateGraph;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected GraphImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass() {
+ return FsmGenPackage.Literals.GRAPH;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EList<Node> getNodes() {
+ if (nodes == null) {
+ nodes = new EObjectContainmentWithInverseEList<Node>(Node.class, this, FsmGenPackage.GRAPH__NODES, FsmGenPackage.NODE__GRAPH);
+ }
+ return nodes;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EList<Link> getLinks() {
+ if (links == null) {
+ links = new EObjectContainmentWithInverseEList<Link>(Link.class, this, FsmGenPackage.GRAPH__LINKS, FsmGenPackage.LINK__GRAPH);
+ }
+ return links;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public StateGraph getStateGraph() {
+ if (stateGraph != null && stateGraph.eIsProxy()) {
+ InternalEObject oldStateGraph = (InternalEObject)stateGraph;
+ stateGraph = (StateGraph)eResolveProxy(oldStateGraph);
+ if (stateGraph != oldStateGraph) {
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.RESOLVE, FsmGenPackage.GRAPH__STATE_GRAPH, oldStateGraph, stateGraph));
+ }
+ }
+ return stateGraph;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public StateGraph basicGetStateGraph() {
+ return stateGraph;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setStateGraph(StateGraph newStateGraph) {
+ StateGraph oldStateGraph = stateGraph;
+ stateGraph = newStateGraph;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, FsmGenPackage.GRAPH__STATE_GRAPH, oldStateGraph, stateGraph));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String toString() {
+ StringBuilder result = new StringBuilder();
+ result.append("StateGraph {\n");
+ for (Node n : getNodes()) {
+ result.append(" " + n.toString() + "\n");
+ }
+ for (Link l : getLinks()) {
+ result.append(" " + l.toString() + "\n");
+ }
+ result.append("}");
+ return result.toString();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @SuppressWarnings("unchecked")
+ @Override
+ public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
+ switch (featureID) {
+ case FsmGenPackage.GRAPH__NODES:
+ return ((InternalEList<InternalEObject>)(InternalEList<?>)getNodes()).basicAdd(otherEnd, msgs);
+ case FsmGenPackage.GRAPH__LINKS:
+ return ((InternalEList<InternalEObject>)(InternalEList<?>)getLinks()).basicAdd(otherEnd, msgs);
+ }
+ return super.eInverseAdd(otherEnd, featureID, msgs);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
+ switch (featureID) {
+ case FsmGenPackage.GRAPH__NODES:
+ return ((InternalEList<?>)getNodes()).basicRemove(otherEnd, msgs);
+ case FsmGenPackage.GRAPH__LINKS:
+ return ((InternalEList<?>)getLinks()).basicRemove(otherEnd, msgs);
+ }
+ return super.eInverseRemove(otherEnd, featureID, msgs);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object eGet(int featureID, boolean resolve, boolean coreType) {
+ switch (featureID) {
+ case FsmGenPackage.GRAPH__NODES:
+ return getNodes();
+ case FsmGenPackage.GRAPH__LINKS:
+ return getLinks();
+ case FsmGenPackage.GRAPH__STATE_GRAPH:
+ if (resolve) return getStateGraph();
+ return basicGetStateGraph();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @SuppressWarnings("unchecked")
+ @Override
+ public void eSet(int featureID, Object newValue) {
+ switch (featureID) {
+ case FsmGenPackage.GRAPH__NODES:
+ getNodes().clear();
+ getNodes().addAll((Collection<? extends Node>)newValue);
+ return;
+ case FsmGenPackage.GRAPH__LINKS:
+ getLinks().clear();
+ getLinks().addAll((Collection<? extends Link>)newValue);
+ return;
+ case FsmGenPackage.GRAPH__STATE_GRAPH:
+ setStateGraph((StateGraph)newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void eUnset(int featureID) {
+ switch (featureID) {
+ case FsmGenPackage.GRAPH__NODES:
+ getNodes().clear();
+ return;
+ case FsmGenPackage.GRAPH__LINKS:
+ getLinks().clear();
+ return;
+ case FsmGenPackage.GRAPH__STATE_GRAPH:
+ setStateGraph((StateGraph)null);
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID) {
+ switch (featureID) {
+ case FsmGenPackage.GRAPH__NODES:
+ return nodes != null && !nodes.isEmpty();
+ case FsmGenPackage.GRAPH__LINKS:
+ return links != null && !links.isEmpty();
+ case FsmGenPackage.GRAPH__STATE_GRAPH:
+ return stateGraph != null;
+ }
+ return super.eIsSet(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object eInvoke(int operationID, EList<?> arguments) throws InvocationTargetException {
+ switch (operationID) {
+ case FsmGenPackage.GRAPH___TO_STRING:
+ return toString();
+ }
+ return super.eInvoke(operationID, arguments);
+ }
+
+} //GraphImpl
diff --git a/plugins/org.eclipse.etrice.core.genmodel.fsm2/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/impl/GraphItemImpl.java b/plugins/org.eclipse.etrice.core.genmodel.fsm2/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/impl/GraphItemImpl.java
new file mode 100644
index 000000000..f52472dbb
--- /dev/null
+++ b/plugins/org.eclipse.etrice.core.genmodel.fsm2/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/impl/GraphItemImpl.java
@@ -0,0 +1,163 @@
+/**
+ */
+package org.eclipse.etrice.core.genmodel.fsm.fsmgen.impl;
+
+import org.eclipse.emf.common.notify.Notification;
+
+import org.eclipse.emf.ecore.EClass;
+
+import org.eclipse.emf.ecore.impl.ENotificationImpl;
+import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
+
+import org.eclipse.etrice.core.genmodel.fsm.fsmgen.FsmGenPackage;
+import org.eclipse.etrice.core.genmodel.fsm.fsmgen.GraphItem;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>Graph Item</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * </p>
+ * <ul>
+ * <li>{@link org.eclipse.etrice.core.genmodel.fsm.fsmgen.impl.GraphItemImpl#isInherited <em>Inherited</em>}</li>
+ * </ul>
+ *
+ * @generated
+ */
+public class GraphItemImpl extends MinimalEObjectImpl.Container implements GraphItem {
+ /**
+ * The default value of the '{@link #isInherited() <em>Inherited</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #isInherited()
+ * @generated
+ * @ordered
+ */
+ protected static final boolean INHERITED_EDEFAULT = false;
+
+ /**
+ * The cached value of the '{@link #isInherited() <em>Inherited</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #isInherited()
+ * @generated
+ * @ordered
+ */
+ protected boolean inherited = INHERITED_EDEFAULT;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected GraphItemImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass() {
+ return FsmGenPackage.Literals.GRAPH_ITEM;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean isInherited() {
+ return inherited;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setInherited(boolean newInherited) {
+ boolean oldInherited = inherited;
+ inherited = newInherited;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, FsmGenPackage.GRAPH_ITEM__INHERITED, oldInherited, inherited));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object eGet(int featureID, boolean resolve, boolean coreType) {
+ switch (featureID) {
+ case FsmGenPackage.GRAPH_ITEM__INHERITED:
+ return isInherited();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void eSet(int featureID, Object newValue) {
+ switch (featureID) {
+ case FsmGenPackage.GRAPH_ITEM__INHERITED:
+ setInherited((Boolean)newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void eUnset(int featureID) {
+ switch (featureID) {
+ case FsmGenPackage.GRAPH_ITEM__INHERITED:
+ setInherited(INHERITED_EDEFAULT);
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID) {
+ switch (featureID) {
+ case FsmGenPackage.GRAPH_ITEM__INHERITED:
+ return inherited != INHERITED_EDEFAULT;
+ }
+ return super.eIsSet(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public String toString() {
+ if (eIsProxy()) return super.toString();
+
+ StringBuffer result = new StringBuffer(super.toString());
+ result.append(" (inherited: ");
+ result.append(inherited);
+ result.append(')');
+ return result.toString();
+ }
+
+} //GraphItemImpl
diff --git a/plugins/org.eclipse.etrice.core.genmodel.fsm2/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/impl/LinkImpl.java b/plugins/org.eclipse.etrice.core.genmodel.fsm2/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/impl/LinkImpl.java
new file mode 100644
index 000000000..1cdac41ec
--- /dev/null
+++ b/plugins/org.eclipse.etrice.core.genmodel.fsm2/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/impl/LinkImpl.java
@@ -0,0 +1,471 @@
+/**
+ */
+package org.eclipse.etrice.core.genmodel.fsm.fsmgen.impl;
+
+import java.lang.reflect.InvocationTargetException;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.notify.NotificationChain;
+
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.InternalEObject;
+
+import org.eclipse.emf.ecore.impl.ENotificationImpl;
+
+import org.eclipse.emf.ecore.util.EcoreUtil;
+
+import org.eclipse.etrice.core.fsm.fSM.InitialTransition;
+import org.eclipse.etrice.core.fsm.fSM.NonInitialTransition;
+import org.eclipse.etrice.core.fsm.fSM.RefinedTransition;
+import org.eclipse.etrice.core.fsm.fSM.TransitionBase;
+
+import org.eclipse.etrice.core.genmodel.fsm.fsmgen.FsmGenPackage;
+import org.eclipse.etrice.core.genmodel.fsm.fsmgen.Graph;
+import org.eclipse.etrice.core.genmodel.fsm.fsmgen.Link;
+import org.eclipse.etrice.core.genmodel.fsm.fsmgen.Node;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>Link</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * </p>
+ * <ul>
+ * <li>{@link org.eclipse.etrice.core.genmodel.fsm.fsmgen.impl.LinkImpl#getGraph <em>Graph</em>}</li>
+ * <li>{@link org.eclipse.etrice.core.genmodel.fsm.fsmgen.impl.LinkImpl#getSource <em>Source</em>}</li>
+ * <li>{@link org.eclipse.etrice.core.genmodel.fsm.fsmgen.impl.LinkImpl#getTarget <em>Target</em>}</li>
+ * <li>{@link org.eclipse.etrice.core.genmodel.fsm.fsmgen.impl.LinkImpl#getTransition <em>Transition</em>}</li>
+ * </ul>
+ *
+ * @generated
+ */
+public class LinkImpl extends GraphItemImpl implements Link {
+ /**
+ * The cached value of the '{@link #getSource() <em>Source</em>}' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getSource()
+ * @generated
+ * @ordered
+ */
+ protected Node source;
+
+ /**
+ * The cached value of the '{@link #getTarget() <em>Target</em>}' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getTarget()
+ * @generated
+ * @ordered
+ */
+ protected Node target;
+
+ /**
+ * The cached value of the '{@link #getTransition() <em>Transition</em>}' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getTransition()
+ * @generated
+ * @ordered
+ */
+ protected TransitionBase transition;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected LinkImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass() {
+ return FsmGenPackage.Literals.LINK;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Graph getGraph() {
+ if (eContainerFeatureID() != FsmGenPackage.LINK__GRAPH) return null;
+ return (Graph)eInternalContainer();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public NotificationChain basicSetGraph(Graph newGraph, NotificationChain msgs) {
+ msgs = eBasicSetContainer((InternalEObject)newGraph, FsmGenPackage.LINK__GRAPH, msgs);
+ return msgs;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setGraph(Graph newGraph) {
+ if (newGraph != eInternalContainer() || (eContainerFeatureID() != FsmGenPackage.LINK__GRAPH && newGraph != null)) {
+ if (EcoreUtil.isAncestor(this, newGraph))
+ throw new IllegalArgumentException("Recursive containment not allowed for " + toString());
+ NotificationChain msgs = null;
+ if (eInternalContainer() != null)
+ msgs = eBasicRemoveFromContainer(msgs);
+ if (newGraph != null)
+ msgs = ((InternalEObject)newGraph).eInverseAdd(this, FsmGenPackage.GRAPH__LINKS, Graph.class, msgs);
+ msgs = basicSetGraph(newGraph, msgs);
+ if (msgs != null) msgs.dispatch();
+ }
+ else if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, FsmGenPackage.LINK__GRAPH, newGraph, newGraph));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Node getSource() {
+ if (source != null && source.eIsProxy()) {
+ InternalEObject oldSource = (InternalEObject)source;
+ source = (Node)eResolveProxy(oldSource);
+ if (source != oldSource) {
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.RESOLVE, FsmGenPackage.LINK__SOURCE, oldSource, source));
+ }
+ }
+ return source;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Node basicGetSource() {
+ return source;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public NotificationChain basicSetSource(Node newSource, NotificationChain msgs) {
+ Node oldSource = source;
+ source = newSource;
+ if (eNotificationRequired()) {
+ ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FsmGenPackage.LINK__SOURCE, oldSource, newSource);
+ if (msgs == null) msgs = notification; else msgs.add(notification);
+ }
+ return msgs;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setSource(Node newSource) {
+ if (newSource != source) {
+ NotificationChain msgs = null;
+ if (source != null)
+ msgs = ((InternalEObject)source).eInverseRemove(this, FsmGenPackage.NODE__OUTGOING, Node.class, msgs);
+ if (newSource != null)
+ msgs = ((InternalEObject)newSource).eInverseAdd(this, FsmGenPackage.NODE__OUTGOING, Node.class, msgs);
+ msgs = basicSetSource(newSource, msgs);
+ if (msgs != null) msgs.dispatch();
+ }
+ else if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, FsmGenPackage.LINK__SOURCE, newSource, newSource));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Node getTarget() {
+ if (target != null && target.eIsProxy()) {
+ InternalEObject oldTarget = (InternalEObject)target;
+ target = (Node)eResolveProxy(oldTarget);
+ if (target != oldTarget) {
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.RESOLVE, FsmGenPackage.LINK__TARGET, oldTarget, target));
+ }
+ }
+ return target;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Node basicGetTarget() {
+ return target;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public NotificationChain basicSetTarget(Node newTarget, NotificationChain msgs) {
+ Node oldTarget = target;
+ target = newTarget;
+ if (eNotificationRequired()) {
+ ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FsmGenPackage.LINK__TARGET, oldTarget, newTarget);
+ if (msgs == null) msgs = notification; else msgs.add(notification);
+ }
+ return msgs;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setTarget(Node newTarget) {
+ if (newTarget != target) {
+ NotificationChain msgs = null;
+ if (target != null)
+ msgs = ((InternalEObject)target).eInverseRemove(this, FsmGenPackage.NODE__INCOMING, Node.class, msgs);
+ if (newTarget != null)
+ msgs = ((InternalEObject)newTarget).eInverseAdd(this, FsmGenPackage.NODE__INCOMING, Node.class, msgs);
+ msgs = basicSetTarget(newTarget, msgs);
+ if (msgs != null) msgs.dispatch();
+ }
+ else if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, FsmGenPackage.LINK__TARGET, newTarget, newTarget));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public TransitionBase getTransition() {
+ if (transition != null && transition.eIsProxy()) {
+ InternalEObject oldTransition = (InternalEObject)transition;
+ transition = (TransitionBase)eResolveProxy(oldTransition);
+ if (transition != oldTransition) {
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.RESOLVE, FsmGenPackage.LINK__TRANSITION, oldTransition, transition));
+ }
+ }
+ return transition;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public TransitionBase basicGetTransition() {
+ return transition;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setTransition(TransitionBase newTransition) {
+ TransitionBase oldTransition = transition;
+ transition = newTransition;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, FsmGenPackage.LINK__TRANSITION, oldTransition, transition));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String toString() {
+ if (getTransition() instanceof InitialTransition) {
+ return "Link initial -> " + getTarget().toString() + " (InitialTransition)";
+ }
+ else if (getTransition() instanceof NonInitialTransition) {
+ return "Link " + getSource().toString() + " -> " + getTarget().toString() + " (InitialTransition)";
+ }
+ else if (getTransition() instanceof RefinedTransition) {
+ return "RefinedTransition";
+ }
+ return "?";
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
+ switch (featureID) {
+ case FsmGenPackage.LINK__GRAPH:
+ if (eInternalContainer() != null)
+ msgs = eBasicRemoveFromContainer(msgs);
+ return basicSetGraph((Graph)otherEnd, msgs);
+ case FsmGenPackage.LINK__SOURCE:
+ if (source != null)
+ msgs = ((InternalEObject)source).eInverseRemove(this, FsmGenPackage.NODE__OUTGOING, Node.class, msgs);
+ return basicSetSource((Node)otherEnd, msgs);
+ case FsmGenPackage.LINK__TARGET:
+ if (target != null)
+ msgs = ((InternalEObject)target).eInverseRemove(this, FsmGenPackage.NODE__INCOMING, Node.class, msgs);
+ return basicSetTarget((Node)otherEnd, msgs);
+ }
+ return super.eInverseAdd(otherEnd, featureID, msgs);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
+ switch (featureID) {
+ case FsmGenPackage.LINK__GRAPH:
+ return basicSetGraph(null, msgs);
+ case FsmGenPackage.LINK__SOURCE:
+ return basicSetSource(null, msgs);
+ case FsmGenPackage.LINK__TARGET:
+ return basicSetTarget(null, msgs);
+ }
+ return super.eInverseRemove(otherEnd, featureID, msgs);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public NotificationChain eBasicRemoveFromContainerFeature(NotificationChain msgs) {
+ switch (eContainerFeatureID()) {
+ case FsmGenPackage.LINK__GRAPH:
+ return eInternalContainer().eInverseRemove(this, FsmGenPackage.GRAPH__LINKS, Graph.class, msgs);
+ }
+ return super.eBasicRemoveFromContainerFeature(msgs);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object eGet(int featureID, boolean resolve, boolean coreType) {
+ switch (featureID) {
+ case FsmGenPackage.LINK__GRAPH:
+ return getGraph();
+ case FsmGenPackage.LINK__SOURCE:
+ if (resolve) return getSource();
+ return basicGetSource();
+ case FsmGenPackage.LINK__TARGET:
+ if (resolve) return getTarget();
+ return basicGetTarget();
+ case FsmGenPackage.LINK__TRANSITION:
+ if (resolve) return getTransition();
+ return basicGetTransition();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void eSet(int featureID, Object newValue) {
+ switch (featureID) {
+ case FsmGenPackage.LINK__GRAPH:
+ setGraph((Graph)newValue);
+ return;
+ case FsmGenPackage.LINK__SOURCE:
+ setSource((Node)newValue);
+ return;
+ case FsmGenPackage.LINK__TARGET:
+ setTarget((Node)newValue);
+ return;
+ case FsmGenPackage.LINK__TRANSITION:
+ setTransition((TransitionBase)newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void eUnset(int featureID) {
+ switch (featureID) {
+ case FsmGenPackage.LINK__GRAPH:
+ setGraph((Graph)null);
+ return;
+ case FsmGenPackage.LINK__SOURCE:
+ setSource((Node)null);
+ return;
+ case FsmGenPackage.LINK__TARGET:
+ setTarget((Node)null);
+ return;
+ case FsmGenPackage.LINK__TRANSITION:
+ setTransition((TransitionBase)null);
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID) {
+ switch (featureID) {
+ case FsmGenPackage.LINK__GRAPH:
+ return getGraph() != null;
+ case FsmGenPackage.LINK__SOURCE:
+ return source != null;
+ case FsmGenPackage.LINK__TARGET:
+ return target != null;
+ case FsmGenPackage.LINK__TRANSITION:
+ return transition != null;
+ }
+ return super.eIsSet(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object eInvoke(int operationID, EList<?> arguments) throws InvocationTargetException {
+ switch (operationID) {
+ case FsmGenPackage.LINK___TO_STRING:
+ return toString();
+ }
+ return super.eInvoke(operationID, arguments);
+ }
+
+} //LinkImpl
diff --git a/plugins/org.eclipse.etrice.core.genmodel.fsm2/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/impl/NodeImpl.java b/plugins/org.eclipse.etrice.core.genmodel.fsm2/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/impl/NodeImpl.java
new file mode 100644
index 000000000..9f963fa6a
--- /dev/null
+++ b/plugins/org.eclipse.etrice.core.genmodel.fsm2/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/impl/NodeImpl.java
@@ -0,0 +1,487 @@
+/**
+ */
+package org.eclipse.etrice.core.genmodel.fsm.fsmgen.impl;
+
+import java.lang.reflect.InvocationTargetException;
+import java.util.Collection;
+
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.notify.NotificationChain;
+
+import org.eclipse.emf.common.util.EList;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.InternalEObject;
+
+import org.eclipse.emf.ecore.impl.ENotificationImpl;
+
+import org.eclipse.emf.ecore.util.EObjectContainmentEList;
+import org.eclipse.emf.ecore.util.EObjectWithInverseResolvingEList;
+import org.eclipse.emf.ecore.util.EcoreUtil;
+import org.eclipse.emf.ecore.util.InternalEList;
+
+import org.eclipse.etrice.core.fsm.fSM.ChoicePoint;
+import org.eclipse.etrice.core.fsm.fSM.RefinedState;
+import org.eclipse.etrice.core.fsm.fSM.SimpleState;
+import org.eclipse.etrice.core.fsm.fSM.StateGraphNode;
+
+import org.eclipse.etrice.core.fsm.fSM.TrPoint;
+import org.eclipse.etrice.core.genmodel.fsm.fsmgen.CommonTrigger;
+import org.eclipse.etrice.core.genmodel.fsm.fsmgen.FsmGenPackage;
+import org.eclipse.etrice.core.genmodel.fsm.fsmgen.Graph;
+import org.eclipse.etrice.core.genmodel.fsm.fsmgen.Link;
+import org.eclipse.etrice.core.genmodel.fsm.fsmgen.Node;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>Node</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * </p>
+ * <ul>
+ * <li>{@link org.eclipse.etrice.core.genmodel.fsm.fsmgen.impl.NodeImpl#getGraph <em>Graph</em>}</li>
+ * <li>{@link org.eclipse.etrice.core.genmodel.fsm.fsmgen.impl.NodeImpl#getSubgraph <em>Subgraph</em>}</li>
+ * <li>{@link org.eclipse.etrice.core.genmodel.fsm.fsmgen.impl.NodeImpl#getOutgoing <em>Outgoing</em>}</li>
+ * <li>{@link org.eclipse.etrice.core.genmodel.fsm.fsmgen.impl.NodeImpl#getIncoming <em>Incoming</em>}</li>
+ * <li>{@link org.eclipse.etrice.core.genmodel.fsm.fsmgen.impl.NodeImpl#getStateGraphNode <em>State Graph Node</em>}</li>
+ * <li>{@link org.eclipse.etrice.core.genmodel.fsm.fsmgen.impl.NodeImpl#getCaughtTriggers <em>Caught Triggers</em>}</li>
+ * </ul>
+ *
+ * @generated
+ */
+public class NodeImpl extends GraphItemImpl implements Node {
+ /**
+ * The cached value of the '{@link #getSubgraph() <em>Subgraph</em>}' containment reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getSubgraph()
+ * @generated
+ * @ordered
+ */
+ protected Graph subgraph;
+
+ /**
+ * The cached value of the '{@link #getOutgoing() <em>Outgoing</em>}' reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getOutgoing()
+ * @generated
+ * @ordered
+ */
+ protected EList<Link> outgoing;
+
+ /**
+ * The cached value of the '{@link #getIncoming() <em>Incoming</em>}' reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getIncoming()
+ * @generated
+ * @ordered
+ */
+ protected EList<Link> incoming;
+
+ /**
+ * The cached value of the '{@link #getStateGraphNode() <em>State Graph Node</em>}' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getStateGraphNode()
+ * @generated
+ * @ordered
+ */
+ protected StateGraphNode stateGraphNode;
+
+ /**
+ * The cached value of the '{@link #getCaughtTriggers() <em>Caught Triggers</em>}' containment reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getCaughtTriggers()
+ * @generated
+ * @ordered
+ */
+ protected EList<CommonTrigger> caughtTriggers;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected NodeImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass() {
+ return FsmGenPackage.Literals.NODE;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Graph getGraph() {
+ if (eContainerFeatureID() != FsmGenPackage.NODE__GRAPH) return null;
+ return (Graph)eInternalContainer();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public NotificationChain basicSetGraph(Graph newGraph, NotificationChain msgs) {
+ msgs = eBasicSetContainer((InternalEObject)newGraph, FsmGenPackage.NODE__GRAPH, msgs);
+ return msgs;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setGraph(Graph newGraph) {
+ if (newGraph != eInternalContainer() || (eContainerFeatureID() != FsmGenPackage.NODE__GRAPH && newGraph != null)) {
+ if (EcoreUtil.isAncestor(this, newGraph))
+ throw new IllegalArgumentException("Recursive containment not allowed for " + toString());
+ NotificationChain msgs = null;
+ if (eInternalContainer() != null)
+ msgs = eBasicRemoveFromContainer(msgs);
+ if (newGraph != null)
+ msgs = ((InternalEObject)newGraph).eInverseAdd(this, FsmGenPackage.GRAPH__NODES, Graph.class, msgs);
+ msgs = basicSetGraph(newGraph, msgs);
+ if (msgs != null) msgs.dispatch();
+ }
+ else if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, FsmGenPackage.NODE__GRAPH, newGraph, newGraph));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Graph getSubgraph() {
+ return subgraph;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public NotificationChain basicSetSubgraph(Graph newSubgraph, NotificationChain msgs) {
+ Graph oldSubgraph = subgraph;
+ subgraph = newSubgraph;
+ if (eNotificationRequired()) {
+ ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FsmGenPackage.NODE__SUBGRAPH, oldSubgraph, newSubgraph);
+ if (msgs == null) msgs = notification; else msgs.add(notification);
+ }
+ return msgs;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setSubgraph(Graph newSubgraph) {
+ if (newSubgraph != subgraph) {
+ NotificationChain msgs = null;
+ if (subgraph != null)
+ msgs = ((InternalEObject)subgraph).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - FsmGenPackage.NODE__SUBGRAPH, null, msgs);
+ if (newSubgraph != null)
+ msgs = ((InternalEObject)newSubgraph).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - FsmGenPackage.NODE__SUBGRAPH, null, msgs);
+ msgs = basicSetSubgraph(newSubgraph, msgs);
+ if (msgs != null) msgs.dispatch();
+ }
+ else if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, FsmGenPackage.NODE__SUBGRAPH, newSubgraph, newSubgraph));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EList<Link> getOutgoing() {
+ if (outgoing == null) {
+ outgoing = new EObjectWithInverseResolvingEList<Link>(Link.class, this, FsmGenPackage.NODE__OUTGOING, FsmGenPackage.LINK__SOURCE);
+ }
+ return outgoing;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EList<Link> getIncoming() {
+ if (incoming == null) {
+ incoming = new EObjectWithInverseResolvingEList<Link>(Link.class, this, FsmGenPackage.NODE__INCOMING, FsmGenPackage.LINK__TARGET);
+ }
+ return incoming;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public StateGraphNode getStateGraphNode() {
+ if (stateGraphNode != null && stateGraphNode.eIsProxy()) {
+ InternalEObject oldStateGraphNode = (InternalEObject)stateGraphNode;
+ stateGraphNode = (StateGraphNode)eResolveProxy(oldStateGraphNode);
+ if (stateGraphNode != oldStateGraphNode) {
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.RESOLVE, FsmGenPackage.NODE__STATE_GRAPH_NODE, oldStateGraphNode, stateGraphNode));
+ }
+ }
+ return stateGraphNode;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public StateGraphNode basicGetStateGraphNode() {
+ return stateGraphNode;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setStateGraphNode(StateGraphNode newStateGraphNode) {
+ StateGraphNode oldStateGraphNode = stateGraphNode;
+ stateGraphNode = newStateGraphNode;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, FsmGenPackage.NODE__STATE_GRAPH_NODE, oldStateGraphNode, stateGraphNode));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EList<CommonTrigger> getCaughtTriggers() {
+ if (caughtTriggers == null) {
+ caughtTriggers = new EObjectContainmentEList<CommonTrigger>(CommonTrigger.class, this, FsmGenPackage.NODE__CAUGHT_TRIGGERS);
+ }
+ return caughtTriggers;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String toString() {
+ String type = "?";
+ if (getStateGraphNode() instanceof RefinedState) {
+ type = "RefinedState";
+ }
+ else if (getStateGraphNode() instanceof SimpleState) {
+ type = "SimpleState";
+ }
+ else if (getStateGraphNode() instanceof TrPoint) {
+ type = "TrPoint";
+ }
+ else if (getStateGraphNode() instanceof ChoicePoint) {
+ type = "ChoicePoint";
+ }
+ return "Node " + getStateGraphNode().getName() + " (" + type + ")";
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @SuppressWarnings("unchecked")
+ @Override
+ public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
+ switch (featureID) {
+ case FsmGenPackage.NODE__GRAPH:
+ if (eInternalContainer() != null)
+ msgs = eBasicRemoveFromContainer(msgs);
+ return basicSetGraph((Graph)otherEnd, msgs);
+ case FsmGenPackage.NODE__OUTGOING:
+ return ((InternalEList<InternalEObject>)(InternalEList<?>)getOutgoing()).basicAdd(otherEnd, msgs);
+ case FsmGenPackage.NODE__INCOMING:
+ return ((InternalEList<InternalEObject>)(InternalEList<?>)getIncoming()).basicAdd(otherEnd, msgs);
+ }
+ return super.eInverseAdd(otherEnd, featureID, msgs);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
+ switch (featureID) {
+ case FsmGenPackage.NODE__GRAPH:
+ return basicSetGraph(null, msgs);
+ case FsmGenPackage.NODE__SUBGRAPH:
+ return basicSetSubgraph(null, msgs);
+ case FsmGenPackage.NODE__OUTGOING:
+ return ((InternalEList<?>)getOutgoing()).basicRemove(otherEnd, msgs);
+ case FsmGenPackage.NODE__INCOMING:
+ return ((InternalEList<?>)getIncoming()).basicRemove(otherEnd, msgs);
+ case FsmGenPackage.NODE__CAUGHT_TRIGGERS:
+ return ((InternalEList<?>)getCaughtTriggers()).basicRemove(otherEnd, msgs);
+ }
+ return super.eInverseRemove(otherEnd, featureID, msgs);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public NotificationChain eBasicRemoveFromContainerFeature(NotificationChain msgs) {
+ switch (eContainerFeatureID()) {
+ case FsmGenPackage.NODE__GRAPH:
+ return eInternalContainer().eInverseRemove(this, FsmGenPackage.GRAPH__NODES, Graph.class, msgs);
+ }
+ return super.eBasicRemoveFromContainerFeature(msgs);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object eGet(int featureID, boolean resolve, boolean coreType) {
+ switch (featureID) {
+ case FsmGenPackage.NODE__GRAPH:
+ return getGraph();
+ case FsmGenPackage.NODE__SUBGRAPH:
+ return getSubgraph();
+ case FsmGenPackage.NODE__OUTGOING:
+ return getOutgoing();
+ case FsmGenPackage.NODE__INCOMING:
+ return getIncoming();
+ case FsmGenPackage.NODE__STATE_GRAPH_NODE:
+ if (resolve) return getStateGraphNode();
+ return basicGetStateGraphNode();
+ case FsmGenPackage.NODE__CAUGHT_TRIGGERS:
+ return getCaughtTriggers();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @SuppressWarnings("unchecked")
+ @Override
+ public void eSet(int featureID, Object newValue) {
+ switch (featureID) {
+ case FsmGenPackage.NODE__GRAPH:
+ setGraph((Graph)newValue);
+ return;
+ case FsmGenPackage.NODE__SUBGRAPH:
+ setSubgraph((Graph)newValue);
+ return;
+ case FsmGenPackage.NODE__OUTGOING:
+ getOutgoing().clear();
+ getOutgoing().addAll((Collection<? extends Link>)newValue);
+ return;
+ case FsmGenPackage.NODE__INCOMING:
+ getIncoming().clear();
+ getIncoming().addAll((Collection<? extends Link>)newValue);
+ return;
+ case FsmGenPackage.NODE__STATE_GRAPH_NODE:
+ setStateGraphNode((StateGraphNode)newValue);
+ return;
+ case FsmGenPackage.NODE__CAUGHT_TRIGGERS:
+ getCaughtTriggers().clear();
+ getCaughtTriggers().addAll((Collection<? extends CommonTrigger>)newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void eUnset(int featureID) {
+ switch (featureID) {
+ case FsmGenPackage.NODE__GRAPH:
+ setGraph((Graph)null);
+ return;
+ case FsmGenPackage.NODE__SUBGRAPH:
+ setSubgraph((Graph)null);
+ return;
+ case FsmGenPackage.NODE__OUTGOING:
+ getOutgoing().clear();
+ return;
+ case FsmGenPackage.NODE__INCOMING:
+ getIncoming().clear();
+ return;
+ case FsmGenPackage.NODE__STATE_GRAPH_NODE:
+ setStateGraphNode((StateGraphNode)null);
+ return;
+ case FsmGenPackage.NODE__CAUGHT_TRIGGERS:
+ getCaughtTriggers().clear();
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID) {
+ switch (featureID) {
+ case FsmGenPackage.NODE__GRAPH:
+ return getGraph() != null;
+ case FsmGenPackage.NODE__SUBGRAPH:
+ return subgraph != null;
+ case FsmGenPackage.NODE__OUTGOING:
+ return outgoing != null && !outgoing.isEmpty();
+ case FsmGenPackage.NODE__INCOMING:
+ return incoming != null && !incoming.isEmpty();
+ case FsmGenPackage.NODE__STATE_GRAPH_NODE:
+ return stateGraphNode != null;
+ case FsmGenPackage.NODE__CAUGHT_TRIGGERS:
+ return caughtTriggers != null && !caughtTriggers.isEmpty();
+ }
+ return super.eIsSet(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object eInvoke(int operationID, EList<?> arguments) throws InvocationTargetException {
+ switch (operationID) {
+ case FsmGenPackage.NODE___TO_STRING:
+ return toString();
+ }
+ return super.eInvoke(operationID, arguments);
+ }
+
+} //NodeImpl
diff --git a/plugins/org.eclipse.etrice.core.genmodel.fsm2/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/util/FsmGenAdapterFactory.java b/plugins/org.eclipse.etrice.core.genmodel.fsm2/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/util/FsmGenAdapterFactory.java
new file mode 100644
index 000000000..56afe2997
--- /dev/null
+++ b/plugins/org.eclipse.etrice.core.genmodel.fsm2/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/util/FsmGenAdapterFactory.java
@@ -0,0 +1,210 @@
+/**
+ */
+package org.eclipse.etrice.core.genmodel.fsm.fsmgen.util;
+
+import org.eclipse.emf.common.notify.Adapter;
+import org.eclipse.emf.common.notify.Notifier;
+
+import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl;
+
+import org.eclipse.emf.ecore.EObject;
+
+import org.eclipse.etrice.core.genmodel.fsm.fsmgen.*;
+
+/**
+ * <!-- begin-user-doc -->
+ * The <b>Adapter Factory</b> for the model.
+ * It provides an adapter <code>createXXX</code> method for each class of the model.
+ * <!-- end-user-doc -->
+ * @see org.eclipse.etrice.core.genmodel.fsm.fsmgen.FsmGenPackage
+ * @generated
+ */
+public class FsmGenAdapterFactory extends AdapterFactoryImpl {
+ /**
+ * The cached model package.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected static FsmGenPackage modelPackage;
+
+ /**
+ * Creates an instance of the adapter factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public FsmGenAdapterFactory() {
+ if (modelPackage == null) {
+ modelPackage = FsmGenPackage.eINSTANCE;
+ }
+ }
+
+ /**
+ * Returns whether this factory is applicable for the type of the object.
+ * <!-- begin-user-doc -->
+ * This implementation returns <code>true</code> if the object is either the model's package or is an instance object of the model.
+ * <!-- end-user-doc -->
+ * @return whether this factory is applicable for the type of the object.
+ * @generated
+ */
+ @Override
+ public boolean isFactoryForType(Object object) {
+ if (object == modelPackage) {
+ return true;
+ }
+ if (object instanceof EObject) {
+ return ((EObject)object).eClass().getEPackage() == modelPackage;
+ }
+ return false;
+ }
+
+ /**
+ * The switch that delegates to the <code>createXXX</code> methods.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected FsmGenSwitch<Adapter> modelSwitch =
+ new FsmGenSwitch<Adapter>() {
+ @Override
+ public Adapter caseGraphContainer(GraphContainer object) {
+ return createGraphContainerAdapter();
+ }
+ @Override
+ public Adapter caseGraph(Graph object) {
+ return createGraphAdapter();
+ }
+ @Override
+ public Adapter caseGraphItem(GraphItem object) {
+ return createGraphItemAdapter();
+ }
+ @Override
+ public Adapter caseNode(Node object) {
+ return createNodeAdapter();
+ }
+ @Override
+ public Adapter caseLink(Link object) {
+ return createLinkAdapter();
+ }
+ @Override
+ public Adapter caseCommonTrigger(CommonTrigger object) {
+ return createCommonTriggerAdapter();
+ }
+ @Override
+ public Adapter defaultCase(EObject object) {
+ return createEObjectAdapter();
+ }
+ };
+
+ /**
+ * Creates an adapter for the <code>target</code>.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param target the object to adapt.
+ * @return the adapter for the <code>target</code>.
+ * @generated
+ */
+ @Override
+ public Adapter createAdapter(Notifier target) {
+ return modelSwitch.doSwitch((EObject)target);
+ }
+
+
+ /**
+ * Creates a new adapter for an object of class '{@link org.eclipse.etrice.core.genmodel.fsm.fsmgen.GraphContainer <em>Graph Container</em>}'.
+ * <!-- begin-user-doc -->
+ * This default implementation returns null so that we can easily ignore cases;
+ * it's useful to ignore a case when inheritance will catch all the cases anyway.
+ * <!-- end-user-doc -->
+ * @return the new adapter.
+ * @see org.eclipse.etrice.core.genmodel.fsm.fsmgen.GraphContainer
+ * @generated
+ */
+ public Adapter createGraphContainerAdapter() {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for an object of class '{@link org.eclipse.etrice.core.genmodel.fsm.fsmgen.Graph <em>Graph</em>}'.
+ * <!-- begin-user-doc -->
+ * This default implementation returns null so that we can easily ignore cases;
+ * it's useful to ignore a case when inheritance will catch all the cases anyway.
+ * <!-- end-user-doc -->
+ * @return the new adapter.
+ * @see org.eclipse.etrice.core.genmodel.fsm.fsmgen.Graph
+ * @generated
+ */
+ public Adapter createGraphAdapter() {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for an object of class '{@link org.eclipse.etrice.core.genmodel.fsm.fsmgen.GraphItem <em>Graph Item</em>}'.
+ * <!-- begin-user-doc -->
+ * This default implementation returns null so that we can easily ignore cases;
+ * it's useful to ignore a case when inheritance will catch all the cases anyway.
+ * <!-- end-user-doc -->
+ * @return the new adapter.
+ * @see org.eclipse.etrice.core.genmodel.fsm.fsmgen.GraphItem
+ * @generated
+ */
+ public Adapter createGraphItemAdapter() {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for an object of class '{@link org.eclipse.etrice.core.genmodel.fsm.fsmgen.Node <em>Node</em>}'.
+ * <!-- begin-user-doc -->
+ * This default implementation returns null so that we can easily ignore cases;
+ * it's useful to ignore a case when inheritance will catch all the cases anyway.
+ * <!-- end-user-doc -->
+ * @return the new adapter.
+ * @see org.eclipse.etrice.core.genmodel.fsm.fsmgen.Node
+ * @generated
+ */
+ public Adapter createNodeAdapter() {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for an object of class '{@link org.eclipse.etrice.core.genmodel.fsm.fsmgen.Link <em>Link</em>}'.
+ * <!-- begin-user-doc -->
+ * This default implementation returns null so that we can easily ignore cases;
+ * it's useful to ignore a case when inheritance will catch all the cases anyway.
+ * <!-- end-user-doc -->
+ * @return the new adapter.
+ * @see org.eclipse.etrice.core.genmodel.fsm.fsmgen.Link
+ * @generated
+ */
+ public Adapter createLinkAdapter() {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for an object of class '{@link org.eclipse.etrice.core.genmodel.fsm.fsmgen.CommonTrigger <em>Common Trigger</em>}'.
+ * <!-- begin-user-doc -->
+ * This default implementation returns null so that we can easily ignore cases;
+ * it's useful to ignore a case when inheritance will catch all the cases anyway.
+ * <!-- end-user-doc -->
+ * @return the new adapter.
+ * @see org.eclipse.etrice.core.genmodel.fsm.fsmgen.CommonTrigger
+ * @generated
+ */
+ public Adapter createCommonTriggerAdapter() {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for the default case.
+ * <!-- begin-user-doc -->
+ * This default implementation returns null.
+ * <!-- end-user-doc -->
+ * @return the new adapter.
+ * @generated
+ */
+ public Adapter createEObjectAdapter() {
+ return null;
+ }
+
+} //FsmGenAdapterFactory
diff --git a/plugins/org.eclipse.etrice.core.genmodel.fsm2/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/util/FsmGenSwitch.java b/plugins/org.eclipse.etrice.core.genmodel.fsm2/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/util/FsmGenSwitch.java
new file mode 100644
index 000000000..ffee2433b
--- /dev/null
+++ b/plugins/org.eclipse.etrice.core.genmodel.fsm2/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/util/FsmGenSwitch.java
@@ -0,0 +1,217 @@
+/**
+ */
+package org.eclipse.etrice.core.genmodel.fsm.fsmgen.util;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EPackage;
+
+import org.eclipse.emf.ecore.util.Switch;
+
+import org.eclipse.etrice.core.genmodel.fsm.fsmgen.*;
+
+/**
+ * <!-- begin-user-doc -->
+ * The <b>Switch</b> for the model's inheritance hierarchy.
+ * It supports the call {@link #doSwitch(EObject) doSwitch(object)}
+ * to invoke the <code>caseXXX</code> method for each class of the model,
+ * starting with the actual class of the object
+ * and proceeding up the inheritance hierarchy
+ * until a non-null result is returned,
+ * which is the result of the switch.
+ * <!-- end-user-doc -->
+ * @see org.eclipse.etrice.core.genmodel.fsm.fsmgen.FsmGenPackage
+ * @generated
+ */
+public class FsmGenSwitch<T> extends Switch<T> {
+ /**
+ * The cached model package
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected static FsmGenPackage modelPackage;
+
+ /**
+ * Creates an instance of the switch.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public FsmGenSwitch() {
+ if (modelPackage == null) {
+ modelPackage = FsmGenPackage.eINSTANCE;
+ }
+ }
+
+ /**
+ * Checks whether this is a switch for the given package.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param ePackage the package in question.
+ * @return whether this is a switch for the given package.
+ * @generated
+ */
+ @Override
+ protected boolean isSwitchFor(EPackage ePackage) {
+ return ePackage == modelPackage;
+ }
+
+ /**
+ * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the first non-null result returned by a <code>caseXXX</code> call.
+ * @generated
+ */
+ @Override
+ protected T doSwitch(int classifierID, EObject theEObject) {
+ switch (classifierID) {
+ case FsmGenPackage.GRAPH_CONTAINER: {
+ GraphContainer graphContainer = (GraphContainer)theEObject;
+ T result = caseGraphContainer(graphContainer);
+ if (result == null) result = defaultCase(theEObject);
+ return result;
+ }
+ case FsmGenPackage.GRAPH: {
+ Graph graph = (Graph)theEObject;
+ T result = caseGraph(graph);
+ if (result == null) result = defaultCase(theEObject);
+ return result;
+ }
+ case FsmGenPackage.GRAPH_ITEM: {
+ GraphItem graphItem = (GraphItem)theEObject;
+ T result = caseGraphItem(graphItem);
+ if (result == null) result = defaultCase(theEObject);
+ return result;
+ }
+ case FsmGenPackage.NODE: {
+ Node node = (Node)theEObject;
+ T result = caseNode(node);
+ if (result == null) result = caseGraphItem(node);
+ if (result == null) result = defaultCase(theEObject);
+ return result;
+ }
+ case FsmGenPackage.LINK: {
+ Link link = (Link)theEObject;
+ T result = caseLink(link);
+ if (result == null) result = caseGraphItem(link);
+ if (result == null) result = defaultCase(theEObject);
+ return result;
+ }
+ case FsmGenPackage.COMMON_TRIGGER: {
+ CommonTrigger commonTrigger = (CommonTrigger)theEObject;
+ T result = caseCommonTrigger(commonTrigger);
+ if (result == null) result = defaultCase(theEObject);
+ return result;
+ }
+ default: return defaultCase(theEObject);
+ }
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '<em>Graph Container</em>'.
+ * <!-- begin-user-doc -->
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch.
+ * <!-- end-user-doc -->
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of '<em>Graph Container</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseGraphContainer(GraphContainer object) {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '<em>Graph</em>'.
+ * <!-- begin-user-doc -->
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch.
+ * <!-- end-user-doc -->
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of '<em>Graph</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseGraph(Graph object) {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '<em>Graph Item</em>'.
+ * <!-- begin-user-doc -->
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch.
+ * <!-- end-user-doc -->
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of '<em>Graph Item</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseGraphItem(GraphItem object) {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '<em>Node</em>'.
+ * <!-- begin-user-doc -->
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch.
+ * <!-- end-user-doc -->
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of '<em>Node</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseNode(Node object) {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '<em>Link</em>'.
+ * <!-- begin-user-doc -->
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch.
+ * <!-- end-user-doc -->
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of '<em>Link</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseLink(Link object) {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '<em>Common Trigger</em>'.
+ * <!-- begin-user-doc -->
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch.
+ * <!-- end-user-doc -->
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of '<em>Common Trigger</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseCommonTrigger(CommonTrigger object) {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '<em>EObject</em>'.
+ * <!-- begin-user-doc -->
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch, but this is the last case anyway.
+ * <!-- end-user-doc -->
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of '<em>EObject</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject)
+ * @generated
+ */
+ @Override
+ public T defaultCase(EObject object) {
+ return null;
+ }
+
+} //FsmGenSwitch
diff --git a/plugins/org.eclipse.etrice.core.genmodel.fsm2/src/org/eclipse/etrice/core/genmodel/fsm/FsmGenBuilder.xtend b/plugins/org.eclipse.etrice.core.genmodel.fsm2/src/org/eclipse/etrice/core/genmodel/fsm/FsmGenBuilder.xtend
new file mode 100644
index 000000000..7bce74511
--- /dev/null
+++ b/plugins/org.eclipse.etrice.core.genmodel.fsm2/src/org/eclipse/etrice/core/genmodel/fsm/FsmGenBuilder.xtend
@@ -0,0 +1,163 @@
+/*******************************************************************************
+ * Copyright (c) 2017 protos software gmbh (http://www.protos.de).
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * CONTRIBUTORS:
+ * Henrik Rentz-Reichert (initial contribution)
+ *
+ *******************************************************************************/
+
+package org.eclipse.etrice.core.genmodel.fsm
+
+import com.google.inject.Inject
+import org.eclipse.etrice.core.fsm.fSM.ChoicepointTerminal
+import org.eclipse.etrice.core.fsm.fSM.ModelComponent
+import org.eclipse.etrice.core.fsm.fSM.NonInitialTransition
+import org.eclipse.etrice.core.fsm.fSM.StateGraph
+import org.eclipse.etrice.core.fsm.fSM.StateGraphNode
+import org.eclipse.etrice.core.fsm.fSM.StateTerminal
+import org.eclipse.etrice.core.fsm.fSM.SubStateTrPointTerminal
+import org.eclipse.etrice.core.fsm.fSM.TrPointTerminal
+import org.eclipse.etrice.core.fsm.fSM.Transition
+import org.eclipse.etrice.core.fsm.util.FSMHelpers
+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.fsm.fSM.State
+import org.eclipse.etrice.core.fsm.fSM.RefinedState
+import org.eclipse.etrice.core.fsm.fSM.SimpleState
+import org.eclipse.etrice.core.genmodel.fsm.fsmgen.Node
+import com.google.inject.Injector
+import org.eclipse.etrice.core.fsm.fSM.RefinedTransition
+
+class FsmGenBuilder {
+
+ @Inject extension FSMHelpers fsmHelpers
+ val factory = FsmGenFactory.eINSTANCE
+
+ new(Injector injector) {
+ injector.injectMembers(this)
+ }
+
+ def GraphContainer createTransformedModel(ModelComponent mc) {
+ mc.createContainer
+ }
+
+ private def GraphContainer create factory.createGraphContainer createContainer(ModelComponent mc) {
+ it.component = mc
+ it.graph = createStateMachine(mc)
+ }
+
+ private def Graph createStateMachine(ModelComponent mc) {
+ // neither we nor all of our base classes need to have a state machine.
+ // So we ask for the super state machine rather than for the base class'
+ // state machine
+ val superFSM = mc.superStateMachine
+
+ if (superFSM!=null) {
+ // if we have a super state machine we first recurse down
+ val baseGraph = createStateMachine(superFSM.modelComponent)
+
+ // and then merge with our (actual) state machine
+ mergeGraph(baseGraph, mc.actualStateMachine)
+ }
+ else {
+ // first state machine in the hierarchy: create it
+ mc.actualStateMachine.createGraph
+ }
+ }
+
+ private def Graph mergeGraph(Graph graph, StateGraph sg) {
+ // mark existing items as inherited
+ graph.nodes.forEach[inherited = true]
+ graph.links.forEach[inherited = true]
+
+ // add items to already existing graph
+ graph.createContents(sg)
+
+ // point to the current state graph
+ graph.stateGraph = sg
+
+ return graph
+ }
+
+ private def create factory.createGraph createGraph(StateGraph sg) {
+ it.stateGraph = sg
+ createContents(sg)
+ }
+
+ private def createContents(Graph graph, StateGraph sg) {
+ graph.nodes.addAll(sg.chPoints.map[createNode])
+ graph.nodes.addAll(sg.trPoints.map[createNode])
+ graph.nodes.addAll(sg.states.filter(typeof(SimpleState)).map[createNode])
+ graph.links.addAll(sg.transitions.map[createLink])
+
+ // refined states and transitions
+ sg.states.filter(typeof(RefinedState)).forEach[handleRefinedState]
+ sg.refinedTransitions.forEach[handleRefinedTransition]
+ }
+
+ private def handleRefinedState(RefinedState s) {
+ // handle the sub graphs
+ if (s.subgraph!=null) {
+ if (s.target.subgraph!=null) {
+ val targetGraph = s.target.subgraph.createGraph
+ targetGraph.mergeGraph(s.subgraph)
+ }
+ else {
+ s.target.createNode.subgraph = s.subgraph.createGraph
+ }
+ }
+ // else nothing to do, whether the targetGraph exist or not
+
+ // change the target Node's stateGraphNode to our RefinedState
+ val target = s.target.createNode
+ target.stateGraphNode = s
+ }
+
+ private def handleRefinedTransition(RefinedTransition t) {
+ // change the target link's transition to the refined transition
+ t.target.createLink.transition = t
+ }
+
+ private def create factory.createLink createLink(Transition tr) {
+ it.transition = tr
+
+ it.source = if (tr instanceof NonInitialTransition) {
+ tr.from.createNode
+ }
+ else {
+ null
+ }
+ it.target = tr.to.createNode
+ }
+
+ private def dispatch create factory.createNode createNode(StateGraphNode s) {
+ it.stateGraphNode = s
+
+ it.subgraph =
+ if (s instanceof State && (s as State).subgraph!=null) {
+ (s as State).subgraph.createGraph
+ }
+ else null
+ }
+
+ private def dispatch Node createNode(ChoicepointTerminal tt) {
+ tt.cp.createNode
+ }
+
+ private def dispatch Node createNode(TrPointTerminal tt) {
+ tt.trPoint.createNode
+ }
+
+ private def dispatch Node createNode(StateTerminal tt) {
+ tt.state.createNode
+ }
+
+ private def dispatch Node createNode(SubStateTrPointTerminal tt) {
+ tt.trPoint.createNode
+ }
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.etrice.core.genmodel.fsm2/src/org/eclipse/etrice/core/genmodel/fsm/FsmGenChecker.xtend b/plugins/org.eclipse.etrice.core.genmodel.fsm2/src/org/eclipse/etrice/core/genmodel/fsm/FsmGenChecker.xtend
new file mode 100644
index 000000000..214d6f915
--- /dev/null
+++ b/plugins/org.eclipse.etrice.core.genmodel.fsm2/src/org/eclipse/etrice/core/genmodel/fsm/FsmGenChecker.xtend
@@ -0,0 +1,119 @@
+/*******************************************************************************
+ * Copyright (c) 2017 protos software gmbh (http://www.protos.de).
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * CONTRIBUTORS:
+ * Henrik Rentz-Reichert (initial contribution)
+ *
+ *******************************************************************************/
+
+package org.eclipse.etrice.core.genmodel.fsm
+
+import org.eclipse.etrice.core.fsm.fSM.NonInitialTransition
+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 org.eclipse.etrice.core.fsm.fSM.TrPoint
+import org.eclipse.etrice.core.fsm.fSM.State
+
+class FsmGenChecker {
+
+ static def check(GraphContainer gc, ILogger logger) {
+ // graphs
+ gc.eAllContents.filter(typeof(Graph)).forEach[checkGraph(it, logger)]
+
+ // nodes
+ gc.eAllContents.filter(typeof(Node)).forEach[checkNode(it, logger)]
+
+ // links
+ gc.eAllContents.filter(typeof(Link)).forEach[checkLink(it, logger)]
+ }
+
+ def static void checkLink(Link it, ILogger logger) {
+ if (transition==null) {
+ logger.logError("graph doesn't point to ROOM transition")
+ }
+ else if (transition.eIsProxy) {
+ logger.logError("unresolved ROOM transition")
+ }
+ else if (transition.eContainer==null) {
+ logger.logError("dangling ROOM transition")
+ }
+ else if (target==null) {
+ logger.logError("link without target")
+ }
+ else if (source==null && transition instanceof NonInitialTransition) {
+ logger.logError("non-initial link without source")
+ }
+
+ if (source!=null) {
+ checkLinkEnd(it, it.source, logger)
+ }
+ checkLinkEnd(it, it.target, logger)
+ }
+
+ def static checkLinkEnd(Link link, Node node, ILogger logger) {
+ if (node.eContainer == link.eContainer) {
+ return;
+ }
+ else {
+ if (!(node.stateGraphNode instanceof TrPoint)) {
+ logger.logError("subgraph item is not transition point")
+ }
+ else if (!(node.eContainer.eContainer instanceof Node)) {
+ logger.logError("subgraph item is in unexpected container")
+ }
+ else if (!((node.eContainer.eContainer as Node).stateGraphNode instanceof State)) {
+ logger.logError("subgraph item is in unexpected container")
+ }
+ else if (node.eContainer.eContainer.eContainer != link.eContainer) {
+ logger.logError("subgraph item is in unexpected container")
+ }
+ }
+ }
+
+ def static void checkNode(Node it, ILogger logger) {
+ if (stateGraphNode==null) {
+ logger.logError("graph doesn't point to ROOM state graph node")
+ }
+ else if (stateGraphNode.eIsProxy) {
+ logger.logError("unresolved ROOM graph node")
+ }
+ else if (stateGraphNode.eContainer==null) {
+ logger.logError("dangling ROOM graph node")
+ }
+ else if (stateGraphNode.getName()==null) {
+ logger.logError("ROOM graph node without name")
+ }
+
+ // incoming transitions
+ for (l : incoming) {
+ if (l.target.stateGraphNode != it.stateGraphNode) {
+ logger.logError("ROOM target node of an incoming transition must be myself")
+ }
+ }
+
+ // outgoing transitions
+ for (l : outgoing) {
+ if (l.source.stateGraphNode != it.stateGraphNode) {
+ logger.logError("ROOM source node of an outgoing transition must be myself")
+ }
+ }
+ }
+
+ def static void checkGraph(Graph it, ILogger logger) {
+ if (stateGraph==null) {
+ logger.logError("graph doesn't point to ROOM state graph")
+ }
+ else if (stateGraph.eIsProxy) {
+ logger.logError("unresolved ROOM graph")
+ }
+ else if (stateGraph.eContainer==null) {
+ logger.logError("dangling ROOM graph")
+ }
+ }
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.etrice.core.genmodel.fsm2/src/org/eclipse/etrice/core/genmodel/fsm/FsmGenExtensions.xtend b/plugins/org.eclipse.etrice.core.genmodel.fsm2/src/org/eclipse/etrice/core/genmodel/fsm/FsmGenExtensions.xtend
new file mode 100644
index 000000000..ded58d176
--- /dev/null
+++ b/plugins/org.eclipse.etrice.core.genmodel.fsm2/src/org/eclipse/etrice/core/genmodel/fsm/FsmGenExtensions.xtend
@@ -0,0 +1,71 @@
+/*******************************************************************************
+ * Copyright (c) 2017 protos software gmbh (http://www.protos.de).
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * CONTRIBUTORS:
+ * Henrik Rentz-Reichert (initial contribution)
+ *
+ *******************************************************************************/
+
+package org.eclipse.etrice.core.genmodel.fsm
+
+import org.eclipse.etrice.core.genmodel.fsm.fsmgen.Node
+import org.eclipse.etrice.core.genmodel.fsm.fsmgen.Graph
+import org.eclipse.etrice.core.fsm.fSM.State
+import org.eclipse.etrice.core.fsm.fSM.ChoicePoint
+import org.eclipse.etrice.core.fsm.fSM.TrPoint
+import org.eclipse.etrice.core.genmodel.fsm.fsmgen.Link
+
+class FsmGenExtensions {
+
+ public static def getName(Node nd) {
+ nd.stateGraphNode.name
+ }
+
+ public static def getStateNodes(Graph g) {
+ g.nodes.filter[stateGraphNode instanceof State]
+ }
+
+ public static def getAllNodes(Graph g) {
+ g.eAllContents.filter(typeof(Node))
+ }
+
+ public static def getAllStateNodes(Graph g) {
+ g.allNodes.filter[stateGraphNode instanceof State]
+ }
+
+ public static def getChoicePointNodes(Graph g) {
+ g.nodes.filter[stateGraphNode instanceof ChoicePoint]
+ }
+
+ public static def getAllChoicePointNodes(Graph g) {
+ g.allNodes.filter[stateGraphNode instanceof ChoicePoint]
+ }
+
+ public static def getTrPointNodes(Graph g) {
+ g.nodes.filter[stateGraphNode instanceof TrPoint]
+ }
+
+ public static def getAllTrPointNodes(Graph g) {
+ g.allNodes.filter[stateGraphNode instanceof TrPoint]
+ }
+
+ public static def getStates(Graph g) {
+ g.stateNodes.map[stateGraphNode].filter(typeof(State))
+ }
+
+ public static def getChoicePoints(Graph g) {
+ g.choicePointNodes.map[stateGraphNode].filter(typeof(ChoicePoint))
+ }
+
+ public static def getTransitionPoints(Graph g) {
+ g.trPointNodes.map[stateGraphNode].filter(typeof(TrPoint))
+ }
+
+ public static def getAllLinks(Graph g) {
+ g.eAllContents.filter(typeof(Link))
+ }
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.etrice.core.genmodel.fsm2/src/org/eclipse/etrice/core/genmodel/fsm/ILogger.java b/plugins/org.eclipse.etrice.core.genmodel.fsm2/src/org/eclipse/etrice/core/genmodel/fsm/ILogger.java
new file mode 100644
index 000000000..64a6523fc
--- /dev/null
+++ b/plugins/org.eclipse.etrice.core.genmodel.fsm2/src/org/eclipse/etrice/core/genmodel/fsm/ILogger.java
@@ -0,0 +1,45 @@
+/*******************************************************************************
+ * Copyright (c) 2010 protos software gmbh (http://www.protos.de).
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * CONTRIBUTORS:
+ * Thomas Schuetz and Henrik Rentz-Reichert (initial contribution)
+ *
+ *******************************************************************************/
+
+package org.eclipse.etrice.core.genmodel.fsm;
+
+import org.eclipse.emf.ecore.EObject;
+
+/**
+ * A simple logger interface for error messages during model validation and code generation.
+ *
+ * @author Henrik Rentz-Reichert
+ *
+ */
+public interface ILogger {
+
+ /**
+ * @param text informational text
+ */
+ void logInfo(String text);
+
+ /**
+ * @param text error text
+ */
+ void logError(String text);
+
+ /**
+ * @param text error text
+ * @param obj {@link org.eclipse.emf.ecore.EObject EObject} (if available) where the error occurred
+ */
+ void logError(String text, EObject obj);
+
+ /**
+ * returns true if an error occurred
+ */
+ boolean hasErrors();
+}
diff --git a/plugins/org.eclipse.etrice.core.genmodel.fsm2/src/org/eclipse/etrice/core/genmodel/fsm/NullLogger.java b/plugins/org.eclipse.etrice.core.genmodel.fsm2/src/org/eclipse/etrice/core/genmodel/fsm/NullLogger.java
new file mode 100644
index 000000000..259f3dca9
--- /dev/null
+++ b/plugins/org.eclipse.etrice.core.genmodel.fsm2/src/org/eclipse/etrice/core/genmodel/fsm/NullLogger.java
@@ -0,0 +1,50 @@
+/*******************************************************************************
+ * Copyright (c) 2012 protos software gmbh (http://www.protos.de).
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * CONTRIBUTORS:
+ * Henrik Rentz-Reichert (initial contribution)
+ *
+ *******************************************************************************/
+
+package org.eclipse.etrice.core.genmodel.fsm;
+
+import org.eclipse.emf.ecore.EObject;
+
+/**
+ * @author Henrik Rentz-Reichert
+ *
+ */
+public class NullLogger implements ILogger {
+
+ private int errors = 0;
+
+ /* (non-Javadoc)
+ * @see org.eclipse.etrice.core.genmodel.base.ILogger#logInfo(java.lang.String)
+ */
+ @Override
+ public void logInfo(String text) {
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.etrice.core.genmodel.base.ILogger#logError(java.lang.String, org.eclipse.emf.ecore.EObject)
+ */
+ @Override
+ public void logError(String text, EObject obj) {
+ ++errors;
+ }
+
+ @Override
+ public void logError(String text) {
+ logError(text, null);
+ }
+
+ @Override
+ public boolean hasErrors() {
+ return errors!=0;
+ }
+
+}
diff --git a/plugins/org.eclipse.etrice.core.genmodel.fsm2/xtend-gen/org/eclipse/etrice/core/genmodel/fsm/FsmGenBuilder.java b/plugins/org.eclipse.etrice.core.genmodel.fsm2/xtend-gen/org/eclipse/etrice/core/genmodel/fsm/FsmGenBuilder.java
new file mode 100644
index 000000000..3bd0f2d45
--- /dev/null
+++ b/plugins/org.eclipse.etrice.core.genmodel.fsm2/xtend-gen/org/eclipse/etrice/core/genmodel/fsm/FsmGenBuilder.java
@@ -0,0 +1,349 @@
+/**
+ * Copyright (c) 2017 protos software gmbh (http://www.protos.de).
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * CONTRIBUTORS:
+ * Henrik Rentz-Reichert (initial contribution)
+ */
+package org.eclipse.etrice.core.genmodel.fsm;
+
+import com.google.common.base.Objects;
+import com.google.common.collect.Iterables;
+import com.google.inject.Inject;
+import com.google.inject.Injector;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.etrice.core.fsm.fSM.ChoicePoint;
+import org.eclipse.etrice.core.fsm.fSM.ChoicepointTerminal;
+import org.eclipse.etrice.core.fsm.fSM.ModelComponent;
+import org.eclipse.etrice.core.fsm.fSM.NonInitialTransition;
+import org.eclipse.etrice.core.fsm.fSM.RefinedState;
+import org.eclipse.etrice.core.fsm.fSM.RefinedTransition;
+import org.eclipse.etrice.core.fsm.fSM.SimpleState;
+import org.eclipse.etrice.core.fsm.fSM.State;
+import org.eclipse.etrice.core.fsm.fSM.StateGraph;
+import org.eclipse.etrice.core.fsm.fSM.StateGraphNode;
+import org.eclipse.etrice.core.fsm.fSM.StateTerminal;
+import org.eclipse.etrice.core.fsm.fSM.SubStateTrPointTerminal;
+import org.eclipse.etrice.core.fsm.fSM.TrPoint;
+import org.eclipse.etrice.core.fsm.fSM.TrPointTerminal;
+import org.eclipse.etrice.core.fsm.fSM.Transition;
+import org.eclipse.etrice.core.fsm.fSM.TransitionTerminal;
+import org.eclipse.etrice.core.fsm.util.FSMHelpers;
+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 org.eclipse.xtext.xbase.lib.CollectionLiterals;
+import org.eclipse.xtext.xbase.lib.Extension;
+import org.eclipse.xtext.xbase.lib.Functions.Function1;
+import org.eclipse.xtext.xbase.lib.IterableExtensions;
+import org.eclipse.xtext.xbase.lib.ListExtensions;
+import org.eclipse.xtext.xbase.lib.Procedures.Procedure1;
+
+@SuppressWarnings("all")
+public class FsmGenBuilder {
+ @Inject
+ @Extension
+ private FSMHelpers fsmHelpers;
+
+ private final FsmGenFactory factory = FsmGenFactory.eINSTANCE;
+
+ public FsmGenBuilder(final Injector injector) {
+ injector.injectMembers(this);
+ }
+
+ public GraphContainer createTransformedModel(final ModelComponent mc) {
+ return this.createContainer(mc);
+ }
+
+ private GraphContainer createContainer(final ModelComponent mc) {
+ final ArrayList<?> _cacheKey = CollectionLiterals.newArrayList(mc);
+ final GraphContainer _result;
+ synchronized (_createCache_createContainer) {
+ if (_createCache_createContainer.containsKey(_cacheKey)) {
+ return _createCache_createContainer.get(_cacheKey);
+ }
+ GraphContainer _createGraphContainer = this.factory.createGraphContainer();
+ _result = _createGraphContainer;
+ _createCache_createContainer.put(_cacheKey, _result);
+ }
+ _init_createContainer(_result, mc);
+ return _result;
+ }
+
+ private final HashMap<ArrayList<?>, GraphContainer> _createCache_createContainer = CollectionLiterals.newHashMap();
+
+ private void _init_createContainer(final GraphContainer it, final ModelComponent mc) {
+ it.setComponent(mc);
+ Graph _createStateMachine = this.createStateMachine(mc);
+ it.setGraph(_createStateMachine);
+ }
+
+ private Graph createStateMachine(final ModelComponent mc) {
+ Graph _xblockexpression = null;
+ {
+ final StateGraph superFSM = this.fsmHelpers.getSuperStateMachine(mc);
+ Graph _xifexpression = null;
+ boolean _notEquals = (!Objects.equal(superFSM, null));
+ if (_notEquals) {
+ Graph _xblockexpression_1 = null;
+ {
+ ModelComponent _modelComponent = this.fsmHelpers.getModelComponent(superFSM);
+ final Graph baseGraph = this.createStateMachine(_modelComponent);
+ StateGraph _actualStateMachine = this.fsmHelpers.getActualStateMachine(mc);
+ _xblockexpression_1 = this.mergeGraph(baseGraph, _actualStateMachine);
+ }
+ _xifexpression = _xblockexpression_1;
+ } else {
+ StateGraph _actualStateMachine = this.fsmHelpers.getActualStateMachine(mc);
+ _xifexpression = this.createGraph(_actualStateMachine);
+ }
+ _xblockexpression = _xifexpression;
+ }
+ return _xblockexpression;
+ }
+
+ private Graph mergeGraph(final Graph graph, final StateGraph sg) {
+ EList<Node> _nodes = graph.getNodes();
+ final Procedure1<Node> _function = new Procedure1<Node>() {
+ @Override
+ public void apply(final Node it) {
+ it.setInherited(true);
+ }
+ };
+ IterableExtensions.<Node>forEach(_nodes, _function);
+ EList<Link> _links = graph.getLinks();
+ final Procedure1<Link> _function_1 = new Procedure1<Link>() {
+ @Override
+ public void apply(final Link it) {
+ it.setInherited(true);
+ }
+ };
+ IterableExtensions.<Link>forEach(_links, _function_1);
+ this.createContents(graph, sg);
+ graph.setStateGraph(sg);
+ return graph;
+ }
+
+ private Graph createGraph(final StateGraph sg) {
+ final ArrayList<?> _cacheKey = CollectionLiterals.newArrayList(sg);
+ final Graph _result;
+ synchronized (_createCache_createGraph) {
+ if (_createCache_createGraph.containsKey(_cacheKey)) {
+ return _createCache_createGraph.get(_cacheKey);
+ }
+ Graph _createGraph = this.factory.createGraph();
+ _result = _createGraph;
+ _createCache_createGraph.put(_cacheKey, _result);
+ }
+ _init_createGraph(_result, sg);
+ return _result;
+ }
+
+ private final HashMap<ArrayList<?>, Graph> _createCache_createGraph = CollectionLiterals.newHashMap();
+
+ private void _init_createGraph(final Graph it, final StateGraph sg) {
+ it.setStateGraph(sg);
+ this.createContents(it, sg);
+ }
+
+ private void createContents(final Graph graph, final StateGraph sg) {
+ EList<Node> _nodes = graph.getNodes();
+ EList<ChoicePoint> _chPoints = sg.getChPoints();
+ final Function1<ChoicePoint, Node> _function = new Function1<ChoicePoint, Node>() {
+ @Override
+ public Node apply(final ChoicePoint it) {
+ return FsmGenBuilder.this.createNode(it);
+ }
+ };
+ List<Node> _map = ListExtensions.<ChoicePoint, Node>map(_chPoints, _function);
+ _nodes.addAll(_map);
+ EList<Node> _nodes_1 = graph.getNodes();
+ EList<TrPoint> _trPoints = sg.getTrPoints();
+ final Function1<TrPoint, Node> _function_1 = new Function1<TrPoint, Node>() {
+ @Override
+ public Node apply(final TrPoint it) {
+ return FsmGenBuilder.this.createNode(it);
+ }
+ };
+ List<Node> _map_1 = ListExtensions.<TrPoint, Node>map(_trPoints, _function_1);
+ _nodes_1.addAll(_map_1);
+ EList<Node> _nodes_2 = graph.getNodes();
+ EList<State> _states = sg.getStates();
+ Iterable<SimpleState> _filter = Iterables.<SimpleState>filter(_states, SimpleState.class);
+ final Function1<SimpleState, Node> _function_2 = new Function1<SimpleState, Node>() {
+ @Override
+ public Node apply(final SimpleState it) {
+ return FsmGenBuilder.this.createNode(it);
+ }
+ };
+ Iterable<Node> _map_2 = IterableExtensions.<SimpleState, Node>map(_filter, _function_2);
+ Iterables.<Node>addAll(_nodes_2, _map_2);
+ EList<Link> _links = graph.getLinks();
+ EList<Transition> _transitions = sg.getTransitions();
+ final Function1<Transition, Link> _function_3 = new Function1<Transition, Link>() {
+ @Override
+ public Link apply(final Transition it) {
+ return FsmGenBuilder.this.createLink(it);
+ }
+ };
+ List<Link> _map_3 = ListExtensions.<Transition, Link>map(_transitions, _function_3);
+ _links.addAll(_map_3);
+ EList<State> _states_1 = sg.getStates();
+ Iterable<RefinedState> _filter_1 = Iterables.<RefinedState>filter(_states_1, RefinedState.class);
+ final Procedure1<RefinedState> _function_4 = new Procedure1<RefinedState>() {
+ @Override
+ public void apply(final RefinedState it) {
+ FsmGenBuilder.this.handleRefinedState(it);
+ }
+ };
+ IterableExtensions.<RefinedState>forEach(_filter_1, _function_4);
+ EList<RefinedTransition> _refinedTransitions = sg.getRefinedTransitions();
+ final Procedure1<RefinedTransition> _function_5 = new Procedure1<RefinedTransition>() {
+ @Override
+ public void apply(final RefinedTransition it) {
+ FsmGenBuilder.this.handleRefinedTransition(it);
+ }
+ };
+ IterableExtensions.<RefinedTransition>forEach(_refinedTransitions, _function_5);
+ }
+
+ private void handleRefinedState(final RefinedState s) {
+ StateGraph _subgraph = s.getSubgraph();
+ boolean _notEquals = (!Objects.equal(_subgraph, null));
+ if (_notEquals) {
+ State _target = s.getTarget();
+ StateGraph _subgraph_1 = _target.getSubgraph();
+ boolean _notEquals_1 = (!Objects.equal(_subgraph_1, null));
+ if (_notEquals_1) {
+ State _target_1 = s.getTarget();
+ StateGraph _subgraph_2 = _target_1.getSubgraph();
+ final Graph targetGraph = this.createGraph(_subgraph_2);
+ StateGraph _subgraph_3 = s.getSubgraph();
+ this.mergeGraph(targetGraph, _subgraph_3);
+ } else {
+ State _target_2 = s.getTarget();
+ Node _createNode = this.createNode(_target_2);
+ StateGraph _subgraph_4 = s.getSubgraph();
+ Graph _createGraph = this.createGraph(_subgraph_4);
+ _createNode.setSubgraph(_createGraph);
+ }
+ }
+ State _target_3 = s.getTarget();
+ final Node target = this.createNode(_target_3);
+ target.setStateGraphNode(s);
+ }
+
+ private void handleRefinedTransition(final RefinedTransition t) {
+ Transition _target = t.getTarget();
+ Link _createLink = this.createLink(_target);
+ _createLink.setTransition(t);
+ }
+
+ private Link createLink(final Transition tr) {
+ final ArrayList<?> _cacheKey = CollectionLiterals.newArrayList(tr);
+ final Link _result;
+ synchronized (_createCache_createLink) {
+ if (_createCache_createLink.containsKey(_cacheKey)) {
+ return _createCache_createLink.get(_cacheKey);
+ }
+ Link _createLink = this.factory.createLink();
+ _result = _createLink;
+ _createCache_createLink.put(_cacheKey, _result);
+ }
+ _init_createLink(_result, tr);
+ return _result;
+ }
+
+ private final HashMap<ArrayList<?>, Link> _createCache_createLink = CollectionLiterals.newHashMap();
+
+ private void _init_createLink(final Link it, final Transition tr) {
+ it.setTransition(tr);
+ Node _xifexpression = null;
+ if ((tr instanceof NonInitialTransition)) {
+ TransitionTerminal _from = ((NonInitialTransition)tr).getFrom();
+ _xifexpression = this.createNode(_from);
+ } else {
+ _xifexpression = null;
+ }
+ it.setSource(_xifexpression);
+ TransitionTerminal _to = tr.getTo();
+ Node _createNode = this.createNode(_to);
+ it.setTarget(_createNode);
+ }
+
+ private Node _createNode(final StateGraphNode s) {
+ final ArrayList<?> _cacheKey = CollectionLiterals.newArrayList(s);
+ final Node _result;
+ synchronized (_createCache_createNode) {
+ if (_createCache_createNode.containsKey(_cacheKey)) {
+ return _createCache_createNode.get(_cacheKey);
+ }
+ Node _createNode = this.factory.createNode();
+ _result = _createNode;
+ _createCache_createNode.put(_cacheKey, _result);
+ }
+ _init_createNode(_result, s);
+ return _result;
+ }
+
+ private final HashMap<ArrayList<?>, Node> _createCache_createNode = CollectionLiterals.newHashMap();
+
+ private void _init_createNode(final Node it, final StateGraphNode s) {
+ it.setStateGraphNode(s);
+ Graph _xifexpression = null;
+ if (((s instanceof State) && (!Objects.equal(((State) s).getSubgraph(), null)))) {
+ StateGraph _subgraph = ((State) s).getSubgraph();
+ _xifexpression = this.createGraph(_subgraph);
+ } else {
+ _xifexpression = null;
+ }
+ it.setSubgraph(_xifexpression);
+ }
+
+ private Node _createNode(final ChoicepointTerminal tt) {
+ ChoicePoint _cp = tt.getCp();
+ return this.createNode(_cp);
+ }
+
+ private Node _createNode(final TrPointTerminal tt) {
+ TrPoint _trPoint = tt.getTrPoint();
+ return this.createNode(_trPoint);
+ }
+
+ private Node _createNode(final StateTerminal tt) {
+ State _state = tt.getState();
+ return this.createNode(_state);
+ }
+
+ private Node _createNode(final SubStateTrPointTerminal tt) {
+ TrPoint _trPoint = tt.getTrPoint();
+ return this.createNode(_trPoint);
+ }
+
+ private Node createNode(final EObject tt) {
+ if (tt instanceof ChoicepointTerminal) {
+ return _createNode((ChoicepointTerminal)tt);
+ } else if (tt instanceof StateGraphNode) {
+ return _createNode((StateGraphNode)tt);
+ } else if (tt instanceof StateTerminal) {
+ return _createNode((StateTerminal)tt);
+ } else if (tt instanceof SubStateTrPointTerminal) {
+ return _createNode((SubStateTrPointTerminal)tt);
+ } else if (tt instanceof TrPointTerminal) {
+ return _createNode((TrPointTerminal)tt);
+ } else {
+ throw new IllegalArgumentException("Unhandled parameter types: " +
+ Arrays.<Object>asList(tt).toString());
+ }
+ }
+}
diff --git a/plugins/org.eclipse.etrice.core.genmodel.fsm2/xtend-gen/org/eclipse/etrice/core/genmodel/fsm/FsmGenChecker.java b/plugins/org.eclipse.etrice.core.genmodel.fsm2/xtend-gen/org/eclipse/etrice/core/genmodel/fsm/FsmGenChecker.java
new file mode 100644
index 000000000..f4c76537b
--- /dev/null
+++ b/plugins/org.eclipse.etrice.core.genmodel.fsm2/xtend-gen/org/eclipse/etrice/core/genmodel/fsm/FsmGenChecker.java
@@ -0,0 +1,211 @@
+/**
+ * Copyright (c) 2017 protos software gmbh (http://www.protos.de).
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * CONTRIBUTORS:
+ * Henrik Rentz-Reichert (initial contribution)
+ */
+package org.eclipse.etrice.core.genmodel.fsm;
+
+import com.google.common.base.Objects;
+import com.google.common.collect.Iterators;
+import java.util.Iterator;
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.common.util.TreeIterator;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.etrice.core.fsm.fSM.NonInitialTransition;
+import org.eclipse.etrice.core.fsm.fSM.State;
+import org.eclipse.etrice.core.fsm.fSM.StateGraph;
+import org.eclipse.etrice.core.fsm.fSM.StateGraphNode;
+import org.eclipse.etrice.core.fsm.fSM.TrPoint;
+import org.eclipse.etrice.core.fsm.fSM.TransitionBase;
+import org.eclipse.etrice.core.genmodel.fsm.ILogger;
+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 org.eclipse.xtext.xbase.lib.IteratorExtensions;
+import org.eclipse.xtext.xbase.lib.Procedures.Procedure1;
+
+@SuppressWarnings("all")
+public class FsmGenChecker {
+ public static void check(final GraphContainer gc, final ILogger logger) {
+ TreeIterator<EObject> _eAllContents = gc.eAllContents();
+ Iterator<Graph> _filter = Iterators.<Graph>filter(_eAllContents, Graph.class);
+ final Procedure1<Graph> _function = new Procedure1<Graph>() {
+ @Override
+ public void apply(final Graph it) {
+ FsmGenChecker.checkGraph(it, logger);
+ }
+ };
+ IteratorExtensions.<Graph>forEach(_filter, _function);
+ TreeIterator<EObject> _eAllContents_1 = gc.eAllContents();
+ Iterator<Node> _filter_1 = Iterators.<Node>filter(_eAllContents_1, Node.class);
+ final Procedure1<Node> _function_1 = new Procedure1<Node>() {
+ @Override
+ public void apply(final Node it) {
+ FsmGenChecker.checkNode(it, logger);
+ }
+ };
+ IteratorExtensions.<Node>forEach(_filter_1, _function_1);
+ TreeIterator<EObject> _eAllContents_2 = gc.eAllContents();
+ Iterator<Link> _filter_2 = Iterators.<Link>filter(_eAllContents_2, Link.class);
+ final Procedure1<Link> _function_2 = new Procedure1<Link>() {
+ @Override
+ public void apply(final Link it) {
+ FsmGenChecker.checkLink(it, logger);
+ }
+ };
+ IteratorExtensions.<Link>forEach(_filter_2, _function_2);
+ }
+
+ public static void checkLink(final Link it, final ILogger logger) {
+ TransitionBase _transition = it.getTransition();
+ boolean _equals = Objects.equal(_transition, null);
+ if (_equals) {
+ logger.logError("graph doesn\'t point to ROOM transition");
+ } else {
+ TransitionBase _transition_1 = it.getTransition();
+ boolean _eIsProxy = _transition_1.eIsProxy();
+ if (_eIsProxy) {
+ logger.logError("unresolved ROOM transition");
+ } else {
+ TransitionBase _transition_2 = it.getTransition();
+ EObject _eContainer = _transition_2.eContainer();
+ boolean _equals_1 = Objects.equal(_eContainer, null);
+ if (_equals_1) {
+ logger.logError("dangling ROOM transition");
+ } else {
+ Node _target = it.getTarget();
+ boolean _equals_2 = Objects.equal(_target, null);
+ if (_equals_2) {
+ logger.logError("link without target");
+ } else {
+ if ((Objects.equal(it.getSource(), null) && (it.getTransition() instanceof NonInitialTransition))) {
+ logger.logError("non-initial link without source");
+ }
+ }
+ }
+ }
+ }
+ Node _source = it.getSource();
+ boolean _notEquals = (!Objects.equal(_source, null));
+ if (_notEquals) {
+ Node _source_1 = it.getSource();
+ FsmGenChecker.checkLinkEnd(it, _source_1, logger);
+ }
+ Node _target_1 = it.getTarget();
+ FsmGenChecker.checkLinkEnd(it, _target_1, logger);
+ }
+
+ public static void checkLinkEnd(final Link link, final Node node, final ILogger logger) {
+ EObject _eContainer = node.eContainer();
+ EObject _eContainer_1 = link.eContainer();
+ boolean _equals = Objects.equal(_eContainer, _eContainer_1);
+ if (_equals) {
+ return;
+ } else {
+ StateGraphNode _stateGraphNode = node.getStateGraphNode();
+ boolean _not = (!(_stateGraphNode instanceof TrPoint));
+ if (_not) {
+ logger.logError("subgraph item is not transition point");
+ } else {
+ EObject _eContainer_2 = node.eContainer();
+ EObject _eContainer_3 = _eContainer_2.eContainer();
+ boolean _not_1 = (!(_eContainer_3 instanceof Node));
+ if (_not_1) {
+ logger.logError("subgraph item is in unexpected container");
+ } else {
+ EObject _eContainer_4 = node.eContainer();
+ EObject _eContainer_5 = _eContainer_4.eContainer();
+ StateGraphNode _stateGraphNode_1 = ((Node) _eContainer_5).getStateGraphNode();
+ boolean _not_2 = (!(_stateGraphNode_1 instanceof State));
+ if (_not_2) {
+ logger.logError("subgraph item is in unexpected container");
+ } else {
+ EObject _eContainer_6 = node.eContainer();
+ EObject _eContainer_7 = _eContainer_6.eContainer();
+ EObject _eContainer_8 = _eContainer_7.eContainer();
+ EObject _eContainer_9 = link.eContainer();
+ boolean _notEquals = (!Objects.equal(_eContainer_8, _eContainer_9));
+ if (_notEquals) {
+ logger.logError("subgraph item is in unexpected container");
+ }
+ }
+ }
+ }
+ }
+ }
+
+ public static void checkNode(final Node it, final ILogger logger) {
+ StateGraphNode _stateGraphNode = it.getStateGraphNode();
+ boolean _equals = Objects.equal(_stateGraphNode, null);
+ if (_equals) {
+ logger.logError("graph doesn\'t point to ROOM state graph node");
+ } else {
+ StateGraphNode _stateGraphNode_1 = it.getStateGraphNode();
+ boolean _eIsProxy = _stateGraphNode_1.eIsProxy();
+ if (_eIsProxy) {
+ logger.logError("unresolved ROOM graph node");
+ } else {
+ StateGraphNode _stateGraphNode_2 = it.getStateGraphNode();
+ EObject _eContainer = _stateGraphNode_2.eContainer();
+ boolean _equals_1 = Objects.equal(_eContainer, null);
+ if (_equals_1) {
+ logger.logError("dangling ROOM graph node");
+ } else {
+ StateGraphNode _stateGraphNode_3 = it.getStateGraphNode();
+ String _name = _stateGraphNode_3.getName();
+ boolean _equals_2 = Objects.equal(_name, null);
+ if (_equals_2) {
+ logger.logError("ROOM graph node without name");
+ }
+ }
+ }
+ }
+ EList<Link> _incoming = it.getIncoming();
+ for (final Link l : _incoming) {
+ Node _target = l.getTarget();
+ StateGraphNode _stateGraphNode_4 = _target.getStateGraphNode();
+ StateGraphNode _stateGraphNode_5 = it.getStateGraphNode();
+ boolean _notEquals = (!Objects.equal(_stateGraphNode_4, _stateGraphNode_5));
+ if (_notEquals) {
+ logger.logError("ROOM target node of an incoming transition must be myself");
+ }
+ }
+ EList<Link> _outgoing = it.getOutgoing();
+ for (final Link l_1 : _outgoing) {
+ Node _source = l_1.getSource();
+ StateGraphNode _stateGraphNode_6 = _source.getStateGraphNode();
+ StateGraphNode _stateGraphNode_7 = it.getStateGraphNode();
+ boolean _notEquals_1 = (!Objects.equal(_stateGraphNode_6, _stateGraphNode_7));
+ if (_notEquals_1) {
+ logger.logError("ROOM source node of an outgoing transition must be myself");
+ }
+ }
+ }
+
+ public static void checkGraph(final Graph it, final ILogger logger) {
+ StateGraph _stateGraph = it.getStateGraph();
+ boolean _equals = Objects.equal(_stateGraph, null);
+ if (_equals) {
+ logger.logError("graph doesn\'t point to ROOM state graph");
+ } else {
+ StateGraph _stateGraph_1 = it.getStateGraph();
+ boolean _eIsProxy = _stateGraph_1.eIsProxy();
+ if (_eIsProxy) {
+ logger.logError("unresolved ROOM graph");
+ } else {
+ StateGraph _stateGraph_2 = it.getStateGraph();
+ EObject _eContainer = _stateGraph_2.eContainer();
+ boolean _equals_1 = Objects.equal(_eContainer, null);
+ if (_equals_1) {
+ logger.logError("dangling ROOM graph");
+ }
+ }
+ }
+ }
+}
diff --git a/plugins/org.eclipse.etrice.core.genmodel.fsm2/xtend-gen/org/eclipse/etrice/core/genmodel/fsm/FsmGenExtensions.java b/plugins/org.eclipse.etrice.core.genmodel.fsm2/xtend-gen/org/eclipse/etrice/core/genmodel/fsm/FsmGenExtensions.java
new file mode 100644
index 000000000..aa707e4e8
--- /dev/null
+++ b/plugins/org.eclipse.etrice.core.genmodel.fsm2/xtend-gen/org/eclipse/etrice/core/genmodel/fsm/FsmGenExtensions.java
@@ -0,0 +1,154 @@
+/**
+ * Copyright (c) 2017 protos software gmbh (http://www.protos.de).
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * CONTRIBUTORS:
+ * Henrik Rentz-Reichert (initial contribution)
+ */
+package org.eclipse.etrice.core.genmodel.fsm;
+
+import com.google.common.collect.Iterables;
+import com.google.common.collect.Iterators;
+import java.util.Iterator;
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.common.util.TreeIterator;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.etrice.core.fsm.fSM.ChoicePoint;
+import org.eclipse.etrice.core.fsm.fSM.State;
+import org.eclipse.etrice.core.fsm.fSM.StateGraphNode;
+import org.eclipse.etrice.core.fsm.fSM.TrPoint;
+import org.eclipse.etrice.core.genmodel.fsm.fsmgen.Graph;
+import org.eclipse.etrice.core.genmodel.fsm.fsmgen.Link;
+import org.eclipse.etrice.core.genmodel.fsm.fsmgen.Node;
+import org.eclipse.xtext.xbase.lib.Functions.Function1;
+import org.eclipse.xtext.xbase.lib.IterableExtensions;
+import org.eclipse.xtext.xbase.lib.IteratorExtensions;
+
+@SuppressWarnings("all")
+public class FsmGenExtensions {
+ public static String getName(final Node nd) {
+ StateGraphNode _stateGraphNode = nd.getStateGraphNode();
+ return _stateGraphNode.getName();
+ }
+
+ public static Iterable<Node> getStateNodes(final Graph g) {
+ EList<Node> _nodes = g.getNodes();
+ final Function1<Node, Boolean> _function = new Function1<Node, Boolean>() {
+ @Override
+ public Boolean apply(final Node it) {
+ StateGraphNode _stateGraphNode = it.getStateGraphNode();
+ return Boolean.valueOf((_stateGraphNode instanceof State));
+ }
+ };
+ return IterableExtensions.<Node>filter(_nodes, _function);
+ }
+
+ public static Iterator<Node> getAllNodes(final Graph g) {
+ TreeIterator<EObject> _eAllContents = g.eAllContents();
+ return Iterators.<Node>filter(_eAllContents, Node.class);
+ }
+
+ public static Iterator<Node> getAllStateNodes(final Graph g) {
+ Iterator<Node> _allNodes = FsmGenExtensions.getAllNodes(g);
+ final Function1<Node, Boolean> _function = new Function1<Node, Boolean>() {
+ @Override
+ public Boolean apply(final Node it) {
+ StateGraphNode _stateGraphNode = it.getStateGraphNode();
+ return Boolean.valueOf((_stateGraphNode instanceof State));
+ }
+ };
+ return IteratorExtensions.<Node>filter(_allNodes, _function);
+ }
+
+ public static Iterable<Node> getChoicePointNodes(final Graph g) {
+ EList<Node> _nodes = g.getNodes();
+ final Function1<Node, Boolean> _function = new Function1<Node, Boolean>() {
+ @Override
+ public Boolean apply(final Node it) {
+ StateGraphNode _stateGraphNode = it.getStateGraphNode();
+ return Boolean.valueOf((_stateGraphNode instanceof ChoicePoint));
+ }
+ };
+ return IterableExtensions.<Node>filter(_nodes, _function);
+ }
+
+ public static Iterator<Node> getAllChoicePointNodes(final Graph g) {
+ Iterator<Node> _allNodes = FsmGenExtensions.getAllNodes(g);
+ final Function1<Node, Boolean> _function = new Function1<Node, Boolean>() {
+ @Override
+ public Boolean apply(final Node it) {
+ StateGraphNode _stateGraphNode = it.getStateGraphNode();
+ return Boolean.valueOf((_stateGraphNode instanceof ChoicePoint));
+ }
+ };
+ return IteratorExtensions.<Node>filter(_allNodes, _function);
+ }
+
+ public static Iterable<Node> getTrPointNodes(final Graph g) {
+ EList<Node> _nodes = g.getNodes();
+ final Function1<Node, Boolean> _function = new Function1<Node, Boolean>() {
+ @Override
+ public Boolean apply(final Node it) {
+ StateGraphNode _stateGraphNode = it.getStateGraphNode();
+ return Boolean.valueOf((_stateGraphNode instanceof TrPoint));
+ }
+ };
+ return IterableExtensions.<Node>filter(_nodes, _function);
+ }
+
+ public static Iterator<Node> getAllTrPointNodes(final Graph g) {
+ Iterator<Node> _allNodes = FsmGenExtensions.getAllNodes(g);
+ final Function1<Node, Boolean> _function = new Function1<Node, Boolean>() {
+ @Override
+ public Boolean apply(final Node it) {
+ StateGraphNode _stateGraphNode = it.getStateGraphNode();
+ return Boolean.valueOf((_stateGraphNode instanceof TrPoint));
+ }
+ };
+ return IteratorExtensions.<Node>filter(_allNodes, _function);
+ }
+
+ public static Iterable<State> getStates(final Graph g) {
+ Iterable<Node> _stateNodes = FsmGenExtensions.getStateNodes(g);
+ final Function1<Node, StateGraphNode> _function = new Function1<Node, StateGraphNode>() {
+ @Override
+ public StateGraphNode apply(final Node it) {
+ return it.getStateGraphNode();
+ }
+ };
+ Iterable<StateGraphNode> _map = IterableExtensions.<Node, StateGraphNode>map(_stateNodes, _function);
+ return Iterables.<State>filter(_map, State.class);
+ }
+
+ public static Iterable<ChoicePoint> getChoicePoints(final Graph g) {
+ Iterable<Node> _choicePointNodes = FsmGenExtensions.getChoicePointNodes(g);
+ final Function1<Node, StateGraphNode> _function = new Function1<Node, StateGraphNode>() {
+ @Override
+ public StateGraphNode apply(final Node it) {
+ return it.getStateGraphNode();
+ }
+ };
+ Iterable<StateGraphNode> _map = IterableExtensions.<Node, StateGraphNode>map(_choicePointNodes, _function);
+ return Iterables.<ChoicePoint>filter(_map, ChoicePoint.class);
+ }
+
+ public static Iterable<TrPoint> getTransitionPoints(final Graph g) {
+ Iterable<Node> _trPointNodes = FsmGenExtensions.getTrPointNodes(g);
+ final Function1<Node, StateGraphNode> _function = new Function1<Node, StateGraphNode>() {
+ @Override
+ public StateGraphNode apply(final Node it) {
+ return it.getStateGraphNode();
+ }
+ };
+ Iterable<StateGraphNode> _map = IterableExtensions.<Node, StateGraphNode>map(_trPointNodes, _function);
+ return Iterables.<TrPoint>filter(_map, TrPoint.class);
+ }
+
+ public static Iterator<Link> getAllLinks(final Graph g) {
+ TreeIterator<EObject> _eAllContents = g.eAllContents();
+ return Iterators.<Link>filter(_eAllContents, Link.class);
+ }
+}
diff --git a/plugins/org.eclipse.etrice.core.genmodel/plugin.properties b/plugins/org.eclipse.etrice.core.genmodel/plugin.properties
index acbbabf20..07a56b2fa 100644
--- a/plugins/org.eclipse.etrice.core.genmodel/plugin.properties
+++ b/plugins/org.eclipse.etrice.core.genmodel/plugin.properties
@@ -5,4 +5,4 @@
# $Id$
pluginName = eTriceGen Model
-providerName = eTrice
+providerName = Eclipse eTrice
diff --git a/plugins/org.eclipse.etrice.ui.behavior.fsm/src/org/eclipse/etrice/ui/behavior/fsm/support/FSMSupportUtil.java b/plugins/org.eclipse.etrice.ui.behavior.fsm/src/org/eclipse/etrice/ui/behavior/fsm/support/FSMSupportUtil.java
index 999b607e6..406140db9 100644
--- a/plugins/org.eclipse.etrice.ui.behavior.fsm/src/org/eclipse/etrice/ui/behavior/fsm/support/FSMSupportUtil.java
+++ b/plugins/org.eclipse.etrice.ui.behavior.fsm/src/org/eclipse/etrice/ui/behavior/fsm/support/FSMSupportUtil.java
@@ -141,7 +141,8 @@ public class FSMSupportUtil {
return fsmNameProvider;
}
- public EObject getOwnObject(EObject obj, ResourceSet rs) {
+ // TODO: remove unused method
+ private EObject getOwnObject(EObject obj, ResourceSet rs) {
URI uri = EcoreUtil.getURI(obj);
EObject own = rs.getEObject(uri, true);
assert(own!=null): "own object must exist";
@@ -152,6 +153,10 @@ public class FSMSupportUtil {
if(obj instanceof StateGraph)
obj = obj.eContainer();
else if (obj instanceof ModelComponent)
+ // the next line states: if a ModelComponent has no base class, then it is not inherited.
+ // And vice versa: if it has a base class it is inherited
+ // QUESTION: is this correct?
+ // However, this method isn't called with an obj instanceof ModelComponent
return ((ModelComponent) obj).getBase() != null;
return obj instanceof RefinedState || obj instanceof RefinedTransition || !EcoreUtil.isAncestor(getModelComponent(diag), obj);
diff --git a/tests/org.eclipse.etrice.core.fsm.tests/org.eclipse.etrice.core.fsm.tests.launch b/tests/org.eclipse.etrice.core.fsm.tests/org.eclipse.etrice.core.fsm.tests.launch
index 993fee367..c14757c85 100644
--- a/tests/org.eclipse.etrice.core.fsm.tests/org.eclipse.etrice.core.fsm.tests.launch
+++ b/tests/org.eclipse.etrice.core.fsm.tests/org.eclipse.etrice.core.fsm.tests.launch
@@ -8,6 +8,8 @@
</listAttribute>
<stringAttribute key="org.eclipse.jdt.junit.CONTAINER" value="=org.eclipse.etrice.core.fsm.tests"/>
<booleanAttribute key="org.eclipse.jdt.junit.KEEPRUNNING_ATTR" value="false"/>
+<stringAttribute key="org.eclipse.jdt.junit.TESTNAME" value=""/>
<stringAttribute key="org.eclipse.jdt.junit.TEST_KIND" value="org.eclipse.jdt.junit.loader.junit4"/>
+<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value=""/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="org.eclipse.etrice.core.fsm.tests"/>
</launchConfiguration>
diff --git a/tests/org.eclipse.etrice.core.genmodel.fsm.tests/.classpath b/tests/org.eclipse.etrice.core.genmodel.fsm.tests/.classpath
new file mode 100644
index 000000000..325150d24
--- /dev/null
+++ b/tests/org.eclipse.etrice.core.genmodel.fsm.tests/.classpath
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="src" path="xtend-gen"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/tests/org.eclipse.etrice.core.genmodel.fsm.tests/.gitignore b/tests/org.eclipse.etrice.core.genmodel.fsm.tests/.gitignore
new file mode 100644
index 000000000..d567ba01e
--- /dev/null
+++ b/tests/org.eclipse.etrice.core.genmodel.fsm.tests/.gitignore
@@ -0,0 +1,2 @@
+bin
+target
diff --git a/tests/org.eclipse.etrice.core.genmodel.fsm.tests/.project b/tests/org.eclipse.etrice.core.genmodel.fsm.tests/.project
new file mode 100644
index 000000000..0121c5ab5
--- /dev/null
+++ b/tests/org.eclipse.etrice.core.genmodel.fsm.tests/.project
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.etrice.core.genmodel.fsm.tests</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.xtext.ui.shared.xtextBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.eclipse.xtext.ui.shared.xtextNature</nature>
+ </natures>
+</projectDescription>
diff --git a/tests/org.eclipse.etrice.core.genmodel.fsm.tests/.settings/org.eclipse.jdt.core.prefs b/tests/org.eclipse.etrice.core.genmodel.fsm.tests/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 000000000..f42de363a
--- /dev/null
+++ b/tests/org.eclipse.etrice.core.genmodel.fsm.tests/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,7 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
+org.eclipse.jdt.core.compiler.compliance=1.7
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.7
diff --git a/tests/org.eclipse.etrice.core.genmodel.fsm.tests/META-INF/MANIFEST.MF b/tests/org.eclipse.etrice.core.genmodel.fsm.tests/META-INF/MANIFEST.MF
new file mode 100644
index 000000000..3edd0318d
--- /dev/null
+++ b/tests/org.eclipse.etrice.core.genmodel.fsm.tests/META-INF/MANIFEST.MF
@@ -0,0 +1,15 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: FSM GenModel Tests
+Bundle-SymbolicName: org.eclipse.etrice.core.genmodel.fsm.tests
+Bundle-Version: 1.0.0.qualifier
+Bundle-Vendor: Eclipse eTrice
+Bundle-RequiredExecutionEnvironment: JavaSE-1.7
+Require-Bundle: org.junit;bundle-version="4.12.0",
+ org.eclipse.osgi;bundle-version="3.11.2",
+ org.eclipse.core.runtime;bundle-version="3.12.0",
+ org.eclipse.etrice.core.genmodel.fsm2;bundle-version="1.0.0",
+ org.eclipse.etrice.core.room;bundle-version="1.1.0",
+ org.eclipse.etrice.core.room.tests;bundle-version="1.1.0"
+Bundle-Activator: org.eclipse.etrice.core.genmodel.fsm.tests.FSMGenModelTestsActivator
+Bundle-ActivationPolicy: lazy
diff --git a/tests/org.eclipse.etrice.core.genmodel.fsm.tests/build.properties b/tests/org.eclipse.etrice.core.genmodel.fsm.tests/build.properties
new file mode 100644
index 000000000..34d2e4d2d
--- /dev/null
+++ b/tests/org.eclipse.etrice.core.genmodel.fsm.tests/build.properties
@@ -0,0 +1,4 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .
diff --git a/tests/org.eclipse.etrice.core.genmodel.fsm.tests/models/FlatFSMExample.room b/tests/org.eclipse.etrice.core.genmodel.fsm.tests/models/FlatFSMExample.room
new file mode 100644
index 000000000..340c2a2fc
--- /dev/null
+++ b/tests/org.eclipse.etrice.core.genmodel.fsm.tests/models/FlatFSMExample.room
@@ -0,0 +1,52 @@
+RoomModel TemplateModel {
+
+ ActorClass TestActor {
+ Interface {
+ Port p0: PC
+ }
+ Structure {
+ external Port p0
+ }
+ Behavior {
+ StateMachine {
+ State state0
+ State state1
+ State state2
+ State state3
+ TransitionPoint tr4
+ ChoicePoint cp0
+ Transition init0: initial -> state0
+ Transition tr0: state0 -> state1 {
+ triggers {
+ <in1: p0>
+ }
+ }
+ Transition tr1: state1 -> cp cp0 {
+ triggers {
+ <in1: p0>
+ }
+ }
+ Transition tr2: cp cp0 -> state3
+ Transition tr3: cp cp0 -> state2 {
+ cond {
+ "true"
+ }
+ }
+ Transition tr5: my tr4 -> state0 {
+ triggers {
+ <in2: p0>
+ }
+ }
+ }
+ }
+ }
+
+ ProtocolClass PC {
+ incoming {
+ Message in1()
+ Message in2()
+ }
+ outgoing { }
+ }
+
+} \ No newline at end of file
diff --git a/tests/org.eclipse.etrice.core.genmodel.fsm.tests/models/FlatInheritedFSMExample.room b/tests/org.eclipse.etrice.core.genmodel.fsm.tests/models/FlatInheritedFSMExample.room
new file mode 100644
index 000000000..81fca1eaf
--- /dev/null
+++ b/tests/org.eclipse.etrice.core.genmodel.fsm.tests/models/FlatInheritedFSMExample.room
@@ -0,0 +1,73 @@
+RoomModel TemplateModel {
+
+ ActorClass TestActor extends Base {
+ Behavior {
+ StateMachine {
+ State state3
+ RefinedState state1 {
+ entry {
+ "//refined"
+ }
+ }
+ Transition tr2: state1 -> state3 {
+ triggers {
+ <in1: p0>
+ }
+ }
+ RefinedTransition tr0 {
+ action {
+ "//refined"
+ }
+ }
+ State state4
+ State state5
+ Transition tr3: state3 -> state4 {
+ triggers {
+ <in1: p0>
+ }
+ }
+ Transition tr4: state3 -> state5 {
+ triggers {
+ <in2: p0>
+ }
+ }
+ }
+ }
+ }
+
+ ActorClass Base {
+ Interface {
+ Port p0: PC
+ }
+ Structure {
+ external Port p0
+ }
+ Behavior {
+ StateMachine {
+ State state0
+ State state1
+ State state2
+ Transition init0: initial -> state0
+ Transition tr0: state0 -> state1 {
+ triggers {
+ <in1: p0>
+ }
+ }
+ Transition tr1: state1 -> state2 {
+ triggers {
+ <in1: p0>
+ }
+ }
+ }
+ }
+ }
+
+ ProtocolClass PC {
+ incoming {
+ Message in1()
+ Message in2()
+ }
+ outgoing { }
+ }
+
+} \ No newline at end of file
diff --git a/tests/org.eclipse.etrice.core.genmodel.fsm.tests/models/HierFSMExample.room b/tests/org.eclipse.etrice.core.genmodel.fsm.tests/models/HierFSMExample.room
new file mode 100644
index 000000000..93b631180
--- /dev/null
+++ b/tests/org.eclipse.etrice.core.genmodel.fsm.tests/models/HierFSMExample.room
@@ -0,0 +1,58 @@
+RoomModel TemplateModel {
+
+ ActorClass TestActor {
+ Interface {
+ Port p0: PC
+ }
+ Structure {
+ external Port p0
+ }
+ Behavior {
+ StateMachine {
+ State state0
+ State state1 {
+ subgraph {
+ State state1_0
+ State state1_1
+ ExitPoint tr1
+ EntryPoint tr3
+ Transition init0: initial -> state1_0
+ Transition tr0: state1_0 -> state1_1 {
+ triggers {
+ <in1: p0>
+ }
+ }
+ Transition tr2: state1_1 -> my tr1 {
+ triggers {
+ <in1: p0>
+ }
+ }
+ Transition tr4: my tr3 -> state1_1
+ }
+ }
+ State state2
+ Transition init0: initial -> state0
+ Transition tr0: state0 -> state1 {
+ triggers {
+ <in1: p0>
+ }
+ }
+ Transition tr1: tr1 of state1 -> state2
+ Transition tr2: state2 -> tr3 of state1 {
+ triggers {
+ <in1: p0>
+ }
+ }
+ }
+ }
+ }
+
+ ProtocolClass PC {
+ incoming {
+ Message in1()
+ Message in2()
+ }
+ outgoing { }
+ }
+
+} \ No newline at end of file
diff --git a/tests/org.eclipse.etrice.core.genmodel.fsm.tests/models/HierInheritedFSMExample.room b/tests/org.eclipse.etrice.core.genmodel.fsm.tests/models/HierInheritedFSMExample.room
new file mode 100644
index 000000000..dd617289d
--- /dev/null
+++ b/tests/org.eclipse.etrice.core.genmodel.fsm.tests/models/HierInheritedFSMExample.room
@@ -0,0 +1,105 @@
+RoomModel TemplateModel {
+
+
+ abstract ActorClass Base {
+ Interface {
+ Port p0: PC
+ }
+ Structure {
+ external Port p0
+ }
+ Behavior {
+ StateMachine {
+ State state0
+ State state2
+ State state1 {
+ subgraph {
+ EntryPoint tr0
+ ExitPoint tr1
+ Transition init0: initial -> state1_0
+ State state1_0
+ State state1_1
+ Transition tr2: state1_0 -> state1_1 {
+ triggers {
+ <in1: p0>
+ }
+ }
+ }
+ }
+ Transition init0: initial -> state0
+ Transition tr0: state0 -> tr0 of state1 {
+ triggers {
+ <in1: p0>
+ }
+ }
+ Transition tr1: tr1 of state1 -> state2
+ Transition tr2: state2 -> state1 {
+ triggers {
+ <in1: p0>
+ }
+ }
+ }
+ }
+ }
+
+ ActorClass TestActor extends Base {
+ Behavior {
+ StateMachine {
+ RefinedState state1 {
+ subgraph {
+ State state1_2
+ Transition tr4: my tr0 -> state1_2
+ Transition tr5: state1_2 -> my tr1 {
+ triggers {
+ <in1: p0>
+ }
+ }
+ Transition tr6: state1_2 -> state1_0 {
+ triggers {
+ <in2: p0>
+ }
+ }
+ RefinedState state1_1 {
+ subgraph {
+ State state1_1_0
+ State state1_1_1
+ Transition tr1: initial -> state1_1_0
+ Transition tr2: state1_1_0 -> state1_1_1 {
+ triggers {
+ <in1: p0>
+ }
+ }
+ }
+ }
+ }
+ }
+ RefinedState state0 {
+ subgraph {
+ State state0_0
+ Transition tr1: initial -> state0_0
+ }
+ }
+ State state3
+ Transition tr3: state0 -> state3 {
+ triggers {
+ <in2: p0>
+ }
+ }
+ Transition tr4: state3 -> tr0 of state1 {
+ triggers {
+ <in1: p0>
+ }
+ }
+ }
+ }
+ }
+
+ ProtocolClass PC {
+ incoming {
+ Message in1()
+ Message in2()
+ }
+ outgoing { }
+ }
+
+} \ No newline at end of file
diff --git a/tests/org.eclipse.etrice.core.genmodel.fsm.tests/org.eclipse.etrice.core.genmodel.fsm.tests.launch b/tests/org.eclipse.etrice.core.genmodel.fsm.tests/org.eclipse.etrice.core.genmodel.fsm.tests.launch
new file mode 100644
index 000000000..8366abdc5
--- /dev/null
+++ b/tests/org.eclipse.etrice.core.genmodel.fsm.tests/org.eclipse.etrice.core.genmodel.fsm.tests.launch
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<launchConfiguration type="org.eclipse.pde.ui.JunitLaunchConfig">
+<booleanAttribute key="append.args" value="true"/>
+<stringAttribute key="application" value="org.eclipse.pde.junit.runtime.coretestapplication"/>
+<booleanAttribute key="askclear" value="false"/>
+<booleanAttribute key="automaticAdd" value="true"/>
+<booleanAttribute key="automaticValidate" value="true"/>
+<stringAttribute key="bootstrap" value=""/>
+<stringAttribute key="checked" value="[NONE]"/>
+<booleanAttribute key="clearConfig" value="true"/>
+<booleanAttribute key="clearws" value="true"/>
+<booleanAttribute key="clearwslog" value="false"/>
+<stringAttribute key="configLocation" value="${workspace_loc}/.metadata/.plugins/org.eclipse.pde.core/pde-junit"/>
+<booleanAttribute key="default" value="true"/>
+<booleanAttribute key="includeOptional" value="true"/>
+<stringAttribute key="location" value="${workspace_loc}/../junit-workspace"/>
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
+<listEntry value="/org.eclipse.etrice.core.genmodel.fsm.tests"/>
+</listAttribute>
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
+<listEntry value="4"/>
+</listAttribute>
+<stringAttribute key="org.eclipse.jdt.junit.CONTAINER" value="=org.eclipse.etrice.core.genmodel.fsm.tests"/>
+<booleanAttribute key="org.eclipse.jdt.junit.KEEPRUNNING_ATTR" value="false"/>
+<stringAttribute key="org.eclipse.jdt.junit.TESTNAME" value=""/>
+<stringAttribute key="org.eclipse.jdt.junit.TEST_KIND" value="org.eclipse.jdt.junit.loader.junit4"/>
+<booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_START_ON_FIRST_THREAD" value="true"/>
+<stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
+<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value=""/>
+<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-os ${target.os} -ws ${target.ws} -arch ${target.arch} -nl ${target.nl} -consoleLog"/>
+<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="org.eclipse.etrice.core.genmodel.fsm.tests"/>
+<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.pde.ui.workbenchClasspathProvider"/>
+<stringAttribute key="pde.version" value="3.3"/>
+<stringAttribute key="product" value="org.eclipse.epp.package.dsl.product"/>
+<booleanAttribute key="run_in_ui_thread" value="true"/>
+<booleanAttribute key="show_selected_only" value="false"/>
+<stringAttribute key="templateConfig" value="${target_home}\configuration\config.ini"/>
+<booleanAttribute key="tracing" value="false"/>
+<booleanAttribute key="useCustomFeatures" value="false"/>
+<booleanAttribute key="useDefaultConfig" value="true"/>
+<booleanAttribute key="useDefaultConfigArea" value="false"/>
+<booleanAttribute key="useProduct" value="false"/>
+</launchConfiguration>
diff --git a/tests/org.eclipse.etrice.core.genmodel.fsm.tests/output/HierInheritedFSMExample.fsmgen2 b/tests/org.eclipse.etrice.core.genmodel.fsm.tests/output/HierInheritedFSMExample.fsmgen2
new file mode 100644
index 000000000..e8eee7d75
--- /dev/null
+++ b/tests/org.eclipse.etrice.core.genmodel.fsm.tests/output/HierInheritedFSMExample.fsmgen2
@@ -0,0 +1,94 @@
+<?xml version="1.0" encoding="ASCII"?>
+<fsmgen:GraphContainer xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:fsmgen="http://www.eclipse.org/etrice/generator/fsm2">
+ <graph>
+ <nodes inherited="true" outgoing="//@graph/@links.1 //@graph/@links.4" incoming="//@graph/@links.0">
+ <subgraph>
+ <nodes incoming="//@graph/@nodes.0/@subgraph/@links.0">
+ <stateGraphNode href="file:/C:/Users/hrentz/EclipseInstallations/etrice-neon/git/org.eclipse.etrice/tests/org.eclipse.etrice.core.genmodel.fsm.tests/models/HierInheritedFSMExample.room#SimpleState:TestActor$state0$state0_0"/>
+ </nodes>
+ <links target="//@graph/@nodes.0/@subgraph/@nodes.0">
+ <transition href="file:/C:/Users/hrentz/EclipseInstallations/etrice-neon/git/org.eclipse.etrice/tests/org.eclipse.etrice.core.genmodel.fsm.tests/models/HierInheritedFSMExample.room#InitialTransition:TestActor$state0$initial"/>
+ </links>
+ <stateGraph href="file:/C:/Users/hrentz/EclipseInstallations/etrice-neon/git/org.eclipse.etrice/tests/org.eclipse.etrice.core.genmodel.fsm.tests/models/HierInheritedFSMExample.room#StateGraph:TestActor$state0$sg"/>
+ </subgraph>
+ <stateGraphNode href="file:/C:/Users/hrentz/EclipseInstallations/etrice-neon/git/org.eclipse.etrice/tests/org.eclipse.etrice.core.genmodel.fsm.tests/models/HierInheritedFSMExample.room#RefinedState:TestActor$state0"/>
+ </nodes>
+ <nodes inherited="true" outgoing="//@graph/@links.3" incoming="//@graph/@links.2">
+ <stateGraphNode href="file:/C:/Users/hrentz/EclipseInstallations/etrice-neon/git/org.eclipse.etrice/tests/org.eclipse.etrice.core.genmodel.fsm.tests/models/HierInheritedFSMExample.room#SimpleState:Base$state2"/>
+ </nodes>
+ <nodes inherited="true" incoming="//@graph/@links.3">
+ <subgraph>
+ <nodes inherited="true" outgoing="//@graph/@nodes.2/@subgraph/@links.2" incoming="//@graph/@links.1 //@graph/@links.5">
+ <stateGraphNode href="file:/C:/Users/hrentz/EclipseInstallations/etrice-neon/git/org.eclipse.etrice/tests/org.eclipse.etrice.core.genmodel.fsm.tests/models/HierInheritedFSMExample.room#EntryPoint:Base$state1$tr0"/>
+ </nodes>
+ <nodes inherited="true" outgoing="//@graph/@links.2" incoming="//@graph/@nodes.2/@subgraph/@links.3">
+ <stateGraphNode href="file:/C:/Users/hrentz/EclipseInstallations/etrice-neon/git/org.eclipse.etrice/tests/org.eclipse.etrice.core.genmodel.fsm.tests/models/HierInheritedFSMExample.room#ExitPoint:Base$state1$tr1"/>
+ </nodes>
+ <nodes inherited="true" outgoing="//@graph/@nodes.2/@subgraph/@links.1" incoming="//@graph/@nodes.2/@subgraph/@links.0 //@graph/@nodes.2/@subgraph/@links.4">
+ <stateGraphNode href="file:/C:/Users/hrentz/EclipseInstallations/etrice-neon/git/org.eclipse.etrice/tests/org.eclipse.etrice.core.genmodel.fsm.tests/models/HierInheritedFSMExample.room#SimpleState:Base$state1$state1_0"/>
+ </nodes>
+ <nodes inherited="true" incoming="//@graph/@nodes.2/@subgraph/@links.1">
+ <subgraph>
+ <nodes outgoing="//@graph/@nodes.2/@subgraph/@nodes.3/@subgraph/@links.1" incoming="//@graph/@nodes.2/@subgraph/@nodes.3/@subgraph/@links.0">
+ <stateGraphNode href="file:/C:/Users/hrentz/EclipseInstallations/etrice-neon/git/org.eclipse.etrice/tests/org.eclipse.etrice.core.genmodel.fsm.tests/models/HierInheritedFSMExample.room#SimpleState:TestActor$state1$state1_1$state1_1_0"/>
+ </nodes>
+ <nodes incoming="//@graph/@nodes.2/@subgraph/@nodes.3/@subgraph/@links.1">
+ <stateGraphNode href="file:/C:/Users/hrentz/EclipseInstallations/etrice-neon/git/org.eclipse.etrice/tests/org.eclipse.etrice.core.genmodel.fsm.tests/models/HierInheritedFSMExample.room#SimpleState:TestActor$state1$state1_1$state1_1_1"/>
+ </nodes>
+ <links target="//@graph/@nodes.2/@subgraph/@nodes.3/@subgraph/@nodes.0">
+ <transition href="file:/C:/Users/hrentz/EclipseInstallations/etrice-neon/git/org.eclipse.etrice/tests/org.eclipse.etrice.core.genmodel.fsm.tests/models/HierInheritedFSMExample.room#InitialTransition:TestActor$state1$state1_1$initial"/>
+ </links>
+ <links source="//@graph/@nodes.2/@subgraph/@nodes.3/@subgraph/@nodes.0" target="//@graph/@nodes.2/@subgraph/@nodes.3/@subgraph/@nodes.1">
+ <transition href="file:/C:/Users/hrentz/EclipseInstallations/etrice-neon/git/org.eclipse.etrice/tests/org.eclipse.etrice.core.genmodel.fsm.tests/models/HierInheritedFSMExample.room#TriggeredTransition:TestActor$state1$state1_1$tr2"/>
+ </links>
+ <stateGraph href="file:/C:/Users/hrentz/EclipseInstallations/etrice-neon/git/org.eclipse.etrice/tests/org.eclipse.etrice.core.genmodel.fsm.tests/models/HierInheritedFSMExample.room#StateGraph:TestActor$state1$state1_1$sg"/>
+ </subgraph>
+ <stateGraphNode href="file:/C:/Users/hrentz/EclipseInstallations/etrice-neon/git/org.eclipse.etrice/tests/org.eclipse.etrice.core.genmodel.fsm.tests/models/HierInheritedFSMExample.room#RefinedState:TestActor$state1$state1_1"/>
+ </nodes>
+ <nodes outgoing="//@graph/@nodes.2/@subgraph/@links.3 //@graph/@nodes.2/@subgraph/@links.4" incoming="//@graph/@nodes.2/@subgraph/@links.2">
+ <stateGraphNode href="file:/C:/Users/hrentz/EclipseInstallations/etrice-neon/git/org.eclipse.etrice/tests/org.eclipse.etrice.core.genmodel.fsm.tests/models/HierInheritedFSMExample.room#SimpleState:TestActor$state1$state1_2"/>
+ </nodes>
+ <links inherited="true" target="//@graph/@nodes.2/@subgraph/@nodes.2">
+ <transition href="file:/C:/Users/hrentz/EclipseInstallations/etrice-neon/git/org.eclipse.etrice/tests/org.eclipse.etrice.core.genmodel.fsm.tests/models/HierInheritedFSMExample.room#InitialTransition:Base$state1$initial"/>
+ </links>
+ <links inherited="true" source="//@graph/@nodes.2/@subgraph/@nodes.2" target="//@graph/@nodes.2/@subgraph/@nodes.3">
+ <transition href="file:/C:/Users/hrentz/EclipseInstallations/etrice-neon/git/org.eclipse.etrice/tests/org.eclipse.etrice.core.genmodel.fsm.tests/models/HierInheritedFSMExample.room#TriggeredTransition:Base$state1$tr2"/>
+ </links>
+ <links source="//@graph/@nodes.2/@subgraph/@nodes.0" target="//@graph/@nodes.2/@subgraph/@nodes.4">
+ <transition href="file:/C:/Users/hrentz/EclipseInstallations/etrice-neon/git/org.eclipse.etrice/tests/org.eclipse.etrice.core.genmodel.fsm.tests/models/HierInheritedFSMExample.room#ContinuationTransition:TestActor$state1$tr4"/>
+ </links>
+ <links source="//@graph/@nodes.2/@subgraph/@nodes.4" target="//@graph/@nodes.2/@subgraph/@nodes.1">
+ <transition href="file:/C:/Users/hrentz/EclipseInstallations/etrice-neon/git/org.eclipse.etrice/tests/org.eclipse.etrice.core.genmodel.fsm.tests/models/HierInheritedFSMExample.room#TriggeredTransition:TestActor$state1$tr5"/>
+ </links>
+ <links source="//@graph/@nodes.2/@subgraph/@nodes.4" target="//@graph/@nodes.2/@subgraph/@nodes.2">
+ <transition href="file:/C:/Users/hrentz/EclipseInstallations/etrice-neon/git/org.eclipse.etrice/tests/org.eclipse.etrice.core.genmodel.fsm.tests/models/HierInheritedFSMExample.room#TriggeredTransition:TestActor$state1$tr6"/>
+ </links>
+ <stateGraph href="file:/C:/Users/hrentz/EclipseInstallations/etrice-neon/git/org.eclipse.etrice/tests/org.eclipse.etrice.core.genmodel.fsm.tests/models/HierInheritedFSMExample.room#StateGraph:TestActor$state1$sg"/>
+ </subgraph>
+ <stateGraphNode href="file:/C:/Users/hrentz/EclipseInstallations/etrice-neon/git/org.eclipse.etrice/tests/org.eclipse.etrice.core.genmodel.fsm.tests/models/HierInheritedFSMExample.room#RefinedState:TestActor$state1"/>
+ </nodes>
+ <nodes outgoing="//@graph/@links.5" incoming="//@graph/@links.4">
+ <stateGraphNode href="file:/C:/Users/hrentz/EclipseInstallations/etrice-neon/git/org.eclipse.etrice/tests/org.eclipse.etrice.core.genmodel.fsm.tests/models/HierInheritedFSMExample.room#SimpleState:TestActor$state3"/>
+ </nodes>
+ <links inherited="true" target="//@graph/@nodes.0">
+ <transition href="file:/C:/Users/hrentz/EclipseInstallations/etrice-neon/git/org.eclipse.etrice/tests/org.eclipse.etrice.core.genmodel.fsm.tests/models/HierInheritedFSMExample.room#InitialTransition:Base$initial"/>
+ </links>
+ <links inherited="true" source="//@graph/@nodes.0" target="//@graph/@nodes.2/@subgraph/@nodes.0">
+ <transition href="file:/C:/Users/hrentz/EclipseInstallations/etrice-neon/git/org.eclipse.etrice/tests/org.eclipse.etrice.core.genmodel.fsm.tests/models/HierInheritedFSMExample.room#TriggeredTransition:Base$tr0"/>
+ </links>
+ <links inherited="true" source="//@graph/@nodes.2/@subgraph/@nodes.1" target="//@graph/@nodes.1">
+ <transition href="file:/C:/Users/hrentz/EclipseInstallations/etrice-neon/git/org.eclipse.etrice/tests/org.eclipse.etrice.core.genmodel.fsm.tests/models/HierInheritedFSMExample.room#ContinuationTransition:Base$tr1"/>
+ </links>
+ <links inherited="true" source="//@graph/@nodes.1" target="//@graph/@nodes.2">
+ <transition href="file:/C:/Users/hrentz/EclipseInstallations/etrice-neon/git/org.eclipse.etrice/tests/org.eclipse.etrice.core.genmodel.fsm.tests/models/HierInheritedFSMExample.room#TriggeredTransition:Base$tr2"/>
+ </links>
+ <links source="//@graph/@nodes.0" target="//@graph/@nodes.3">
+ <transition href="file:/C:/Users/hrentz/EclipseInstallations/etrice-neon/git/org.eclipse.etrice/tests/org.eclipse.etrice.core.genmodel.fsm.tests/models/HierInheritedFSMExample.room#TriggeredTransition:TestActor$tr3"/>
+ </links>
+ <links source="//@graph/@nodes.3" target="//@graph/@nodes.2/@subgraph/@nodes.0">
+ <transition href="file:/C:/Users/hrentz/EclipseInstallations/etrice-neon/git/org.eclipse.etrice/tests/org.eclipse.etrice.core.genmodel.fsm.tests/models/HierInheritedFSMExample.room#TriggeredTransition:TestActor$tr4"/>
+ </links>
+ <stateGraph href="file:/C:/Users/hrentz/EclipseInstallations/etrice-neon/git/org.eclipse.etrice/tests/org.eclipse.etrice.core.genmodel.fsm.tests/models/HierInheritedFSMExample.room#StateGraph:TestActor$sg"/>
+ </graph>
+ <component href="file:/C:/Users/hrentz/EclipseInstallations/etrice-neon/git/org.eclipse.etrice/tests/org.eclipse.etrice.core.genmodel.fsm.tests/models/HierInheritedFSMExample.room#ActorClass:TestActor"/>
+</fsmgen:GraphContainer>
diff --git a/tests/org.eclipse.etrice.core.genmodel.fsm.tests/src/org/eclipse/etrice/core/genmodel/fsm/tests/FSMGenModelTestsActivator.java b/tests/org.eclipse.etrice.core.genmodel.fsm.tests/src/org/eclipse/etrice/core/genmodel/fsm/tests/FSMGenModelTestsActivator.java
new file mode 100644
index 000000000..c947ef93f
--- /dev/null
+++ b/tests/org.eclipse.etrice.core.genmodel.fsm.tests/src/org/eclipse/etrice/core/genmodel/fsm/tests/FSMGenModelTestsActivator.java
@@ -0,0 +1,37 @@
+package org.eclipse.etrice.core.genmodel.fsm.tests;
+
+import org.eclipse.core.runtime.Plugin;
+import org.eclipse.emf.ecore.util.Diagnostician;
+import org.eclipse.etrice.core.RoomStandaloneSetup;
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+
+import com.google.inject.Inject;
+import com.google.inject.Injector;
+
+public class FSMGenModelTestsActivator extends Plugin implements BundleActivator {
+
+ private static FSMGenModelTestsActivator instance = null;
+
+ @Inject
+ private Diagnostician diagnostician;
+
+ public static FSMGenModelTestsActivator getInstance() {
+ return instance;
+ }
+
+ @Override
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+
+ instance = this;
+
+ Injector injector = new RoomStandaloneSetup().createInjectorAndDoEMFRegistration();
+ injector.injectMembers(this);
+ }
+
+ public Diagnostician getDiagnostician() {
+ return diagnostician;
+ }
+
+}
diff --git a/tests/org.eclipse.etrice.core.genmodel.fsm.tests/src/org/eclipse/etrice/core/genmodel/fsm/tests/FsmGenTestBase.xtend b/tests/org.eclipse.etrice.core.genmodel.fsm.tests/src/org/eclipse/etrice/core/genmodel/fsm/tests/FsmGenTestBase.xtend
new file mode 100644
index 000000000..57de115da
--- /dev/null
+++ b/tests/org.eclipse.etrice.core.genmodel.fsm.tests/src/org/eclipse/etrice/core/genmodel/fsm/tests/FsmGenTestBase.xtend
@@ -0,0 +1,46 @@
+/*******************************************************************************
+ * Copyright (c) 2011 protos software gmbh (http://www.protos.de).
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * CONTRIBUTORS:
+ * hrr@protos.de (initial contribution)
+ *
+ *******************************************************************************/
+
+package org.eclipse.etrice.core.genmodel.fsm.tests
+
+import org.eclipse.emf.ecore.resource.Resource
+import org.eclipse.etrice.core.RoomStandaloneSetup
+import org.eclipse.etrice.core.TestBase
+import org.eclipse.etrice.core.genmodel.fsm.FsmGenBuilder
+import org.eclipse.etrice.core.room.ActorClass
+import org.eclipse.etrice.core.room.RoomModel
+import org.eclipse.etrice.core.genmodel.fsm.fsmgen.GraphContainer
+import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl
+import org.eclipse.emf.common.util.URI
+
+class FsmGenTestBase extends TestBase {
+
+ protected Resource res = null
+ protected ActorClass actor
+
+ protected def getGraphContainer(String roomFile, String actorName) {
+ prepare(FSMGenModelTestsActivator.getInstance().getBundle())
+ res = getResource(roomFile)
+ actor = (res.contents.get(0) as RoomModel).actorClasses.findFirst[name.equals(actorName)]
+ val injector = new RoomStandaloneSetup().createInjectorAndDoEMFRegistration()
+ val FsmGenBuilder builder = new FsmGenBuilder(injector)
+ builder.createTransformedModel(actor)
+ }
+
+ protected def save(GraphContainer gc, String fileName) {
+ val rs = new ResourceSetImpl
+ val uri = URI.createFileURI("./output/" + fileName + ".fsmgen2")
+ val res = rs.createResource(uri)
+ res.contents.add(gc)
+ res.save(newHashMap)
+ }
+} \ No newline at end of file
diff --git a/tests/org.eclipse.etrice.core.genmodel.fsm.tests/src/org/eclipse/etrice/core/genmodel/fsm/tests/TestFlatFSM.xtend b/tests/org.eclipse.etrice.core.genmodel.fsm.tests/src/org/eclipse/etrice/core/genmodel/fsm/tests/TestFlatFSM.xtend
new file mode 100644
index 000000000..977a8b0ea
--- /dev/null
+++ b/tests/org.eclipse.etrice.core.genmodel.fsm.tests/src/org/eclipse/etrice/core/genmodel/fsm/tests/TestFlatFSM.xtend
@@ -0,0 +1,78 @@
+/*******************************************************************************
+ * Copyright (c) 2017 protos software gmbh (http://www.protos.de).
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * CONTRIBUTORS:
+ * Henrik Rentz-Reichert (initial contribution)
+ *
+ *******************************************************************************/
+
+package org.eclipse.etrice.core.genmodel.fsm.tests
+
+import org.eclipse.etrice.core.fsm.fSM.ChoicePoint
+import org.eclipse.etrice.core.fsm.fSM.State
+import org.eclipse.etrice.core.fsm.fSM.TrPoint
+import org.eclipse.etrice.core.genmodel.fsm.FsmGenChecker
+import org.eclipse.etrice.core.genmodel.fsm.NullLogger
+import org.eclipse.etrice.core.genmodel.fsm.fsmgen.GraphContainer
+import org.junit.Before
+import org.junit.Test
+
+import static org.junit.Assert.assertEquals
+import static org.junit.Assert.assertFalse
+import static org.junit.Assert.assertNotNull
+
+import static extension org.eclipse.etrice.core.genmodel.fsm.FsmGenExtensions.*
+
+class TestFlatFSM extends FsmGenTestBase {
+
+ GraphContainer gc
+
+ @Before
+ def void SetUp() {
+ gc = getGraphContainer("FlatFSMExample.room", "TestActor")
+ assertNotNull("graph context was created", gc)
+ val logger = new NullLogger
+ FsmGenChecker.check(gc, logger)
+ assertFalse("logger has no errors", logger.hasErrors)
+ }
+
+ @Test
+ def void testFlatFSMItemCounts() {
+ assertEquals("number of nodes", 6, gc.graph.nodes.size)
+ assertEquals("number of links", 6, gc.graph.links.size)
+ assertEquals("number of states", 4, gc.graph.nodes.filter[stateGraphNode instanceof State].size)
+ assertEquals("number of tr points", 1, gc.graph.nodes.filter[stateGraphNode instanceof TrPoint].size)
+ assertEquals("number of choice points", 1, gc.graph.nodes.filter[stateGraphNode instanceof ChoicePoint].size)
+ }
+
+ @Test
+ def void testFlatFSMState1Connections() {
+ val s1 = gc.graph.stateNodes.filter[name.equals("state1")].head
+ assertNotNull("state found", s1)
+
+ assertEquals("incoming links", 1, s1.incoming.size)
+ assertEquals("outgoing links", 1, s1.outgoing.size)
+ }
+
+ @Test
+ def void testFlatFSMState3Connections() {
+ val s3 = gc.graph.stateNodes.filter[name.equals("state3")].head
+ assertNotNull("state found", s3)
+
+ assertEquals("incoming links", 1, s3.incoming.size)
+ assertEquals("outgoing links", 0, s3.outgoing.size)
+ }
+
+ @Test
+ def void testFlatFSMCPConnections() {
+ val cp = gc.graph.choicePointNodes.filter[name.equals("cp0")].head
+ assertNotNull("choice point found", cp)
+
+ assertEquals("incoming links", 1, cp.incoming.size)
+ assertEquals("outgoing links", 2, cp.outgoing.size)
+ }
+} \ No newline at end of file
diff --git a/tests/org.eclipse.etrice.core.genmodel.fsm.tests/src/org/eclipse/etrice/core/genmodel/fsm/tests/TestFlatInheritedFSM.xtend b/tests/org.eclipse.etrice.core.genmodel.fsm.tests/src/org/eclipse/etrice/core/genmodel/fsm/tests/TestFlatInheritedFSM.xtend
new file mode 100644
index 000000000..fadf00a4d
--- /dev/null
+++ b/tests/org.eclipse.etrice.core.genmodel.fsm.tests/src/org/eclipse/etrice/core/genmodel/fsm/tests/TestFlatInheritedFSM.xtend
@@ -0,0 +1,70 @@
+/*******************************************************************************
+ * Copyright (c) 2017 protos software gmbh (http://www.protos.de).
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * CONTRIBUTORS:
+ * Henrik Rentz-Reichert (initial contribution)
+ *
+ *******************************************************************************/
+
+package org.eclipse.etrice.core.genmodel.fsm.tests
+
+import org.eclipse.etrice.core.fsm.fSM.RefinedState
+import org.eclipse.etrice.core.genmodel.fsm.fsmgen.GraphContainer
+import org.junit.Before
+import org.junit.Test
+
+import static org.junit.Assert.assertEquals
+import static org.junit.Assert.assertNotNull
+import static org.junit.Assert.assertTrue
+import static org.junit.Assert.assertFalse
+
+import static extension org.eclipse.etrice.core.genmodel.fsm.FsmGenExtensions.*
+import org.eclipse.etrice.core.genmodel.fsm.NullLogger
+import org.eclipse.etrice.core.genmodel.fsm.FsmGenChecker
+
+class TestFlatInheritedFSM extends FsmGenTestBase {
+
+ GraphContainer gc
+
+ @Before
+ def void SetUp() {
+ gc = getGraphContainer("FlatInheritedFSMExample.room", "TestActor")
+ assertNotNull("graph context was created", gc)
+ val logger = new NullLogger
+ FsmGenChecker.check(gc, logger)
+ assertFalse("logger has no errors", logger.hasErrors)
+ }
+
+ @Test
+ def void testFlatInheritedFSMItemCounts() {
+ assertEquals("number of nodes", 6, gc.graph.nodes.size)
+ assertEquals("number of links", 6, gc.graph.links.size)
+ assertEquals("number of states", 6, gc.graph.stateNodes.size)
+ assertEquals("number of tr points", 0, gc.graph.trPointNodes.size)
+ assertEquals("number of choice points", 0, gc.graph.choicePointNodes.size)
+ }
+
+ @Test
+ def void testFlatInheritedFSMState0Connections() {
+ val s = gc.graph.stateNodes.filter[name.equals("state0")].head
+ assertNotNull("state found", s)
+
+ assertEquals("incoming links", 1, s.incoming.size)
+ assertEquals("outgoing links", 1, s.outgoing.size)
+ }
+
+ @Test
+ def void testHierFSMPointersIntoOriginalFSM() {
+ val n = gc.graph.stateNodes.filter[name.equals("state1")].head
+ val s = actor.stateMachine.states.filter[name.equals("state1")].head
+
+ assertNotNull("node found", n)
+ assertNotNull("state found", s)
+ assertTrue("RefinedState expected", n.stateGraphNode instanceof RefinedState)
+ assertEquals("correct target", s, n.stateGraphNode)
+ }
+} \ No newline at end of file
diff --git a/tests/org.eclipse.etrice.core.genmodel.fsm.tests/src/org/eclipse/etrice/core/genmodel/fsm/tests/TestHierFSM.xtend b/tests/org.eclipse.etrice.core.genmodel.fsm.tests/src/org/eclipse/etrice/core/genmodel/fsm/tests/TestHierFSM.xtend
new file mode 100644
index 000000000..db3793243
--- /dev/null
+++ b/tests/org.eclipse.etrice.core.genmodel.fsm.tests/src/org/eclipse/etrice/core/genmodel/fsm/tests/TestHierFSM.xtend
@@ -0,0 +1,82 @@
+/*******************************************************************************
+ * Copyright (c) 2017 protos software gmbh (http://www.protos.de).
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * CONTRIBUTORS:
+ * Henrik Rentz-Reichert (initial contribution)
+ *
+ *******************************************************************************/
+
+package org.eclipse.etrice.core.genmodel.fsm.tests
+
+import org.eclipse.etrice.core.fsm.fSM.SimpleState
+import org.eclipse.etrice.core.genmodel.fsm.FsmGenChecker
+import org.eclipse.etrice.core.genmodel.fsm.NullLogger
+import org.eclipse.etrice.core.genmodel.fsm.fsmgen.GraphContainer
+import org.junit.Before
+import org.junit.Test
+
+import static org.junit.Assert.assertEquals
+import static org.junit.Assert.assertFalse
+import static org.junit.Assert.assertNotNull
+import static org.junit.Assert.assertTrue
+
+import static extension org.eclipse.etrice.core.genmodel.fsm.FsmGenExtensions.*
+
+class TestHierFSM extends FsmGenTestBase {
+
+ GraphContainer gc
+
+ @Before
+ def void SetUp() {
+ gc = getGraphContainer("HierFSMExample.room", "TestActor")
+ assertNotNull("graph context was created", gc)
+ val logger = new NullLogger
+ FsmGenChecker.check(gc, logger)
+ assertFalse("logger has no errors", logger.hasErrors)
+ }
+
+ @Test
+ def void testHierFSMItemCounts() {
+ assertEquals("number of nodes", 3, gc.graph.nodes.size)
+ assertEquals("number of links", 4, gc.graph.links.size)
+ assertEquals("number of states", 3, gc.graph.stateNodes.size)
+ assertEquals("number of tr points", 0, gc.graph.trPointNodes.size)
+ assertEquals("number of choice points", 0, gc.graph.choicePointNodes.size)
+ }
+
+ @Test
+ def void testHierFSMSubGraphItemCounts() {
+ val subGraph = gc.graph.stateNodes.filter[name.equals("state1")].head.subgraph
+
+ assertEquals("number of nodes", 4, subGraph.nodes.size)
+ assertEquals("number of links", 4, subGraph.links.size)
+ assertEquals("number of states", 2, subGraph.stateNodes.size)
+ assertEquals("number of tr points", 2, subGraph.trPointNodes.size)
+ assertEquals("number of choice points", 0, subGraph.choicePointNodes.size)
+ }
+
+ @Test
+ def void testHierFSMState1_1Connections() {
+ val subGraph = gc.graph.stateNodes.filter[name.equals("state1")].head.subgraph
+ val s1_1 = subGraph.stateNodes.filter[name.equals("state1_1")].head
+ assertNotNull("state found", s1_1)
+
+ assertEquals("incoming links", 2, s1_1.incoming.size)
+ assertEquals("outgoing links", 1, s1_1.outgoing.size)
+ }
+
+ @Test
+ def void testHierFSMPointersIntoOriginalFSM() {
+ val n = gc.graph.stateNodes.filter[name.equals("state1")].head
+ val s = actor.stateMachine.states.filter[name.equals("state1")].head
+
+ assertNotNull("node found", n)
+ assertNotNull("state found", s)
+ assertTrue("State expected", n.stateGraphNode instanceof SimpleState)
+ assertEquals("correct target", s, n.stateGraphNode)
+ }
+} \ No newline at end of file
diff --git a/tests/org.eclipse.etrice.core.genmodel.fsm.tests/src/org/eclipse/etrice/core/genmodel/fsm/tests/TestHierInheritedFSM.xtend b/tests/org.eclipse.etrice.core.genmodel.fsm.tests/src/org/eclipse/etrice/core/genmodel/fsm/tests/TestHierInheritedFSM.xtend
new file mode 100644
index 000000000..0392ef48c
--- /dev/null
+++ b/tests/org.eclipse.etrice.core.genmodel.fsm.tests/src/org/eclipse/etrice/core/genmodel/fsm/tests/TestHierInheritedFSM.xtend
@@ -0,0 +1,69 @@
+/*******************************************************************************
+ * Copyright (c) 2017 protos software gmbh (http://www.protos.de).
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * CONTRIBUTORS:
+ * Henrik Rentz-Reichert (initial contribution)
+ *
+ *******************************************************************************/
+
+package org.eclipse.etrice.core.genmodel.fsm.tests
+
+import org.eclipse.etrice.core.genmodel.fsm.FsmGenChecker
+import org.eclipse.etrice.core.genmodel.fsm.NullLogger
+import org.eclipse.etrice.core.genmodel.fsm.fsmgen.GraphContainer
+import org.junit.Before
+import org.junit.Test
+
+import static org.junit.Assert.assertEquals
+import static org.junit.Assert.assertFalse
+import static org.junit.Assert.assertNotNull
+
+import static extension org.eclipse.etrice.core.genmodel.fsm.FsmGenExtensions.*
+
+class TestHierInheritedFSM extends FsmGenTestBase {
+
+ GraphContainer gc
+
+ @Before
+ def void SetUp() {
+ gc = getGraphContainer("HierInheritedFSMExample.room", "TestActor")
+ assertNotNull("graph context was created", gc)
+
+ val logger = new NullLogger
+ FsmGenChecker.check(gc, logger)
+ assertFalse("logger has no errors", logger.hasErrors)
+
+ save(gc, "HierInheritedFSMExample")
+ }
+
+ @Test
+ def void testHierInheritedFSMItemCounts() {
+ assertEquals("number of nodes", 4, gc.graph.nodes.size)
+ assertEquals("number of links", 6, gc.graph.links.size)
+ assertEquals("number of states", 4, gc.graph.stateNodes.size)
+ assertEquals("number of tr points", 0, gc.graph.trPointNodes.size)
+ assertEquals("number of choice points", 0, gc.graph.choicePointNodes.size)
+ }
+
+ @Test
+ def void testHierInheritedFSMDeepItemCounts() {
+ assertEquals("number of nodes", 12, gc.graph.allNodes.size)
+ assertEquals("number of links", 14, gc.graph.allLinks.size)
+ assertEquals("number of states", 10, gc.graph.allStateNodes.size)
+ assertEquals("number of tr points", 2, gc.graph.allTrPointNodes.size)
+ assertEquals("number of choice points", 0, gc.graph.allChoicePointNodes.size)
+ }
+
+ @Test
+ def void testHierInheritedFSMLinks() {
+ val s = gc.graph.allStateNodes.filter[name.equals("state1_0")].head
+ assertNotNull("state found", s)
+
+ assertEquals("incoming links", 2, s.incoming.size)
+ assertEquals("outgoing links", 1, s.outgoing.size)
+ }
+} \ No newline at end of file
diff --git a/tests/org.eclipse.etrice.core.genmodel.fsm.tests/xtend-gen/org/eclipse/etrice/core/genmodel/fsm/tests/.gitignore b/tests/org.eclipse.etrice.core.genmodel.fsm.tests/xtend-gen/org/eclipse/etrice/core/genmodel/fsm/tests/.gitignore
new file mode 100644
index 000000000..0ab9915f8
--- /dev/null
+++ b/tests/org.eclipse.etrice.core.genmodel.fsm.tests/xtend-gen/org/eclipse/etrice/core/genmodel/fsm/tests/.gitignore
@@ -0,0 +1,5 @@
+/FsmGenTestBase.java
+/TestFlatFSM.java
+/TestFlatInheritedFSM.java
+/TestHierFSM.java
+/TestHierInheritedFSM.java
diff --git a/tests/org.eclipse.etrice.core.genmodel.fsm.tests/xtend-gen/org/eclipse/etrice/core/genmodel/fsm/tests/FsmGenTestBase.java b/tests/org.eclipse.etrice.core.genmodel.fsm.tests/xtend-gen/org/eclipse/etrice/core/genmodel/fsm/tests/FsmGenTestBase.java
new file mode 100644
index 000000000..143c2fbc2
--- /dev/null
+++ b/tests/org.eclipse.etrice.core.genmodel.fsm.tests/xtend-gen/org/eclipse/etrice/core/genmodel/fsm/tests/FsmGenTestBase.java
@@ -0,0 +1,80 @@
+/**
+ * Copyright (c) 2011 protos software gmbh (http://www.protos.de).
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * CONTRIBUTORS:
+ * hrr@protos.de (initial contribution)
+ */
+package org.eclipse.etrice.core.genmodel.fsm.tests;
+
+import com.google.inject.Injector;
+import java.util.HashMap;
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
+import org.eclipse.etrice.core.RoomStandaloneSetup;
+import org.eclipse.etrice.core.TestBase;
+import org.eclipse.etrice.core.genmodel.fsm.FsmGenBuilder;
+import org.eclipse.etrice.core.genmodel.fsm.fsmgen.GraphContainer;
+import org.eclipse.etrice.core.genmodel.fsm.tests.FSMGenModelTestsActivator;
+import org.eclipse.etrice.core.room.ActorClass;
+import org.eclipse.etrice.core.room.RoomModel;
+import org.eclipse.xtext.xbase.lib.CollectionLiterals;
+import org.eclipse.xtext.xbase.lib.Exceptions;
+import org.eclipse.xtext.xbase.lib.Functions.Function1;
+import org.eclipse.xtext.xbase.lib.IterableExtensions;
+import org.osgi.framework.Bundle;
+
+@SuppressWarnings("all")
+public class FsmGenTestBase extends TestBase {
+ protected Resource res = null;
+
+ protected ActorClass actor;
+
+ protected GraphContainer getGraphContainer(final String roomFile, final String actorName) {
+ GraphContainer _xblockexpression = null;
+ {
+ FSMGenModelTestsActivator _instance = FSMGenModelTestsActivator.getInstance();
+ Bundle _bundle = _instance.getBundle();
+ this.prepare(_bundle);
+ Resource _resource = this.getResource(roomFile);
+ this.res = _resource;
+ EList<EObject> _contents = this.res.getContents();
+ EObject _get = _contents.get(0);
+ EList<ActorClass> _actorClasses = ((RoomModel) _get).getActorClasses();
+ final Function1<ActorClass, Boolean> _function = new Function1<ActorClass, Boolean>() {
+ @Override
+ public Boolean apply(final ActorClass it) {
+ String _name = it.getName();
+ return Boolean.valueOf(_name.equals(actorName));
+ }
+ };
+ ActorClass _findFirst = IterableExtensions.<ActorClass>findFirst(_actorClasses, _function);
+ this.actor = _findFirst;
+ RoomStandaloneSetup _roomStandaloneSetup = new RoomStandaloneSetup();
+ final Injector injector = _roomStandaloneSetup.createInjectorAndDoEMFRegistration();
+ final FsmGenBuilder builder = new FsmGenBuilder(injector);
+ _xblockexpression = builder.createTransformedModel(this.actor);
+ }
+ return _xblockexpression;
+ }
+
+ protected void save(final GraphContainer gc, final String fileName) {
+ try {
+ final ResourceSetImpl rs = new ResourceSetImpl();
+ final URI uri = URI.createFileURI((("./output/" + fileName) + ".fsmgen2"));
+ final Resource res = rs.createResource(uri);
+ EList<EObject> _contents = res.getContents();
+ _contents.add(gc);
+ HashMap<Object, Object> _newHashMap = CollectionLiterals.<Object, Object>newHashMap();
+ res.save(_newHashMap);
+ } catch (Throwable _e) {
+ throw Exceptions.sneakyThrow(_e);
+ }
+ }
+}
diff --git a/tests/org.eclipse.etrice.core.genmodel.fsm.tests/xtend-gen/org/eclipse/etrice/core/genmodel/fsm/tests/TestFlatFSM.java b/tests/org.eclipse.etrice.core.genmodel.fsm.tests/xtend-gen/org/eclipse/etrice/core/genmodel/fsm/tests/TestFlatFSM.java
new file mode 100644
index 000000000..2fbf3946b
--- /dev/null
+++ b/tests/org.eclipse.etrice.core.genmodel.fsm.tests/xtend-gen/org/eclipse/etrice/core/genmodel/fsm/tests/TestFlatFSM.java
@@ -0,0 +1,160 @@
+/**
+ * Copyright (c) 2017 protos software gmbh (http://www.protos.de).
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * CONTRIBUTORS:
+ * Henrik Rentz-Reichert (initial contribution)
+ */
+package org.eclipse.etrice.core.genmodel.fsm.tests;
+
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.etrice.core.fsm.fSM.ChoicePoint;
+import org.eclipse.etrice.core.fsm.fSM.State;
+import org.eclipse.etrice.core.fsm.fSM.StateGraphNode;
+import org.eclipse.etrice.core.fsm.fSM.TrPoint;
+import org.eclipse.etrice.core.genmodel.fsm.FsmGenChecker;
+import org.eclipse.etrice.core.genmodel.fsm.FsmGenExtensions;
+import org.eclipse.etrice.core.genmodel.fsm.NullLogger;
+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 org.eclipse.etrice.core.genmodel.fsm.tests.FsmGenTestBase;
+import org.eclipse.xtext.xbase.lib.Functions.Function1;
+import org.eclipse.xtext.xbase.lib.IterableExtensions;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+
+@SuppressWarnings("all")
+public class TestFlatFSM extends FsmGenTestBase {
+ private GraphContainer gc;
+
+ @Before
+ public void SetUp() {
+ GraphContainer _graphContainer = this.getGraphContainer("FlatFSMExample.room", "TestActor");
+ this.gc = _graphContainer;
+ Assert.assertNotNull("graph context was created", this.gc);
+ final NullLogger logger = new NullLogger();
+ FsmGenChecker.check(this.gc, logger);
+ boolean _hasErrors = logger.hasErrors();
+ Assert.assertFalse("logger has no errors", _hasErrors);
+ }
+
+ @Test
+ public void testFlatFSMItemCounts() {
+ Graph _graph = this.gc.getGraph();
+ EList<Node> _nodes = _graph.getNodes();
+ int _size = _nodes.size();
+ Assert.assertEquals("number of nodes", 6, _size);
+ Graph _graph_1 = this.gc.getGraph();
+ EList<Link> _links = _graph_1.getLinks();
+ int _size_1 = _links.size();
+ Assert.assertEquals("number of links", 6, _size_1);
+ Graph _graph_2 = this.gc.getGraph();
+ EList<Node> _nodes_1 = _graph_2.getNodes();
+ final Function1<Node, Boolean> _function = new Function1<Node, Boolean>() {
+ @Override
+ public Boolean apply(final Node it) {
+ StateGraphNode _stateGraphNode = it.getStateGraphNode();
+ return Boolean.valueOf((_stateGraphNode instanceof State));
+ }
+ };
+ Iterable<Node> _filter = IterableExtensions.<Node>filter(_nodes_1, _function);
+ int _size_2 = IterableExtensions.size(_filter);
+ Assert.assertEquals("number of states", 4, _size_2);
+ Graph _graph_3 = this.gc.getGraph();
+ EList<Node> _nodes_2 = _graph_3.getNodes();
+ final Function1<Node, Boolean> _function_1 = new Function1<Node, Boolean>() {
+ @Override
+ public Boolean apply(final Node it) {
+ StateGraphNode _stateGraphNode = it.getStateGraphNode();
+ return Boolean.valueOf((_stateGraphNode instanceof TrPoint));
+ }
+ };
+ Iterable<Node> _filter_1 = IterableExtensions.<Node>filter(_nodes_2, _function_1);
+ int _size_3 = IterableExtensions.size(_filter_1);
+ Assert.assertEquals("number of tr points", 1, _size_3);
+ Graph _graph_4 = this.gc.getGraph();
+ EList<Node> _nodes_3 = _graph_4.getNodes();
+ final Function1<Node, Boolean> _function_2 = new Function1<Node, Boolean>() {
+ @Override
+ public Boolean apply(final Node it) {
+ StateGraphNode _stateGraphNode = it.getStateGraphNode();
+ return Boolean.valueOf((_stateGraphNode instanceof ChoicePoint));
+ }
+ };
+ Iterable<Node> _filter_2 = IterableExtensions.<Node>filter(_nodes_3, _function_2);
+ int _size_4 = IterableExtensions.size(_filter_2);
+ Assert.assertEquals("number of choice points", 1, _size_4);
+ }
+
+ @Test
+ public void testFlatFSMState1Connections() {
+ Graph _graph = this.gc.getGraph();
+ Iterable<Node> _stateNodes = FsmGenExtensions.getStateNodes(_graph);
+ final Function1<Node, Boolean> _function = new Function1<Node, Boolean>() {
+ @Override
+ public Boolean apply(final Node it) {
+ String _name = FsmGenExtensions.getName(it);
+ return Boolean.valueOf(_name.equals("state1"));
+ }
+ };
+ Iterable<Node> _filter = IterableExtensions.<Node>filter(_stateNodes, _function);
+ final Node s1 = IterableExtensions.<Node>head(_filter);
+ Assert.assertNotNull("state found", s1);
+ EList<Link> _incoming = s1.getIncoming();
+ int _size = _incoming.size();
+ Assert.assertEquals("incoming links", 1, _size);
+ EList<Link> _outgoing = s1.getOutgoing();
+ int _size_1 = _outgoing.size();
+ Assert.assertEquals("outgoing links", 1, _size_1);
+ }
+
+ @Test
+ public void testFlatFSMState3Connections() {
+ Graph _graph = this.gc.getGraph();
+ Iterable<Node> _stateNodes = FsmGenExtensions.getStateNodes(_graph);
+ final Function1<Node, Boolean> _function = new Function1<Node, Boolean>() {
+ @Override
+ public Boolean apply(final Node it) {
+ String _name = FsmGenExtensions.getName(it);
+ return Boolean.valueOf(_name.equals("state3"));
+ }
+ };
+ Iterable<Node> _filter = IterableExtensions.<Node>filter(_stateNodes, _function);
+ final Node s3 = IterableExtensions.<Node>head(_filter);
+ Assert.assertNotNull("state found", s3);
+ EList<Link> _incoming = s3.getIncoming();
+ int _size = _incoming.size();
+ Assert.assertEquals("incoming links", 1, _size);
+ EList<Link> _outgoing = s3.getOutgoing();
+ int _size_1 = _outgoing.size();
+ Assert.assertEquals("outgoing links", 0, _size_1);
+ }
+
+ @Test
+ public void testFlatFSMCPConnections() {
+ Graph _graph = this.gc.getGraph();
+ Iterable<Node> _choicePointNodes = FsmGenExtensions.getChoicePointNodes(_graph);
+ final Function1<Node, Boolean> _function = new Function1<Node, Boolean>() {
+ @Override
+ public Boolean apply(final Node it) {
+ String _name = FsmGenExtensions.getName(it);
+ return Boolean.valueOf(_name.equals("cp0"));
+ }
+ };
+ Iterable<Node> _filter = IterableExtensions.<Node>filter(_choicePointNodes, _function);
+ final Node cp = IterableExtensions.<Node>head(_filter);
+ Assert.assertNotNull("choice point found", cp);
+ EList<Link> _incoming = cp.getIncoming();
+ int _size = _incoming.size();
+ Assert.assertEquals("incoming links", 1, _size);
+ EList<Link> _outgoing = cp.getOutgoing();
+ int _size_1 = _outgoing.size();
+ Assert.assertEquals("outgoing links", 2, _size_1);
+ }
+}
diff --git a/tests/org.eclipse.etrice.core.genmodel.fsm.tests/xtend-gen/org/eclipse/etrice/core/genmodel/fsm/tests/TestFlatInheritedFSM.java b/tests/org.eclipse.etrice.core.genmodel.fsm.tests/xtend-gen/org/eclipse/etrice/core/genmodel/fsm/tests/TestFlatInheritedFSM.java
new file mode 100644
index 000000000..c24c73d24
--- /dev/null
+++ b/tests/org.eclipse.etrice.core.genmodel.fsm.tests/xtend-gen/org/eclipse/etrice/core/genmodel/fsm/tests/TestFlatInheritedFSM.java
@@ -0,0 +1,124 @@
+/**
+ * Copyright (c) 2017 protos software gmbh (http://www.protos.de).
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * CONTRIBUTORS:
+ * Henrik Rentz-Reichert (initial contribution)
+ */
+package org.eclipse.etrice.core.genmodel.fsm.tests;
+
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.etrice.core.fsm.fSM.RefinedState;
+import org.eclipse.etrice.core.fsm.fSM.State;
+import org.eclipse.etrice.core.fsm.fSM.StateGraph;
+import org.eclipse.etrice.core.fsm.fSM.StateGraphNode;
+import org.eclipse.etrice.core.genmodel.fsm.FsmGenChecker;
+import org.eclipse.etrice.core.genmodel.fsm.FsmGenExtensions;
+import org.eclipse.etrice.core.genmodel.fsm.NullLogger;
+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 org.eclipse.etrice.core.genmodel.fsm.tests.FsmGenTestBase;
+import org.eclipse.xtext.xbase.lib.Functions.Function1;
+import org.eclipse.xtext.xbase.lib.IterableExtensions;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+
+@SuppressWarnings("all")
+public class TestFlatInheritedFSM extends FsmGenTestBase {
+ private GraphContainer gc;
+
+ @Before
+ public void SetUp() {
+ GraphContainer _graphContainer = this.getGraphContainer("FlatInheritedFSMExample.room", "TestActor");
+ this.gc = _graphContainer;
+ Assert.assertNotNull("graph context was created", this.gc);
+ final NullLogger logger = new NullLogger();
+ FsmGenChecker.check(this.gc, logger);
+ boolean _hasErrors = logger.hasErrors();
+ Assert.assertFalse("logger has no errors", _hasErrors);
+ }
+
+ @Test
+ public void testFlatInheritedFSMItemCounts() {
+ Graph _graph = this.gc.getGraph();
+ EList<Node> _nodes = _graph.getNodes();
+ int _size = _nodes.size();
+ Assert.assertEquals("number of nodes", 6, _size);
+ Graph _graph_1 = this.gc.getGraph();
+ EList<Link> _links = _graph_1.getLinks();
+ int _size_1 = _links.size();
+ Assert.assertEquals("number of links", 6, _size_1);
+ Graph _graph_2 = this.gc.getGraph();
+ Iterable<Node> _stateNodes = FsmGenExtensions.getStateNodes(_graph_2);
+ int _size_2 = IterableExtensions.size(_stateNodes);
+ Assert.assertEquals("number of states", 6, _size_2);
+ Graph _graph_3 = this.gc.getGraph();
+ Iterable<Node> _trPointNodes = FsmGenExtensions.getTrPointNodes(_graph_3);
+ int _size_3 = IterableExtensions.size(_trPointNodes);
+ Assert.assertEquals("number of tr points", 0, _size_3);
+ Graph _graph_4 = this.gc.getGraph();
+ Iterable<Node> _choicePointNodes = FsmGenExtensions.getChoicePointNodes(_graph_4);
+ int _size_4 = IterableExtensions.size(_choicePointNodes);
+ Assert.assertEquals("number of choice points", 0, _size_4);
+ }
+
+ @Test
+ public void testFlatInheritedFSMState0Connections() {
+ Graph _graph = this.gc.getGraph();
+ Iterable<Node> _stateNodes = FsmGenExtensions.getStateNodes(_graph);
+ final Function1<Node, Boolean> _function = new Function1<Node, Boolean>() {
+ @Override
+ public Boolean apply(final Node it) {
+ String _name = FsmGenExtensions.getName(it);
+ return Boolean.valueOf(_name.equals("state0"));
+ }
+ };
+ Iterable<Node> _filter = IterableExtensions.<Node>filter(_stateNodes, _function);
+ final Node s = IterableExtensions.<Node>head(_filter);
+ Assert.assertNotNull("state found", s);
+ EList<Link> _incoming = s.getIncoming();
+ int _size = _incoming.size();
+ Assert.assertEquals("incoming links", 1, _size);
+ EList<Link> _outgoing = s.getOutgoing();
+ int _size_1 = _outgoing.size();
+ Assert.assertEquals("outgoing links", 1, _size_1);
+ }
+
+ @Test
+ public void testHierFSMPointersIntoOriginalFSM() {
+ Graph _graph = this.gc.getGraph();
+ Iterable<Node> _stateNodes = FsmGenExtensions.getStateNodes(_graph);
+ final Function1<Node, Boolean> _function = new Function1<Node, Boolean>() {
+ @Override
+ public Boolean apply(final Node it) {
+ String _name = FsmGenExtensions.getName(it);
+ return Boolean.valueOf(_name.equals("state1"));
+ }
+ };
+ Iterable<Node> _filter = IterableExtensions.<Node>filter(_stateNodes, _function);
+ final Node n = IterableExtensions.<Node>head(_filter);
+ StateGraph _stateMachine = this.actor.getStateMachine();
+ EList<State> _states = _stateMachine.getStates();
+ final Function1<State, Boolean> _function_1 = new Function1<State, Boolean>() {
+ @Override
+ public Boolean apply(final State it) {
+ String _name = it.getName();
+ return Boolean.valueOf(_name.equals("state1"));
+ }
+ };
+ Iterable<State> _filter_1 = IterableExtensions.<State>filter(_states, _function_1);
+ final State s = IterableExtensions.<State>head(_filter_1);
+ Assert.assertNotNull("node found", n);
+ Assert.assertNotNull("state found", s);
+ StateGraphNode _stateGraphNode = n.getStateGraphNode();
+ Assert.assertTrue("RefinedState expected", (_stateGraphNode instanceof RefinedState));
+ StateGraphNode _stateGraphNode_1 = n.getStateGraphNode();
+ Assert.assertEquals("correct target", s, _stateGraphNode_1);
+ }
+}
diff --git a/tests/org.eclipse.etrice.core.genmodel.fsm.tests/xtend-gen/org/eclipse/etrice/core/genmodel/fsm/tests/TestHierFSM.java b/tests/org.eclipse.etrice.core.genmodel.fsm.tests/xtend-gen/org/eclipse/etrice/core/genmodel/fsm/tests/TestHierFSM.java
new file mode 100644
index 000000000..0358dca7b
--- /dev/null
+++ b/tests/org.eclipse.etrice.core.genmodel.fsm.tests/xtend-gen/org/eclipse/etrice/core/genmodel/fsm/tests/TestHierFSM.java
@@ -0,0 +1,166 @@
+/**
+ * Copyright (c) 2017 protos software gmbh (http://www.protos.de).
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * CONTRIBUTORS:
+ * Henrik Rentz-Reichert (initial contribution)
+ */
+package org.eclipse.etrice.core.genmodel.fsm.tests;
+
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.etrice.core.fsm.fSM.SimpleState;
+import org.eclipse.etrice.core.fsm.fSM.State;
+import org.eclipse.etrice.core.fsm.fSM.StateGraph;
+import org.eclipse.etrice.core.fsm.fSM.StateGraphNode;
+import org.eclipse.etrice.core.genmodel.fsm.FsmGenChecker;
+import org.eclipse.etrice.core.genmodel.fsm.FsmGenExtensions;
+import org.eclipse.etrice.core.genmodel.fsm.NullLogger;
+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 org.eclipse.etrice.core.genmodel.fsm.tests.FsmGenTestBase;
+import org.eclipse.xtext.xbase.lib.Functions.Function1;
+import org.eclipse.xtext.xbase.lib.IterableExtensions;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+
+@SuppressWarnings("all")
+public class TestHierFSM extends FsmGenTestBase {
+ private GraphContainer gc;
+
+ @Before
+ public void SetUp() {
+ GraphContainer _graphContainer = this.getGraphContainer("HierFSMExample.room", "TestActor");
+ this.gc = _graphContainer;
+ Assert.assertNotNull("graph context was created", this.gc);
+ final NullLogger logger = new NullLogger();
+ FsmGenChecker.check(this.gc, logger);
+ boolean _hasErrors = logger.hasErrors();
+ Assert.assertFalse("logger has no errors", _hasErrors);
+ }
+
+ @Test
+ public void testHierFSMItemCounts() {
+ Graph _graph = this.gc.getGraph();
+ EList<Node> _nodes = _graph.getNodes();
+ int _size = _nodes.size();
+ Assert.assertEquals("number of nodes", 3, _size);
+ Graph _graph_1 = this.gc.getGraph();
+ EList<Link> _links = _graph_1.getLinks();
+ int _size_1 = _links.size();
+ Assert.assertEquals("number of links", 4, _size_1);
+ Graph _graph_2 = this.gc.getGraph();
+ Iterable<Node> _stateNodes = FsmGenExtensions.getStateNodes(_graph_2);
+ int _size_2 = IterableExtensions.size(_stateNodes);
+ Assert.assertEquals("number of states", 3, _size_2);
+ Graph _graph_3 = this.gc.getGraph();
+ Iterable<Node> _trPointNodes = FsmGenExtensions.getTrPointNodes(_graph_3);
+ int _size_3 = IterableExtensions.size(_trPointNodes);
+ Assert.assertEquals("number of tr points", 0, _size_3);
+ Graph _graph_4 = this.gc.getGraph();
+ Iterable<Node> _choicePointNodes = FsmGenExtensions.getChoicePointNodes(_graph_4);
+ int _size_4 = IterableExtensions.size(_choicePointNodes);
+ Assert.assertEquals("number of choice points", 0, _size_4);
+ }
+
+ @Test
+ public void testHierFSMSubGraphItemCounts() {
+ Graph _graph = this.gc.getGraph();
+ Iterable<Node> _stateNodes = FsmGenExtensions.getStateNodes(_graph);
+ final Function1<Node, Boolean> _function = new Function1<Node, Boolean>() {
+ @Override
+ public Boolean apply(final Node it) {
+ String _name = FsmGenExtensions.getName(it);
+ return Boolean.valueOf(_name.equals("state1"));
+ }
+ };
+ Iterable<Node> _filter = IterableExtensions.<Node>filter(_stateNodes, _function);
+ Node _head = IterableExtensions.<Node>head(_filter);
+ final Graph subGraph = _head.getSubgraph();
+ EList<Node> _nodes = subGraph.getNodes();
+ int _size = _nodes.size();
+ Assert.assertEquals("number of nodes", 4, _size);
+ EList<Link> _links = subGraph.getLinks();
+ int _size_1 = _links.size();
+ Assert.assertEquals("number of links", 4, _size_1);
+ Iterable<Node> _stateNodes_1 = FsmGenExtensions.getStateNodes(subGraph);
+ int _size_2 = IterableExtensions.size(_stateNodes_1);
+ Assert.assertEquals("number of states", 2, _size_2);
+ Iterable<Node> _trPointNodes = FsmGenExtensions.getTrPointNodes(subGraph);
+ int _size_3 = IterableExtensions.size(_trPointNodes);
+ Assert.assertEquals("number of tr points", 2, _size_3);
+ Iterable<Node> _choicePointNodes = FsmGenExtensions.getChoicePointNodes(subGraph);
+ int _size_4 = IterableExtensions.size(_choicePointNodes);
+ Assert.assertEquals("number of choice points", 0, _size_4);
+ }
+
+ @Test
+ public void testHierFSMState1_1Connections() {
+ Graph _graph = this.gc.getGraph();
+ Iterable<Node> _stateNodes = FsmGenExtensions.getStateNodes(_graph);
+ final Function1<Node, Boolean> _function = new Function1<Node, Boolean>() {
+ @Override
+ public Boolean apply(final Node it) {
+ String _name = FsmGenExtensions.getName(it);
+ return Boolean.valueOf(_name.equals("state1"));
+ }
+ };
+ Iterable<Node> _filter = IterableExtensions.<Node>filter(_stateNodes, _function);
+ Node _head = IterableExtensions.<Node>head(_filter);
+ final Graph subGraph = _head.getSubgraph();
+ Iterable<Node> _stateNodes_1 = FsmGenExtensions.getStateNodes(subGraph);
+ final Function1<Node, Boolean> _function_1 = new Function1<Node, Boolean>() {
+ @Override
+ public Boolean apply(final Node it) {
+ String _name = FsmGenExtensions.getName(it);
+ return Boolean.valueOf(_name.equals("state1_1"));
+ }
+ };
+ Iterable<Node> _filter_1 = IterableExtensions.<Node>filter(_stateNodes_1, _function_1);
+ final Node s1_1 = IterableExtensions.<Node>head(_filter_1);
+ Assert.assertNotNull("state found", s1_1);
+ EList<Link> _incoming = s1_1.getIncoming();
+ int _size = _incoming.size();
+ Assert.assertEquals("incoming links", 2, _size);
+ EList<Link> _outgoing = s1_1.getOutgoing();
+ int _size_1 = _outgoing.size();
+ Assert.assertEquals("outgoing links", 1, _size_1);
+ }
+
+ @Test
+ public void testHierFSMPointersIntoOriginalFSM() {
+ Graph _graph = this.gc.getGraph();
+ Iterable<Node> _stateNodes = FsmGenExtensions.getStateNodes(_graph);
+ final Function1<Node, Boolean> _function = new Function1<Node, Boolean>() {
+ @Override
+ public Boolean apply(final Node it) {
+ String _name = FsmGenExtensions.getName(it);
+ return Boolean.valueOf(_name.equals("state1"));
+ }
+ };
+ Iterable<Node> _filter = IterableExtensions.<Node>filter(_stateNodes, _function);
+ final Node n = IterableExtensions.<Node>head(_filter);
+ StateGraph _stateMachine = this.actor.getStateMachine();
+ EList<State> _states = _stateMachine.getStates();
+ final Function1<State, Boolean> _function_1 = new Function1<State, Boolean>() {
+ @Override
+ public Boolean apply(final State it) {
+ String _name = it.getName();
+ return Boolean.valueOf(_name.equals("state1"));
+ }
+ };
+ Iterable<State> _filter_1 = IterableExtensions.<State>filter(_states, _function_1);
+ final State s = IterableExtensions.<State>head(_filter_1);
+ Assert.assertNotNull("node found", n);
+ Assert.assertNotNull("state found", s);
+ StateGraphNode _stateGraphNode = n.getStateGraphNode();
+ Assert.assertTrue("State expected", (_stateGraphNode instanceof SimpleState));
+ StateGraphNode _stateGraphNode_1 = n.getStateGraphNode();
+ Assert.assertEquals("correct target", s, _stateGraphNode_1);
+ }
+}
diff --git a/tests/org.eclipse.etrice.core.room.tests/META-INF/MANIFEST.MF b/tests/org.eclipse.etrice.core.room.tests/META-INF/MANIFEST.MF
index af58eccb0..fb752bf86 100644
--- a/tests/org.eclipse.etrice.core.room.tests/META-INF/MANIFEST.MF
+++ b/tests/org.eclipse.etrice.core.room.tests/META-INF/MANIFEST.MF
@@ -16,3 +16,4 @@ Require-Bundle: org.eclipse.etrice.core.room;bundle-version="1.1.0",
org.eclipse.xtend.core;bundle-version="2.7.3"
Bundle-Activator: org.eclipse.etrice.core.CoreTestsActivator
Bundle-ActivationPolicy: lazy
+Export-Package: org.eclipse.etrice.core
diff --git a/tests/org.eclipse.etrice.core.room.tests/src/org/eclipse/etrice/core/TestAnnotations.java b/tests/org.eclipse.etrice.core.room.tests/src/org/eclipse/etrice/core/TestAnnotations.java
index fa3d16e23..c65deeb25 100644
--- a/tests/org.eclipse.etrice.core.room.tests/src/org/eclipse/etrice/core/TestAnnotations.java
+++ b/tests/org.eclipse.etrice.core.room.tests/src/org/eclipse/etrice/core/TestAnnotations.java
@@ -28,7 +28,7 @@ public class TestAnnotations extends TestBase {
@Before
public void SetUp() {
- prepare();
+ prepare(CoreTestsActivator.getInstance().getBundle());
res = getResource("AnnotationExample.room");
}
diff --git a/tests/org.eclipse.etrice.core.room.tests/src/org/eclipse/etrice/core/TestBase.java b/tests/org.eclipse.etrice.core.room.tests/src/org/eclipse/etrice/core/TestBase.java
index ee8f39db1..1f358ba29 100644
--- a/tests/org.eclipse.etrice.core.room.tests/src/org/eclipse/etrice/core/TestBase.java
+++ b/tests/org.eclipse.etrice.core.room.tests/src/org/eclipse/etrice/core/TestBase.java
@@ -28,6 +28,7 @@ import org.eclipse.xtext.util.CancelIndicator;
import org.eclipse.xtext.validation.CancelableDiagnostician;
import org.eclipse.xtext.validation.CheckMode;
import org.eclipse.xtext.validation.impl.ConcreteSyntaxEValidator;
+import org.osgi.framework.Bundle;
import com.google.common.collect.Maps;
@@ -41,9 +42,9 @@ public class TestBase {
private String basePath;
- protected void prepare() {
+ protected void prepare(Bundle bundle) {
try {
- URL modelsDir = CoreTestsActivator.getInstance().getBundle().getEntry("models");
+ URL modelsDir = bundle.getEntry("models");
URL fileURL = FileLocator.toFileURL(modelsDir);
basePath = fileURL.getFile();
} catch (IOException e) {
diff --git a/tests/org.eclipse.etrice.core.room.tests/src/org/eclipse/etrice/core/TestBindings.java b/tests/org.eclipse.etrice.core.room.tests/src/org/eclipse/etrice/core/TestBindings.java
index 2ed4994e4..e24db2b25 100644
--- a/tests/org.eclipse.etrice.core.room.tests/src/org/eclipse/etrice/core/TestBindings.java
+++ b/tests/org.eclipse.etrice.core.room.tests/src/org/eclipse/etrice/core/TestBindings.java
@@ -33,7 +33,7 @@ public class TestBindings extends TestBase {
@Before
public void setUp() {
- prepare();
+ prepare(CoreTestsActivator.getInstance().getBundle());
resource = getResource("TestBindings.room");
}
diff --git a/tests/org.eclipse.etrice.core.room.tests/src/org/eclipse/etrice/core/TestBug505406.java b/tests/org.eclipse.etrice.core.room.tests/src/org/eclipse/etrice/core/TestBug505406.java
index f0044dd58..262029e7a 100644
--- a/tests/org.eclipse.etrice.core.room.tests/src/org/eclipse/etrice/core/TestBug505406.java
+++ b/tests/org.eclipse.etrice.core.room.tests/src/org/eclipse/etrice/core/TestBug505406.java
@@ -29,7 +29,7 @@ public class TestBug505406 extends TestBase {
@Before
public void SetUp() {
- prepare();
+ prepare(CoreTestsActivator.getInstance().getBundle());
res = getResource("bug505406.room");
}
diff --git a/tests/org.eclipse.etrice.core.room.tests/src/org/eclipse/etrice/core/TestCases.java b/tests/org.eclipse.etrice.core.room.tests/src/org/eclipse/etrice/core/TestCases.java
index 8030130c0..769ffc253 100644
--- a/tests/org.eclipse.etrice.core.room.tests/src/org/eclipse/etrice/core/TestCases.java
+++ b/tests/org.eclipse.etrice.core.room.tests/src/org/eclipse/etrice/core/TestCases.java
@@ -31,7 +31,7 @@ public class TestCases extends TestBase {
@Before
public void setUp() {
- prepare();
+ prepare(CoreTestsActivator.getInstance().getBundle());
resource = getResource("test.room");
}
diff --git a/tests/org.eclipse.etrice.core.room.tests/src/org/eclipse/etrice/core/TestDynamicActors.java b/tests/org.eclipse.etrice.core.room.tests/src/org/eclipse/etrice/core/TestDynamicActors.java
index 163223420..f4af08991 100644
--- a/tests/org.eclipse.etrice.core.room.tests/src/org/eclipse/etrice/core/TestDynamicActors.java
+++ b/tests/org.eclipse.etrice.core.room.tests/src/org/eclipse/etrice/core/TestDynamicActors.java
@@ -34,7 +34,7 @@ public class TestDynamicActors extends TestBase {
@Before
public void setUp() {
- prepare();
+ prepare(CoreTestsActivator.getInstance().getBundle());
resource = getResource("TestDynamicActors.room");
}
diff --git a/tests/org.eclipse.etrice.core.room.tests/src/org/eclipse/etrice/core/TestEnumerations.java b/tests/org.eclipse.etrice.core.room.tests/src/org/eclipse/etrice/core/TestEnumerations.java
index adc68f457..1b50a282c 100644
--- a/tests/org.eclipse.etrice.core.room.tests/src/org/eclipse/etrice/core/TestEnumerations.java
+++ b/tests/org.eclipse.etrice.core.room.tests/src/org/eclipse/etrice/core/TestEnumerations.java
@@ -32,7 +32,7 @@ public class TestEnumerations extends TestBase {
@Before
public void SetUp() {
- prepare();
+ prepare(CoreTestsActivator.getInstance().getBundle());
res = getResource("EnumExample.room");
}
diff --git a/tests/org.eclipse.etrice.core.room.tests/src/org/eclipse/etrice/core/TestFragments.java b/tests/org.eclipse.etrice.core.room.tests/src/org/eclipse/etrice/core/TestFragments.java
index b448a38a8..b94063609 100644
--- a/tests/org.eclipse.etrice.core.room.tests/src/org/eclipse/etrice/core/TestFragments.java
+++ b/tests/org.eclipse.etrice.core.room.tests/src/org/eclipse/etrice/core/TestFragments.java
@@ -31,7 +31,7 @@ public class TestFragments extends TestBase {
@Before
public void setUp() {
- prepare();
+ prepare(CoreTestsActivator.getInstance().getBundle());
resource = getResource("ChoicePointTest.room");
}
diff --git a/tests/org.eclipse.etrice.core.room.tests/src/org/eclipse/etrice/core/TestNames.xtend b/tests/org.eclipse.etrice.core.room.tests/src/org/eclipse/etrice/core/TestNames.xtend
index 170c8aa5b..bc7f587b7 100644
--- a/tests/org.eclipse.etrice.core.room.tests/src/org/eclipse/etrice/core/TestNames.xtend
+++ b/tests/org.eclipse.etrice.core.room.tests/src/org/eclipse/etrice/core/TestNames.xtend
@@ -25,12 +25,12 @@ import org.junit.Test
class TestNames extends TestBase {
val Map<EObject, Boolean> nameErrorMap = Maps.newHashMap
- Resource res;
+ Resource res
@Before
def void SetUp() {
- prepare();
- res = getResource("NamesAreUnique.room");
+ prepare(CoreTestsActivator.getInstance().getBundle())
+ res = getResource("NamesAreUnique.room")
val model = res.contents.head
val diag = getDiag(model)
@@ -61,7 +61,7 @@ class TestNames extends TestBase {
val items = newArrayList(ac, dc)
items += ac.eContents
items += dc.eContents
- Assert.assertEquals("Unexpected item count", 15, items.size);
+ Assert.assertEquals("Unexpected item count", 15, items.size)
items.forEach[
Assert.assertFalse("expected no name error: " + it, it.hasNameErrorMessage)
]
@@ -75,7 +75,7 @@ class TestNames extends TestBase {
val items = newArrayList(ac, dc)
items += ac.eContents
items += dc.eContents
- Assert.assertEquals("Unexpected item count", 9, items.size);
+ Assert.assertEquals("Unexpected item count", 9, items.size)
items.forEach[
Assert.assertFalse("expected no name error: " + it, it.hasNameErrorMessage)
]
@@ -89,7 +89,7 @@ class TestNames extends TestBase {
val items = newArrayList()
items += ac.eContents.filter[!(it instanceof ExternalPort)]
items += dc.eContents
- Assert.assertEquals("Unexpected item count", 13, items.size);
+ Assert.assertEquals("Unexpected item count", 13, items.size)
items.forEach[
Assert.assertTrue("expected name error: " + it, it.hasNameErrorMessage)
]
@@ -109,7 +109,7 @@ class TestNames extends TestBase {
items += lc.eContents
items += sc.eContents
items += enum.eContents
- Assert.assertEquals("Unexpected item count", 16, items.size);
+ Assert.assertEquals("Unexpected item count", 16, items.size)
items.forEach[
Assert.assertTrue("expected name error: " + it, it.hasNameErrorMessage)
]
@@ -121,6 +121,6 @@ class TestNames extends TestBase {
protected def boolean isNameErrorMessage(Diagnostic diag) {
val message = diag.message
- return diag.severity >= Diagnostic.ERROR && (message.contains("Duplicate name") || (message.contains("Name") && message.contains("is already assigned to")));
+ return diag.severity >= Diagnostic.ERROR && (message.contains("Duplicate name") || (message.contains("Name") && message.contains("is already assigned to")))
}
}
diff --git a/tests/org.eclipse.etrice.core.room.tests/xtend-gen/org/eclipse/etrice/core/TestNames.java b/tests/org.eclipse.etrice.core.room.tests/xtend-gen/org/eclipse/etrice/core/TestNames.java
index 645b5a78a..528081ed8 100644
--- a/tests/org.eclipse.etrice.core.room.tests/xtend-gen/org/eclipse/etrice/core/TestNames.java
+++ b/tests/org.eclipse.etrice.core.room.tests/xtend-gen/org/eclipse/etrice/core/TestNames.java
@@ -20,6 +20,7 @@ import org.eclipse.emf.common.util.Diagnostic;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.etrice.core.CoreTestsActivator;
import org.eclipse.etrice.core.TestBase;
import org.eclipse.etrice.core.room.ExternalPort;
import org.eclipse.xtext.validation.AbstractValidationDiagnostic;
@@ -30,6 +31,7 @@ import org.eclipse.xtext.xbase.lib.Procedures.Procedure1;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
+import org.osgi.framework.Bundle;
@SuppressWarnings("all")
public class TestNames extends TestBase {
@@ -39,7 +41,9 @@ public class TestNames extends TestBase {
@Before
public void SetUp() {
- this.prepare();
+ CoreTestsActivator _instance = CoreTestsActivator.getInstance();
+ Bundle _bundle = _instance.getBundle();
+ this.prepare(_bundle);
Resource _resource = this.getResource("NamesAreUnique.room");
this.res = _resource;
EList<EObject> _contents = this.res.getContents();

Back to the top