Quellcode durchsuchen

Implemented dervied features 'localReactions' 'and 'reactions' in SGraph Model

Andreas Mülder vor 14 Jahren
Ursprung
Commit
85743c85b2

+ 113 - 113
plugins/org.yakindu.sct.model.sgraph/model/emf/sgraph.ecore

@@ -1,113 +1,113 @@
-<?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="sgraph"
-    nsURI="http://www.yakindu.org/sct/2.0.0" nsPrefix="sgraph">
-  <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel"/>
-  <eClassifiers xsi:type="ecore:EClass" name="Pseudostate" abstract="true" eSuperTypes="#//Vertex"/>
-  <eClassifiers xsi:type="ecore:EClass" name="Vertex" abstract="true" eSuperTypes="#//NamedElement">
-    <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore">
-      <details key="constraints" value="IncomingTransitionCount OutgoingTransitionCount"/>
-    </eAnnotations>
-    <eStructuralFeatures xsi:type="ecore:EReference" name="parentRegion" ordered="false"
-        lowerBound="1" eType="#//Region" eOpposite="#//Region/vertices"/>
-    <eStructuralFeatures xsi:type="ecore:EReference" name="incomingTransitions" ordered="false"
-        upperBound="-1" eType="#//Transition" eOpposite="#//Transition/target"/>
-    <eStructuralFeatures xsi:type="ecore:EReference" name="outgoingTransitions" ordered="false"
-        upperBound="-1" eType="#//Transition" containment="true" eOpposite="#//Transition/source"/>
-  </eClassifiers>
-  <eClassifiers xsi:type="ecore:EClass" name="NamedElement" abstract="true">
-    <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" ordered="false" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
-  </eClassifiers>
-  <eClassifiers xsi:type="ecore:EClass" name="Region" eSuperTypes="#//NamedElement">
-    <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore">
-      <details key="constraints" value="ExactlyOneInitialState"/>
-    </eAnnotations>
-    <eStructuralFeatures xsi:type="ecore:EReference" name="vertices" ordered="false"
-        upperBound="-1" eType="#//Vertex" containment="true" eOpposite="#//Vertex/parentRegion"/>
-    <eStructuralFeatures xsi:type="ecore:EAttribute" name="priority" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"/>
-  </eClassifiers>
-  <eClassifiers xsi:type="ecore:EClass" name="Transition" eSuperTypes="#//ExpressionElement #//Reaction">
-    <eAnnotations source="InjectMembers"/>
-    <eStructuralFeatures xsi:type="ecore:EReference" name="target" ordered="false"
-        lowerBound="1" eType="#//Vertex" eOpposite="#//Vertex/incomingTransitions"/>
-    <eStructuralFeatures xsi:type="ecore:EReference" name="source" ordered="false"
-        lowerBound="1" eType="#//Vertex" eOpposite="#//Vertex/outgoingTransitions"/>
-    <eStructuralFeatures xsi:type="ecore:EAttribute" name="priority" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"/>
-  </eClassifiers>
-  <eClassifiers xsi:type="ecore:EClass" name="FinalState" eSuperTypes="#//Vertex"/>
-  <eClassifiers xsi:type="ecore:EClass" name="Variable" abstract="true" eSuperTypes="#//Declaration"/>
-  <eClassifiers xsi:type="ecore:EClass" name="Junction" eSuperTypes="#//Pseudostate"/>
-  <eClassifiers xsi:type="ecore:EClass" name="Event" abstract="true" eSuperTypes="#//Declaration"/>
-  <eClassifiers xsi:type="ecore:EClass" name="Choice" eSuperTypes="#//Pseudostate"/>
-  <eClassifiers xsi:type="ecore:EClass" name="Statechart" eSuperTypes="#//NamedElement #//ExpressionElement #//ReactiveElement #//ScopedElement">
-    <eAnnotations source="InjectMembers"/>
-    <eStructuralFeatures xsi:type="ecore:EReference" name="regions" ordered="false"
-        lowerBound="1" upperBound="-1" eType="#//Region" containment="true"/>
-  </eClassifiers>
-  <eClassifiers xsi:type="ecore:EClass" name="Entry" eSuperTypes="#//Pseudostate">
-    <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore">
-      <details key="constraints" value="DisallowTrigger"/>
-    </eAnnotations>
-    <eStructuralFeatures xsi:type="ecore:EAttribute" name="kind" eType="#//EntryKind"/>
-  </eClassifiers>
-  <eClassifiers xsi:type="ecore:EClass" name="Trigger" abstract="true"/>
-  <eClassifiers xsi:type="ecore:EClass" name="Effect" abstract="true"/>
-  <eClassifiers xsi:type="ecore:EClass" name="ExpressionElement" abstract="true">
-    <eStructuralFeatures xsi:type="ecore:EAttribute" name="expression" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
-  </eClassifiers>
-  <eClassifiers xsi:type="ecore:EClass" name="Declaration" abstract="true" eSuperTypes="#//NamedElement"/>
-  <eClassifiers xsi:type="ecore:EClass" name="Reaction" abstract="true">
-    <eStructuralFeatures xsi:type="ecore:EReference" name="trigger" eType="#//Trigger"
-        containment="true"/>
-    <eStructuralFeatures xsi:type="ecore:EReference" name="effect" eType="#//Effect"
-        containment="true"/>
-  </eClassifiers>
-  <eClassifiers xsi:type="ecore:EEnum" name="EntryKind">
-    <eLiterals name="initial" literal="INITIAL"/>
-    <eLiterals name="shallowHistory" value="1" literal="SHALLOW_HISTORY"/>
-    <eLiterals name="deepHistory" value="2" literal="DEEP_HISTORY"/>
-  </eClassifiers>
-  <eClassifiers xsi:type="ecore:EClass" name="ReactiveElement" abstract="true">
-    <eStructuralFeatures xsi:type="ecore:EReference" name="reactions" upperBound="-1"
-        eType="#//Reaction" changeable="false" derived="true"/>
-    <eStructuralFeatures xsi:type="ecore:EReference" name="localReactions" upperBound="-1"
-        eType="#//Reaction" containment="true"/>
-  </eClassifiers>
-  <eClassifiers xsi:type="ecore:EClass" name="Exit" eSuperTypes="#//Pseudostate"/>
-  <eClassifiers xsi:type="ecore:EClass" name="Scope">
-    <eStructuralFeatures xsi:type="ecore:EReference" name="declarations" upperBound="-1"
-        eType="#//Declaration" containment="true"/>
-    <eStructuralFeatures xsi:type="ecore:EReference" name="events" upperBound="-1"
-        eType="#//Event" changeable="false" volatile="true" transient="true" derived="true"/>
-    <eStructuralFeatures xsi:type="ecore:EReference" name="variables" unique="false"
-        upperBound="-1" eType="#//Variable" changeable="false" volatile="true" transient="true"
-        derived="true"/>
-  </eClassifiers>
-  <eClassifiers xsi:type="ecore:EClass" name="ScopedElement" abstract="true">
-    <eStructuralFeatures xsi:type="ecore:EReference" name="scopes" upperBound="-1"
-        eType="#//Scope" containment="true"/>
-    <eStructuralFeatures xsi:type="ecore:EAttribute" name="namespace" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
-  </eClassifiers>
-  <eClassifiers xsi:type="ecore:EClass" name="Synchronization" eSuperTypes="#//Pseudostate"/>
-  <eClassifiers xsi:type="ecore:EClass" name="State" eSuperTypes="#//Vertex #//ExpressionElement #//ReactiveElement #//ScopedElement">
-    <eAnnotations source="InjectMembers"/>
-    <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore">
-      <details key="constraints" value="NameIsNotEmpty"/>
-    </eAnnotations>
-    <eStructuralFeatures xsi:type="ecore:EReference" name="subRegions" ordered="false"
-        upperBound="-1" eType="#//Region" containment="true"/>
-    <eStructuralFeatures xsi:type="ecore:EAttribute" name="orthogonal" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"
-        changeable="false" volatile="true" transient="true" derived="true"/>
-    <eStructuralFeatures xsi:type="ecore:EReference" name="substatechart" eType="#//Statechart"/>
-    <eStructuralFeatures xsi:type="ecore:EAttribute" name="submachine" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"
-        changeable="false" volatile="true" transient="true" derived="true"/>
-    <eStructuralFeatures xsi:type="ecore:EAttribute" name="simple" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"
-        changeable="false" volatile="true" transient="true" derived="true"/>
-    <eStructuralFeatures xsi:type="ecore:EAttribute" name="composite" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"
-        changeable="false" volatile="true" transient="true" derived="true"/>
-    <eStructuralFeatures xsi:type="ecore:EAttribute" name="leaf" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"
-        changeable="false" volatile="true" transient="true" derived="true"/>
-  </eClassifiers>
-  <eClassifiers xsi:type="ecore:EClass" name="Statement"/>
-</ecore:EPackage>
+<?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="sgraph"
+    nsURI="http://www.yakindu.org/sct/2.0.0" nsPrefix="sgraph">
+  <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel"/>
+  <eClassifiers xsi:type="ecore:EClass" name="Pseudostate" abstract="true" eSuperTypes="#//Vertex"/>
+  <eClassifiers xsi:type="ecore:EClass" name="Vertex" abstract="true" eSuperTypes="#//NamedElement">
+    <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore">
+      <details key="constraints" value="IncomingTransitionCount OutgoingTransitionCount"/>
+    </eAnnotations>
+    <eStructuralFeatures xsi:type="ecore:EReference" name="parentRegion" ordered="false"
+        lowerBound="1" eType="#//Region" eOpposite="#//Region/vertices"/>
+    <eStructuralFeatures xsi:type="ecore:EReference" name="incomingTransitions" ordered="false"
+        upperBound="-1" eType="#//Transition" eOpposite="#//Transition/target"/>
+    <eStructuralFeatures xsi:type="ecore:EReference" name="outgoingTransitions" ordered="false"
+        upperBound="-1" eType="#//Transition" containment="true" eOpposite="#//Transition/source"/>
+  </eClassifiers>
+  <eClassifiers xsi:type="ecore:EClass" name="NamedElement" abstract="true">
+    <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" ordered="false" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+  </eClassifiers>
+  <eClassifiers xsi:type="ecore:EClass" name="Region" eSuperTypes="#//NamedElement">
+    <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore">
+      <details key="constraints" value="ExactlyOneInitialState"/>
+    </eAnnotations>
+    <eStructuralFeatures xsi:type="ecore:EReference" name="vertices" ordered="false"
+        upperBound="-1" eType="#//Vertex" containment="true" eOpposite="#//Vertex/parentRegion"/>
+    <eStructuralFeatures xsi:type="ecore:EAttribute" name="priority" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"/>
+  </eClassifiers>
+  <eClassifiers xsi:type="ecore:EClass" name="Transition" eSuperTypes="#//ExpressionElement #//Reaction">
+    <eAnnotations source="InjectMembers"/>
+    <eStructuralFeatures xsi:type="ecore:EReference" name="target" ordered="false"
+        lowerBound="1" eType="#//Vertex" eOpposite="#//Vertex/incomingTransitions"/>
+    <eStructuralFeatures xsi:type="ecore:EReference" name="source" ordered="false"
+        lowerBound="1" eType="#//Vertex" eOpposite="#//Vertex/outgoingTransitions"/>
+    <eStructuralFeatures xsi:type="ecore:EAttribute" name="priority" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"/>
+  </eClassifiers>
+  <eClassifiers xsi:type="ecore:EClass" name="FinalState" eSuperTypes="#//Vertex"/>
+  <eClassifiers xsi:type="ecore:EClass" name="Variable" abstract="true" eSuperTypes="#//Declaration"/>
+  <eClassifiers xsi:type="ecore:EClass" name="Junction" eSuperTypes="#//Pseudostate"/>
+  <eClassifiers xsi:type="ecore:EClass" name="Event" abstract="true" eSuperTypes="#//Declaration"/>
+  <eClassifiers xsi:type="ecore:EClass" name="Choice" eSuperTypes="#//Pseudostate"/>
+  <eClassifiers xsi:type="ecore:EClass" name="Statechart" eSuperTypes="#//NamedElement #//ExpressionElement #//ReactiveElement #//ScopedElement">
+    <eAnnotations source="InjectMembers"/>
+    <eStructuralFeatures xsi:type="ecore:EReference" name="regions" ordered="false"
+        lowerBound="1" upperBound="-1" eType="#//Region" containment="true"/>
+  </eClassifiers>
+  <eClassifiers xsi:type="ecore:EClass" name="Entry" eSuperTypes="#//Pseudostate">
+    <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore">
+      <details key="constraints" value="DisallowTrigger"/>
+    </eAnnotations>
+    <eStructuralFeatures xsi:type="ecore:EAttribute" name="kind" eType="#//EntryKind"/>
+  </eClassifiers>
+  <eClassifiers xsi:type="ecore:EClass" name="Trigger" abstract="true"/>
+  <eClassifiers xsi:type="ecore:EClass" name="Effect" abstract="true"/>
+  <eClassifiers xsi:type="ecore:EClass" name="ExpressionElement" abstract="true">
+    <eStructuralFeatures xsi:type="ecore:EAttribute" name="expression" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+  </eClassifiers>
+  <eClassifiers xsi:type="ecore:EClass" name="Declaration" abstract="true" eSuperTypes="#//NamedElement"/>
+  <eClassifiers xsi:type="ecore:EClass" name="Reaction" abstract="true">
+    <eStructuralFeatures xsi:type="ecore:EReference" name="trigger" eType="#//Trigger"
+        containment="true"/>
+    <eStructuralFeatures xsi:type="ecore:EReference" name="effect" eType="#//Effect"
+        containment="true"/>
+  </eClassifiers>
+  <eClassifiers xsi:type="ecore:EEnum" name="EntryKind">
+    <eLiterals name="initial" literal="INITIAL"/>
+    <eLiterals name="shallowHistory" value="1" literal="SHALLOW_HISTORY"/>
+    <eLiterals name="deepHistory" value="2" literal="DEEP_HISTORY"/>
+  </eClassifiers>
+  <eClassifiers xsi:type="ecore:EClass" name="ReactiveElement" abstract="true">
+    <eStructuralFeatures xsi:type="ecore:EReference" name="reactions" upperBound="-1"
+        eType="#//Reaction" changeable="false" volatile="true" transient="true" derived="true"/>
+    <eStructuralFeatures xsi:type="ecore:EReference" name="localReactions" upperBound="-1"
+        eType="#//Reaction" changeable="false" volatile="true" transient="true" derived="true"/>
+  </eClassifiers>
+  <eClassifiers xsi:type="ecore:EClass" name="Exit" eSuperTypes="#//Pseudostate"/>
+  <eClassifiers xsi:type="ecore:EClass" name="Scope">
+    <eStructuralFeatures xsi:type="ecore:EReference" name="declarations" upperBound="-1"
+        eType="#//Declaration" containment="true"/>
+    <eStructuralFeatures xsi:type="ecore:EReference" name="events" upperBound="-1"
+        eType="#//Event" changeable="false" volatile="true" transient="true" derived="true"/>
+    <eStructuralFeatures xsi:type="ecore:EReference" name="variables" unique="false"
+        upperBound="-1" eType="#//Variable" changeable="false" volatile="true" transient="true"
+        derived="true"/>
+  </eClassifiers>
+  <eClassifiers xsi:type="ecore:EClass" name="ScopedElement" abstract="true">
+    <eStructuralFeatures xsi:type="ecore:EReference" name="scopes" upperBound="-1"
+        eType="#//Scope" containment="true"/>
+    <eStructuralFeatures xsi:type="ecore:EAttribute" name="namespace" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+  </eClassifiers>
+  <eClassifiers xsi:type="ecore:EClass" name="Synchronization" eSuperTypes="#//Pseudostate"/>
+  <eClassifiers xsi:type="ecore:EClass" name="State" eSuperTypes="#//Vertex #//ExpressionElement #//ReactiveElement #//ScopedElement">
+    <eAnnotations source="InjectMembers"/>
+    <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore">
+      <details key="constraints" value="NameIsNotEmpty"/>
+    </eAnnotations>
+    <eStructuralFeatures xsi:type="ecore:EReference" name="subRegions" ordered="false"
+        upperBound="-1" eType="#//Region" containment="true"/>
+    <eStructuralFeatures xsi:type="ecore:EAttribute" name="orthogonal" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"
+        changeable="false" volatile="true" transient="true" derived="true"/>
+    <eStructuralFeatures xsi:type="ecore:EReference" name="substatechart" eType="#//Statechart"/>
+    <eStructuralFeatures xsi:type="ecore:EAttribute" name="submachine" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"
+        changeable="false" volatile="true" transient="true" derived="true"/>
+    <eStructuralFeatures xsi:type="ecore:EAttribute" name="simple" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"
+        changeable="false" volatile="true" transient="true" derived="true"/>
+    <eStructuralFeatures xsi:type="ecore:EAttribute" name="composite" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"
+        changeable="false" volatile="true" transient="true" derived="true"/>
+    <eStructuralFeatures xsi:type="ecore:EAttribute" name="leaf" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"
+        changeable="false" volatile="true" transient="true" derived="true"/>
+  </eClassifiers>
+  <eClassifiers xsi:type="ecore:EClass" name="Statement"/>
+</ecore:EPackage>

+ 4 - 4
plugins/org.yakindu.sct.model.sgraph/src/org/yakindu/sct/model/sgraph/ReactiveElement.java

@@ -49,13 +49,13 @@ public interface ReactiveElement extends EObject {
 	 * <!-- end-user-doc -->
 	 * @return the value of the '<em>Reactions</em>' reference list.
 	 * @see org.yakindu.sct.model.sgraph.SGraphPackage#getReactiveElement_Reactions()
-	 * @model changeable="false" derived="true"
+	 * @model transient="true" changeable="false" volatile="true" derived="true"
 	 * @generated
 	 */
 	EList<Reaction> getReactions();
 
 	/**
-	 * Returns the value of the '<em><b>Local Reactions</b></em>' containment reference list.
+	 * Returns the value of the '<em><b>Local Reactions</b></em>' reference list.
 	 * The list contents are of type {@link org.yakindu.sct.model.sgraph.Reaction}.
 	 * <!-- begin-user-doc -->
 	 * <p>
@@ -63,9 +63,9 @@ public interface ReactiveElement extends EObject {
 	 * there really should be more of a description here...
 	 * </p>
 	 * <!-- end-user-doc -->
-	 * @return the value of the '<em>Local Reactions</em>' containment reference list.
+	 * @return the value of the '<em>Local Reactions</em>' reference list.
 	 * @see org.yakindu.sct.model.sgraph.SGraphPackage#getReactiveElement_LocalReactions()
-	 * @model containment="true"
+	 * @model transient="true" changeable="false" volatile="true" derived="true"
 	 * @generated
 	 */
 	EList<Reaction> getLocalReactions();

+ 6 - 6
plugins/org.yakindu.sct.model.sgraph/src/org/yakindu/sct/model/sgraph/SGraphPackage.java

@@ -653,7 +653,7 @@ public interface SGraphPackage extends EPackage {
 	int STATECHART__REACTIONS = NAMED_ELEMENT_FEATURE_COUNT + 1;
 
 	/**
-	 * The feature id for the '<em><b>Local Reactions</b></em>' containment reference list.
+	 * The feature id for the '<em><b>Local Reactions</b></em>' reference list.
 	 * <!-- begin-user-doc -->
 	 * <!-- end-user-doc -->
 	 * @generated
@@ -856,7 +856,7 @@ public interface SGraphPackage extends EPackage {
 	int REACTIVE_ELEMENT__REACTIONS = 0;
 
 	/**
-	 * The feature id for the '<em><b>Local Reactions</b></em>' containment reference list.
+	 * The feature id for the '<em><b>Local Reactions</b></em>' reference list.
 	 * <!-- begin-user-doc -->
 	 * <!-- end-user-doc -->
 	 * @generated
@@ -1121,7 +1121,7 @@ public interface SGraphPackage extends EPackage {
 	int STATE__REACTIONS = VERTEX_FEATURE_COUNT + 1;
 
 	/**
-	 * The feature id for the '<em><b>Local Reactions</b></em>' containment reference list.
+	 * The feature id for the '<em><b>Local Reactions</b></em>' reference list.
 	 * <!-- begin-user-doc -->
 	 * <!-- end-user-doc -->
 	 * @generated
@@ -1692,10 +1692,10 @@ public interface SGraphPackage extends EPackage {
 	EReference getReactiveElement_Reactions();
 
 	/**
-	 * Returns the meta object for the containment reference list '{@link org.yakindu.sct.model.sgraph.ReactiveElement#getLocalReactions <em>Local Reactions</em>}'.
+	 * Returns the meta object for the reference list '{@link org.yakindu.sct.model.sgraph.ReactiveElement#getLocalReactions <em>Local Reactions</em>}'.
 	 * <!-- begin-user-doc -->
 	 * <!-- end-user-doc -->
-	 * @return the meta object for the containment reference list '<em>Local Reactions</em>'.
+	 * @return the meta object for the reference list '<em>Local Reactions</em>'.
 	 * @see org.yakindu.sct.model.sgraph.ReactiveElement#getLocalReactions()
 	 * @see #getReactiveElement()
 	 * @generated
@@ -2206,7 +2206,7 @@ public interface SGraphPackage extends EPackage {
 		EReference REACTIVE_ELEMENT__REACTIONS = eINSTANCE.getReactiveElement_Reactions();
 
 		/**
-		 * The meta object literal for the '<em><b>Local Reactions</b></em>' containment reference list feature.
+		 * The meta object literal for the '<em><b>Local Reactions</b></em>' reference list feature.
 		 * <!-- begin-user-doc -->
 		 * <!-- end-user-doc -->
 		 * @generated

+ 6 - 85
plugins/org.yakindu.sct.model.sgraph/src/org/yakindu/sct/model/sgraph/impl/ReactiveElementImpl.java

@@ -10,16 +10,9 @@
  */
 package org.yakindu.sct.model.sgraph.impl;
 
-import java.util.Collection;
-
-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.EObjectImpl;
-import org.eclipse.emf.ecore.util.EObjectContainmentEList;
-import org.eclipse.emf.ecore.util.EObjectResolvingEList;
-import org.eclipse.emf.ecore.util.InternalEList;
 import org.yakindu.sct.model.sgraph.Reaction;
 import org.yakindu.sct.model.sgraph.ReactiveElement;
 import org.yakindu.sct.model.sgraph.SGraphPackage;
@@ -46,26 +39,6 @@ public abstract class ReactiveElementImpl extends EObjectImpl implements Reactiv
 	 */
 	public static final String copyright = "Copyright (c) 2011 committers of YAKINDU and others.\r\nAll rights reserved. This program and the accompanying materials\r\nare made available under the terms of the Eclipse Public License v1.0\r\nwhich accompanies this distribution, and is available at\r\nhttp://www.eclipse.org/legal/epl-v10.html\r\nContributors:\r\ncommitters of YAKINDU - initial API and implementation\r\n";
 
-	/**
-	 * The cached value of the '{@link #getReactions() <em>Reactions</em>}' reference list.
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * @see #getReactions()
-	 * @generated
-	 * @ordered
-	 */
-	protected EList<Reaction> reactions;
-
-	/**
-	 * The cached value of the '{@link #getLocalReactions() <em>Local Reactions</em>}' containment reference list.
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * @see #getLocalReactions()
-	 * @generated
-	 * @ordered
-	 */
-	protected EList<Reaction> localReactions;
-
 	/**
 	 * <!-- begin-user-doc -->
 	 * <!-- end-user-doc -->
@@ -88,39 +61,19 @@ public abstract class ReactiveElementImpl extends EObjectImpl implements Reactiv
 	/**
 	 * <!-- begin-user-doc -->
 	 * <!-- end-user-doc -->
-	 * @generated
+	 * @generated NOT
 	 */
 	public EList<Reaction> getReactions() {
-		if (reactions == null) {
-			reactions = new EObjectResolvingEList<Reaction>(Reaction.class, this, SGraphPackage.REACTIVE_ELEMENT__REACTIONS);
-		}
-		return reactions;
+		throw new UnsupportedOperationException();
 	}
 
 	/**
 	 * <!-- begin-user-doc -->
 	 * <!-- end-user-doc -->
-	 * @generated
+	 * @generated NOT
 	 */
 	public EList<Reaction> getLocalReactions() {
-		if (localReactions == null) {
-			localReactions = new EObjectContainmentEList<Reaction>(Reaction.class, this, SGraphPackage.REACTIVE_ELEMENT__LOCAL_REACTIONS);
-		}
-		return localReactions;
-	}
-
-	/**
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * @generated
-	 */
-	@Override
-	public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
-		switch (featureID) {
-			case SGraphPackage.REACTIVE_ELEMENT__LOCAL_REACTIONS:
-				return ((InternalEList<?>)getLocalReactions()).basicRemove(otherEnd, msgs);
-		}
-		return super.eInverseRemove(otherEnd, featureID, msgs);
+		throw new UnsupportedOperationException();
 	}
 
 	/**
@@ -139,38 +92,6 @@ public abstract class ReactiveElementImpl extends EObjectImpl implements Reactiv
 		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 SGraphPackage.REACTIVE_ELEMENT__LOCAL_REACTIONS:
-				getLocalReactions().clear();
-				getLocalReactions().addAll((Collection<? extends Reaction>)newValue);
-				return;
-		}
-		super.eSet(featureID, newValue);
-	}
-
-	/**
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * @generated
-	 */
-	@Override
-	public void eUnset(int featureID) {
-		switch (featureID) {
-			case SGraphPackage.REACTIVE_ELEMENT__LOCAL_REACTIONS:
-				getLocalReactions().clear();
-				return;
-		}
-		super.eUnset(featureID);
-	}
-
 	/**
 	 * <!-- begin-user-doc -->
 	 * <!-- end-user-doc -->
@@ -180,9 +101,9 @@ public abstract class ReactiveElementImpl extends EObjectImpl implements Reactiv
 	public boolean eIsSet(int featureID) {
 		switch (featureID) {
 			case SGraphPackage.REACTIVE_ELEMENT__REACTIONS:
-				return reactions != null && !reactions.isEmpty();
+				return !getReactions().isEmpty();
 			case SGraphPackage.REACTIVE_ELEMENT__LOCAL_REACTIONS:
-				return localReactions != null && !localReactions.isEmpty();
+				return !getLocalReactions().isEmpty();
 		}
 		return super.eIsSet(featureID);
 	}

+ 236 - 187
plugins/org.yakindu.sct.model.sgraph/src/org/yakindu/sct/model/sgraph/impl/StateImpl.java

@@ -14,13 +14,14 @@ import java.util.Collection;
 
 import org.eclipse.emf.common.notify.Notification;
 import org.eclipse.emf.common.notify.NotificationChain;
+import org.eclipse.emf.common.util.BasicEList;
 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.EObjectResolvingEList;
 import org.eclipse.emf.ecore.util.InternalEList;
+import org.yakindu.sct.model.sgraph.Declaration;
 import org.yakindu.sct.model.sgraph.ExpressionElement;
 import org.yakindu.sct.model.sgraph.Reaction;
 import org.yakindu.sct.model.sgraph.ReactiveElement;
@@ -37,33 +38,46 @@ import org.yakindu.sct.model.sgraph.Statechart;
  * <p>
  * The following features are implemented:
  * <ul>
- *   <li>{@link org.yakindu.sct.model.sgraph.impl.StateImpl#getExpression <em>Expression</em>}</li>
- *   <li>{@link org.yakindu.sct.model.sgraph.impl.StateImpl#getReactions <em>Reactions</em>}</li>
- *   <li>{@link org.yakindu.sct.model.sgraph.impl.StateImpl#getLocalReactions <em>Local Reactions</em>}</li>
- *   <li>{@link org.yakindu.sct.model.sgraph.impl.StateImpl#getScopes <em>Scopes</em>}</li>
- *   <li>{@link org.yakindu.sct.model.sgraph.impl.StateImpl#getNamespace <em>Namespace</em>}</li>
- *   <li>{@link org.yakindu.sct.model.sgraph.impl.StateImpl#getSubRegions <em>Sub Regions</em>}</li>
- *   <li>{@link org.yakindu.sct.model.sgraph.impl.StateImpl#isOrthogonal <em>Orthogonal</em>}</li>
- *   <li>{@link org.yakindu.sct.model.sgraph.impl.StateImpl#getSubstatechart <em>Substatechart</em>}</li>
- *   <li>{@link org.yakindu.sct.model.sgraph.impl.StateImpl#isSubmachine <em>Submachine</em>}</li>
- *   <li>{@link org.yakindu.sct.model.sgraph.impl.StateImpl#isSimple <em>Simple</em>}</li>
- *   <li>{@link org.yakindu.sct.model.sgraph.impl.StateImpl#isComposite <em>Composite</em>}</li>
- *   <li>{@link org.yakindu.sct.model.sgraph.impl.StateImpl#isLeaf <em>Leaf</em>}</li>
+ * <li>{@link org.yakindu.sct.model.sgraph.impl.StateImpl#getExpression <em>
+ * Expression</em>}</li>
+ * <li>{@link org.yakindu.sct.model.sgraph.impl.StateImpl#getReactions <em>
+ * Reactions</em>}</li>
+ * <li>{@link org.yakindu.sct.model.sgraph.impl.StateImpl#getLocalReactions <em>
+ * Local Reactions</em>}</li>
+ * <li>{@link org.yakindu.sct.model.sgraph.impl.StateImpl#getScopes <em>Scopes
+ * </em>}</li>
+ * <li>{@link org.yakindu.sct.model.sgraph.impl.StateImpl#getNamespace <em>
+ * Namespace</em>}</li>
+ * <li>{@link org.yakindu.sct.model.sgraph.impl.StateImpl#getSubRegions <em>Sub
+ * Regions</em>}</li>
+ * <li>{@link org.yakindu.sct.model.sgraph.impl.StateImpl#isOrthogonal <em>
+ * Orthogonal</em>}</li>
+ * <li>{@link org.yakindu.sct.model.sgraph.impl.StateImpl#getSubstatechart <em>
+ * Substatechart</em>}</li>
+ * <li>{@link org.yakindu.sct.model.sgraph.impl.StateImpl#isSubmachine <em>
+ * Submachine</em>}</li>
+ * <li>{@link org.yakindu.sct.model.sgraph.impl.StateImpl#isSimple <em>Simple
+ * </em>}</li>
+ * <li>{@link org.yakindu.sct.model.sgraph.impl.StateImpl#isComposite <em>
+ * Composite</em>}</li>
+ * <li>{@link org.yakindu.sct.model.sgraph.impl.StateImpl#isLeaf <em>Leaf</em>}</li>
  * </ul>
  * </p>
- *
+ * 
  * @generated
  */
 public class StateImpl extends VertexImpl implements State {
 	/**
 	 * <!-- begin-user-doc --> <!-- end-user-doc -->
+	 * 
 	 * @generated
 	 */
 	public static final String copyright = "Copyright (c) 2011 committers of YAKINDU and others.\r\nAll rights reserved. This program and the accompanying materials\r\nare made available under the terms of the Eclipse Public License v1.0\r\nwhich accompanies this distribution, and is available at\r\nhttp://www.eclipse.org/legal/epl-v10.html\r\nContributors:\r\ncommitters of YAKINDU - initial API and implementation\r\n";
 
 	/**
-	 * The default value of the '{@link #getExpression() <em>Expression</em>}' attribute.
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
+	 * The default value of the '{@link #getExpression() <em>Expression</em>}'
+	 * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+	 * 
 	 * @see #getExpression()
 	 * @generated
 	 * @ordered
@@ -71,8 +85,9 @@ public class StateImpl extends VertexImpl implements State {
 	protected static final String EXPRESSION_EDEFAULT = null;
 
 	/**
-	 * The cached value of the '{@link #getExpression() <em>Expression</em>}' attribute.
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
+	 * The cached value of the '{@link #getExpression() <em>Expression</em>}'
+	 * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+	 * 
 	 * @see #getExpression()
 	 * @generated
 	 * @ordered
@@ -80,28 +95,9 @@ public class StateImpl extends VertexImpl implements State {
 	protected String expression = EXPRESSION_EDEFAULT;
 
 	/**
-	 * The cached value of the '{@link #getReactions() <em>Reactions</em>}' reference list.
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * @see #getReactions()
-	 * @generated
-	 * @ordered
-	 */
-	protected EList<Reaction> reactions;
-
-	/**
-	 * The cached value of the '{@link #getLocalReactions()
-	 * <em>Local Reactions</em>}' containment reference list. <!--
-	 * begin-user-doc --> <!-- end-user-doc -->
+	 * The cached value of the '{@link #getScopes() <em>Scopes</em>}'
+	 * containment reference list. <!-- begin-user-doc --> <!-- end-user-doc -->
 	 * 
-	 * @see #getLocalReactions()
-	 * @generated
-	 * @ordered
-	 */
-	protected EList<Reaction> localReactions;
-
-	/**
-	 * The cached value of the '{@link #getScopes() <em>Scopes</em>}' containment reference list.
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
 	 * @see #getScopes()
 	 * @generated
 	 * @ordered
@@ -109,9 +105,9 @@ public class StateImpl extends VertexImpl implements State {
 	protected EList<Scope> scopes;
 
 	/**
-	 * The default value of the '{@link #getNamespace() <em>Namespace</em>}' attribute.
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
+	 * The default value of the '{@link #getNamespace() <em>Namespace</em>}'
+	 * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+	 * 
 	 * @see #getNamespace()
 	 * @generated
 	 * @ordered
@@ -119,9 +115,9 @@ public class StateImpl extends VertexImpl implements State {
 	protected static final String NAMESPACE_EDEFAULT = null;
 
 	/**
-	 * The cached value of the '{@link #getNamespace() <em>Namespace</em>}' attribute.
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
+	 * The cached value of the '{@link #getNamespace() <em>Namespace</em>}'
+	 * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+	 * 
 	 * @see #getNamespace()
 	 * @generated
 	 * @ordered
@@ -129,8 +125,9 @@ public class StateImpl extends VertexImpl implements State {
 	protected String namespace = NAMESPACE_EDEFAULT;
 
 	/**
-	 * The cached value of the '{@link #getSubRegions() <em>Sub Regions</em>}' containment reference list.
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
+	 * The cached value of the '{@link #getSubRegions() <em>Sub Regions</em>}'
+	 * containment reference list. <!-- begin-user-doc --> <!-- end-user-doc -->
+	 * 
 	 * @see #getSubRegions()
 	 * @generated
 	 * @ordered
@@ -138,8 +135,9 @@ public class StateImpl extends VertexImpl implements State {
 	protected EList<Region> subRegions;
 
 	/**
-	 * The default value of the '{@link #isOrthogonal() <em>Orthogonal</em>}' attribute.
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
+	 * The default value of the '{@link #isOrthogonal() <em>Orthogonal</em>}'
+	 * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+	 * 
 	 * @see #isOrthogonal()
 	 * @generated
 	 * @ordered
@@ -147,9 +145,10 @@ public class StateImpl extends VertexImpl implements State {
 	protected static final boolean ORTHOGONAL_EDEFAULT = false;
 
 	/**
-	 * The cached value of the '{@link #getSubstatechart() <em>Substatechart</em>}' reference.
-	 * <!-- begin-user-doc --> <!--
+	 * The cached value of the '{@link #getSubstatechart()
+	 * <em>Substatechart</em>}' reference. <!-- begin-user-doc --> <!--
 	 * end-user-doc -->
+	 * 
 	 * @see #getSubstatechart()
 	 * @generated
 	 * @ordered
@@ -157,8 +156,9 @@ public class StateImpl extends VertexImpl implements State {
 	protected Statechart substatechart;
 
 	/**
-	 * The default value of the '{@link #isSubmachine() <em>Submachine</em>}' attribute.
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
+	 * The default value of the '{@link #isSubmachine() <em>Submachine</em>}'
+	 * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+	 * 
 	 * @see #isSubmachine()
 	 * @generated
 	 * @ordered
@@ -168,6 +168,7 @@ public class StateImpl extends VertexImpl implements State {
 	/**
 	 * The default value of the '{@link #isSimple() <em>Simple</em>}' attribute.
 	 * <!-- begin-user-doc --> <!-- end-user-doc -->
+	 * 
 	 * @see #isSimple()
 	 * @generated
 	 * @ordered
@@ -175,8 +176,9 @@ public class StateImpl extends VertexImpl implements State {
 	protected static final boolean SIMPLE_EDEFAULT = false;
 
 	/**
-	 * The default value of the '{@link #isComposite() <em>Composite</em>}' attribute.
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
+	 * The default value of the '{@link #isComposite() <em>Composite</em>}'
+	 * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+	 * 
 	 * @see #isComposite()
 	 * @generated
 	 * @ordered
@@ -186,6 +188,7 @@ public class StateImpl extends VertexImpl implements State {
 	/**
 	 * The default value of the '{@link #isLeaf() <em>Leaf</em>}' attribute.
 	 * <!-- begin-user-doc --> <!-- end-user-doc -->
+	 * 
 	 * @see #isLeaf()
 	 * @generated
 	 * @ordered
@@ -194,6 +197,7 @@ public class StateImpl extends VertexImpl implements State {
 
 	/**
 	 * <!-- begin-user-doc --> <!-- end-user-doc -->
+	 * 
 	 * @generated
 	 */
 	protected StateImpl() {
@@ -202,6 +206,7 @@ public class StateImpl extends VertexImpl implements State {
 
 	/**
 	 * <!-- begin-user-doc --> <!-- end-user-doc -->
+	 * 
 	 * @generated
 	 */
 	@Override
@@ -211,6 +216,7 @@ public class StateImpl extends VertexImpl implements State {
 
 	/**
 	 * <!-- begin-user-doc --> <!-- end-user-doc -->
+	 * 
 	 * @generated
 	 */
 	public String getExpression() {
@@ -219,51 +225,64 @@ public class StateImpl extends VertexImpl implements State {
 
 	/**
 	 * <!-- begin-user-doc --> <!-- end-user-doc -->
+	 * 
 	 * @generated
 	 */
 	public void setExpression(String newExpression) {
 		String oldExpression = expression;
 		expression = newExpression;
 		if (eNotificationRequired())
-			eNotify(new ENotificationImpl(this, Notification.SET, SGraphPackage.STATE__EXPRESSION, oldExpression, expression));
+			eNotify(new ENotificationImpl(this, Notification.SET,
+					SGraphPackage.STATE__EXPRESSION, oldExpression, expression));
 	}
 
 	/**
 	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * @generated
+	 * 
+	 * @generated NOT
 	 */
 	public EList<Reaction> getReactions() {
-		if (reactions == null) {
-			reactions = new EObjectResolvingEList<Reaction>(Reaction.class, this, SGraphPackage.STATE__REACTIONS);
-		}
-		return reactions;
+		EList<Reaction> result = new BasicEList<Reaction>();
+		result.addAll(getOutgoingTransitions());
+		result.addAll(getLocalReactions());
+		return result;
 	}
 
 	/**
 	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * @generated
+	 * 
+	 * @generated NOT
 	 */
 	public EList<Reaction> getLocalReactions() {
-		if (localReactions == null) {
-			localReactions = new EObjectContainmentEList<Reaction>(Reaction.class, this, SGraphPackage.STATE__LOCAL_REACTIONS);
+		EList<Reaction> result = new BasicEList<Reaction>();
+		EList<Scope> scopes = getScopes();
+		for (Scope scope : scopes) {
+			EList<Declaration> declarations = scope.getDeclarations();
+			for (Declaration declaration : declarations) {
+				if (declaration instanceof Reaction) {
+					result.add((Reaction) declaration);
+				}
+			}
 		}
-		return localReactions;
+		return result;
 	}
 
 	/**
 	 * <!-- begin-user-doc --> <!-- end-user-doc -->
+	 * 
 	 * @generated
 	 */
 	public EList<Scope> getScopes() {
 		if (scopes == null) {
-			scopes = new EObjectContainmentEList<Scope>(Scope.class, this, SGraphPackage.STATE__SCOPES);
+			scopes = new EObjectContainmentEList<Scope>(Scope.class, this,
+					SGraphPackage.STATE__SCOPES);
 		}
 		return scopes;
 	}
 
 	/**
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
+	 * <!-- begin-user-doc --> <!-- end-user-doc -->
+	 * 
 	 * @generated
 	 */
 	public String getNamespace() {
@@ -271,24 +290,27 @@ public class StateImpl extends VertexImpl implements State {
 	}
 
 	/**
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
+	 * <!-- begin-user-doc --> <!-- end-user-doc -->
+	 * 
 	 * @generated
 	 */
 	public void setNamespace(String newNamespace) {
 		String oldNamespace = namespace;
 		namespace = newNamespace;
 		if (eNotificationRequired())
-			eNotify(new ENotificationImpl(this, Notification.SET, SGraphPackage.STATE__NAMESPACE, oldNamespace, namespace));
+			eNotify(new ENotificationImpl(this, Notification.SET,
+					SGraphPackage.STATE__NAMESPACE, oldNamespace, namespace));
 	}
 
 	/**
 	 * <!-- begin-user-doc --> <!-- end-user-doc -->
+	 * 
 	 * @generated
 	 */
 	public EList<Region> getSubRegions() {
 		if (subRegions == null) {
-			subRegions = new EObjectContainmentEList<Region>(Region.class, this, SGraphPackage.STATE__SUB_REGIONS);
+			subRegions = new EObjectContainmentEList<Region>(Region.class,
+					this, SGraphPackage.STATE__SUB_REGIONS);
 		}
 		return subRegions;
 	}
@@ -304,15 +326,18 @@ public class StateImpl extends VertexImpl implements State {
 
 	/**
 	 * <!-- begin-user-doc --> <!-- end-user-doc -->
+	 * 
 	 * @generated
 	 */
 	public Statechart getSubstatechart() {
 		if (substatechart != null && substatechart.eIsProxy()) {
-			InternalEObject oldSubstatechart = (InternalEObject)substatechart;
-			substatechart = (Statechart)eResolveProxy(oldSubstatechart);
+			InternalEObject oldSubstatechart = (InternalEObject) substatechart;
+			substatechart = (Statechart) eResolveProxy(oldSubstatechart);
 			if (substatechart != oldSubstatechart) {
 				if (eNotificationRequired())
-					eNotify(new ENotificationImpl(this, Notification.RESOLVE, SGraphPackage.STATE__SUBSTATECHART, oldSubstatechart, substatechart));
+					eNotify(new ENotificationImpl(this, Notification.RESOLVE,
+							SGraphPackage.STATE__SUBSTATECHART,
+							oldSubstatechart, substatechart));
 			}
 		}
 		return substatechart;
@@ -320,6 +345,7 @@ public class StateImpl extends VertexImpl implements State {
 
 	/**
 	 * <!-- begin-user-doc --> <!-- end-user-doc -->
+	 * 
 	 * @generated
 	 */
 	public Statechart basicGetSubstatechart() {
@@ -328,13 +354,16 @@ public class StateImpl extends VertexImpl implements State {
 
 	/**
 	 * <!-- begin-user-doc --> <!-- end-user-doc -->
+	 * 
 	 * @generated
 	 */
 	public void setSubstatechart(Statechart newSubstatechart) {
 		Statechart oldSubstatechart = substatechart;
 		substatechart = newSubstatechart;
 		if (eNotificationRequired())
-			eNotify(new ENotificationImpl(this, Notification.SET, SGraphPackage.STATE__SUBSTATECHART, oldSubstatechart, substatechart));
+			eNotify(new ENotificationImpl(this, Notification.SET,
+					SGraphPackage.STATE__SUBSTATECHART, oldSubstatechart,
+					substatechart));
 	}
 
 	/**
@@ -382,179 +411,188 @@ public class StateImpl extends VertexImpl implements State {
 
 	/**
 	 * <!-- begin-user-doc --> <!-- end-user-doc -->
+	 * 
 	 * @generated
 	 */
 	@Override
 	public NotificationChain eInverseRemove(InternalEObject otherEnd,
 			int featureID, NotificationChain msgs) {
 		switch (featureID) {
-			case SGraphPackage.STATE__LOCAL_REACTIONS:
-				return ((InternalEList<?>)getLocalReactions()).basicRemove(otherEnd, msgs);
-			case SGraphPackage.STATE__SCOPES:
-				return ((InternalEList<?>)getScopes()).basicRemove(otherEnd, msgs);
-			case SGraphPackage.STATE__SUB_REGIONS:
-				return ((InternalEList<?>)getSubRegions()).basicRemove(otherEnd, msgs);
+		case SGraphPackage.STATE__SCOPES:
+			return ((InternalEList<?>) getScopes()).basicRemove(otherEnd, msgs);
+		case SGraphPackage.STATE__SUB_REGIONS:
+			return ((InternalEList<?>) getSubRegions()).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 SGraphPackage.STATE__EXPRESSION:
-				return getExpression();
-			case SGraphPackage.STATE__REACTIONS:
-				return getReactions();
-			case SGraphPackage.STATE__LOCAL_REACTIONS:
-				return getLocalReactions();
-			case SGraphPackage.STATE__SCOPES:
-				return getScopes();
-			case SGraphPackage.STATE__NAMESPACE:
-				return getNamespace();
-			case SGraphPackage.STATE__SUB_REGIONS:
-				return getSubRegions();
-			case SGraphPackage.STATE__ORTHOGONAL:
-				return isOrthogonal();
-			case SGraphPackage.STATE__SUBSTATECHART:
-				if (resolve) return getSubstatechart();
-				return basicGetSubstatechart();
-			case SGraphPackage.STATE__SUBMACHINE:
-				return isSubmachine();
-			case SGraphPackage.STATE__SIMPLE:
-				return isSimple();
-			case SGraphPackage.STATE__COMPOSITE:
-				return isComposite();
-			case SGraphPackage.STATE__LEAF:
-				return isLeaf();
+		case SGraphPackage.STATE__EXPRESSION:
+			return getExpression();
+		case SGraphPackage.STATE__REACTIONS:
+			return getReactions();
+		case SGraphPackage.STATE__LOCAL_REACTIONS:
+			return getLocalReactions();
+		case SGraphPackage.STATE__SCOPES:
+			return getScopes();
+		case SGraphPackage.STATE__NAMESPACE:
+			return getNamespace();
+		case SGraphPackage.STATE__SUB_REGIONS:
+			return getSubRegions();
+		case SGraphPackage.STATE__ORTHOGONAL:
+			return isOrthogonal();
+		case SGraphPackage.STATE__SUBSTATECHART:
+			if (resolve)
+				return getSubstatechart();
+			return basicGetSubstatechart();
+		case SGraphPackage.STATE__SUBMACHINE:
+			return isSubmachine();
+		case SGraphPackage.STATE__SIMPLE:
+			return isSimple();
+		case SGraphPackage.STATE__COMPOSITE:
+			return isComposite();
+		case SGraphPackage.STATE__LEAF:
+			return isLeaf();
 		}
 		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 SGraphPackage.STATE__EXPRESSION:
-				setExpression((String)newValue);
-				return;
-			case SGraphPackage.STATE__LOCAL_REACTIONS:
-				getLocalReactions().clear();
-				getLocalReactions().addAll((Collection<? extends Reaction>)newValue);
-				return;
-			case SGraphPackage.STATE__SCOPES:
-				getScopes().clear();
-				getScopes().addAll((Collection<? extends Scope>)newValue);
-				return;
-			case SGraphPackage.STATE__NAMESPACE:
-				setNamespace((String)newValue);
-				return;
-			case SGraphPackage.STATE__SUB_REGIONS:
-				getSubRegions().clear();
-				getSubRegions().addAll((Collection<? extends Region>)newValue);
-				return;
-			case SGraphPackage.STATE__SUBSTATECHART:
-				setSubstatechart((Statechart)newValue);
-				return;
+		case SGraphPackage.STATE__EXPRESSION:
+			setExpression((String) newValue);
+			return;
+		case SGraphPackage.STATE__SCOPES:
+			getScopes().clear();
+			getScopes().addAll((Collection<? extends Scope>) newValue);
+			return;
+		case SGraphPackage.STATE__NAMESPACE:
+			setNamespace((String) newValue);
+			return;
+		case SGraphPackage.STATE__SUB_REGIONS:
+			getSubRegions().clear();
+			getSubRegions().addAll((Collection<? extends Region>) newValue);
+			return;
+		case SGraphPackage.STATE__SUBSTATECHART:
+			setSubstatechart((Statechart) newValue);
+			return;
 		}
 		super.eSet(featureID, newValue);
 	}
 
 	/**
 	 * <!-- begin-user-doc --> <!-- end-user-doc -->
+	 * 
 	 * @generated
 	 */
 	@Override
 	public void eUnset(int featureID) {
 		switch (featureID) {
-			case SGraphPackage.STATE__EXPRESSION:
-				setExpression(EXPRESSION_EDEFAULT);
-				return;
-			case SGraphPackage.STATE__LOCAL_REACTIONS:
-				getLocalReactions().clear();
-				return;
-			case SGraphPackage.STATE__SCOPES:
-				getScopes().clear();
-				return;
-			case SGraphPackage.STATE__NAMESPACE:
-				setNamespace(NAMESPACE_EDEFAULT);
-				return;
-			case SGraphPackage.STATE__SUB_REGIONS:
-				getSubRegions().clear();
-				return;
-			case SGraphPackage.STATE__SUBSTATECHART:
-				setSubstatechart((Statechart)null);
-				return;
+		case SGraphPackage.STATE__EXPRESSION:
+			setExpression(EXPRESSION_EDEFAULT);
+			return;
+		case SGraphPackage.STATE__SCOPES:
+			getScopes().clear();
+			return;
+		case SGraphPackage.STATE__NAMESPACE:
+			setNamespace(NAMESPACE_EDEFAULT);
+			return;
+		case SGraphPackage.STATE__SUB_REGIONS:
+			getSubRegions().clear();
+			return;
+		case SGraphPackage.STATE__SUBSTATECHART:
+			setSubstatechart((Statechart) null);
+			return;
 		}
 		super.eUnset(featureID);
 	}
 
 	/**
 	 * <!-- begin-user-doc --> <!-- end-user-doc -->
+	 * 
 	 * @generated
 	 */
 	@Override
 	public boolean eIsSet(int featureID) {
 		switch (featureID) {
-			case SGraphPackage.STATE__EXPRESSION:
-				return EXPRESSION_EDEFAULT == null ? expression != null : !EXPRESSION_EDEFAULT.equals(expression);
-			case SGraphPackage.STATE__REACTIONS:
-				return reactions != null && !reactions.isEmpty();
-			case SGraphPackage.STATE__LOCAL_REACTIONS:
-				return localReactions != null && !localReactions.isEmpty();
-			case SGraphPackage.STATE__SCOPES:
-				return scopes != null && !scopes.isEmpty();
-			case SGraphPackage.STATE__NAMESPACE:
-				return NAMESPACE_EDEFAULT == null ? namespace != null : !NAMESPACE_EDEFAULT.equals(namespace);
-			case SGraphPackage.STATE__SUB_REGIONS:
-				return subRegions != null && !subRegions.isEmpty();
-			case SGraphPackage.STATE__ORTHOGONAL:
-				return isOrthogonal() != ORTHOGONAL_EDEFAULT;
-			case SGraphPackage.STATE__SUBSTATECHART:
-				return substatechart != null;
-			case SGraphPackage.STATE__SUBMACHINE:
-				return isSubmachine() != SUBMACHINE_EDEFAULT;
-			case SGraphPackage.STATE__SIMPLE:
-				return isSimple() != SIMPLE_EDEFAULT;
-			case SGraphPackage.STATE__COMPOSITE:
-				return isComposite() != COMPOSITE_EDEFAULT;
-			case SGraphPackage.STATE__LEAF:
-				return isLeaf() != LEAF_EDEFAULT;
+		case SGraphPackage.STATE__EXPRESSION:
+			return EXPRESSION_EDEFAULT == null ? expression != null
+					: !EXPRESSION_EDEFAULT.equals(expression);
+		case SGraphPackage.STATE__REACTIONS:
+			return !getReactions().isEmpty();
+		case SGraphPackage.STATE__LOCAL_REACTIONS:
+			return !getLocalReactions().isEmpty();
+		case SGraphPackage.STATE__SCOPES:
+			return scopes != null && !scopes.isEmpty();
+		case SGraphPackage.STATE__NAMESPACE:
+			return NAMESPACE_EDEFAULT == null ? namespace != null
+					: !NAMESPACE_EDEFAULT.equals(namespace);
+		case SGraphPackage.STATE__SUB_REGIONS:
+			return subRegions != null && !subRegions.isEmpty();
+		case SGraphPackage.STATE__ORTHOGONAL:
+			return isOrthogonal() != ORTHOGONAL_EDEFAULT;
+		case SGraphPackage.STATE__SUBSTATECHART:
+			return substatechart != null;
+		case SGraphPackage.STATE__SUBMACHINE:
+			return isSubmachine() != SUBMACHINE_EDEFAULT;
+		case SGraphPackage.STATE__SIMPLE:
+			return isSimple() != SIMPLE_EDEFAULT;
+		case SGraphPackage.STATE__COMPOSITE:
+			return isComposite() != COMPOSITE_EDEFAULT;
+		case SGraphPackage.STATE__LEAF:
+			return isLeaf() != LEAF_EDEFAULT;
 		}
 		return super.eIsSet(featureID);
 	}
 
 	/**
 	 * <!-- begin-user-doc --> <!-- end-user-doc -->
+	 * 
 	 * @generated
 	 */
 	@Override
 	public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass) {
 		if (baseClass == ExpressionElement.class) {
 			switch (derivedFeatureID) {
-				case SGraphPackage.STATE__EXPRESSION: return SGraphPackage.EXPRESSION_ELEMENT__EXPRESSION;
-				default: return -1;
+			case SGraphPackage.STATE__EXPRESSION:
+				return SGraphPackage.EXPRESSION_ELEMENT__EXPRESSION;
+			default:
+				return -1;
 			}
 		}
 		if (baseClass == ReactiveElement.class) {
 			switch (derivedFeatureID) {
-				case SGraphPackage.STATE__REACTIONS: return SGraphPackage.REACTIVE_ELEMENT__REACTIONS;
-				case SGraphPackage.STATE__LOCAL_REACTIONS: return SGraphPackage.REACTIVE_ELEMENT__LOCAL_REACTIONS;
-				default: return -1;
+			case SGraphPackage.STATE__REACTIONS:
+				return SGraphPackage.REACTIVE_ELEMENT__REACTIONS;
+			case SGraphPackage.STATE__LOCAL_REACTIONS:
+				return SGraphPackage.REACTIVE_ELEMENT__LOCAL_REACTIONS;
+			default:
+				return -1;
 			}
 		}
 		if (baseClass == ScopedElement.class) {
 			switch (derivedFeatureID) {
-				case SGraphPackage.STATE__SCOPES: return SGraphPackage.SCOPED_ELEMENT__SCOPES;
-				case SGraphPackage.STATE__NAMESPACE: return SGraphPackage.SCOPED_ELEMENT__NAMESPACE;
-				default: return -1;
+			case SGraphPackage.STATE__SCOPES:
+				return SGraphPackage.SCOPED_ELEMENT__SCOPES;
+			case SGraphPackage.STATE__NAMESPACE:
+				return SGraphPackage.SCOPED_ELEMENT__NAMESPACE;
+			default:
+				return -1;
 			}
 		}
 		return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass);
@@ -562,28 +600,37 @@ public class StateImpl extends VertexImpl implements State {
 
 	/**
 	 * <!-- begin-user-doc --> <!-- end-user-doc -->
+	 * 
 	 * @generated
 	 */
 	@Override
 	public int eDerivedStructuralFeatureID(int baseFeatureID, Class<?> baseClass) {
 		if (baseClass == ExpressionElement.class) {
 			switch (baseFeatureID) {
-				case SGraphPackage.EXPRESSION_ELEMENT__EXPRESSION: return SGraphPackage.STATE__EXPRESSION;
-				default: return -1;
+			case SGraphPackage.EXPRESSION_ELEMENT__EXPRESSION:
+				return SGraphPackage.STATE__EXPRESSION;
+			default:
+				return -1;
 			}
 		}
 		if (baseClass == ReactiveElement.class) {
 			switch (baseFeatureID) {
-				case SGraphPackage.REACTIVE_ELEMENT__REACTIONS: return SGraphPackage.STATE__REACTIONS;
-				case SGraphPackage.REACTIVE_ELEMENT__LOCAL_REACTIONS: return SGraphPackage.STATE__LOCAL_REACTIONS;
-				default: return -1;
+			case SGraphPackage.REACTIVE_ELEMENT__REACTIONS:
+				return SGraphPackage.STATE__REACTIONS;
+			case SGraphPackage.REACTIVE_ELEMENT__LOCAL_REACTIONS:
+				return SGraphPackage.STATE__LOCAL_REACTIONS;
+			default:
+				return -1;
 			}
 		}
 		if (baseClass == ScopedElement.class) {
 			switch (baseFeatureID) {
-				case SGraphPackage.SCOPED_ELEMENT__SCOPES: return SGraphPackage.STATE__SCOPES;
-				case SGraphPackage.SCOPED_ELEMENT__NAMESPACE: return SGraphPackage.STATE__NAMESPACE;
-				default: return -1;
+			case SGraphPackage.SCOPED_ELEMENT__SCOPES:
+				return SGraphPackage.STATE__SCOPES;
+			case SGraphPackage.SCOPED_ELEMENT__NAMESPACE:
+				return SGraphPackage.STATE__NAMESPACE;
+			default:
+				return -1;
 			}
 		}
 		return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass);
@@ -591,11 +638,13 @@ public class StateImpl extends VertexImpl implements State {
 
 	/**
 	 * <!-- begin-user-doc --> <!-- end-user-doc -->
+	 * 
 	 * @generated
 	 */
 	@Override
 	public String toString() {
-		if (eIsProxy()) return super.toString();
+		if (eIsProxy())
+			return super.toString();
 
 		StringBuffer result = new StringBuffer(super.toString());
 		result.append(" (expression: ");

+ 23 - 45
plugins/org.yakindu.sct.model.sgraph/src/org/yakindu/sct/model/sgraph/impl/StatechartImpl.java

@@ -14,13 +14,14 @@ import java.util.Collection;
 
 import org.eclipse.emf.common.notify.Notification;
 import org.eclipse.emf.common.notify.NotificationChain;
+import org.eclipse.emf.common.util.BasicEList;
 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.EObjectResolvingEList;
 import org.eclipse.emf.ecore.util.InternalEList;
+import org.yakindu.sct.model.sgraph.Declaration;
 import org.yakindu.sct.model.sgraph.ExpressionElement;
 import org.yakindu.sct.model.sgraph.Reaction;
 import org.yakindu.sct.model.sgraph.ReactiveElement;
@@ -76,26 +77,6 @@ public class StatechartImpl extends NamedElementImpl implements Statechart {
 	 */
 	protected String expression = EXPRESSION_EDEFAULT;
 
-	/**
-	 * The cached value of the '{@link #getReactions() <em>Reactions</em>}' reference list.
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * @see #getReactions()
-	 * @generated
-	 * @ordered
-	 */
-	protected EList<Reaction> reactions;
-
-	/**
-	 * The cached value of the '{@link #getLocalReactions() <em>Local Reactions</em>}' containment reference list.
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * @see #getLocalReactions()
-	 * @generated
-	 * @ordered
-	 */
-	protected EList<Reaction> localReactions;
-
 	/**
 	 * The cached value of the '{@link #getScopes() <em>Scopes</em>}' containment reference list.
 	 * <!-- begin-user-doc -->
@@ -177,27 +158,33 @@ public class StatechartImpl extends NamedElementImpl implements Statechart {
 	}
 
 	/**
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * @generated
+	 * <!-- begin-user-doc --> <!-- end-user-doc -->
+	 * 
+	 * @generated NOT
 	 */
 	public EList<Reaction> getReactions() {
-		if (reactions == null) {
-			reactions = new EObjectResolvingEList<Reaction>(Reaction.class, this, SGraphPackage.STATECHART__REACTIONS);
-		}
-		return reactions;
+		EList<Reaction> result = new BasicEList<Reaction>();
+		result.addAll(getLocalReactions());
+		return result;
 	}
 
 	/**
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * @generated
+	 * <!-- begin-user-doc --> <!-- end-user-doc -->
+	 * 
+	 * @generated NOT
 	 */
 	public EList<Reaction> getLocalReactions() {
-		if (localReactions == null) {
-			localReactions = new EObjectContainmentEList<Reaction>(Reaction.class, this, SGraphPackage.STATECHART__LOCAL_REACTIONS);
+		EList<Reaction> result = new BasicEList<Reaction>();
+		EList<Scope> scopes = getScopes();
+		for (Scope scope : scopes) {
+			EList<Declaration> declarations = scope.getDeclarations();
+			for (Declaration declaration : declarations) {
+				if (declaration instanceof Reaction) {
+					result.add((Reaction) declaration);
+				}
+			}
 		}
-		return localReactions;
+		return result;
 	}
 
 	/**
@@ -253,8 +240,6 @@ public class StatechartImpl extends NamedElementImpl implements Statechart {
 	@Override
 	public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
 		switch (featureID) {
-			case SGraphPackage.STATECHART__LOCAL_REACTIONS:
-				return ((InternalEList<?>)getLocalReactions()).basicRemove(otherEnd, msgs);
 			case SGraphPackage.STATECHART__SCOPES:
 				return ((InternalEList<?>)getScopes()).basicRemove(otherEnd, msgs);
 			case SGraphPackage.STATECHART__REGIONS:
@@ -299,10 +284,6 @@ public class StatechartImpl extends NamedElementImpl implements Statechart {
 			case SGraphPackage.STATECHART__EXPRESSION:
 				setExpression((String)newValue);
 				return;
-			case SGraphPackage.STATECHART__LOCAL_REACTIONS:
-				getLocalReactions().clear();
-				getLocalReactions().addAll((Collection<? extends Reaction>)newValue);
-				return;
 			case SGraphPackage.STATECHART__SCOPES:
 				getScopes().clear();
 				getScopes().addAll((Collection<? extends Scope>)newValue);
@@ -329,9 +310,6 @@ public class StatechartImpl extends NamedElementImpl implements Statechart {
 			case SGraphPackage.STATECHART__EXPRESSION:
 				setExpression(EXPRESSION_EDEFAULT);
 				return;
-			case SGraphPackage.STATECHART__LOCAL_REACTIONS:
-				getLocalReactions().clear();
-				return;
 			case SGraphPackage.STATECHART__SCOPES:
 				getScopes().clear();
 				return;
@@ -356,9 +334,9 @@ public class StatechartImpl extends NamedElementImpl implements Statechart {
 			case SGraphPackage.STATECHART__EXPRESSION:
 				return EXPRESSION_EDEFAULT == null ? expression != null : !EXPRESSION_EDEFAULT.equals(expression);
 			case SGraphPackage.STATECHART__REACTIONS:
-				return reactions != null && !reactions.isEmpty();
+				return !getReactions().isEmpty();
 			case SGraphPackage.STATECHART__LOCAL_REACTIONS:
-				return localReactions != null && !localReactions.isEmpty();
+				return !getLocalReactions().isEmpty();
 			case SGraphPackage.STATECHART__SCOPES:
 				return scopes != null && !scopes.isEmpty();
 			case SGraphPackage.STATECHART__NAMESPACE:

+ 112 - 112
plugins/org.yakindu.sct.model.sgraph/src/org/yakindu/sct/model/sgraph/impl/sgraph.ecore

@@ -1,112 +1,112 @@
-<?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="sgraph"
-    nsURI="http://www.yakindu.org/sct/2.0.0" nsPrefix="sgraph">
-  <eClassifiers xsi:type="ecore:EClass" name="Pseudostate" abstract="true" eSuperTypes="#//Vertex"/>
-  <eClassifiers xsi:type="ecore:EClass" name="Vertex" abstract="true" eSuperTypes="#//NamedElement">
-    <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore">
-      <details key="constraints" value="IncomingTransitionCount OutgoingTransitionCount"/>
-    </eAnnotations>
-    <eStructuralFeatures xsi:type="ecore:EReference" name="parentRegion" ordered="false"
-        lowerBound="1" eType="#//Region" eOpposite="#//Region/vertices"/>
-    <eStructuralFeatures xsi:type="ecore:EReference" name="incomingTransitions" ordered="false"
-        upperBound="-1" eType="#//Transition" eOpposite="#//Transition/target"/>
-    <eStructuralFeatures xsi:type="ecore:EReference" name="outgoingTransitions" ordered="false"
-        upperBound="-1" eType="#//Transition" containment="true" eOpposite="#//Transition/source"/>
-  </eClassifiers>
-  <eClassifiers xsi:type="ecore:EClass" name="NamedElement" abstract="true">
-    <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" ordered="false" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
-  </eClassifiers>
-  <eClassifiers xsi:type="ecore:EClass" name="Region" eSuperTypes="#//NamedElement">
-    <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore">
-      <details key="constraints" value="ExactlyOneInitialState"/>
-    </eAnnotations>
-    <eStructuralFeatures xsi:type="ecore:EReference" name="vertices" ordered="false"
-        upperBound="-1" eType="#//Vertex" containment="true" eOpposite="#//Vertex/parentRegion"/>
-    <eStructuralFeatures xsi:type="ecore:EAttribute" name="priority" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"/>
-  </eClassifiers>
-  <eClassifiers xsi:type="ecore:EClass" name="Transition" eSuperTypes="#//ExpressionElement #//Reaction">
-    <eAnnotations source="InjectMembers"/>
-    <eStructuralFeatures xsi:type="ecore:EReference" name="target" ordered="false"
-        lowerBound="1" eType="#//Vertex" eOpposite="#//Vertex/incomingTransitions"/>
-    <eStructuralFeatures xsi:type="ecore:EReference" name="source" ordered="false"
-        lowerBound="1" eType="#//Vertex" eOpposite="#//Vertex/outgoingTransitions"/>
-    <eStructuralFeatures xsi:type="ecore:EAttribute" name="priority" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"/>
-  </eClassifiers>
-  <eClassifiers xsi:type="ecore:EClass" name="FinalState" eSuperTypes="#//Vertex"/>
-  <eClassifiers xsi:type="ecore:EClass" name="Variable" abstract="true" eSuperTypes="#//Declaration"/>
-  <eClassifiers xsi:type="ecore:EClass" name="Junction" eSuperTypes="#//Pseudostate"/>
-  <eClassifiers xsi:type="ecore:EClass" name="Event" abstract="true" eSuperTypes="#//Declaration"/>
-  <eClassifiers xsi:type="ecore:EClass" name="Choice" eSuperTypes="#//Pseudostate"/>
-  <eClassifiers xsi:type="ecore:EClass" name="Statechart" eSuperTypes="#//NamedElement #//ExpressionElement #//ReactiveElement #//ScopedElement">
-    <eAnnotations source="InjectMembers"/>
-    <eStructuralFeatures xsi:type="ecore:EReference" name="regions" ordered="false"
-        lowerBound="1" upperBound="-1" eType="#//Region" containment="true"/>
-  </eClassifiers>
-  <eClassifiers xsi:type="ecore:EClass" name="Entry" eSuperTypes="#//Pseudostate">
-    <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore">
-      <details key="constraints" value="DisallowTrigger"/>
-    </eAnnotations>
-    <eStructuralFeatures xsi:type="ecore:EAttribute" name="kind" eType="#//EntryKind"/>
-  </eClassifiers>
-  <eClassifiers xsi:type="ecore:EClass" name="Trigger" abstract="true"/>
-  <eClassifiers xsi:type="ecore:EClass" name="Effect" abstract="true"/>
-  <eClassifiers xsi:type="ecore:EClass" name="ExpressionElement" abstract="true">
-    <eStructuralFeatures xsi:type="ecore:EAttribute" name="expression" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
-  </eClassifiers>
-  <eClassifiers xsi:type="ecore:EClass" name="Declaration" abstract="true" eSuperTypes="#//NamedElement"/>
-  <eClassifiers xsi:type="ecore:EClass" name="Reaction" abstract="true">
-    <eStructuralFeatures xsi:type="ecore:EReference" name="trigger" eType="#//Trigger"
-        containment="true"/>
-    <eStructuralFeatures xsi:type="ecore:EReference" name="effect" eType="#//Effect"
-        containment="true"/>
-  </eClassifiers>
-  <eClassifiers xsi:type="ecore:EEnum" name="EntryKind">
-    <eLiterals name="initial" literal="INITIAL"/>
-    <eLiterals name="shallowHistory" value="1" literal="SHALLOW_HISTORY"/>
-    <eLiterals name="deepHistory" value="2" literal="DEEP_HISTORY"/>
-  </eClassifiers>
-  <eClassifiers xsi:type="ecore:EClass" name="ReactiveElement" abstract="true">
-    <eStructuralFeatures xsi:type="ecore:EReference" name="reactions" upperBound="-1"
-        eType="#//Reaction" changeable="false" derived="true"/>
-    <eStructuralFeatures xsi:type="ecore:EReference" name="localReactions" upperBound="-1"
-        eType="#//Reaction" containment="true"/>
-  </eClassifiers>
-  <eClassifiers xsi:type="ecore:EClass" name="Exit" eSuperTypes="#//Pseudostate"/>
-  <eClassifiers xsi:type="ecore:EClass" name="Scope">
-    <eStructuralFeatures xsi:type="ecore:EReference" name="declarations" upperBound="-1"
-        eType="#//Declaration" containment="true"/>
-    <eStructuralFeatures xsi:type="ecore:EReference" name="events" upperBound="-1"
-        eType="#//Event" changeable="false" volatile="true" transient="true" derived="true"/>
-    <eStructuralFeatures xsi:type="ecore:EReference" name="variables" unique="false"
-        upperBound="-1" eType="#//Variable" changeable="false" volatile="true" transient="true"
-        derived="true"/>
-  </eClassifiers>
-  <eClassifiers xsi:type="ecore:EClass" name="ScopedElement" abstract="true">
-    <eStructuralFeatures xsi:type="ecore:EReference" name="scopes" upperBound="-1"
-        eType="#//Scope" containment="true"/>
-    <eStructuralFeatures xsi:type="ecore:EAttribute" name="namespace" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
-  </eClassifiers>
-  <eClassifiers xsi:type="ecore:EClass" name="Synchronization" eSuperTypes="#//Pseudostate"/>
-  <eClassifiers xsi:type="ecore:EClass" name="State" eSuperTypes="#//Vertex #//ExpressionElement #//ReactiveElement #//ScopedElement">
-    <eAnnotations source="InjectMembers"/>
-    <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore">
-      <details key="constraints" value="NameIsNotEmpty"/>
-    </eAnnotations>
-    <eStructuralFeatures xsi:type="ecore:EReference" name="subRegions" ordered="false"
-        upperBound="-1" eType="#//Region" containment="true"/>
-    <eStructuralFeatures xsi:type="ecore:EAttribute" name="orthogonal" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"
-        changeable="false" volatile="true" transient="true" derived="true"/>
-    <eStructuralFeatures xsi:type="ecore:EReference" name="substatechart" eType="#//Statechart"/>
-    <eStructuralFeatures xsi:type="ecore:EAttribute" name="submachine" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"
-        changeable="false" volatile="true" transient="true" derived="true"/>
-    <eStructuralFeatures xsi:type="ecore:EAttribute" name="simple" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"
-        changeable="false" volatile="true" transient="true" derived="true"/>
-    <eStructuralFeatures xsi:type="ecore:EAttribute" name="composite" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"
-        changeable="false" volatile="true" transient="true" derived="true"/>
-    <eStructuralFeatures xsi:type="ecore:EAttribute" name="leaf" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"
-        changeable="false" volatile="true" transient="true" derived="true"/>
-  </eClassifiers>
-  <eClassifiers xsi:type="ecore:EClass" name="Statement"/>
-</ecore:EPackage>
+<?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="sgraph"
+    nsURI="http://www.yakindu.org/sct/2.0.0" nsPrefix="sgraph">
+  <eClassifiers xsi:type="ecore:EClass" name="Pseudostate" abstract="true" eSuperTypes="#//Vertex"/>
+  <eClassifiers xsi:type="ecore:EClass" name="Vertex" abstract="true" eSuperTypes="#//NamedElement">
+    <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore">
+      <details key="constraints" value="IncomingTransitionCount OutgoingTransitionCount"/>
+    </eAnnotations>
+    <eStructuralFeatures xsi:type="ecore:EReference" name="parentRegion" ordered="false"
+        lowerBound="1" eType="#//Region" eOpposite="#//Region/vertices"/>
+    <eStructuralFeatures xsi:type="ecore:EReference" name="incomingTransitions" ordered="false"
+        upperBound="-1" eType="#//Transition" eOpposite="#//Transition/target"/>
+    <eStructuralFeatures xsi:type="ecore:EReference" name="outgoingTransitions" ordered="false"
+        upperBound="-1" eType="#//Transition" containment="true" eOpposite="#//Transition/source"/>
+  </eClassifiers>
+  <eClassifiers xsi:type="ecore:EClass" name="NamedElement" abstract="true">
+    <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" ordered="false" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+  </eClassifiers>
+  <eClassifiers xsi:type="ecore:EClass" name="Region" eSuperTypes="#//NamedElement">
+    <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore">
+      <details key="constraints" value="ExactlyOneInitialState"/>
+    </eAnnotations>
+    <eStructuralFeatures xsi:type="ecore:EReference" name="vertices" ordered="false"
+        upperBound="-1" eType="#//Vertex" containment="true" eOpposite="#//Vertex/parentRegion"/>
+    <eStructuralFeatures xsi:type="ecore:EAttribute" name="priority" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"/>
+  </eClassifiers>
+  <eClassifiers xsi:type="ecore:EClass" name="Transition" eSuperTypes="#//ExpressionElement #//Reaction">
+    <eAnnotations source="InjectMembers"/>
+    <eStructuralFeatures xsi:type="ecore:EReference" name="target" ordered="false"
+        lowerBound="1" eType="#//Vertex" eOpposite="#//Vertex/incomingTransitions"/>
+    <eStructuralFeatures xsi:type="ecore:EReference" name="source" ordered="false"
+        lowerBound="1" eType="#//Vertex" eOpposite="#//Vertex/outgoingTransitions"/>
+    <eStructuralFeatures xsi:type="ecore:EAttribute" name="priority" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"/>
+  </eClassifiers>
+  <eClassifiers xsi:type="ecore:EClass" name="FinalState" eSuperTypes="#//Vertex"/>
+  <eClassifiers xsi:type="ecore:EClass" name="Variable" abstract="true" eSuperTypes="#//Declaration"/>
+  <eClassifiers xsi:type="ecore:EClass" name="Junction" eSuperTypes="#//Pseudostate"/>
+  <eClassifiers xsi:type="ecore:EClass" name="Event" abstract="true" eSuperTypes="#//Declaration"/>
+  <eClassifiers xsi:type="ecore:EClass" name="Choice" eSuperTypes="#//Pseudostate"/>
+  <eClassifiers xsi:type="ecore:EClass" name="Statechart" eSuperTypes="#//NamedElement #//ExpressionElement #//ReactiveElement #//ScopedElement">
+    <eAnnotations source="InjectMembers"/>
+    <eStructuralFeatures xsi:type="ecore:EReference" name="regions" ordered="false"
+        lowerBound="1" upperBound="-1" eType="#//Region" containment="true"/>
+  </eClassifiers>
+  <eClassifiers xsi:type="ecore:EClass" name="Entry" eSuperTypes="#//Pseudostate">
+    <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore">
+      <details key="constraints" value="DisallowTrigger"/>
+    </eAnnotations>
+    <eStructuralFeatures xsi:type="ecore:EAttribute" name="kind" eType="#//EntryKind"/>
+  </eClassifiers>
+  <eClassifiers xsi:type="ecore:EClass" name="Trigger" abstract="true"/>
+  <eClassifiers xsi:type="ecore:EClass" name="Effect" abstract="true"/>
+  <eClassifiers xsi:type="ecore:EClass" name="ExpressionElement" abstract="true">
+    <eStructuralFeatures xsi:type="ecore:EAttribute" name="expression" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+  </eClassifiers>
+  <eClassifiers xsi:type="ecore:EClass" name="Declaration" abstract="true" eSuperTypes="#//NamedElement"/>
+  <eClassifiers xsi:type="ecore:EClass" name="Reaction" abstract="true">
+    <eStructuralFeatures xsi:type="ecore:EReference" name="trigger" eType="#//Trigger"
+        containment="true"/>
+    <eStructuralFeatures xsi:type="ecore:EReference" name="effect" eType="#//Effect"
+        containment="true"/>
+  </eClassifiers>
+  <eClassifiers xsi:type="ecore:EEnum" name="EntryKind">
+    <eLiterals name="initial" literal="INITIAL"/>
+    <eLiterals name="shallowHistory" value="1" literal="SHALLOW_HISTORY"/>
+    <eLiterals name="deepHistory" value="2" literal="DEEP_HISTORY"/>
+  </eClassifiers>
+  <eClassifiers xsi:type="ecore:EClass" name="ReactiveElement" abstract="true">
+    <eStructuralFeatures xsi:type="ecore:EReference" name="reactions" upperBound="-1"
+        eType="#//Reaction" changeable="false" volatile="true" transient="true" derived="true"/>
+    <eStructuralFeatures xsi:type="ecore:EReference" name="localReactions" upperBound="-1"
+        eType="#//Reaction" changeable="false" volatile="true" transient="true" derived="true"/>
+  </eClassifiers>
+  <eClassifiers xsi:type="ecore:EClass" name="Exit" eSuperTypes="#//Pseudostate"/>
+  <eClassifiers xsi:type="ecore:EClass" name="Scope">
+    <eStructuralFeatures xsi:type="ecore:EReference" name="declarations" upperBound="-1"
+        eType="#//Declaration" containment="true"/>
+    <eStructuralFeatures xsi:type="ecore:EReference" name="events" upperBound="-1"
+        eType="#//Event" changeable="false" volatile="true" transient="true" derived="true"/>
+    <eStructuralFeatures xsi:type="ecore:EReference" name="variables" unique="false"
+        upperBound="-1" eType="#//Variable" changeable="false" volatile="true" transient="true"
+        derived="true"/>
+  </eClassifiers>
+  <eClassifiers xsi:type="ecore:EClass" name="ScopedElement" abstract="true">
+    <eStructuralFeatures xsi:type="ecore:EReference" name="scopes" upperBound="-1"
+        eType="#//Scope" containment="true"/>
+    <eStructuralFeatures xsi:type="ecore:EAttribute" name="namespace" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+  </eClassifiers>
+  <eClassifiers xsi:type="ecore:EClass" name="Synchronization" eSuperTypes="#//Pseudostate"/>
+  <eClassifiers xsi:type="ecore:EClass" name="State" eSuperTypes="#//Vertex #//ExpressionElement #//ReactiveElement #//ScopedElement">
+    <eAnnotations source="InjectMembers"/>
+    <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore">
+      <details key="constraints" value="NameIsNotEmpty"/>
+    </eAnnotations>
+    <eStructuralFeatures xsi:type="ecore:EReference" name="subRegions" ordered="false"
+        upperBound="-1" eType="#//Region" containment="true"/>
+    <eStructuralFeatures xsi:type="ecore:EAttribute" name="orthogonal" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"
+        changeable="false" volatile="true" transient="true" derived="true"/>
+    <eStructuralFeatures xsi:type="ecore:EReference" name="substatechart" eType="#//Statechart"/>
+    <eStructuralFeatures xsi:type="ecore:EAttribute" name="submachine" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"
+        changeable="false" volatile="true" transient="true" derived="true"/>
+    <eStructuralFeatures xsi:type="ecore:EAttribute" name="simple" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"
+        changeable="false" volatile="true" transient="true" derived="true"/>
+    <eStructuralFeatures xsi:type="ecore:EAttribute" name="composite" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"
+        changeable="false" volatile="true" transient="true" derived="true"/>
+    <eStructuralFeatures xsi:type="ecore:EAttribute" name="leaf" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"
+        changeable="false" volatile="true" transient="true" derived="true"/>
+  </eClassifiers>
+  <eClassifiers xsi:type="ecore:EClass" name="Statement"/>
+</ecore:EPackage>