Просмотр исходного кода

transitions out of composite orthogonal states now also performs exit on orthogonal sibling regions ( YAKHMI-441 )

terfloth@itemis.de 14 лет назад
Родитель
Сommit
ddc6b7944a
40 измененных файлов с 3682 добавлено и 595 удалено
  1. BIN
      plugins/org.yakindu.sct.model.sexec.edit/icons/full/ctool16/CreateExecutionFlow_nodes_ExecutionEntry.gif
  2. BIN
      plugins/org.yakindu.sct.model.sexec.edit/icons/full/ctool16/CreateExecutionFlow_regions_ExecutionRegion.gif
  3. BIN
      plugins/org.yakindu.sct.model.sexec.edit/icons/full/ctool16/CreateExecutionNode_stateVector_StateVector.gif
  4. BIN
      plugins/org.yakindu.sct.model.sexec.edit/icons/full/ctool16/CreateExecutionScope_stateVector_StateVector.gif
  5. BIN
      plugins/org.yakindu.sct.model.sexec.edit/icons/full/obj16/ExecutionEntry.gif
  6. BIN
      plugins/org.yakindu.sct.model.sexec.edit/icons/full/obj16/ExecutionRegion.gif
  7. BIN
      plugins/org.yakindu.sct.model.sexec.edit/icons/full/obj16/ExecutionScope.gif
  8. 8 0
      plugins/org.yakindu.sct.model.sexec.edit/plugin.properties
  9. 114 0
      plugins/org.yakindu.sct.model.sexec.edit/src/org/yakindu/sct/model/sexec/provider/ExecutionEntryItemProvider.java
  10. 88 7
      plugins/org.yakindu.sct.model.sexec.edit/src/org/yakindu/sct/model/sexec/provider/ExecutionFlowItemProvider.java
  11. 114 0
      plugins/org.yakindu.sct.model.sexec.edit/src/org/yakindu/sct/model/sexec/provider/ExecutionRegionItemProvider.java
  12. 230 0
      plugins/org.yakindu.sct.model.sexec.edit/src/org/yakindu/sct/model/sexec/provider/ExecutionScopeItemProvider.java
  13. 53 7
      plugins/org.yakindu.sct.model.sexec.edit/src/org/yakindu/sct/model/sexec/provider/ExecutionStateItemProvider.java
  14. 72 0
      plugins/org.yakindu.sct.model.sexec.edit/src/org/yakindu/sct/model/sexec/provider/SexecItemProviderAdapterFactory.java
  15. 12 4
      plugins/org.yakindu.sct.model.sexec/model/sexec.ecore
  16. 21 0
      plugins/org.yakindu.sct.model.sexec/src/org/yakindu/sct/model/sexec/ExecutionEntry.java
  17. 18 28
      plugins/org.yakindu.sct.model.sexec/src/org/yakindu/sct/model/sexec/ExecutionFlow.java
  18. 21 0
      plugins/org.yakindu.sct.model.sexec/src/org/yakindu/sct/model/sexec/ExecutionRegion.java
  19. 102 0
      plugins/org.yakindu.sct.model.sexec/src/org/yakindu/sct/model/sexec/ExecutionScope.java
  20. 1 28
      plugins/org.yakindu.sct.model.sexec/src/org/yakindu/sct/model/sexec/ExecutionState.java
  21. 27 0
      plugins/org.yakindu.sct.model.sexec/src/org/yakindu/sct/model/sexec/SexecFactory.java
  22. 405 61
      plugins/org.yakindu.sct.model.sexec/src/org/yakindu/sct/model/sexec/SexecPackage.java
  23. 43 0
      plugins/org.yakindu.sct.model.sexec/src/org/yakindu/sct/model/sexec/impl/ExecutionEntryImpl.java
  24. 290 22
      plugins/org.yakindu.sct.model.sexec/src/org/yakindu/sct/model/sexec/impl/ExecutionFlowImpl.java
  25. 1 0
      plugins/org.yakindu.sct.model.sexec/src/org/yakindu/sct/model/sexec/impl/ExecutionNodeImpl.java
  26. 43 0
      plugins/org.yakindu.sct.model.sexec/src/org/yakindu/sct/model/sexec/impl/ExecutionRegionImpl.java
  27. 420 0
      plugins/org.yakindu.sct.model.sexec/src/org/yakindu/sct/model/sexec/impl/ExecutionScopeImpl.java
  28. 238 57
      plugins/org.yakindu.sct.model.sexec/src/org/yakindu/sct/model/sexec/impl/ExecutionStateImpl.java
  29. 33 0
      plugins/org.yakindu.sct.model.sexec/src/org/yakindu/sct/model/sexec/impl/SexecFactoryImpl.java
  30. 100 10
      plugins/org.yakindu.sct.model.sexec/src/org/yakindu/sct/model/sexec/impl/SexecPackageImpl.java
  31. 11 0
      plugins/org.yakindu.sct.model.sexec/src/org/yakindu/sct/model/sexec/transformation/FactoryExtension.xtend
  32. 224 83
      plugins/org.yakindu.sct.model.sexec/src/org/yakindu/sct/model/sexec/transformation/ModelSequencer.xtend
  33. 29 0
      plugins/org.yakindu.sct.model.sexec/src/org/yakindu/sct/model/sexec/transformation/StatechartExtensions.xtend
  34. 54 0
      plugins/org.yakindu.sct.model.sexec/src/org/yakindu/sct/model/sexec/util/SexecAdapterFactory.java
  35. 74 0
      plugins/org.yakindu.sct.model.sexec/src/org/yakindu/sct/model/sexec/util/SexecSwitch.java
  36. 36 10
      plugins/org.yakindu.sct.model.sexec/xtend-gen/org/yakindu/sct/model/sexec/transformation/FactoryExtension.java
  37. 454 271
      plugins/org.yakindu.sct.model.sexec/xtend-gen/org/yakindu/sct/model/sexec/transformation/ModelSequencer.java
  38. 35 0
      plugins/org.yakindu.sct.model.sexec/xtend-gen/org/yakindu/sct/model/sexec/transformation/StatechartExtensions.java
  39. 309 5
      test-plugins/org.yakindu.sct.model.sexec.test/src/org/yakindu/sct/model/sexec/transformation/test/ModelSequencerOrthogonalityTest.java
  40. 2 2
      test-plugins/org.yakindu.sct.model.sexec.test/src/org/yakindu/sct/model/sexec/transformation/test/ModelSequencerStateTest.java

BIN
plugins/org.yakindu.sct.model.sexec.edit/icons/full/ctool16/CreateExecutionFlow_nodes_ExecutionEntry.gif


BIN
plugins/org.yakindu.sct.model.sexec.edit/icons/full/ctool16/CreateExecutionFlow_regions_ExecutionRegion.gif


BIN
plugins/org.yakindu.sct.model.sexec.edit/icons/full/ctool16/CreateExecutionNode_stateVector_StateVector.gif


BIN
plugins/org.yakindu.sct.model.sexec.edit/icons/full/ctool16/CreateExecutionScope_stateVector_StateVector.gif


BIN
plugins/org.yakindu.sct.model.sexec.edit/icons/full/obj16/ExecutionEntry.gif


BIN
plugins/org.yakindu.sct.model.sexec.edit/icons/full/obj16/ExecutionRegion.gif


BIN
plugins/org.yakindu.sct.model.sexec.edit/icons/full/obj16/ExecutionScope.gif


+ 8 - 0
plugins/org.yakindu.sct.model.sexec.edit/plugin.properties

@@ -99,3 +99,11 @@ _UI_TraceStateExited_state_feature = State
 _UI_TraceNodeExecuted_type = Trace Node Executed
 _UI_TraceNodeExecuted_node_feature = Node
 _UI_StateSwitch_stateConfigurationIdx_feature = State Configuration Idx
+_UI_ExecutionNode_stateVector_feature = State Vector
+_UI_ExecutionEntry_type = Execution Entry
+_UI_ExecutionScope_type = Execution Scope
+_UI_ExecutionRegion_type = Execution Region
+_UI_ExecutionFlow_regions_feature = Regions
+_UI_ExecutionScope_stateVector_feature = State Vector
+_UI_ExecutionScope_subScopes_feature = Sub Scopes
+_UI_ExecutionScope_superScope_feature = Super Scope

+ 114 - 0
plugins/org.yakindu.sct.model.sexec.edit/src/org/yakindu/sct/model/sexec/provider/ExecutionEntryItemProvider.java

@@ -0,0 +1,114 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id$
+ */
+package org.yakindu.sct.model.sexec.provider;
+
+
+import java.util.Collection;
+import java.util.List;
+
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.common.notify.Notification;
+
+import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
+import org.eclipse.emf.edit.provider.IItemLabelProvider;
+import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.IItemPropertySource;
+import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
+import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
+
+import org.yakindu.sct.model.sexec.ExecutionEntry;
+
+/**
+ * This is the item provider adapter for a {@link org.yakindu.sct.model.sexec.ExecutionEntry} object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class ExecutionEntryItemProvider
+	extends ExecutionNodeItemProvider
+	implements
+		IEditingDomainItemProvider,
+		IStructuredItemContentProvider,
+		ITreeItemContentProvider,
+		IItemLabelProvider,
+		IItemPropertySource {
+	/**
+	 * This constructs an instance from a factory and a notifier.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public ExecutionEntryItemProvider(AdapterFactory adapterFactory) {
+		super(adapterFactory);
+	}
+
+	/**
+	 * This returns the property descriptors for the adapted class.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	@Override
+	public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
+		if (itemPropertyDescriptors == null) {
+			super.getPropertyDescriptors(object);
+
+		}
+		return itemPropertyDescriptors;
+	}
+
+	/**
+	 * This returns ExecutionEntry.gif.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	@Override
+	public Object getImage(Object object) {
+		return overlayImage(object, getResourceLocator().getImage("full/obj16/ExecutionEntry"));
+	}
+
+	/**
+	 * This returns the label text for the adapted class.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	@Override
+	public String getText(Object object) {
+		String label = ((ExecutionEntry)object).getName();
+		return label == null || label.length() == 0 ?
+			getString("_UI_ExecutionEntry_type") :
+			getString("_UI_ExecutionEntry_type") + " " + label;
+	}
+
+	/**
+	 * This handles model notifications by calling {@link #updateChildren} to update any cached
+	 * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	@Override
+	public void notifyChanged(Notification notification) {
+		updateChildren(notification);
+		super.notifyChanged(notification);
+	}
+
+	/**
+	 * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children
+	 * that can be created under this object.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	@Override
+	protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) {
+		super.collectNewChildDescriptors(newChildDescriptors, object);
+	}
+
+}

+ 88 - 7
plugins/org.yakindu.sct.model.sexec.edit/src/org/yakindu/sct/model/sexec/provider/ExecutionFlowItemProvider.java

@@ -64,6 +64,9 @@ public class ExecutionFlowItemProvider
 			super.getPropertyDescriptors(object);
 
 			addNamePropertyDescriptor(object);
+			addSourceElementPropertyDescriptor(object);
+			addSubScopesPropertyDescriptor(object);
+			addSuperScopePropertyDescriptor(object);
 		}
 		return itemPropertyDescriptors;
 	}
@@ -90,6 +93,72 @@ public class ExecutionFlowItemProvider
 				 null));
 	}
 
+	/**
+	 * This adds a property descriptor for the Source Element feature.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	protected void addSourceElementPropertyDescriptor(Object object) {
+		itemPropertyDescriptors.add
+			(createItemPropertyDescriptor
+				(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
+				 getResourceLocator(),
+				 getString("_UI_MappedElement_sourceElement_feature"),
+				 getString("_UI_PropertyDescriptor_description", "_UI_MappedElement_sourceElement_feature", "_UI_MappedElement_type"),
+				 SexecPackage.Literals.MAPPED_ELEMENT__SOURCE_ELEMENT,
+				 true,
+				 false,
+				 true,
+				 null,
+				 null,
+				 null));
+	}
+
+	/**
+	 * This adds a property descriptor for the Sub Scopes feature.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	protected void addSubScopesPropertyDescriptor(Object object) {
+		itemPropertyDescriptors.add
+			(createItemPropertyDescriptor
+				(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
+				 getResourceLocator(),
+				 getString("_UI_ExecutionScope_subScopes_feature"),
+				 getString("_UI_PropertyDescriptor_description", "_UI_ExecutionScope_subScopes_feature", "_UI_ExecutionScope_type"),
+				 SexecPackage.Literals.EXECUTION_SCOPE__SUB_SCOPES,
+				 true,
+				 false,
+				 true,
+				 null,
+				 null,
+				 null));
+	}
+
+	/**
+	 * This adds a property descriptor for the Super Scope feature.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	protected void addSuperScopePropertyDescriptor(Object object) {
+		itemPropertyDescriptors.add
+			(createItemPropertyDescriptor
+				(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
+				 getResourceLocator(),
+				 getString("_UI_ExecutionScope_superScope_feature"),
+				 getString("_UI_PropertyDescriptor_description", "_UI_ExecutionScope_superScope_feature", "_UI_ExecutionScope_type"),
+				 SexecPackage.Literals.EXECUTION_SCOPE__SUPER_SCOPE,
+				 true,
+				 false,
+				 true,
+				 null,
+				 null,
+				 null));
+	}
+
 	/**
 	 * This specifies how to implement {@link #getChildren} and is used to deduce an appropriate feature for an
 	 * {@link org.eclipse.emf.edit.command.AddCommand}, {@link org.eclipse.emf.edit.command.RemoveCommand} or
@@ -102,11 +171,12 @@ public class ExecutionFlowItemProvider
 	public Collection<? extends EStructuralFeature> getChildrenFeatures(Object object) {
 		if (childrenFeatures == null) {
 			super.getChildrenFeatures(object);
+			childrenFeatures.add(SexecPackage.Literals.EXECUTION_SCOPE__STATE_VECTOR);
 			childrenFeatures.add(SexecPackage.Literals.EXECUTION_FLOW__STATES);
 			childrenFeatures.add(SexecPackage.Literals.EXECUTION_FLOW__ENTER_SEQUENCE);
-			childrenFeatures.add(SexecPackage.Literals.EXECUTION_FLOW__STATE_VECTOR);
 			childrenFeatures.add(SexecPackage.Literals.EXECUTION_FLOW__EXIT_SEQUENCE);
 			childrenFeatures.add(SexecPackage.Literals.EXECUTION_FLOW__NODES);
+			childrenFeatures.add(SexecPackage.Literals.EXECUTION_FLOW__REGIONS);
 		}
 		return childrenFeatures;
 	}
@@ -164,11 +234,12 @@ public class ExecutionFlowItemProvider
 			case SexecPackage.EXECUTION_FLOW__NAME:
 				fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
 				return;
+			case SexecPackage.EXECUTION_FLOW__STATE_VECTOR:
 			case SexecPackage.EXECUTION_FLOW__STATES:
 			case SexecPackage.EXECUTION_FLOW__ENTER_SEQUENCE:
-			case SexecPackage.EXECUTION_FLOW__STATE_VECTOR:
 			case SexecPackage.EXECUTION_FLOW__EXIT_SEQUENCE:
 			case SexecPackage.EXECUTION_FLOW__NODES:
+			case SexecPackage.EXECUTION_FLOW__REGIONS:
 				fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false));
 				return;
 		}
@@ -186,6 +257,11 @@ public class ExecutionFlowItemProvider
 	protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) {
 		super.collectNewChildDescriptors(newChildDescriptors, object);
 
+		newChildDescriptors.add
+			(createChildParameter
+				(SexecPackage.Literals.EXECUTION_SCOPE__STATE_VECTOR,
+				 SexecFactory.eINSTANCE.createStateVector()));
+
 		newChildDescriptors.add
 			(createChildParameter
 				(SexecPackage.Literals.EXECUTION_FLOW__STATES,
@@ -196,11 +272,6 @@ public class ExecutionFlowItemProvider
 				(SexecPackage.Literals.EXECUTION_FLOW__ENTER_SEQUENCE,
 				 SexecFactory.eINSTANCE.createSequence()));
 
-		newChildDescriptors.add
-			(createChildParameter
-				(SexecPackage.Literals.EXECUTION_FLOW__STATE_VECTOR,
-				 SexecFactory.eINSTANCE.createStateVector()));
-
 		newChildDescriptors.add
 			(createChildParameter
 				(SexecPackage.Literals.EXECUTION_FLOW__EXIT_SEQUENCE,
@@ -216,10 +287,20 @@ public class ExecutionFlowItemProvider
 				(SexecPackage.Literals.EXECUTION_FLOW__NODES,
 				 SexecFactory.eINSTANCE.createExecutionState()));
 
+		newChildDescriptors.add
+			(createChildParameter
+				(SexecPackage.Literals.EXECUTION_FLOW__NODES,
+				 SexecFactory.eINSTANCE.createExecutionEntry()));
+
 		newChildDescriptors.add
 			(createChildParameter
 				(SexecPackage.Literals.EXECUTION_FLOW__NODES,
 				 SexecFactory.eINSTANCE.createExecutionChoice()));
+
+		newChildDescriptors.add
+			(createChildParameter
+				(SexecPackage.Literals.EXECUTION_FLOW__REGIONS,
+				 SexecFactory.eINSTANCE.createExecutionRegion()));
 	}
 
 	/**

+ 114 - 0
plugins/org.yakindu.sct.model.sexec.edit/src/org/yakindu/sct/model/sexec/provider/ExecutionRegionItemProvider.java

@@ -0,0 +1,114 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id$
+ */
+package org.yakindu.sct.model.sexec.provider;
+
+
+import java.util.Collection;
+import java.util.List;
+
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.common.notify.Notification;
+
+import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
+import org.eclipse.emf.edit.provider.IItemLabelProvider;
+import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.IItemPropertySource;
+import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
+import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
+
+import org.yakindu.sct.model.sexec.ExecutionRegion;
+
+/**
+ * This is the item provider adapter for a {@link org.yakindu.sct.model.sexec.ExecutionRegion} object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class ExecutionRegionItemProvider
+	extends ExecutionScopeItemProvider
+	implements
+		IEditingDomainItemProvider,
+		IStructuredItemContentProvider,
+		ITreeItemContentProvider,
+		IItemLabelProvider,
+		IItemPropertySource {
+	/**
+	 * This constructs an instance from a factory and a notifier.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public ExecutionRegionItemProvider(AdapterFactory adapterFactory) {
+		super(adapterFactory);
+	}
+
+	/**
+	 * This returns the property descriptors for the adapted class.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	@Override
+	public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
+		if (itemPropertyDescriptors == null) {
+			super.getPropertyDescriptors(object);
+
+		}
+		return itemPropertyDescriptors;
+	}
+
+	/**
+	 * This returns ExecutionRegion.gif.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	@Override
+	public Object getImage(Object object) {
+		return overlayImage(object, getResourceLocator().getImage("full/obj16/ExecutionRegion"));
+	}
+
+	/**
+	 * This returns the label text for the adapted class.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	@Override
+	public String getText(Object object) {
+		String label = ((ExecutionRegion)object).getName();
+		return label == null || label.length() == 0 ?
+			getString("_UI_ExecutionRegion_type") :
+			getString("_UI_ExecutionRegion_type") + " " + label;
+	}
+
+	/**
+	 * This handles model notifications by calling {@link #updateChildren} to update any cached
+	 * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	@Override
+	public void notifyChanged(Notification notification) {
+		updateChildren(notification);
+		super.notifyChanged(notification);
+	}
+
+	/**
+	 * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children
+	 * that can be created under this object.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	@Override
+	protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) {
+		super.collectNewChildDescriptors(newChildDescriptors, object);
+	}
+
+}

+ 230 - 0
plugins/org.yakindu.sct.model.sexec.edit/src/org/yakindu/sct/model/sexec/provider/ExecutionScopeItemProvider.java

@@ -0,0 +1,230 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id$
+ */
+package org.yakindu.sct.model.sexec.provider;
+
+
+import java.util.Collection;
+import java.util.List;
+
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.common.notify.Notification;
+
+import org.eclipse.emf.ecore.EStructuralFeature;
+
+import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
+import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
+import org.eclipse.emf.edit.provider.IItemLabelProvider;
+import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.IItemPropertySource;
+import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
+import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
+import org.eclipse.emf.edit.provider.ViewerNotification;
+
+import org.yakindu.sct.model.sexec.ExecutionScope;
+import org.yakindu.sct.model.sexec.SexecFactory;
+import org.yakindu.sct.model.sexec.SexecPackage;
+
+/**
+ * This is the item provider adapter for a {@link org.yakindu.sct.model.sexec.ExecutionScope} object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class ExecutionScopeItemProvider
+	extends NamedElementItemProvider
+	implements
+		IEditingDomainItemProvider,
+		IStructuredItemContentProvider,
+		ITreeItemContentProvider,
+		IItemLabelProvider,
+		IItemPropertySource {
+	/**
+	 * This constructs an instance from a factory and a notifier.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public ExecutionScopeItemProvider(AdapterFactory adapterFactory) {
+		super(adapterFactory);
+	}
+
+	/**
+	 * This returns the property descriptors for the adapted class.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	@Override
+	public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
+		if (itemPropertyDescriptors == null) {
+			super.getPropertyDescriptors(object);
+
+			addSourceElementPropertyDescriptor(object);
+			addSubScopesPropertyDescriptor(object);
+			addSuperScopePropertyDescriptor(object);
+		}
+		return itemPropertyDescriptors;
+	}
+
+	/**
+	 * This adds a property descriptor for the Source Element feature.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	protected void addSourceElementPropertyDescriptor(Object object) {
+		itemPropertyDescriptors.add
+			(createItemPropertyDescriptor
+				(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
+				 getResourceLocator(),
+				 getString("_UI_MappedElement_sourceElement_feature"),
+				 getString("_UI_PropertyDescriptor_description", "_UI_MappedElement_sourceElement_feature", "_UI_MappedElement_type"),
+				 SexecPackage.Literals.MAPPED_ELEMENT__SOURCE_ELEMENT,
+				 true,
+				 false,
+				 true,
+				 null,
+				 null,
+				 null));
+	}
+
+	/**
+	 * This adds a property descriptor for the Sub Scopes feature.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	protected void addSubScopesPropertyDescriptor(Object object) {
+		itemPropertyDescriptors.add
+			(createItemPropertyDescriptor
+				(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
+				 getResourceLocator(),
+				 getString("_UI_ExecutionScope_subScopes_feature"),
+				 getString("_UI_PropertyDescriptor_description", "_UI_ExecutionScope_subScopes_feature", "_UI_ExecutionScope_type"),
+				 SexecPackage.Literals.EXECUTION_SCOPE__SUB_SCOPES,
+				 true,
+				 false,
+				 true,
+				 null,
+				 null,
+				 null));
+	}
+
+	/**
+	 * This adds a property descriptor for the Super Scope feature.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	protected void addSuperScopePropertyDescriptor(Object object) {
+		itemPropertyDescriptors.add
+			(createItemPropertyDescriptor
+				(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
+				 getResourceLocator(),
+				 getString("_UI_ExecutionScope_superScope_feature"),
+				 getString("_UI_PropertyDescriptor_description", "_UI_ExecutionScope_superScope_feature", "_UI_ExecutionScope_type"),
+				 SexecPackage.Literals.EXECUTION_SCOPE__SUPER_SCOPE,
+				 true,
+				 false,
+				 true,
+				 null,
+				 null,
+				 null));
+	}
+
+	/**
+	 * This specifies how to implement {@link #getChildren} and is used to deduce an appropriate feature for an
+	 * {@link org.eclipse.emf.edit.command.AddCommand}, {@link org.eclipse.emf.edit.command.RemoveCommand} or
+	 * {@link org.eclipse.emf.edit.command.MoveCommand} in {@link #createCommand}.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	@Override
+	public Collection<? extends EStructuralFeature> getChildrenFeatures(Object object) {
+		if (childrenFeatures == null) {
+			super.getChildrenFeatures(object);
+			childrenFeatures.add(SexecPackage.Literals.EXECUTION_SCOPE__STATE_VECTOR);
+		}
+		return childrenFeatures;
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	@Override
+	protected EStructuralFeature getChildFeature(Object object, Object child) {
+		// Check the type of the specified child object and return the proper feature to use for
+		// adding (see {@link AddCommand}) it as a child.
+
+		return super.getChildFeature(object, child);
+	}
+
+	/**
+	 * This returns ExecutionScope.gif.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	@Override
+	public Object getImage(Object object) {
+		return overlayImage(object, getResourceLocator().getImage("full/obj16/ExecutionScope"));
+	}
+
+	/**
+	 * This returns the label text for the adapted class.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	@Override
+	public String getText(Object object) {
+		String label = ((ExecutionScope)object).getName();
+		return label == null || label.length() == 0 ?
+			getString("_UI_ExecutionScope_type") :
+			getString("_UI_ExecutionScope_type") + " " + label;
+	}
+
+	/**
+	 * This handles model notifications by calling {@link #updateChildren} to update any cached
+	 * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	@Override
+	public void notifyChanged(Notification notification) {
+		updateChildren(notification);
+
+		switch (notification.getFeatureID(ExecutionScope.class)) {
+			case SexecPackage.EXECUTION_SCOPE__STATE_VECTOR:
+				fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false));
+				return;
+		}
+		super.notifyChanged(notification);
+	}
+
+	/**
+	 * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children
+	 * that can be created under this object.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	@Override
+	protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) {
+		super.collectNewChildDescriptors(newChildDescriptors, object);
+
+		newChildDescriptors.add
+			(createChildParameter
+				(SexecPackage.Literals.EXECUTION_SCOPE__STATE_VECTOR,
+				 SexecFactory.eINSTANCE.createStateVector()));
+	}
+
+}

+ 53 - 7
plugins/org.yakindu.sct.model.sexec.edit/src/org/yakindu/sct/model/sexec/provider/ExecutionStateItemProvider.java

@@ -61,11 +61,57 @@ public class ExecutionStateItemProvider
 		if (itemPropertyDescriptors == null) {
 			super.getPropertyDescriptors(object);
 
+			addSubScopesPropertyDescriptor(object);
+			addSuperScopePropertyDescriptor(object);
 			addLeafPropertyDescriptor(object);
 		}
 		return itemPropertyDescriptors;
 	}
 
+	/**
+	 * This adds a property descriptor for the Sub Scopes feature.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	protected void addSubScopesPropertyDescriptor(Object object) {
+		itemPropertyDescriptors.add
+			(createItemPropertyDescriptor
+				(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
+				 getResourceLocator(),
+				 getString("_UI_ExecutionScope_subScopes_feature"),
+				 getString("_UI_PropertyDescriptor_description", "_UI_ExecutionScope_subScopes_feature", "_UI_ExecutionScope_type"),
+				 SexecPackage.Literals.EXECUTION_SCOPE__SUB_SCOPES,
+				 true,
+				 false,
+				 true,
+				 null,
+				 null,
+				 null));
+	}
+
+	/**
+	 * This adds a property descriptor for the Super Scope feature.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	protected void addSuperScopePropertyDescriptor(Object object) {
+		itemPropertyDescriptors.add
+			(createItemPropertyDescriptor
+				(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
+				 getResourceLocator(),
+				 getString("_UI_ExecutionScope_superScope_feature"),
+				 getString("_UI_PropertyDescriptor_description", "_UI_ExecutionScope_superScope_feature", "_UI_ExecutionScope_type"),
+				 SexecPackage.Literals.EXECUTION_SCOPE__SUPER_SCOPE,
+				 true,
+				 false,
+				 true,
+				 null,
+				 null,
+				 null));
+	}
+
 	/**
 	 * This adds a property descriptor for the Leaf feature.
 	 * <!-- begin-user-doc -->
@@ -100,11 +146,11 @@ public class ExecutionStateItemProvider
 	public Collection<? extends EStructuralFeature> getChildrenFeatures(Object object) {
 		if (childrenFeatures == null) {
 			super.getChildrenFeatures(object);
+			childrenFeatures.add(SexecPackage.Literals.EXECUTION_SCOPE__STATE_VECTOR);
 			childrenFeatures.add(SexecPackage.Literals.EXECUTION_STATE__ENTRY_ACTION);
 			childrenFeatures.add(SexecPackage.Literals.EXECUTION_STATE__EXIT_ACTION);
 			childrenFeatures.add(SexecPackage.Literals.EXECUTION_STATE__ENTER_SEQUENCE);
 			childrenFeatures.add(SexecPackage.Literals.EXECUTION_STATE__EXIT_SEQUENCE);
-			childrenFeatures.add(SexecPackage.Literals.EXECUTION_STATE__STATE_VECTOR);
 		}
 		return childrenFeatures;
 	}
@@ -162,11 +208,11 @@ public class ExecutionStateItemProvider
 			case SexecPackage.EXECUTION_STATE__LEAF:
 				fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
 				return;
+			case SexecPackage.EXECUTION_STATE__STATE_VECTOR:
 			case SexecPackage.EXECUTION_STATE__ENTRY_ACTION:
 			case SexecPackage.EXECUTION_STATE__EXIT_ACTION:
 			case SexecPackage.EXECUTION_STATE__ENTER_SEQUENCE:
 			case SexecPackage.EXECUTION_STATE__EXIT_SEQUENCE:
-			case SexecPackage.EXECUTION_STATE__STATE_VECTOR:
 				fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false));
 				return;
 		}
@@ -184,6 +230,11 @@ public class ExecutionStateItemProvider
 	protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) {
 		super.collectNewChildDescriptors(newChildDescriptors, object);
 
+		newChildDescriptors.add
+			(createChildParameter
+				(SexecPackage.Literals.EXECUTION_SCOPE__STATE_VECTOR,
+				 SexecFactory.eINSTANCE.createStateVector()));
+
 		newChildDescriptors.add
 			(createChildParameter
 				(SexecPackage.Literals.EXECUTION_STATE__ENTRY_ACTION,
@@ -343,11 +394,6 @@ public class ExecutionStateItemProvider
 			(createChildParameter
 				(SexecPackage.Literals.EXECUTION_STATE__EXIT_SEQUENCE,
 				 SexecFactory.eINSTANCE.createSequence()));
-
-		newChildDescriptors.add
-			(createChildParameter
-				(SexecPackage.Literals.EXECUTION_STATE__STATE_VECTOR,
-				 SexecFactory.eINSTANCE.createStateVector()));
 	}
 
 	/**

+ 72 - 0
plugins/org.yakindu.sct.model.sexec.edit/src/org/yakindu/sct/model/sexec/provider/SexecItemProviderAdapterFactory.java

@@ -142,6 +142,75 @@ public class SexecItemProviderAdapterFactory extends SexecAdapterFactory impleme
 		return executionStateItemProvider;
 	}
 
+	/**
+	 * This keeps track of the one adapter used for all {@link org.yakindu.sct.model.sexec.ExecutionScope} instances.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	protected ExecutionScopeItemProvider executionScopeItemProvider;
+
+	/**
+	 * This creates an adapter for a {@link org.yakindu.sct.model.sexec.ExecutionScope}.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	@Override
+	public Adapter createExecutionScopeAdapter() {
+		if (executionScopeItemProvider == null) {
+			executionScopeItemProvider = new ExecutionScopeItemProvider(this);
+		}
+
+		return executionScopeItemProvider;
+	}
+
+	/**
+	 * This keeps track of the one adapter used for all {@link org.yakindu.sct.model.sexec.ExecutionRegion} instances.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	protected ExecutionRegionItemProvider executionRegionItemProvider;
+
+	/**
+	 * This creates an adapter for a {@link org.yakindu.sct.model.sexec.ExecutionRegion}.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	@Override
+	public Adapter createExecutionRegionAdapter() {
+		if (executionRegionItemProvider == null) {
+			executionRegionItemProvider = new ExecutionRegionItemProvider(this);
+		}
+
+		return executionRegionItemProvider;
+	}
+
+	/**
+	 * This keeps track of the one adapter used for all {@link org.yakindu.sct.model.sexec.ExecutionEntry} instances.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	protected ExecutionEntryItemProvider executionEntryItemProvider;
+
+	/**
+	 * This creates an adapter for a {@link org.yakindu.sct.model.sexec.ExecutionEntry}.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	@Override
+	public Adapter createExecutionEntryAdapter() {
+		if (executionEntryItemProvider == null) {
+			executionEntryItemProvider = new ExecutionEntryItemProvider(this);
+		}
+
+		return executionEntryItemProvider;
+	}
+
 	/**
 	 * This keeps track of the one adapter used for all {@link org.yakindu.sct.model.sexec.ExecutionChoice} instances.
 	 * <!-- begin-user-doc -->
@@ -752,6 +821,9 @@ public class SexecItemProviderAdapterFactory extends SexecAdapterFactory impleme
 		if (executionFlowItemProvider != null) executionFlowItemProvider.dispose();
 		if (executionNodeItemProvider != null) executionNodeItemProvider.dispose();
 		if (executionStateItemProvider != null) executionStateItemProvider.dispose();
+		if (executionScopeItemProvider != null) executionScopeItemProvider.dispose();
+		if (executionRegionItemProvider != null) executionRegionItemProvider.dispose();
+		if (executionEntryItemProvider != null) executionEntryItemProvider.dispose();
 		if (executionChoiceItemProvider != null) executionChoiceItemProvider.dispose();
 		if (reactionItemProvider != null) reactionItemProvider.dispose();
 		if (stateVectorItemProvider != null) stateVectorItemProvider.dispose();

+ 12 - 4
plugins/org.yakindu.sct.model.sexec/model/sexec.ecore

@@ -9,17 +9,17 @@
   <eClassifiers xsi:type="ecore:EClass" name="MappedElement">
     <eStructuralFeatures xsi:type="ecore:EReference" name="sourceElement" eType="ecore:EClass http://www.eclipse.org/emf/2002/Ecore#//EObject"/>
   </eClassifiers>
-  <eClassifiers xsi:type="ecore:EClass" name="ExecutionFlow" eSuperTypes="../../org.yakindu.sct.model.sgraph/model/emf/sgraph.ecore#//ScopedElement #//NamedElement">
+  <eClassifiers xsi:type="ecore:EClass" name="ExecutionFlow" eSuperTypes="../../org.yakindu.sct.model.sgraph/model/emf/sgraph.ecore#//ScopedElement #//ExecutionScope">
     <eStructuralFeatures xsi:type="ecore:EReference" name="states" upperBound="-1"
         eType="#//ExecutionState" containment="true"/>
     <eStructuralFeatures xsi:type="ecore:EReference" name="enterSequence" eType="#//Sequence"
         containment="true"/>
-    <eStructuralFeatures xsi:type="ecore:EReference" name="stateVector" eType="#//StateVector"
-        containment="true"/>
     <eStructuralFeatures xsi:type="ecore:EReference" name="exitSequence" eType="#//Sequence"
         containment="true"/>
     <eStructuralFeatures xsi:type="ecore:EReference" name="nodes" upperBound="-1"
         eType="#//ExecutionNode" containment="true"/>
+    <eStructuralFeatures xsi:type="ecore:EReference" name="regions" upperBound="-1"
+        eType="#//ExecutionRegion" containment="true"/>
   </eClassifiers>
   <eClassifiers xsi:type="ecore:EClass" name="ExecutionNode" eSuperTypes="#//NamedElement #//MappedElement">
     <eStructuralFeatures xsi:type="ecore:EReference" name="reactions" upperBound="-1"
@@ -28,7 +28,7 @@
     <eStructuralFeatures xsi:type="ecore:EReference" name="reactSequence" eType="#//Sequence"
         containment="true"/>
   </eClassifiers>
-  <eClassifiers xsi:type="ecore:EClass" name="ExecutionState" eSuperTypes="#//ExecutionNode">
+  <eClassifiers xsi:type="ecore:EClass" name="ExecutionState" eSuperTypes="#//ExecutionNode #//ExecutionScope">
     <eStructuralFeatures xsi:type="ecore:EAttribute" name="leaf" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"
         defaultValueLiteral="false"/>
     <eStructuralFeatures xsi:type="ecore:EReference" name="entryAction" eType="#//Step"
@@ -39,9 +39,17 @@
         containment="true"/>
     <eStructuralFeatures xsi:type="ecore:EReference" name="exitSequence" eType="#//Sequence"
         containment="true"/>
+  </eClassifiers>
+  <eClassifiers xsi:type="ecore:EClass" name="ExecutionScope" eSuperTypes="#//NamedElement #//MappedElement">
     <eStructuralFeatures xsi:type="ecore:EReference" name="stateVector" eType="#//StateVector"
         containment="true"/>
+    <eStructuralFeatures xsi:type="ecore:EReference" name="subScopes" upperBound="-1"
+        eType="#//ExecutionScope" eOpposite="#//ExecutionScope/superScope"/>
+    <eStructuralFeatures xsi:type="ecore:EReference" name="superScope" eType="#//ExecutionScope"
+        eOpposite="#//ExecutionScope/subScopes"/>
   </eClassifiers>
+  <eClassifiers xsi:type="ecore:EClass" name="ExecutionRegion" eSuperTypes="#//ExecutionScope"/>
+  <eClassifiers xsi:type="ecore:EClass" name="ExecutionEntry" eSuperTypes="#//ExecutionNode"/>
   <eClassifiers xsi:type="ecore:EClass" name="ExecutionChoice" eSuperTypes="#//ExecutionNode"/>
   <eClassifiers xsi:type="ecore:EClass" name="Reaction" eSuperTypes="#//NamedElement #//MappedElement">
     <eStructuralFeatures xsi:type="ecore:EReference" name="check" eType="#//Check"

+ 21 - 0
plugins/org.yakindu.sct.model.sexec/src/org/yakindu/sct/model/sexec/ExecutionEntry.java

@@ -0,0 +1,21 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id$
+ */
+package org.yakindu.sct.model.sexec;
+
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>Execution Entry</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ *
+ * @see org.yakindu.sct.model.sexec.SexecPackage#getExecutionEntry()
+ * @model
+ * @generated
+ */
+public interface ExecutionEntry extends ExecutionNode {
+} // ExecutionEntry

+ 18 - 28
plugins/org.yakindu.sct.model.sexec/src/org/yakindu/sct/model/sexec/ExecutionFlow.java

@@ -19,9 +19,9 @@ import org.yakindu.sct.model.sgraph.ScopedElement;
  * <ul>
  *   <li>{@link org.yakindu.sct.model.sexec.ExecutionFlow#getStates <em>States</em>}</li>
  *   <li>{@link org.yakindu.sct.model.sexec.ExecutionFlow#getEnterSequence <em>Enter Sequence</em>}</li>
- *   <li>{@link org.yakindu.sct.model.sexec.ExecutionFlow#getStateVector <em>State Vector</em>}</li>
  *   <li>{@link org.yakindu.sct.model.sexec.ExecutionFlow#getExitSequence <em>Exit Sequence</em>}</li>
  *   <li>{@link org.yakindu.sct.model.sexec.ExecutionFlow#getNodes <em>Nodes</em>}</li>
+ *   <li>{@link org.yakindu.sct.model.sexec.ExecutionFlow#getRegions <em>Regions</em>}</li>
  * </ul>
  * </p>
  *
@@ -29,7 +29,7 @@ import org.yakindu.sct.model.sgraph.ScopedElement;
  * @model
  * @generated
  */
-public interface ExecutionFlow extends ScopedElement, NamedElement {
+public interface ExecutionFlow extends ScopedElement, ExecutionScope {
 	/**
 	 * Returns the value of the '<em><b>States</b></em>' containment reference list.
 	 * The list contents are of type {@link org.yakindu.sct.model.sexec.ExecutionState}.
@@ -72,32 +72,6 @@ public interface ExecutionFlow extends ScopedElement, NamedElement {
 	 */
 	void setEnterSequence(Sequence value);
 
-	/**
-	 * Returns the value of the '<em><b>State Vector</b></em>' containment reference.
-	 * <!-- begin-user-doc -->
-	 * <p>
-	 * If the meaning of the '<em>State Vector</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>State Vector</em>' containment reference.
-	 * @see #setStateVector(StateVector)
-	 * @see org.yakindu.sct.model.sexec.SexecPackage#getExecutionFlow_StateVector()
-	 * @model containment="true"
-	 * @generated
-	 */
-	StateVector getStateVector();
-
-	/**
-	 * Sets the value of the '{@link org.yakindu.sct.model.sexec.ExecutionFlow#getStateVector <em>State Vector</em>}' containment reference.
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * @param value the new value of the '<em>State Vector</em>' containment reference.
-	 * @see #getStateVector()
-	 * @generated
-	 */
-	void setStateVector(StateVector value);
-
 	/**
 	 * Returns the value of the '<em><b>Exit Sequence</b></em>' containment reference.
 	 * <!-- begin-user-doc -->
@@ -140,4 +114,20 @@ public interface ExecutionFlow extends ScopedElement, NamedElement {
 	 */
 	EList<ExecutionNode> getNodes();
 
+	/**
+	 * Returns the value of the '<em><b>Regions</b></em>' containment reference list.
+	 * The list contents are of type {@link org.yakindu.sct.model.sexec.ExecutionRegion}.
+	 * <!-- begin-user-doc -->
+	 * <p>
+	 * If the meaning of the '<em>Regions</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>Regions</em>' containment reference list.
+	 * @see org.yakindu.sct.model.sexec.SexecPackage#getExecutionFlow_Regions()
+	 * @model containment="true"
+	 * @generated
+	 */
+	EList<ExecutionRegion> getRegions();
+
 } // ExecutionFlow

+ 21 - 0
plugins/org.yakindu.sct.model.sexec/src/org/yakindu/sct/model/sexec/ExecutionRegion.java

@@ -0,0 +1,21 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id$
+ */
+package org.yakindu.sct.model.sexec;
+
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>Execution Region</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ *
+ * @see org.yakindu.sct.model.sexec.SexecPackage#getExecutionRegion()
+ * @model
+ * @generated
+ */
+public interface ExecutionRegion extends ExecutionScope {
+} // ExecutionRegion

+ 102 - 0
plugins/org.yakindu.sct.model.sexec/src/org/yakindu/sct/model/sexec/ExecutionScope.java

@@ -0,0 +1,102 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id$
+ */
+package org.yakindu.sct.model.sexec;
+
+import org.eclipse.emf.common.util.EList;
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>Execution Scope</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * <ul>
+ *   <li>{@link org.yakindu.sct.model.sexec.ExecutionScope#getStateVector <em>State Vector</em>}</li>
+ *   <li>{@link org.yakindu.sct.model.sexec.ExecutionScope#getSubScopes <em>Sub Scopes</em>}</li>
+ *   <li>{@link org.yakindu.sct.model.sexec.ExecutionScope#getSuperScope <em>Super Scope</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @see org.yakindu.sct.model.sexec.SexecPackage#getExecutionScope()
+ * @model
+ * @generated
+ */
+public interface ExecutionScope extends NamedElement, MappedElement {
+	/**
+	 * Returns the value of the '<em><b>State Vector</b></em>' containment reference.
+	 * <!-- begin-user-doc -->
+	 * <p>
+	 * If the meaning of the '<em>State Vector</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>State Vector</em>' containment reference.
+	 * @see #setStateVector(StateVector)
+	 * @see org.yakindu.sct.model.sexec.SexecPackage#getExecutionScope_StateVector()
+	 * @model containment="true"
+	 * @generated
+	 */
+	StateVector getStateVector();
+
+	/**
+	 * Sets the value of the '{@link org.yakindu.sct.model.sexec.ExecutionScope#getStateVector <em>State Vector</em>}' containment reference.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @param value the new value of the '<em>State Vector</em>' containment reference.
+	 * @see #getStateVector()
+	 * @generated
+	 */
+	void setStateVector(StateVector value);
+
+	/**
+	 * Returns the value of the '<em><b>Sub Scopes</b></em>' reference list.
+	 * The list contents are of type {@link org.yakindu.sct.model.sexec.ExecutionScope}.
+	 * It is bidirectional and its opposite is '{@link org.yakindu.sct.model.sexec.ExecutionScope#getSuperScope <em>Super Scope</em>}'.
+	 * <!-- begin-user-doc -->
+	 * <p>
+	 * If the meaning of the '<em>Sub Scopes</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>Sub Scopes</em>' reference list.
+	 * @see org.yakindu.sct.model.sexec.SexecPackage#getExecutionScope_SubScopes()
+	 * @see org.yakindu.sct.model.sexec.ExecutionScope#getSuperScope
+	 * @model opposite="superScope"
+	 * @generated
+	 */
+	EList<ExecutionScope> getSubScopes();
+
+	/**
+	 * Returns the value of the '<em><b>Super Scope</b></em>' reference.
+	 * It is bidirectional and its opposite is '{@link org.yakindu.sct.model.sexec.ExecutionScope#getSubScopes <em>Sub Scopes</em>}'.
+	 * <!-- begin-user-doc -->
+	 * <p>
+	 * If the meaning of the '<em>Super Scope</em>' reference isn't clear,
+	 * there really should be more of a description here...
+	 * </p>
+	 * <!-- end-user-doc -->
+	 * @return the value of the '<em>Super Scope</em>' reference.
+	 * @see #setSuperScope(ExecutionScope)
+	 * @see org.yakindu.sct.model.sexec.SexecPackage#getExecutionScope_SuperScope()
+	 * @see org.yakindu.sct.model.sexec.ExecutionScope#getSubScopes
+	 * @model opposite="subScopes"
+	 * @generated
+	 */
+	ExecutionScope getSuperScope();
+
+	/**
+	 * Sets the value of the '{@link org.yakindu.sct.model.sexec.ExecutionScope#getSuperScope <em>Super Scope</em>}' reference.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @param value the new value of the '<em>Super Scope</em>' reference.
+	 * @see #getSuperScope()
+	 * @generated
+	 */
+	void setSuperScope(ExecutionScope value);
+
+} // ExecutionScope

+ 1 - 28
plugins/org.yakindu.sct.model.sexec/src/org/yakindu/sct/model/sexec/ExecutionState.java

@@ -20,7 +20,6 @@ package org.yakindu.sct.model.sexec;
  *   <li>{@link org.yakindu.sct.model.sexec.ExecutionState#getExitAction <em>Exit Action</em>}</li>
  *   <li>{@link org.yakindu.sct.model.sexec.ExecutionState#getEnterSequence <em>Enter Sequence</em>}</li>
  *   <li>{@link org.yakindu.sct.model.sexec.ExecutionState#getExitSequence <em>Exit Sequence</em>}</li>
- *   <li>{@link org.yakindu.sct.model.sexec.ExecutionState#getStateVector <em>State Vector</em>}</li>
  * </ul>
  * </p>
  *
@@ -28,7 +27,7 @@ package org.yakindu.sct.model.sexec;
  * @model
  * @generated
  */
-public interface ExecutionState extends ExecutionNode {
+public interface ExecutionState extends ExecutionNode, ExecutionScope {
 	/**
 	 * Returns the value of the '<em><b>Entry Action</b></em>' containment reference.
 	 * <!-- begin-user-doc -->
@@ -133,32 +132,6 @@ public interface ExecutionState extends ExecutionNode {
 	 */
 	void setExitSequence(Sequence value);
 
-	/**
-	 * Returns the value of the '<em><b>State Vector</b></em>' containment reference.
-	 * <!-- begin-user-doc -->
-	 * <p>
-	 * If the meaning of the '<em>State Vector</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>State Vector</em>' containment reference.
-	 * @see #setStateVector(StateVector)
-	 * @see org.yakindu.sct.model.sexec.SexecPackage#getExecutionState_StateVector()
-	 * @model containment="true"
-	 * @generated
-	 */
-	StateVector getStateVector();
-
-	/**
-	 * Sets the value of the '{@link org.yakindu.sct.model.sexec.ExecutionState#getStateVector <em>State Vector</em>}' containment reference.
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * @param value the new value of the '<em>State Vector</em>' containment reference.
-	 * @see #getStateVector()
-	 * @generated
-	 */
-	void setStateVector(StateVector value);
-
 	/**
 	 * Returns the value of the '<em><b>Leaf</b></em>' attribute.
 	 * The default value is <code>"false"</code>.

+ 27 - 0
plugins/org.yakindu.sct.model.sexec/src/org/yakindu/sct/model/sexec/SexecFactory.java

@@ -52,6 +52,33 @@ public interface SexecFactory extends EFactory {
 	 */
 	ExecutionState createExecutionState();
 
+	/**
+	 * Returns a new object of class '<em>Execution Scope</em>'.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @return a new object of class '<em>Execution Scope</em>'.
+	 * @generated
+	 */
+	ExecutionScope createExecutionScope();
+
+	/**
+	 * Returns a new object of class '<em>Execution Region</em>'.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @return a new object of class '<em>Execution Region</em>'.
+	 * @generated
+	 */
+	ExecutionRegion createExecutionRegion();
+
+	/**
+	 * Returns a new object of class '<em>Execution Entry</em>'.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @return a new object of class '<em>Execution Entry</em>'.
+	 * @generated
+	 */
+	ExecutionEntry createExecutionEntry();
+
 	/**
 	 * Returns a new object of class '<em>Execution Choice</em>'.
 	 * <!-- begin-user-doc -->

+ 405 - 61
plugins/org.yakindu.sct.model.sexec/src/org/yakindu/sct/model/sexec/SexecPackage.java

@@ -154,31 +154,58 @@ public interface SexecPackage extends EPackage {
 	int EXECUTION_FLOW__NAME = SGraphPackage.SCOPED_ELEMENT_FEATURE_COUNT + 0;
 
 	/**
-	 * The feature id for the '<em><b>States</b></em>' containment reference list.
+	 * The feature id for the '<em><b>Source Element</b></em>' reference.
 	 * <!-- begin-user-doc -->
 	 * <!-- end-user-doc -->
 	 * @generated
 	 * @ordered
 	 */
-	int EXECUTION_FLOW__STATES = SGraphPackage.SCOPED_ELEMENT_FEATURE_COUNT + 1;
+	int EXECUTION_FLOW__SOURCE_ELEMENT = SGraphPackage.SCOPED_ELEMENT_FEATURE_COUNT + 1;
 
 	/**
-	 * The feature id for the '<em><b>Enter Sequence</b></em>' containment reference.
+	 * The feature id for the '<em><b>State Vector</b></em>' containment reference.
 	 * <!-- begin-user-doc -->
 	 * <!-- end-user-doc -->
 	 * @generated
 	 * @ordered
 	 */
-	int EXECUTION_FLOW__ENTER_SEQUENCE = SGraphPackage.SCOPED_ELEMENT_FEATURE_COUNT + 2;
+	int EXECUTION_FLOW__STATE_VECTOR = SGraphPackage.SCOPED_ELEMENT_FEATURE_COUNT + 2;
 
 	/**
-	 * The feature id for the '<em><b>State Vector</b></em>' containment reference.
+	 * The feature id for the '<em><b>Sub Scopes</b></em>' reference list.
 	 * <!-- begin-user-doc -->
 	 * <!-- end-user-doc -->
 	 * @generated
 	 * @ordered
 	 */
-	int EXECUTION_FLOW__STATE_VECTOR = SGraphPackage.SCOPED_ELEMENT_FEATURE_COUNT + 3;
+	int EXECUTION_FLOW__SUB_SCOPES = SGraphPackage.SCOPED_ELEMENT_FEATURE_COUNT + 3;
+
+	/**
+	 * The feature id for the '<em><b>Super Scope</b></em>' reference.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 * @ordered
+	 */
+	int EXECUTION_FLOW__SUPER_SCOPE = SGraphPackage.SCOPED_ELEMENT_FEATURE_COUNT + 4;
+
+	/**
+	 * The feature id for the '<em><b>States</b></em>' containment reference list.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 * @ordered
+	 */
+	int EXECUTION_FLOW__STATES = SGraphPackage.SCOPED_ELEMENT_FEATURE_COUNT + 5;
+
+	/**
+	 * The feature id for the '<em><b>Enter Sequence</b></em>' containment reference.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 * @ordered
+	 */
+	int EXECUTION_FLOW__ENTER_SEQUENCE = SGraphPackage.SCOPED_ELEMENT_FEATURE_COUNT + 6;
 
 	/**
 	 * The feature id for the '<em><b>Exit Sequence</b></em>' containment reference.
@@ -187,7 +214,7 @@ public interface SexecPackage extends EPackage {
 	 * @generated
 	 * @ordered
 	 */
-	int EXECUTION_FLOW__EXIT_SEQUENCE = SGraphPackage.SCOPED_ELEMENT_FEATURE_COUNT + 4;
+	int EXECUTION_FLOW__EXIT_SEQUENCE = SGraphPackage.SCOPED_ELEMENT_FEATURE_COUNT + 7;
 
 	/**
 	 * The feature id for the '<em><b>Nodes</b></em>' containment reference list.
@@ -196,7 +223,16 @@ public interface SexecPackage extends EPackage {
 	 * @generated
 	 * @ordered
 	 */
-	int EXECUTION_FLOW__NODES = SGraphPackage.SCOPED_ELEMENT_FEATURE_COUNT + 5;
+	int EXECUTION_FLOW__NODES = SGraphPackage.SCOPED_ELEMENT_FEATURE_COUNT + 8;
+
+	/**
+	 * The feature id for the '<em><b>Regions</b></em>' containment reference list.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 * @ordered
+	 */
+	int EXECUTION_FLOW__REGIONS = SGraphPackage.SCOPED_ELEMENT_FEATURE_COUNT + 9;
 
 	/**
 	 * The number of structural features of the '<em>Execution Flow</em>' class.
@@ -205,7 +241,7 @@ public interface SexecPackage extends EPackage {
 	 * @generated
 	 * @ordered
 	 */
-	int EXECUTION_FLOW_FEATURE_COUNT = SGraphPackage.SCOPED_ELEMENT_FEATURE_COUNT + 6;
+	int EXECUTION_FLOW_FEATURE_COUNT = SGraphPackage.SCOPED_ELEMENT_FEATURE_COUNT + 10;
 
 	/**
 	 * The meta object id for the '{@link org.yakindu.sct.model.sexec.impl.ExecutionNodeImpl <em>Execution Node</em>}' class.
@@ -289,7 +325,7 @@ public interface SexecPackage extends EPackage {
 	 * @see org.yakindu.sct.model.sexec.impl.SexecPackageImpl#getReaction()
 	 * @generated
 	 */
-	int REACTION = 6;
+	int REACTION = 9;
 
 	/**
 	 * The meta object id for the '{@link org.yakindu.sct.model.sexec.impl.StepImpl <em>Step</em>}' class.
@@ -299,7 +335,7 @@ public interface SexecPackage extends EPackage {
 	 * @see org.yakindu.sct.model.sexec.impl.SexecPackageImpl#getStep()
 	 * @generated
 	 */
-	int STEP = 9;
+	int STEP = 12;
 
 	/**
 	 * The meta object id for the '{@link org.yakindu.sct.model.sexec.impl.SequenceImpl <em>Sequence</em>}' class.
@@ -309,7 +345,7 @@ public interface SexecPackage extends EPackage {
 	 * @see org.yakindu.sct.model.sexec.impl.SexecPackageImpl#getSequence()
 	 * @generated
 	 */
-	int SEQUENCE = 10;
+	int SEQUENCE = 13;
 
 	/**
 	 * The meta object id for the '{@link org.yakindu.sct.model.sexec.impl.CheckImpl <em>Check</em>}' class.
@@ -319,7 +355,7 @@ public interface SexecPackage extends EPackage {
 	 * @see org.yakindu.sct.model.sexec.impl.SexecPackageImpl#getCheck()
 	 * @generated
 	 */
-	int CHECK = 11;
+	int CHECK = 14;
 
 	/**
 	 * The meta object id for the '{@link org.yakindu.sct.model.sexec.impl.IfImpl <em>If</em>}' class.
@@ -329,7 +365,7 @@ public interface SexecPackage extends EPackage {
 	 * @see org.yakindu.sct.model.sexec.impl.SexecPackageImpl#getIf()
 	 * @generated
 	 */
-	int IF = 13;
+	int IF = 16;
 
 	/**
 	 * The meta object id for the '{@link org.yakindu.sct.model.sexec.impl.ExecutionImpl <em>Execution</em>}' class.
@@ -339,7 +375,7 @@ public interface SexecPackage extends EPackage {
 	 * @see org.yakindu.sct.model.sexec.impl.SexecPackageImpl#getExecution()
 	 * @generated
 	 */
-	int EXECUTION = 14;
+	int EXECUTION = 17;
 
 	/**
 	 * The meta object id for the '{@link org.yakindu.sct.model.sexec.impl.EnterStateImpl <em>Enter State</em>}' class.
@@ -349,7 +385,7 @@ public interface SexecPackage extends EPackage {
 	 * @see org.yakindu.sct.model.sexec.impl.SexecPackageImpl#getEnterState()
 	 * @generated
 	 */
-	int ENTER_STATE = 15;
+	int ENTER_STATE = 18;
 
 	/**
 	 * The meta object id for the '{@link org.yakindu.sct.model.sexec.impl.ExitStateImpl <em>Exit State</em>}' class.
@@ -359,7 +395,7 @@ public interface SexecPackage extends EPackage {
 	 * @see org.yakindu.sct.model.sexec.impl.SexecPackageImpl#getExitState()
 	 * @generated
 	 */
-	int EXIT_STATE = 16;
+	int EXIT_STATE = 19;
 
 	/**
 	 * The meta object id for the '{@link org.yakindu.sct.model.sexec.impl.StateVectorImpl <em>State Vector</em>}' class.
@@ -369,7 +405,7 @@ public interface SexecPackage extends EPackage {
 	 * @see org.yakindu.sct.model.sexec.impl.SexecPackageImpl#getStateVector()
 	 * @generated
 	 */
-	int STATE_VECTOR = 7;
+	int STATE_VECTOR = 10;
 
 	/**
 	 * The meta object id for the '{@link org.yakindu.sct.model.sexec.impl.TimeEventImpl <em>Time Event</em>}' class.
@@ -379,7 +415,7 @@ public interface SexecPackage extends EPackage {
 	 * @see org.yakindu.sct.model.sexec.impl.SexecPackageImpl#getTimeEvent()
 	 * @generated
 	 */
-	int TIME_EVENT = 8;
+	int TIME_EVENT = 11;
 
 	/**
 	 * The feature id for the '<em><b>Name</b></em>' attribute.
@@ -426,6 +462,33 @@ public interface SexecPackage extends EPackage {
 	 */
 	int EXECUTION_STATE__REACT_SEQUENCE = EXECUTION_NODE__REACT_SEQUENCE;
 
+	/**
+	 * The feature id for the '<em><b>State Vector</b></em>' containment reference.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 * @ordered
+	 */
+	int EXECUTION_STATE__STATE_VECTOR = EXECUTION_NODE_FEATURE_COUNT + 0;
+
+	/**
+	 * The feature id for the '<em><b>Sub Scopes</b></em>' reference list.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 * @ordered
+	 */
+	int EXECUTION_STATE__SUB_SCOPES = EXECUTION_NODE_FEATURE_COUNT + 1;
+
+	/**
+	 * The feature id for the '<em><b>Super Scope</b></em>' reference.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 * @ordered
+	 */
+	int EXECUTION_STATE__SUPER_SCOPE = EXECUTION_NODE_FEATURE_COUNT + 2;
+
 	/**
 	 * The feature id for the '<em><b>Leaf</b></em>' attribute.
 	 * <!-- begin-user-doc -->
@@ -433,7 +496,7 @@ public interface SexecPackage extends EPackage {
 	 * @generated
 	 * @ordered
 	 */
-	int EXECUTION_STATE__LEAF = EXECUTION_NODE_FEATURE_COUNT + 0;
+	int EXECUTION_STATE__LEAF = EXECUTION_NODE_FEATURE_COUNT + 3;
 
 	/**
 	 * The feature id for the '<em><b>Entry Action</b></em>' containment reference.
@@ -442,7 +505,7 @@ public interface SexecPackage extends EPackage {
 	 * @generated
 	 * @ordered
 	 */
-	int EXECUTION_STATE__ENTRY_ACTION = EXECUTION_NODE_FEATURE_COUNT + 1;
+	int EXECUTION_STATE__ENTRY_ACTION = EXECUTION_NODE_FEATURE_COUNT + 4;
 
 	/**
 	 * The feature id for the '<em><b>Exit Action</b></em>' containment reference.
@@ -451,7 +514,7 @@ public interface SexecPackage extends EPackage {
 	 * @generated
 	 * @ordered
 	 */
-	int EXECUTION_STATE__EXIT_ACTION = EXECUTION_NODE_FEATURE_COUNT + 2;
+	int EXECUTION_STATE__EXIT_ACTION = EXECUTION_NODE_FEATURE_COUNT + 5;
 
 	/**
 	 * The feature id for the '<em><b>Enter Sequence</b></em>' containment reference.
@@ -460,7 +523,7 @@ public interface SexecPackage extends EPackage {
 	 * @generated
 	 * @ordered
 	 */
-	int EXECUTION_STATE__ENTER_SEQUENCE = EXECUTION_NODE_FEATURE_COUNT + 3;
+	int EXECUTION_STATE__ENTER_SEQUENCE = EXECUTION_NODE_FEATURE_COUNT + 6;
 
 	/**
 	 * The feature id for the '<em><b>Exit Sequence</b></em>' containment reference.
@@ -469,7 +532,44 @@ public interface SexecPackage extends EPackage {
 	 * @generated
 	 * @ordered
 	 */
-	int EXECUTION_STATE__EXIT_SEQUENCE = EXECUTION_NODE_FEATURE_COUNT + 4;
+	int EXECUTION_STATE__EXIT_SEQUENCE = EXECUTION_NODE_FEATURE_COUNT + 7;
+
+	/**
+	 * The number of structural features of the '<em>Execution State</em>' class.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 * @ordered
+	 */
+	int EXECUTION_STATE_FEATURE_COUNT = EXECUTION_NODE_FEATURE_COUNT + 8;
+
+	/**
+	 * The meta object id for the '{@link org.yakindu.sct.model.sexec.impl.ExecutionScopeImpl <em>Execution Scope</em>}' class.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @see org.yakindu.sct.model.sexec.impl.ExecutionScopeImpl
+	 * @see org.yakindu.sct.model.sexec.impl.SexecPackageImpl#getExecutionScope()
+	 * @generated
+	 */
+	int EXECUTION_SCOPE = 5;
+
+	/**
+	 * The feature id for the '<em><b>Name</b></em>' attribute.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 * @ordered
+	 */
+	int EXECUTION_SCOPE__NAME = NAMED_ELEMENT__NAME;
+
+	/**
+	 * The feature id for the '<em><b>Source Element</b></em>' reference.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 * @ordered
+	 */
+	int EXECUTION_SCOPE__SOURCE_ELEMENT = NAMED_ELEMENT_FEATURE_COUNT + 0;
 
 	/**
 	 * The feature id for the '<em><b>State Vector</b></em>' containment reference.
@@ -478,16 +578,162 @@ public interface SexecPackage extends EPackage {
 	 * @generated
 	 * @ordered
 	 */
-	int EXECUTION_STATE__STATE_VECTOR = EXECUTION_NODE_FEATURE_COUNT + 5;
+	int EXECUTION_SCOPE__STATE_VECTOR = NAMED_ELEMENT_FEATURE_COUNT + 1;
 
 	/**
-	 * The number of structural features of the '<em>Execution State</em>' class.
+	 * The feature id for the '<em><b>Sub Scopes</b></em>' reference list.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 * @ordered
+	 */
+	int EXECUTION_SCOPE__SUB_SCOPES = NAMED_ELEMENT_FEATURE_COUNT + 2;
+
+	/**
+	 * The feature id for the '<em><b>Super Scope</b></em>' reference.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 * @ordered
+	 */
+	int EXECUTION_SCOPE__SUPER_SCOPE = NAMED_ELEMENT_FEATURE_COUNT + 3;
+
+	/**
+	 * The number of structural features of the '<em>Execution Scope</em>' class.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 * @ordered
+	 */
+	int EXECUTION_SCOPE_FEATURE_COUNT = NAMED_ELEMENT_FEATURE_COUNT + 4;
+
+	/**
+	 * The meta object id for the '{@link org.yakindu.sct.model.sexec.impl.ExecutionRegionImpl <em>Execution Region</em>}' class.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @see org.yakindu.sct.model.sexec.impl.ExecutionRegionImpl
+	 * @see org.yakindu.sct.model.sexec.impl.SexecPackageImpl#getExecutionRegion()
+	 * @generated
+	 */
+	int EXECUTION_REGION = 6;
+
+	/**
+	 * The feature id for the '<em><b>Name</b></em>' attribute.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 * @ordered
+	 */
+	int EXECUTION_REGION__NAME = EXECUTION_SCOPE__NAME;
+
+	/**
+	 * The feature id for the '<em><b>Source Element</b></em>' reference.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 * @ordered
+	 */
+	int EXECUTION_REGION__SOURCE_ELEMENT = EXECUTION_SCOPE__SOURCE_ELEMENT;
+
+	/**
+	 * The feature id for the '<em><b>State Vector</b></em>' containment reference.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 * @ordered
+	 */
+	int EXECUTION_REGION__STATE_VECTOR = EXECUTION_SCOPE__STATE_VECTOR;
+
+	/**
+	 * The feature id for the '<em><b>Sub Scopes</b></em>' reference list.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 * @ordered
+	 */
+	int EXECUTION_REGION__SUB_SCOPES = EXECUTION_SCOPE__SUB_SCOPES;
+
+	/**
+	 * The feature id for the '<em><b>Super Scope</b></em>' reference.
 	 * <!-- begin-user-doc -->
 	 * <!-- end-user-doc -->
 	 * @generated
 	 * @ordered
 	 */
-	int EXECUTION_STATE_FEATURE_COUNT = EXECUTION_NODE_FEATURE_COUNT + 6;
+	int EXECUTION_REGION__SUPER_SCOPE = EXECUTION_SCOPE__SUPER_SCOPE;
+
+	/**
+	 * The number of structural features of the '<em>Execution Region</em>' class.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 * @ordered
+	 */
+	int EXECUTION_REGION_FEATURE_COUNT = EXECUTION_SCOPE_FEATURE_COUNT + 0;
+
+	/**
+	 * The meta object id for the '{@link org.yakindu.sct.model.sexec.impl.ExecutionEntryImpl <em>Execution Entry</em>}' class.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @see org.yakindu.sct.model.sexec.impl.ExecutionEntryImpl
+	 * @see org.yakindu.sct.model.sexec.impl.SexecPackageImpl#getExecutionEntry()
+	 * @generated
+	 */
+	int EXECUTION_ENTRY = 7;
+
+	/**
+	 * The feature id for the '<em><b>Name</b></em>' attribute.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 * @ordered
+	 */
+	int EXECUTION_ENTRY__NAME = EXECUTION_NODE__NAME;
+
+	/**
+	 * The feature id for the '<em><b>Source Element</b></em>' reference.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 * @ordered
+	 */
+	int EXECUTION_ENTRY__SOURCE_ELEMENT = EXECUTION_NODE__SOURCE_ELEMENT;
+
+	/**
+	 * The feature id for the '<em><b>Reactions</b></em>' containment reference list.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 * @ordered
+	 */
+	int EXECUTION_ENTRY__REACTIONS = EXECUTION_NODE__REACTIONS;
+
+	/**
+	 * The feature id for the '<em><b>Simple Name</b></em>' attribute.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 * @ordered
+	 */
+	int EXECUTION_ENTRY__SIMPLE_NAME = EXECUTION_NODE__SIMPLE_NAME;
+
+	/**
+	 * The feature id for the '<em><b>React Sequence</b></em>' containment reference.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 * @ordered
+	 */
+	int EXECUTION_ENTRY__REACT_SEQUENCE = EXECUTION_NODE__REACT_SEQUENCE;
+
+	/**
+	 * The number of structural features of the '<em>Execution Entry</em>' class.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 * @ordered
+	 */
+	int EXECUTION_ENTRY_FEATURE_COUNT = EXECUTION_NODE_FEATURE_COUNT + 0;
 
 	/**
 	 * The meta object id for the '{@link org.yakindu.sct.model.sexec.impl.ExecutionChoiceImpl <em>Execution Choice</em>}' class.
@@ -497,7 +743,7 @@ public interface SexecPackage extends EPackage {
 	 * @see org.yakindu.sct.model.sexec.impl.SexecPackageImpl#getExecutionChoice()
 	 * @generated
 	 */
-	int EXECUTION_CHOICE = 5;
+	int EXECUTION_CHOICE = 8;
 
 	/**
 	 * The feature id for the '<em><b>Name</b></em>' attribute.
@@ -804,7 +1050,7 @@ public interface SexecPackage extends EPackage {
 	 * @see org.yakindu.sct.model.sexec.impl.SexecPackageImpl#getCall()
 	 * @generated
 	 */
-	int CALL = 17;
+	int CALL = 20;
 
 	/**
 	 * The meta object id for the '{@link org.yakindu.sct.model.sexec.impl.ScheduleTimeEventImpl <em>Schedule Time Event</em>}' class.
@@ -814,7 +1060,7 @@ public interface SexecPackage extends EPackage {
 	 * @see org.yakindu.sct.model.sexec.impl.SexecPackageImpl#getScheduleTimeEvent()
 	 * @generated
 	 */
-	int SCHEDULE_TIME_EVENT = 18;
+	int SCHEDULE_TIME_EVENT = 21;
 
 	/**
 	 * The meta object id for the '{@link org.yakindu.sct.model.sexec.impl.UnscheduleTimeEventImpl <em>Unschedule Time Event</em>}' class.
@@ -824,7 +1070,7 @@ public interface SexecPackage extends EPackage {
 	 * @see org.yakindu.sct.model.sexec.impl.SexecPackageImpl#getUnscheduleTimeEvent()
 	 * @generated
 	 */
-	int UNSCHEDULE_TIME_EVENT = 19;
+	int UNSCHEDULE_TIME_EVENT = 22;
 
 	/**
 	 * The meta object id for the '{@link org.yakindu.sct.model.sexec.impl.CheckRefImpl <em>Check Ref</em>}' class.
@@ -834,7 +1080,7 @@ public interface SexecPackage extends EPackage {
 	 * @see org.yakindu.sct.model.sexec.impl.SexecPackageImpl#getCheckRef()
 	 * @generated
 	 */
-	int CHECK_REF = 12;
+	int CHECK_REF = 15;
 
 	/**
 	 * The feature id for the '<em><b>Name</b></em>' attribute.
@@ -1250,7 +1496,7 @@ public interface SexecPackage extends EPackage {
 	 * @see org.yakindu.sct.model.sexec.impl.SexecPackageImpl#getStateSwitch()
 	 * @generated
 	 */
-	int STATE_SWITCH = 20;
+	int STATE_SWITCH = 23;
 
 	/**
 	 * The feature id for the '<em><b>Name</b></em>' attribute.
@@ -1314,7 +1560,7 @@ public interface SexecPackage extends EPackage {
 	 * @see org.yakindu.sct.model.sexec.impl.SexecPackageImpl#getStateCase()
 	 * @generated
 	 */
-	int STATE_CASE = 21;
+	int STATE_CASE = 24;
 
 	/**
 	 * The feature id for the '<em><b>State</b></em>' reference.
@@ -1352,7 +1598,7 @@ public interface SexecPackage extends EPackage {
 	 * @see org.yakindu.sct.model.sexec.impl.SexecPackageImpl#getTrace()
 	 * @generated
 	 */
-	int TRACE = 22;
+	int TRACE = 25;
 
 	/**
 	 * The feature id for the '<em><b>Name</b></em>' attribute.
@@ -1398,7 +1644,7 @@ public interface SexecPackage extends EPackage {
 	 * @see org.yakindu.sct.model.sexec.impl.SexecPackageImpl#getTraceNodeExecuted()
 	 * @generated
 	 */
-	int TRACE_NODE_EXECUTED = 23;
+	int TRACE_NODE_EXECUTED = 26;
 
 	/**
 	 * The feature id for the '<em><b>Name</b></em>' attribute.
@@ -1453,7 +1699,7 @@ public interface SexecPackage extends EPackage {
 	 * @see org.yakindu.sct.model.sexec.impl.SexecPackageImpl#getReactionFired()
 	 * @generated
 	 */
-	int REACTION_FIRED = 24;
+	int REACTION_FIRED = 27;
 
 	/**
 	 * The feature id for the '<em><b>Name</b></em>' attribute.
@@ -1509,7 +1755,7 @@ public interface SexecPackage extends EPackage {
 	 * @see org.yakindu.sct.model.sexec.impl.SexecPackageImpl#getTraceStateEntered()
 	 * @generated
 	 */
-	int TRACE_STATE_ENTERED = 25;
+	int TRACE_STATE_ENTERED = 28;
 
 	/**
 	 * The feature id for the '<em><b>Name</b></em>' attribute.
@@ -1564,7 +1810,7 @@ public interface SexecPackage extends EPackage {
 	 * @see org.yakindu.sct.model.sexec.impl.SexecPackageImpl#getTraceStateExited()
 	 * @generated
 	 */
-	int TRACE_STATE_EXITED = 26;
+	int TRACE_STATE_EXITED = 29;
 
 	/**
 	 * The feature id for the '<em><b>Name</b></em>' attribute.
@@ -1644,17 +1890,6 @@ public interface SexecPackage extends EPackage {
 	 */
 	EReference getExecutionFlow_EnterSequence();
 
-	/**
-	 * Returns the meta object for the containment reference '{@link org.yakindu.sct.model.sexec.ExecutionFlow#getStateVector <em>State Vector</em>}'.
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * @return the meta object for the containment reference '<em>State Vector</em>'.
-	 * @see org.yakindu.sct.model.sexec.ExecutionFlow#getStateVector()
-	 * @see #getExecutionFlow()
-	 * @generated
-	 */
-	EReference getExecutionFlow_StateVector();
-
 	/**
 	 * Returns the meta object for the containment reference '{@link org.yakindu.sct.model.sexec.ExecutionFlow#getExitSequence <em>Exit Sequence</em>}'.
 	 * <!-- begin-user-doc -->
@@ -1677,6 +1912,17 @@ public interface SexecPackage extends EPackage {
 	 */
 	EReference getExecutionFlow_Nodes();
 
+	/**
+	 * Returns the meta object for the containment reference list '{@link org.yakindu.sct.model.sexec.ExecutionFlow#getRegions <em>Regions</em>}'.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @return the meta object for the containment reference list '<em>Regions</em>'.
+	 * @see org.yakindu.sct.model.sexec.ExecutionFlow#getRegions()
+	 * @see #getExecutionFlow()
+	 * @generated
+	 */
+	EReference getExecutionFlow_Regions();
+
 	/**
 	 * Returns the meta object for class '{@link org.yakindu.sct.model.sexec.ExecutionNode <em>Execution Node</em>}'.
 	 * <!-- begin-user-doc -->
@@ -1775,15 +2021,67 @@ public interface SexecPackage extends EPackage {
 	EReference getExecutionState_ExitSequence();
 
 	/**
-	 * Returns the meta object for the containment reference '{@link org.yakindu.sct.model.sexec.ExecutionState#getStateVector <em>State Vector</em>}'.
+	 * Returns the meta object for class '{@link org.yakindu.sct.model.sexec.ExecutionScope <em>Execution Scope</em>}'.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @return the meta object for class '<em>Execution Scope</em>'.
+	 * @see org.yakindu.sct.model.sexec.ExecutionScope
+	 * @generated
+	 */
+	EClass getExecutionScope();
+
+	/**
+	 * Returns the meta object for the containment reference '{@link org.yakindu.sct.model.sexec.ExecutionScope#getStateVector <em>State Vector</em>}'.
 	 * <!-- begin-user-doc -->
 	 * <!-- end-user-doc -->
 	 * @return the meta object for the containment reference '<em>State Vector</em>'.
-	 * @see org.yakindu.sct.model.sexec.ExecutionState#getStateVector()
-	 * @see #getExecutionState()
+	 * @see org.yakindu.sct.model.sexec.ExecutionScope#getStateVector()
+	 * @see #getExecutionScope()
+	 * @generated
+	 */
+	EReference getExecutionScope_StateVector();
+
+	/**
+	 * Returns the meta object for the reference list '{@link org.yakindu.sct.model.sexec.ExecutionScope#getSubScopes <em>Sub Scopes</em>}'.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @return the meta object for the reference list '<em>Sub Scopes</em>'.
+	 * @see org.yakindu.sct.model.sexec.ExecutionScope#getSubScopes()
+	 * @see #getExecutionScope()
+	 * @generated
+	 */
+	EReference getExecutionScope_SubScopes();
+
+	/**
+	 * Returns the meta object for the reference '{@link org.yakindu.sct.model.sexec.ExecutionScope#getSuperScope <em>Super Scope</em>}'.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @return the meta object for the reference '<em>Super Scope</em>'.
+	 * @see org.yakindu.sct.model.sexec.ExecutionScope#getSuperScope()
+	 * @see #getExecutionScope()
+	 * @generated
+	 */
+	EReference getExecutionScope_SuperScope();
+
+	/**
+	 * Returns the meta object for class '{@link org.yakindu.sct.model.sexec.ExecutionRegion <em>Execution Region</em>}'.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @return the meta object for class '<em>Execution Region</em>'.
+	 * @see org.yakindu.sct.model.sexec.ExecutionRegion
 	 * @generated
 	 */
-	EReference getExecutionState_StateVector();
+	EClass getExecutionRegion();
+
+	/**
+	 * Returns the meta object for class '{@link org.yakindu.sct.model.sexec.ExecutionEntry <em>Execution Entry</em>}'.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @return the meta object for class '<em>Execution Entry</em>'.
+	 * @see org.yakindu.sct.model.sexec.ExecutionEntry
+	 * @generated
+	 */
+	EClass getExecutionEntry();
 
 	/**
 	 * Returns the meta object for class '{@link org.yakindu.sct.model.sexec.ExecutionChoice <em>Execution Choice</em>}'.
@@ -2437,28 +2735,28 @@ public interface SexecPackage extends EPackage {
 		EReference EXECUTION_FLOW__ENTER_SEQUENCE = eINSTANCE.getExecutionFlow_EnterSequence();
 
 		/**
-		 * The meta object literal for the '<em><b>State Vector</b></em>' containment reference feature.
+		 * The meta object literal for the '<em><b>Exit Sequence</b></em>' containment reference feature.
 		 * <!-- begin-user-doc -->
 		 * <!-- end-user-doc -->
 		 * @generated
 		 */
-		EReference EXECUTION_FLOW__STATE_VECTOR = eINSTANCE.getExecutionFlow_StateVector();
+		EReference EXECUTION_FLOW__EXIT_SEQUENCE = eINSTANCE.getExecutionFlow_ExitSequence();
 
 		/**
-		 * The meta object literal for the '<em><b>Exit Sequence</b></em>' containment reference feature.
+		 * The meta object literal for the '<em><b>Nodes</b></em>' containment reference list feature.
 		 * <!-- begin-user-doc -->
 		 * <!-- end-user-doc -->
 		 * @generated
 		 */
-		EReference EXECUTION_FLOW__EXIT_SEQUENCE = eINSTANCE.getExecutionFlow_ExitSequence();
+		EReference EXECUTION_FLOW__NODES = eINSTANCE.getExecutionFlow_Nodes();
 
 		/**
-		 * The meta object literal for the '<em><b>Nodes</b></em>' containment reference list feature.
+		 * The meta object literal for the '<em><b>Regions</b></em>' containment reference list feature.
 		 * <!-- begin-user-doc -->
 		 * <!-- end-user-doc -->
 		 * @generated
 		 */
-		EReference EXECUTION_FLOW__NODES = eINSTANCE.getExecutionFlow_Nodes();
+		EReference EXECUTION_FLOW__REGIONS = eINSTANCE.getExecutionFlow_Regions();
 
 		/**
 		 * The meta object literal for the '{@link org.yakindu.sct.model.sexec.impl.ExecutionNodeImpl <em>Execution Node</em>}' class.
@@ -2536,13 +2834,59 @@ public interface SexecPackage extends EPackage {
 		 */
 		EReference EXECUTION_STATE__EXIT_SEQUENCE = eINSTANCE.getExecutionState_ExitSequence();
 
+		/**
+		 * The meta object literal for the '{@link org.yakindu.sct.model.sexec.impl.ExecutionScopeImpl <em>Execution Scope</em>}' class.
+		 * <!-- begin-user-doc -->
+		 * <!-- end-user-doc -->
+		 * @see org.yakindu.sct.model.sexec.impl.ExecutionScopeImpl
+		 * @see org.yakindu.sct.model.sexec.impl.SexecPackageImpl#getExecutionScope()
+		 * @generated
+		 */
+		EClass EXECUTION_SCOPE = eINSTANCE.getExecutionScope();
+
 		/**
 		 * The meta object literal for the '<em><b>State Vector</b></em>' containment reference feature.
 		 * <!-- begin-user-doc -->
 		 * <!-- end-user-doc -->
 		 * @generated
 		 */
-		EReference EXECUTION_STATE__STATE_VECTOR = eINSTANCE.getExecutionState_StateVector();
+		EReference EXECUTION_SCOPE__STATE_VECTOR = eINSTANCE.getExecutionScope_StateVector();
+
+		/**
+		 * The meta object literal for the '<em><b>Sub Scopes</b></em>' reference list feature.
+		 * <!-- begin-user-doc -->
+		 * <!-- end-user-doc -->
+		 * @generated
+		 */
+		EReference EXECUTION_SCOPE__SUB_SCOPES = eINSTANCE.getExecutionScope_SubScopes();
+
+		/**
+		 * The meta object literal for the '<em><b>Super Scope</b></em>' reference feature.
+		 * <!-- begin-user-doc -->
+		 * <!-- end-user-doc -->
+		 * @generated
+		 */
+		EReference EXECUTION_SCOPE__SUPER_SCOPE = eINSTANCE.getExecutionScope_SuperScope();
+
+		/**
+		 * The meta object literal for the '{@link org.yakindu.sct.model.sexec.impl.ExecutionRegionImpl <em>Execution Region</em>}' class.
+		 * <!-- begin-user-doc -->
+		 * <!-- end-user-doc -->
+		 * @see org.yakindu.sct.model.sexec.impl.ExecutionRegionImpl
+		 * @see org.yakindu.sct.model.sexec.impl.SexecPackageImpl#getExecutionRegion()
+		 * @generated
+		 */
+		EClass EXECUTION_REGION = eINSTANCE.getExecutionRegion();
+
+		/**
+		 * The meta object literal for the '{@link org.yakindu.sct.model.sexec.impl.ExecutionEntryImpl <em>Execution Entry</em>}' class.
+		 * <!-- begin-user-doc -->
+		 * <!-- end-user-doc -->
+		 * @see org.yakindu.sct.model.sexec.impl.ExecutionEntryImpl
+		 * @see org.yakindu.sct.model.sexec.impl.SexecPackageImpl#getExecutionEntry()
+		 * @generated
+		 */
+		EClass EXECUTION_ENTRY = eINSTANCE.getExecutionEntry();
 
 		/**
 		 * The meta object literal for the '{@link org.yakindu.sct.model.sexec.impl.ExecutionChoiceImpl <em>Execution Choice</em>}' class.

+ 43 - 0
plugins/org.yakindu.sct.model.sexec/src/org/yakindu/sct/model/sexec/impl/ExecutionEntryImpl.java

@@ -0,0 +1,43 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id$
+ */
+package org.yakindu.sct.model.sexec.impl;
+
+import org.eclipse.emf.ecore.EClass;
+
+import org.yakindu.sct.model.sexec.ExecutionEntry;
+import org.yakindu.sct.model.sexec.SexecPackage;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>Execution Entry</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * </p>
+ *
+ * @generated
+ */
+public class ExecutionEntryImpl extends ExecutionNodeImpl implements ExecutionEntry {
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	protected ExecutionEntryImpl() {
+		super();
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	@Override
+	protected EClass eStaticClass() {
+		return SexecPackage.Literals.EXECUTION_ENTRY;
+	}
+
+} //ExecutionEntryImpl

+ 290 - 22
plugins/org.yakindu.sct.model.sexec/src/org/yakindu/sct/model/sexec/impl/ExecutionFlowImpl.java

@@ -12,13 +12,18 @@ 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.EObject;
 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.InternalEList;
 import org.yakindu.sct.model.sexec.ExecutionFlow;
 import org.yakindu.sct.model.sexec.ExecutionNode;
+import org.yakindu.sct.model.sexec.ExecutionRegion;
+import org.yakindu.sct.model.sexec.ExecutionScope;
 import org.yakindu.sct.model.sexec.ExecutionState;
+import org.yakindu.sct.model.sexec.MappedElement;
 import org.yakindu.sct.model.sexec.NamedElement;
 import org.yakindu.sct.model.sexec.Sequence;
 import org.yakindu.sct.model.sexec.SexecPackage;
@@ -33,11 +38,15 @@ import org.yakindu.sct.model.sgraph.impl.ScopedElementImpl;
  * The following features are implemented:
  * <ul>
  *   <li>{@link org.yakindu.sct.model.sexec.impl.ExecutionFlowImpl#getName <em>Name</em>}</li>
+ *   <li>{@link org.yakindu.sct.model.sexec.impl.ExecutionFlowImpl#getSourceElement <em>Source Element</em>}</li>
+ *   <li>{@link org.yakindu.sct.model.sexec.impl.ExecutionFlowImpl#getStateVector <em>State Vector</em>}</li>
+ *   <li>{@link org.yakindu.sct.model.sexec.impl.ExecutionFlowImpl#getSubScopes <em>Sub Scopes</em>}</li>
+ *   <li>{@link org.yakindu.sct.model.sexec.impl.ExecutionFlowImpl#getSuperScope <em>Super Scope</em>}</li>
  *   <li>{@link org.yakindu.sct.model.sexec.impl.ExecutionFlowImpl#getStates <em>States</em>}</li>
  *   <li>{@link org.yakindu.sct.model.sexec.impl.ExecutionFlowImpl#getEnterSequence <em>Enter Sequence</em>}</li>
- *   <li>{@link org.yakindu.sct.model.sexec.impl.ExecutionFlowImpl#getStateVector <em>State Vector</em>}</li>
  *   <li>{@link org.yakindu.sct.model.sexec.impl.ExecutionFlowImpl#getExitSequence <em>Exit Sequence</em>}</li>
  *   <li>{@link org.yakindu.sct.model.sexec.impl.ExecutionFlowImpl#getNodes <em>Nodes</em>}</li>
+ *   <li>{@link org.yakindu.sct.model.sexec.impl.ExecutionFlowImpl#getRegions <em>Regions</em>}</li>
  * </ul>
  * </p>
  *
@@ -65,34 +74,64 @@ public class ExecutionFlowImpl extends ScopedElementImpl implements ExecutionFlo
 	protected String name = NAME_EDEFAULT;
 
 	/**
-	 * The cached value of the '{@link #getStates() <em>States</em>}' containment reference list.
+	 * The cached value of the '{@link #getSourceElement() <em>Source Element</em>}' reference.
 	 * <!-- begin-user-doc -->
 	 * <!-- end-user-doc -->
-	 * @see #getStates()
+	 * @see #getSourceElement()
 	 * @generated
 	 * @ordered
 	 */
-	protected EList<ExecutionState> states;
+	protected EObject sourceElement;
 
 	/**
-	 * The cached value of the '{@link #getEnterSequence() <em>Enter Sequence</em>}' containment reference.
+	 * The cached value of the '{@link #getStateVector() <em>State Vector</em>}' containment reference.
 	 * <!-- begin-user-doc -->
 	 * <!-- end-user-doc -->
-	 * @see #getEnterSequence()
+	 * @see #getStateVector()
 	 * @generated
 	 * @ordered
 	 */
-	protected Sequence enterSequence;
+	protected StateVector stateVector;
 
 	/**
-	 * The cached value of the '{@link #getStateVector() <em>State Vector</em>}' containment reference.
+	 * The cached value of the '{@link #getSubScopes() <em>Sub Scopes</em>}' reference list.
 	 * <!-- begin-user-doc -->
 	 * <!-- end-user-doc -->
-	 * @see #getStateVector()
+	 * @see #getSubScopes()
 	 * @generated
 	 * @ordered
 	 */
-	protected StateVector stateVector;
+	protected EList<ExecutionScope> subScopes;
+
+	/**
+	 * The cached value of the '{@link #getSuperScope() <em>Super Scope</em>}' reference.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @see #getSuperScope()
+	 * @generated
+	 * @ordered
+	 */
+	protected ExecutionScope superScope;
+
+	/**
+	 * The cached value of the '{@link #getStates() <em>States</em>}' containment reference list.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @see #getStates()
+	 * @generated
+	 * @ordered
+	 */
+	protected EList<ExecutionState> states;
+
+	/**
+	 * The cached value of the '{@link #getEnterSequence() <em>Enter Sequence</em>}' containment reference.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @see #getEnterSequence()
+	 * @generated
+	 * @ordered
+	 */
+	protected Sequence enterSequence;
 
 	/**
 	 * The cached value of the '{@link #getExitSequence() <em>Exit Sequence</em>}' containment reference.
@@ -114,6 +153,16 @@ public class ExecutionFlowImpl extends ScopedElementImpl implements ExecutionFlo
 	 */
 	protected EList<ExecutionNode> nodes;
 
+	/**
+	 * The cached value of the '{@link #getRegions() <em>Regions</em>}' containment reference list.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @see #getRegions()
+	 * @generated
+	 * @ordered
+	 */
+	protected EList<ExecutionRegion> regions;
+
 	/**
 	 * <!-- begin-user-doc -->
 	 * <!-- end-user-doc -->
@@ -154,6 +203,44 @@ public class ExecutionFlowImpl extends ScopedElementImpl implements ExecutionFlo
 			eNotify(new ENotificationImpl(this, Notification.SET, SexecPackage.EXECUTION_FLOW__NAME, oldName, name));
 	}
 
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public EObject getSourceElement() {
+		if (sourceElement != null && sourceElement.eIsProxy()) {
+			InternalEObject oldSourceElement = (InternalEObject)sourceElement;
+			sourceElement = eResolveProxy(oldSourceElement);
+			if (sourceElement != oldSourceElement) {
+				if (eNotificationRequired())
+					eNotify(new ENotificationImpl(this, Notification.RESOLVE, SexecPackage.EXECUTION_FLOW__SOURCE_ELEMENT, oldSourceElement, sourceElement));
+			}
+		}
+		return sourceElement;
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public EObject basicGetSourceElement() {
+		return sourceElement;
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public void setSourceElement(EObject newSourceElement) {
+		EObject oldSourceElement = sourceElement;
+		sourceElement = newSourceElement;
+		if (eNotificationRequired())
+			eNotify(new ENotificationImpl(this, Notification.SET, SexecPackage.EXECUTION_FLOW__SOURCE_ELEMENT, oldSourceElement, sourceElement));
+	}
+
 	/**
 	 * <!-- begin-user-doc -->
 	 * <!-- end-user-doc -->
@@ -252,6 +339,78 @@ public class ExecutionFlowImpl extends ScopedElementImpl implements ExecutionFlo
 			eNotify(new ENotificationImpl(this, Notification.SET, SexecPackage.EXECUTION_FLOW__STATE_VECTOR, newStateVector, newStateVector));
 	}
 
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public EList<ExecutionScope> getSubScopes() {
+		if (subScopes == null) {
+			subScopes = new EObjectWithInverseResolvingEList<ExecutionScope>(ExecutionScope.class, this, SexecPackage.EXECUTION_FLOW__SUB_SCOPES, SexecPackage.EXECUTION_SCOPE__SUPER_SCOPE);
+		}
+		return subScopes;
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public ExecutionScope getSuperScope() {
+		if (superScope != null && superScope.eIsProxy()) {
+			InternalEObject oldSuperScope = (InternalEObject)superScope;
+			superScope = (ExecutionScope)eResolveProxy(oldSuperScope);
+			if (superScope != oldSuperScope) {
+				if (eNotificationRequired())
+					eNotify(new ENotificationImpl(this, Notification.RESOLVE, SexecPackage.EXECUTION_FLOW__SUPER_SCOPE, oldSuperScope, superScope));
+			}
+		}
+		return superScope;
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public ExecutionScope basicGetSuperScope() {
+		return superScope;
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public NotificationChain basicSetSuperScope(ExecutionScope newSuperScope, NotificationChain msgs) {
+		ExecutionScope oldSuperScope = superScope;
+		superScope = newSuperScope;
+		if (eNotificationRequired()) {
+			ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, SexecPackage.EXECUTION_FLOW__SUPER_SCOPE, oldSuperScope, newSuperScope);
+			if (msgs == null) msgs = notification; else msgs.add(notification);
+		}
+		return msgs;
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public void setSuperScope(ExecutionScope newSuperScope) {
+		if (newSuperScope != superScope) {
+			NotificationChain msgs = null;
+			if (superScope != null)
+				msgs = ((InternalEObject)superScope).eInverseRemove(this, SexecPackage.EXECUTION_SCOPE__SUB_SCOPES, ExecutionScope.class, msgs);
+			if (newSuperScope != null)
+				msgs = ((InternalEObject)newSuperScope).eInverseAdd(this, SexecPackage.EXECUTION_SCOPE__SUB_SCOPES, ExecutionScope.class, msgs);
+			msgs = basicSetSuperScope(newSuperScope, msgs);
+			if (msgs != null) msgs.dispatch();
+		}
+		else if (eNotificationRequired())
+			eNotify(new ENotificationImpl(this, Notification.SET, SexecPackage.EXECUTION_FLOW__SUPER_SCOPE, newSuperScope, newSuperScope));
+	}
+
 	/**
 	 * <!-- begin-user-doc -->
 	 * <!-- end-user-doc -->
@@ -307,6 +466,37 @@ public class ExecutionFlowImpl extends ScopedElementImpl implements ExecutionFlo
 		return nodes;
 	}
 
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public EList<ExecutionRegion> getRegions() {
+		if (regions == null) {
+			regions = new EObjectContainmentEList<ExecutionRegion>(ExecutionRegion.class, this, SexecPackage.EXECUTION_FLOW__REGIONS);
+		}
+		return regions;
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	@SuppressWarnings("unchecked")
+	@Override
+	public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
+		switch (featureID) {
+			case SexecPackage.EXECUTION_FLOW__SUB_SCOPES:
+				return ((InternalEList<InternalEObject>)(InternalEList<?>)getSubScopes()).basicAdd(otherEnd, msgs);
+			case SexecPackage.EXECUTION_FLOW__SUPER_SCOPE:
+				if (superScope != null)
+					msgs = ((InternalEObject)superScope).eInverseRemove(this, SexecPackage.EXECUTION_SCOPE__SUB_SCOPES, ExecutionScope.class, msgs);
+				return basicSetSuperScope((ExecutionScope)otherEnd, msgs);
+		}
+		return super.eInverseAdd(otherEnd, featureID, msgs);
+	}
+
 	/**
 	 * <!-- begin-user-doc -->
 	 * <!-- end-user-doc -->
@@ -315,16 +505,22 @@ public class ExecutionFlowImpl extends ScopedElementImpl implements ExecutionFlo
 	@Override
 	public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
 		switch (featureID) {
+			case SexecPackage.EXECUTION_FLOW__STATE_VECTOR:
+				return basicSetStateVector(null, msgs);
+			case SexecPackage.EXECUTION_FLOW__SUB_SCOPES:
+				return ((InternalEList<?>)getSubScopes()).basicRemove(otherEnd, msgs);
+			case SexecPackage.EXECUTION_FLOW__SUPER_SCOPE:
+				return basicSetSuperScope(null, msgs);
 			case SexecPackage.EXECUTION_FLOW__STATES:
 				return ((InternalEList<?>)getStates()).basicRemove(otherEnd, msgs);
 			case SexecPackage.EXECUTION_FLOW__ENTER_SEQUENCE:
 				return basicSetEnterSequence(null, msgs);
-			case SexecPackage.EXECUTION_FLOW__STATE_VECTOR:
-				return basicSetStateVector(null, msgs);
 			case SexecPackage.EXECUTION_FLOW__EXIT_SEQUENCE:
 				return basicSetExitSequence(null, msgs);
 			case SexecPackage.EXECUTION_FLOW__NODES:
 				return ((InternalEList<?>)getNodes()).basicRemove(otherEnd, msgs);
+			case SexecPackage.EXECUTION_FLOW__REGIONS:
+				return ((InternalEList<?>)getRegions()).basicRemove(otherEnd, msgs);
 		}
 		return super.eInverseRemove(otherEnd, featureID, msgs);
 	}
@@ -339,16 +535,26 @@ public class ExecutionFlowImpl extends ScopedElementImpl implements ExecutionFlo
 		switch (featureID) {
 			case SexecPackage.EXECUTION_FLOW__NAME:
 				return getName();
+			case SexecPackage.EXECUTION_FLOW__SOURCE_ELEMENT:
+				if (resolve) return getSourceElement();
+				return basicGetSourceElement();
+			case SexecPackage.EXECUTION_FLOW__STATE_VECTOR:
+				return getStateVector();
+			case SexecPackage.EXECUTION_FLOW__SUB_SCOPES:
+				return getSubScopes();
+			case SexecPackage.EXECUTION_FLOW__SUPER_SCOPE:
+				if (resolve) return getSuperScope();
+				return basicGetSuperScope();
 			case SexecPackage.EXECUTION_FLOW__STATES:
 				return getStates();
 			case SexecPackage.EXECUTION_FLOW__ENTER_SEQUENCE:
 				return getEnterSequence();
-			case SexecPackage.EXECUTION_FLOW__STATE_VECTOR:
-				return getStateVector();
 			case SexecPackage.EXECUTION_FLOW__EXIT_SEQUENCE:
 				return getExitSequence();
 			case SexecPackage.EXECUTION_FLOW__NODES:
 				return getNodes();
+			case SexecPackage.EXECUTION_FLOW__REGIONS:
+				return getRegions();
 		}
 		return super.eGet(featureID, resolve, coreType);
 	}
@@ -365,6 +571,19 @@ public class ExecutionFlowImpl extends ScopedElementImpl implements ExecutionFlo
 			case SexecPackage.EXECUTION_FLOW__NAME:
 				setName((String)newValue);
 				return;
+			case SexecPackage.EXECUTION_FLOW__SOURCE_ELEMENT:
+				setSourceElement((EObject)newValue);
+				return;
+			case SexecPackage.EXECUTION_FLOW__STATE_VECTOR:
+				setStateVector((StateVector)newValue);
+				return;
+			case SexecPackage.EXECUTION_FLOW__SUB_SCOPES:
+				getSubScopes().clear();
+				getSubScopes().addAll((Collection<? extends ExecutionScope>)newValue);
+				return;
+			case SexecPackage.EXECUTION_FLOW__SUPER_SCOPE:
+				setSuperScope((ExecutionScope)newValue);
+				return;
 			case SexecPackage.EXECUTION_FLOW__STATES:
 				getStates().clear();
 				getStates().addAll((Collection<? extends ExecutionState>)newValue);
@@ -372,9 +591,6 @@ public class ExecutionFlowImpl extends ScopedElementImpl implements ExecutionFlo
 			case SexecPackage.EXECUTION_FLOW__ENTER_SEQUENCE:
 				setEnterSequence((Sequence)newValue);
 				return;
-			case SexecPackage.EXECUTION_FLOW__STATE_VECTOR:
-				setStateVector((StateVector)newValue);
-				return;
 			case SexecPackage.EXECUTION_FLOW__EXIT_SEQUENCE:
 				setExitSequence((Sequence)newValue);
 				return;
@@ -382,6 +598,10 @@ public class ExecutionFlowImpl extends ScopedElementImpl implements ExecutionFlo
 				getNodes().clear();
 				getNodes().addAll((Collection<? extends ExecutionNode>)newValue);
 				return;
+			case SexecPackage.EXECUTION_FLOW__REGIONS:
+				getRegions().clear();
+				getRegions().addAll((Collection<? extends ExecutionRegion>)newValue);
+				return;
 		}
 		super.eSet(featureID, newValue);
 	}
@@ -397,21 +617,33 @@ public class ExecutionFlowImpl extends ScopedElementImpl implements ExecutionFlo
 			case SexecPackage.EXECUTION_FLOW__NAME:
 				setName(NAME_EDEFAULT);
 				return;
+			case SexecPackage.EXECUTION_FLOW__SOURCE_ELEMENT:
+				setSourceElement((EObject)null);
+				return;
+			case SexecPackage.EXECUTION_FLOW__STATE_VECTOR:
+				setStateVector((StateVector)null);
+				return;
+			case SexecPackage.EXECUTION_FLOW__SUB_SCOPES:
+				getSubScopes().clear();
+				return;
+			case SexecPackage.EXECUTION_FLOW__SUPER_SCOPE:
+				setSuperScope((ExecutionScope)null);
+				return;
 			case SexecPackage.EXECUTION_FLOW__STATES:
 				getStates().clear();
 				return;
 			case SexecPackage.EXECUTION_FLOW__ENTER_SEQUENCE:
 				setEnterSequence((Sequence)null);
 				return;
-			case SexecPackage.EXECUTION_FLOW__STATE_VECTOR:
-				setStateVector((StateVector)null);
-				return;
 			case SexecPackage.EXECUTION_FLOW__EXIT_SEQUENCE:
 				setExitSequence((Sequence)null);
 				return;
 			case SexecPackage.EXECUTION_FLOW__NODES:
 				getNodes().clear();
 				return;
+			case SexecPackage.EXECUTION_FLOW__REGIONS:
+				getRegions().clear();
+				return;
 		}
 		super.eUnset(featureID);
 	}
@@ -426,16 +658,24 @@ public class ExecutionFlowImpl extends ScopedElementImpl implements ExecutionFlo
 		switch (featureID) {
 			case SexecPackage.EXECUTION_FLOW__NAME:
 				return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
+			case SexecPackage.EXECUTION_FLOW__SOURCE_ELEMENT:
+				return sourceElement != null;
+			case SexecPackage.EXECUTION_FLOW__STATE_VECTOR:
+				return stateVector != null;
+			case SexecPackage.EXECUTION_FLOW__SUB_SCOPES:
+				return subScopes != null && !subScopes.isEmpty();
+			case SexecPackage.EXECUTION_FLOW__SUPER_SCOPE:
+				return superScope != null;
 			case SexecPackage.EXECUTION_FLOW__STATES:
 				return states != null && !states.isEmpty();
 			case SexecPackage.EXECUTION_FLOW__ENTER_SEQUENCE:
 				return enterSequence != null;
-			case SexecPackage.EXECUTION_FLOW__STATE_VECTOR:
-				return stateVector != null;
 			case SexecPackage.EXECUTION_FLOW__EXIT_SEQUENCE:
 				return exitSequence != null;
 			case SexecPackage.EXECUTION_FLOW__NODES:
 				return nodes != null && !nodes.isEmpty();
+			case SexecPackage.EXECUTION_FLOW__REGIONS:
+				return regions != null && !regions.isEmpty();
 		}
 		return super.eIsSet(featureID);
 	}
@@ -453,6 +693,20 @@ public class ExecutionFlowImpl extends ScopedElementImpl implements ExecutionFlo
 				default: return -1;
 			}
 		}
+		if (baseClass == MappedElement.class) {
+			switch (derivedFeatureID) {
+				case SexecPackage.EXECUTION_FLOW__SOURCE_ELEMENT: return SexecPackage.MAPPED_ELEMENT__SOURCE_ELEMENT;
+				default: return -1;
+			}
+		}
+		if (baseClass == ExecutionScope.class) {
+			switch (derivedFeatureID) {
+				case SexecPackage.EXECUTION_FLOW__STATE_VECTOR: return SexecPackage.EXECUTION_SCOPE__STATE_VECTOR;
+				case SexecPackage.EXECUTION_FLOW__SUB_SCOPES: return SexecPackage.EXECUTION_SCOPE__SUB_SCOPES;
+				case SexecPackage.EXECUTION_FLOW__SUPER_SCOPE: return SexecPackage.EXECUTION_SCOPE__SUPER_SCOPE;
+				default: return -1;
+			}
+		}
 		return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass);
 	}
 
@@ -469,6 +723,20 @@ public class ExecutionFlowImpl extends ScopedElementImpl implements ExecutionFlo
 				default: return -1;
 			}
 		}
+		if (baseClass == MappedElement.class) {
+			switch (baseFeatureID) {
+				case SexecPackage.MAPPED_ELEMENT__SOURCE_ELEMENT: return SexecPackage.EXECUTION_FLOW__SOURCE_ELEMENT;
+				default: return -1;
+			}
+		}
+		if (baseClass == ExecutionScope.class) {
+			switch (baseFeatureID) {
+				case SexecPackage.EXECUTION_SCOPE__STATE_VECTOR: return SexecPackage.EXECUTION_FLOW__STATE_VECTOR;
+				case SexecPackage.EXECUTION_SCOPE__SUB_SCOPES: return SexecPackage.EXECUTION_FLOW__SUB_SCOPES;
+				case SexecPackage.EXECUTION_SCOPE__SUPER_SCOPE: return SexecPackage.EXECUTION_FLOW__SUPER_SCOPE;
+				default: return -1;
+			}
+		}
 		return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass);
 	}
 

+ 1 - 0
plugins/org.yakindu.sct.model.sexec/src/org/yakindu/sct/model/sexec/impl/ExecutionNodeImpl.java

@@ -22,6 +22,7 @@ import org.yakindu.sct.model.sexec.MappedElement;
 import org.yakindu.sct.model.sexec.Reaction;
 import org.yakindu.sct.model.sexec.Sequence;
 import org.yakindu.sct.model.sexec.SexecPackage;
+import org.yakindu.sct.model.sexec.StateVector;
 
 /**
  * <!-- begin-user-doc -->

+ 43 - 0
plugins/org.yakindu.sct.model.sexec/src/org/yakindu/sct/model/sexec/impl/ExecutionRegionImpl.java

@@ -0,0 +1,43 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id$
+ */
+package org.yakindu.sct.model.sexec.impl;
+
+import org.eclipse.emf.ecore.EClass;
+
+import org.yakindu.sct.model.sexec.ExecutionRegion;
+import org.yakindu.sct.model.sexec.SexecPackage;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>Execution Region</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * </p>
+ *
+ * @generated
+ */
+public class ExecutionRegionImpl extends ExecutionScopeImpl implements ExecutionRegion {
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	protected ExecutionRegionImpl() {
+		super();
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	@Override
+	protected EClass eStaticClass() {
+		return SexecPackage.Literals.EXECUTION_REGION;
+	}
+
+} //ExecutionRegionImpl

+ 420 - 0
plugins/org.yakindu.sct.model.sexec/src/org/yakindu/sct/model/sexec/impl/ExecutionScopeImpl.java

@@ -0,0 +1,420 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id$
+ */
+package org.yakindu.sct.model.sexec.impl;
+
+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.EObject;
+import org.eclipse.emf.ecore.InternalEObject;
+
+import org.eclipse.emf.ecore.impl.ENotificationImpl;
+
+import org.eclipse.emf.ecore.util.EObjectWithInverseResolvingEList;
+import org.eclipse.emf.ecore.util.InternalEList;
+
+import org.yakindu.sct.model.sexec.ExecutionScope;
+import org.yakindu.sct.model.sexec.MappedElement;
+import org.yakindu.sct.model.sexec.SexecPackage;
+import org.yakindu.sct.model.sexec.StateVector;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>Execution Scope</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * <ul>
+ *   <li>{@link org.yakindu.sct.model.sexec.impl.ExecutionScopeImpl#getSourceElement <em>Source Element</em>}</li>
+ *   <li>{@link org.yakindu.sct.model.sexec.impl.ExecutionScopeImpl#getStateVector <em>State Vector</em>}</li>
+ *   <li>{@link org.yakindu.sct.model.sexec.impl.ExecutionScopeImpl#getSubScopes <em>Sub Scopes</em>}</li>
+ *   <li>{@link org.yakindu.sct.model.sexec.impl.ExecutionScopeImpl#getSuperScope <em>Super Scope</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public class ExecutionScopeImpl extends NamedElementImpl implements ExecutionScope {
+	/**
+	 * The cached value of the '{@link #getSourceElement() <em>Source Element</em>}' reference.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @see #getSourceElement()
+	 * @generated
+	 * @ordered
+	 */
+	protected EObject sourceElement;
+
+	/**
+	 * The cached value of the '{@link #getStateVector() <em>State Vector</em>}' containment reference.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @see #getStateVector()
+	 * @generated
+	 * @ordered
+	 */
+	protected StateVector stateVector;
+
+	/**
+	 * The cached value of the '{@link #getSubScopes() <em>Sub Scopes</em>}' reference list.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @see #getSubScopes()
+	 * @generated
+	 * @ordered
+	 */
+	protected EList<ExecutionScope> subScopes;
+
+	/**
+	 * The cached value of the '{@link #getSuperScope() <em>Super Scope</em>}' reference.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @see #getSuperScope()
+	 * @generated
+	 * @ordered
+	 */
+	protected ExecutionScope superScope;
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	protected ExecutionScopeImpl() {
+		super();
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	@Override
+	protected EClass eStaticClass() {
+		return SexecPackage.Literals.EXECUTION_SCOPE;
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public EObject getSourceElement() {
+		if (sourceElement != null && sourceElement.eIsProxy()) {
+			InternalEObject oldSourceElement = (InternalEObject)sourceElement;
+			sourceElement = eResolveProxy(oldSourceElement);
+			if (sourceElement != oldSourceElement) {
+				if (eNotificationRequired())
+					eNotify(new ENotificationImpl(this, Notification.RESOLVE, SexecPackage.EXECUTION_SCOPE__SOURCE_ELEMENT, oldSourceElement, sourceElement));
+			}
+		}
+		return sourceElement;
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public EObject basicGetSourceElement() {
+		return sourceElement;
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public void setSourceElement(EObject newSourceElement) {
+		EObject oldSourceElement = sourceElement;
+		sourceElement = newSourceElement;
+		if (eNotificationRequired())
+			eNotify(new ENotificationImpl(this, Notification.SET, SexecPackage.EXECUTION_SCOPE__SOURCE_ELEMENT, oldSourceElement, sourceElement));
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public StateVector getStateVector() {
+		return stateVector;
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public NotificationChain basicSetStateVector(StateVector newStateVector, NotificationChain msgs) {
+		StateVector oldStateVector = stateVector;
+		stateVector = newStateVector;
+		if (eNotificationRequired()) {
+			ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, SexecPackage.EXECUTION_SCOPE__STATE_VECTOR, oldStateVector, newStateVector);
+			if (msgs == null) msgs = notification; else msgs.add(notification);
+		}
+		return msgs;
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public void setStateVector(StateVector newStateVector) {
+		if (newStateVector != stateVector) {
+			NotificationChain msgs = null;
+			if (stateVector != null)
+				msgs = ((InternalEObject)stateVector).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - SexecPackage.EXECUTION_SCOPE__STATE_VECTOR, null, msgs);
+			if (newStateVector != null)
+				msgs = ((InternalEObject)newStateVector).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - SexecPackage.EXECUTION_SCOPE__STATE_VECTOR, null, msgs);
+			msgs = basicSetStateVector(newStateVector, msgs);
+			if (msgs != null) msgs.dispatch();
+		}
+		else if (eNotificationRequired())
+			eNotify(new ENotificationImpl(this, Notification.SET, SexecPackage.EXECUTION_SCOPE__STATE_VECTOR, newStateVector, newStateVector));
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public EList<ExecutionScope> getSubScopes() {
+		if (subScopes == null) {
+			subScopes = new EObjectWithInverseResolvingEList<ExecutionScope>(ExecutionScope.class, this, SexecPackage.EXECUTION_SCOPE__SUB_SCOPES, SexecPackage.EXECUTION_SCOPE__SUPER_SCOPE);
+		}
+		return subScopes;
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public ExecutionScope getSuperScope() {
+		if (superScope != null && superScope.eIsProxy()) {
+			InternalEObject oldSuperScope = (InternalEObject)superScope;
+			superScope = (ExecutionScope)eResolveProxy(oldSuperScope);
+			if (superScope != oldSuperScope) {
+				if (eNotificationRequired())
+					eNotify(new ENotificationImpl(this, Notification.RESOLVE, SexecPackage.EXECUTION_SCOPE__SUPER_SCOPE, oldSuperScope, superScope));
+			}
+		}
+		return superScope;
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public ExecutionScope basicGetSuperScope() {
+		return superScope;
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public NotificationChain basicSetSuperScope(ExecutionScope newSuperScope, NotificationChain msgs) {
+		ExecutionScope oldSuperScope = superScope;
+		superScope = newSuperScope;
+		if (eNotificationRequired()) {
+			ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, SexecPackage.EXECUTION_SCOPE__SUPER_SCOPE, oldSuperScope, newSuperScope);
+			if (msgs == null) msgs = notification; else msgs.add(notification);
+		}
+		return msgs;
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public void setSuperScope(ExecutionScope newSuperScope) {
+		if (newSuperScope != superScope) {
+			NotificationChain msgs = null;
+			if (superScope != null)
+				msgs = ((InternalEObject)superScope).eInverseRemove(this, SexecPackage.EXECUTION_SCOPE__SUB_SCOPES, ExecutionScope.class, msgs);
+			if (newSuperScope != null)
+				msgs = ((InternalEObject)newSuperScope).eInverseAdd(this, SexecPackage.EXECUTION_SCOPE__SUB_SCOPES, ExecutionScope.class, msgs);
+			msgs = basicSetSuperScope(newSuperScope, msgs);
+			if (msgs != null) msgs.dispatch();
+		}
+		else if (eNotificationRequired())
+			eNotify(new ENotificationImpl(this, Notification.SET, SexecPackage.EXECUTION_SCOPE__SUPER_SCOPE, newSuperScope, newSuperScope));
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	@SuppressWarnings("unchecked")
+	@Override
+	public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
+		switch (featureID) {
+			case SexecPackage.EXECUTION_SCOPE__SUB_SCOPES:
+				return ((InternalEList<InternalEObject>)(InternalEList<?>)getSubScopes()).basicAdd(otherEnd, msgs);
+			case SexecPackage.EXECUTION_SCOPE__SUPER_SCOPE:
+				if (superScope != null)
+					msgs = ((InternalEObject)superScope).eInverseRemove(this, SexecPackage.EXECUTION_SCOPE__SUB_SCOPES, ExecutionScope.class, msgs);
+				return basicSetSuperScope((ExecutionScope)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 SexecPackage.EXECUTION_SCOPE__STATE_VECTOR:
+				return basicSetStateVector(null, msgs);
+			case SexecPackage.EXECUTION_SCOPE__SUB_SCOPES:
+				return ((InternalEList<?>)getSubScopes()).basicRemove(otherEnd, msgs);
+			case SexecPackage.EXECUTION_SCOPE__SUPER_SCOPE:
+				return basicSetSuperScope(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 SexecPackage.EXECUTION_SCOPE__SOURCE_ELEMENT:
+				if (resolve) return getSourceElement();
+				return basicGetSourceElement();
+			case SexecPackage.EXECUTION_SCOPE__STATE_VECTOR:
+				return getStateVector();
+			case SexecPackage.EXECUTION_SCOPE__SUB_SCOPES:
+				return getSubScopes();
+			case SexecPackage.EXECUTION_SCOPE__SUPER_SCOPE:
+				if (resolve) return getSuperScope();
+				return basicGetSuperScope();
+		}
+		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 SexecPackage.EXECUTION_SCOPE__SOURCE_ELEMENT:
+				setSourceElement((EObject)newValue);
+				return;
+			case SexecPackage.EXECUTION_SCOPE__STATE_VECTOR:
+				setStateVector((StateVector)newValue);
+				return;
+			case SexecPackage.EXECUTION_SCOPE__SUB_SCOPES:
+				getSubScopes().clear();
+				getSubScopes().addAll((Collection<? extends ExecutionScope>)newValue);
+				return;
+			case SexecPackage.EXECUTION_SCOPE__SUPER_SCOPE:
+				setSuperScope((ExecutionScope)newValue);
+				return;
+		}
+		super.eSet(featureID, newValue);
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	@Override
+	public void eUnset(int featureID) {
+		switch (featureID) {
+			case SexecPackage.EXECUTION_SCOPE__SOURCE_ELEMENT:
+				setSourceElement((EObject)null);
+				return;
+			case SexecPackage.EXECUTION_SCOPE__STATE_VECTOR:
+				setStateVector((StateVector)null);
+				return;
+			case SexecPackage.EXECUTION_SCOPE__SUB_SCOPES:
+				getSubScopes().clear();
+				return;
+			case SexecPackage.EXECUTION_SCOPE__SUPER_SCOPE:
+				setSuperScope((ExecutionScope)null);
+				return;
+		}
+		super.eUnset(featureID);
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	@Override
+	public boolean eIsSet(int featureID) {
+		switch (featureID) {
+			case SexecPackage.EXECUTION_SCOPE__SOURCE_ELEMENT:
+				return sourceElement != null;
+			case SexecPackage.EXECUTION_SCOPE__STATE_VECTOR:
+				return stateVector != null;
+			case SexecPackage.EXECUTION_SCOPE__SUB_SCOPES:
+				return subScopes != null && !subScopes.isEmpty();
+			case SexecPackage.EXECUTION_SCOPE__SUPER_SCOPE:
+				return superScope != null;
+		}
+		return super.eIsSet(featureID);
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	@Override
+	public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass) {
+		if (baseClass == MappedElement.class) {
+			switch (derivedFeatureID) {
+				case SexecPackage.EXECUTION_SCOPE__SOURCE_ELEMENT: return SexecPackage.MAPPED_ELEMENT__SOURCE_ELEMENT;
+				default: return -1;
+			}
+		}
+		return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass);
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	@Override
+	public int eDerivedStructuralFeatureID(int baseFeatureID, Class<?> baseClass) {
+		if (baseClass == MappedElement.class) {
+			switch (baseFeatureID) {
+				case SexecPackage.MAPPED_ELEMENT__SOURCE_ELEMENT: return SexecPackage.EXECUTION_SCOPE__SOURCE_ELEMENT;
+				default: return -1;
+			}
+		}
+		return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass);
+	}
+
+} //ExecutionScopeImpl

+ 238 - 57
plugins/org.yakindu.sct.model.sexec/src/org/yakindu/sct/model/sexec/impl/ExecutionStateImpl.java

@@ -6,11 +6,16 @@
  */
 package org.yakindu.sct.model.sexec.impl;
 
+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.EObjectWithInverseResolvingEList;
+import org.eclipse.emf.ecore.util.InternalEList;
+import org.yakindu.sct.model.sexec.ExecutionScope;
 import org.yakindu.sct.model.sexec.ExecutionState;
 import org.yakindu.sct.model.sexec.Sequence;
 import org.yakindu.sct.model.sexec.SexecPackage;
@@ -24,18 +29,50 @@ import org.yakindu.sct.model.sexec.Step;
  * <p>
  * The following features are implemented:
  * <ul>
+ *   <li>{@link org.yakindu.sct.model.sexec.impl.ExecutionStateImpl#getStateVector <em>State Vector</em>}</li>
+ *   <li>{@link org.yakindu.sct.model.sexec.impl.ExecutionStateImpl#getSubScopes <em>Sub Scopes</em>}</li>
+ *   <li>{@link org.yakindu.sct.model.sexec.impl.ExecutionStateImpl#getSuperScope <em>Super Scope</em>}</li>
  *   <li>{@link org.yakindu.sct.model.sexec.impl.ExecutionStateImpl#isLeaf <em>Leaf</em>}</li>
  *   <li>{@link org.yakindu.sct.model.sexec.impl.ExecutionStateImpl#getEntryAction <em>Entry Action</em>}</li>
  *   <li>{@link org.yakindu.sct.model.sexec.impl.ExecutionStateImpl#getExitAction <em>Exit Action</em>}</li>
  *   <li>{@link org.yakindu.sct.model.sexec.impl.ExecutionStateImpl#getEnterSequence <em>Enter Sequence</em>}</li>
  *   <li>{@link org.yakindu.sct.model.sexec.impl.ExecutionStateImpl#getExitSequence <em>Exit Sequence</em>}</li>
- *   <li>{@link org.yakindu.sct.model.sexec.impl.ExecutionStateImpl#getStateVector <em>State Vector</em>}</li>
  * </ul>
  * </p>
  *
  * @generated
  */
 public class ExecutionStateImpl extends ExecutionNodeImpl implements ExecutionState {
+	/**
+	 * The cached value of the '{@link #getStateVector() <em>State Vector</em>}' containment reference.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @see #getStateVector()
+	 * @generated
+	 * @ordered
+	 */
+	protected StateVector stateVector;
+
+	/**
+	 * The cached value of the '{@link #getSubScopes() <em>Sub Scopes</em>}' reference list.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @see #getSubScopes()
+	 * @generated
+	 * @ordered
+	 */
+	protected EList<ExecutionScope> subScopes;
+
+	/**
+	 * The cached value of the '{@link #getSuperScope() <em>Super Scope</em>}' reference.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @see #getSuperScope()
+	 * @generated
+	 * @ordered
+	 */
+	protected ExecutionScope superScope;
+
 	/**
 	 * The default value of the '{@link #isLeaf() <em>Leaf</em>}' attribute.
 	 * <!-- begin-user-doc -->
@@ -97,22 +134,22 @@ public class ExecutionStateImpl extends ExecutionNodeImpl implements ExecutionSt
 	protected Sequence exitSequence;
 
 	/**
-	 * The cached value of the '{@link #getStateVector() <em>State Vector</em>}' containment reference.
 	 * <!-- begin-user-doc -->
 	 * <!-- end-user-doc -->
-	 * @see #getStateVector()
 	 * @generated
-	 * @ordered
 	 */
-	protected StateVector stateVector;
+	protected ExecutionStateImpl() {
+		super();
+	}
 
 	/**
 	 * <!-- begin-user-doc -->
 	 * <!-- end-user-doc -->
 	 * @generated
 	 */
-	protected ExecutionStateImpl() {
-		super();
+	@Override
+	protected EClass eStaticClass() {
+		return SexecPackage.Literals.EXECUTION_STATE;
 	}
 
 	/**
@@ -120,9 +157,114 @@ public class ExecutionStateImpl extends ExecutionNodeImpl implements ExecutionSt
 	 * <!-- end-user-doc -->
 	 * @generated
 	 */
-	@Override
-	protected EClass eStaticClass() {
-		return SexecPackage.Literals.EXECUTION_STATE;
+	public StateVector getStateVector() {
+		return stateVector;
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public NotificationChain basicSetStateVector(StateVector newStateVector, NotificationChain msgs) {
+		StateVector oldStateVector = stateVector;
+		stateVector = newStateVector;
+		if (eNotificationRequired()) {
+			ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, SexecPackage.EXECUTION_STATE__STATE_VECTOR, oldStateVector, newStateVector);
+			if (msgs == null) msgs = notification; else msgs.add(notification);
+		}
+		return msgs;
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public void setStateVector(StateVector newStateVector) {
+		if (newStateVector != stateVector) {
+			NotificationChain msgs = null;
+			if (stateVector != null)
+				msgs = ((InternalEObject)stateVector).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - SexecPackage.EXECUTION_STATE__STATE_VECTOR, null, msgs);
+			if (newStateVector != null)
+				msgs = ((InternalEObject)newStateVector).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - SexecPackage.EXECUTION_STATE__STATE_VECTOR, null, msgs);
+			msgs = basicSetStateVector(newStateVector, msgs);
+			if (msgs != null) msgs.dispatch();
+		}
+		else if (eNotificationRequired())
+			eNotify(new ENotificationImpl(this, Notification.SET, SexecPackage.EXECUTION_STATE__STATE_VECTOR, newStateVector, newStateVector));
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public EList<ExecutionScope> getSubScopes() {
+		if (subScopes == null) {
+			subScopes = new EObjectWithInverseResolvingEList<ExecutionScope>(ExecutionScope.class, this, SexecPackage.EXECUTION_STATE__SUB_SCOPES, SexecPackage.EXECUTION_SCOPE__SUPER_SCOPE);
+		}
+		return subScopes;
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public ExecutionScope getSuperScope() {
+		if (superScope != null && superScope.eIsProxy()) {
+			InternalEObject oldSuperScope = (InternalEObject)superScope;
+			superScope = (ExecutionScope)eResolveProxy(oldSuperScope);
+			if (superScope != oldSuperScope) {
+				if (eNotificationRequired())
+					eNotify(new ENotificationImpl(this, Notification.RESOLVE, SexecPackage.EXECUTION_STATE__SUPER_SCOPE, oldSuperScope, superScope));
+			}
+		}
+		return superScope;
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public ExecutionScope basicGetSuperScope() {
+		return superScope;
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public NotificationChain basicSetSuperScope(ExecutionScope newSuperScope, NotificationChain msgs) {
+		ExecutionScope oldSuperScope = superScope;
+		superScope = newSuperScope;
+		if (eNotificationRequired()) {
+			ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, SexecPackage.EXECUTION_STATE__SUPER_SCOPE, oldSuperScope, newSuperScope);
+			if (msgs == null) msgs = notification; else msgs.add(notification);
+		}
+		return msgs;
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public void setSuperScope(ExecutionScope newSuperScope) {
+		if (newSuperScope != superScope) {
+			NotificationChain msgs = null;
+			if (superScope != null)
+				msgs = ((InternalEObject)superScope).eInverseRemove(this, SexecPackage.EXECUTION_SCOPE__SUB_SCOPES, ExecutionScope.class, msgs);
+			if (newSuperScope != null)
+				msgs = ((InternalEObject)newSuperScope).eInverseAdd(this, SexecPackage.EXECUTION_SCOPE__SUB_SCOPES, ExecutionScope.class, msgs);
+			msgs = basicSetSuperScope(newSuperScope, msgs);
+			if (msgs != null) msgs.dispatch();
+		}
+		else if (eNotificationRequired())
+			eNotify(new ENotificationImpl(this, Notification.SET, SexecPackage.EXECUTION_STATE__SUPER_SCOPE, newSuperScope, newSuperScope));
 	}
 
 	/**
@@ -302,42 +444,18 @@ public class ExecutionStateImpl extends ExecutionNodeImpl implements ExecutionSt
 	 * <!-- end-user-doc -->
 	 * @generated
 	 */
-	public StateVector getStateVector() {
-		return stateVector;
-	}
-
-	/**
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * @generated
-	 */
-	public NotificationChain basicSetStateVector(StateVector newStateVector, NotificationChain msgs) {
-		StateVector oldStateVector = stateVector;
-		stateVector = newStateVector;
-		if (eNotificationRequired()) {
-			ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, SexecPackage.EXECUTION_STATE__STATE_VECTOR, oldStateVector, newStateVector);
-			if (msgs == null) msgs = notification; else msgs.add(notification);
-		}
-		return msgs;
-	}
-
-	/**
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * @generated
-	 */
-	public void setStateVector(StateVector newStateVector) {
-		if (newStateVector != stateVector) {
-			NotificationChain msgs = null;
-			if (stateVector != null)
-				msgs = ((InternalEObject)stateVector).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - SexecPackage.EXECUTION_STATE__STATE_VECTOR, null, msgs);
-			if (newStateVector != null)
-				msgs = ((InternalEObject)newStateVector).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - SexecPackage.EXECUTION_STATE__STATE_VECTOR, null, msgs);
-			msgs = basicSetStateVector(newStateVector, msgs);
-			if (msgs != null) msgs.dispatch();
+	@SuppressWarnings("unchecked")
+	@Override
+	public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
+		switch (featureID) {
+			case SexecPackage.EXECUTION_STATE__SUB_SCOPES:
+				return ((InternalEList<InternalEObject>)(InternalEList<?>)getSubScopes()).basicAdd(otherEnd, msgs);
+			case SexecPackage.EXECUTION_STATE__SUPER_SCOPE:
+				if (superScope != null)
+					msgs = ((InternalEObject)superScope).eInverseRemove(this, SexecPackage.EXECUTION_SCOPE__SUB_SCOPES, ExecutionScope.class, msgs);
+				return basicSetSuperScope((ExecutionScope)otherEnd, msgs);
 		}
-		else if (eNotificationRequired())
-			eNotify(new ENotificationImpl(this, Notification.SET, SexecPackage.EXECUTION_STATE__STATE_VECTOR, newStateVector, newStateVector));
+		return super.eInverseAdd(otherEnd, featureID, msgs);
 	}
 
 	/**
@@ -369,6 +487,12 @@ public class ExecutionStateImpl extends ExecutionNodeImpl implements ExecutionSt
 	@Override
 	public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
 		switch (featureID) {
+			case SexecPackage.EXECUTION_STATE__STATE_VECTOR:
+				return basicSetStateVector(null, msgs);
+			case SexecPackage.EXECUTION_STATE__SUB_SCOPES:
+				return ((InternalEList<?>)getSubScopes()).basicRemove(otherEnd, msgs);
+			case SexecPackage.EXECUTION_STATE__SUPER_SCOPE:
+				return basicSetSuperScope(null, msgs);
 			case SexecPackage.EXECUTION_STATE__ENTRY_ACTION:
 				return basicSetEntryAction(null, msgs);
 			case SexecPackage.EXECUTION_STATE__EXIT_ACTION:
@@ -377,8 +501,6 @@ public class ExecutionStateImpl extends ExecutionNodeImpl implements ExecutionSt
 				return basicSetEnterSequence(null, msgs);
 			case SexecPackage.EXECUTION_STATE__EXIT_SEQUENCE:
 				return basicSetExitSequence(null, msgs);
-			case SexecPackage.EXECUTION_STATE__STATE_VECTOR:
-				return basicSetStateVector(null, msgs);
 		}
 		return super.eInverseRemove(otherEnd, featureID, msgs);
 	}
@@ -391,6 +513,13 @@ public class ExecutionStateImpl extends ExecutionNodeImpl implements ExecutionSt
 	@Override
 	public Object eGet(int featureID, boolean resolve, boolean coreType) {
 		switch (featureID) {
+			case SexecPackage.EXECUTION_STATE__STATE_VECTOR:
+				return getStateVector();
+			case SexecPackage.EXECUTION_STATE__SUB_SCOPES:
+				return getSubScopes();
+			case SexecPackage.EXECUTION_STATE__SUPER_SCOPE:
+				if (resolve) return getSuperScope();
+				return basicGetSuperScope();
 			case SexecPackage.EXECUTION_STATE__LEAF:
 				return isLeaf();
 			case SexecPackage.EXECUTION_STATE__ENTRY_ACTION:
@@ -401,8 +530,6 @@ public class ExecutionStateImpl extends ExecutionNodeImpl implements ExecutionSt
 				return getEnterSequence();
 			case SexecPackage.EXECUTION_STATE__EXIT_SEQUENCE:
 				return getExitSequence();
-			case SexecPackage.EXECUTION_STATE__STATE_VECTOR:
-				return getStateVector();
 		}
 		return super.eGet(featureID, resolve, coreType);
 	}
@@ -412,9 +539,20 @@ public class ExecutionStateImpl extends ExecutionNodeImpl implements ExecutionSt
 	 * <!-- end-user-doc -->
 	 * @generated
 	 */
+	@SuppressWarnings("unchecked")
 	@Override
 	public void eSet(int featureID, Object newValue) {
 		switch (featureID) {
+			case SexecPackage.EXECUTION_STATE__STATE_VECTOR:
+				setStateVector((StateVector)newValue);
+				return;
+			case SexecPackage.EXECUTION_STATE__SUB_SCOPES:
+				getSubScopes().clear();
+				getSubScopes().addAll((Collection<? extends ExecutionScope>)newValue);
+				return;
+			case SexecPackage.EXECUTION_STATE__SUPER_SCOPE:
+				setSuperScope((ExecutionScope)newValue);
+				return;
 			case SexecPackage.EXECUTION_STATE__LEAF:
 				setLeaf((Boolean)newValue);
 				return;
@@ -430,9 +568,6 @@ public class ExecutionStateImpl extends ExecutionNodeImpl implements ExecutionSt
 			case SexecPackage.EXECUTION_STATE__EXIT_SEQUENCE:
 				setExitSequence((Sequence)newValue);
 				return;
-			case SexecPackage.EXECUTION_STATE__STATE_VECTOR:
-				setStateVector((StateVector)newValue);
-				return;
 		}
 		super.eSet(featureID, newValue);
 	}
@@ -445,6 +580,15 @@ public class ExecutionStateImpl extends ExecutionNodeImpl implements ExecutionSt
 	@Override
 	public void eUnset(int featureID) {
 		switch (featureID) {
+			case SexecPackage.EXECUTION_STATE__STATE_VECTOR:
+				setStateVector((StateVector)null);
+				return;
+			case SexecPackage.EXECUTION_STATE__SUB_SCOPES:
+				getSubScopes().clear();
+				return;
+			case SexecPackage.EXECUTION_STATE__SUPER_SCOPE:
+				setSuperScope((ExecutionScope)null);
+				return;
 			case SexecPackage.EXECUTION_STATE__LEAF:
 				setLeaf(LEAF_EDEFAULT);
 				return;
@@ -460,9 +604,6 @@ public class ExecutionStateImpl extends ExecutionNodeImpl implements ExecutionSt
 			case SexecPackage.EXECUTION_STATE__EXIT_SEQUENCE:
 				setExitSequence((Sequence)null);
 				return;
-			case SexecPackage.EXECUTION_STATE__STATE_VECTOR:
-				setStateVector((StateVector)null);
-				return;
 		}
 		super.eUnset(featureID);
 	}
@@ -475,6 +616,12 @@ public class ExecutionStateImpl extends ExecutionNodeImpl implements ExecutionSt
 	@Override
 	public boolean eIsSet(int featureID) {
 		switch (featureID) {
+			case SexecPackage.EXECUTION_STATE__STATE_VECTOR:
+				return stateVector != null;
+			case SexecPackage.EXECUTION_STATE__SUB_SCOPES:
+				return subScopes != null && !subScopes.isEmpty();
+			case SexecPackage.EXECUTION_STATE__SUPER_SCOPE:
+				return superScope != null;
 			case SexecPackage.EXECUTION_STATE__LEAF:
 				return leaf != LEAF_EDEFAULT;
 			case SexecPackage.EXECUTION_STATE__ENTRY_ACTION:
@@ -485,12 +632,46 @@ public class ExecutionStateImpl extends ExecutionNodeImpl implements ExecutionSt
 				return enterSequence != null;
 			case SexecPackage.EXECUTION_STATE__EXIT_SEQUENCE:
 				return exitSequence != null;
-			case SexecPackage.EXECUTION_STATE__STATE_VECTOR:
-				return stateVector != null;
 		}
 		return super.eIsSet(featureID);
 	}
 
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	@Override
+	public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass) {
+		if (baseClass == ExecutionScope.class) {
+			switch (derivedFeatureID) {
+				case SexecPackage.EXECUTION_STATE__STATE_VECTOR: return SexecPackage.EXECUTION_SCOPE__STATE_VECTOR;
+				case SexecPackage.EXECUTION_STATE__SUB_SCOPES: return SexecPackage.EXECUTION_SCOPE__SUB_SCOPES;
+				case SexecPackage.EXECUTION_STATE__SUPER_SCOPE: return SexecPackage.EXECUTION_SCOPE__SUPER_SCOPE;
+				default: return -1;
+			}
+		}
+		return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass);
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	@Override
+	public int eDerivedStructuralFeatureID(int baseFeatureID, Class<?> baseClass) {
+		if (baseClass == ExecutionScope.class) {
+			switch (baseFeatureID) {
+				case SexecPackage.EXECUTION_SCOPE__STATE_VECTOR: return SexecPackage.EXECUTION_STATE__STATE_VECTOR;
+				case SexecPackage.EXECUTION_SCOPE__SUB_SCOPES: return SexecPackage.EXECUTION_STATE__SUB_SCOPES;
+				case SexecPackage.EXECUTION_SCOPE__SUPER_SCOPE: return SexecPackage.EXECUTION_STATE__SUPER_SCOPE;
+				default: return -1;
+			}
+		}
+		return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass);
+	}
+
 	/**
 	 * <!-- begin-user-doc -->
 	 * <!-- end-user-doc -->

+ 33 - 0
plugins/org.yakindu.sct.model.sexec/src/org/yakindu/sct/model/sexec/impl/SexecFactoryImpl.java

@@ -86,6 +86,9 @@ public class SexecFactoryImpl extends EFactoryImpl implements SexecFactory {
 			case SexecPackage.EXECUTION_FLOW: return createExecutionFlow();
 			case SexecPackage.EXECUTION_NODE: return createExecutionNode();
 			case SexecPackage.EXECUTION_STATE: return createExecutionState();
+			case SexecPackage.EXECUTION_SCOPE: return createExecutionScope();
+			case SexecPackage.EXECUTION_REGION: return createExecutionRegion();
+			case SexecPackage.EXECUTION_ENTRY: return createExecutionEntry();
 			case SexecPackage.EXECUTION_CHOICE: return createExecutionChoice();
 			case SexecPackage.REACTION: return createReaction();
 			case SexecPackage.STATE_VECTOR: return createStateVector();
@@ -141,6 +144,36 @@ public class SexecFactoryImpl extends EFactoryImpl implements SexecFactory {
 		return executionState;
 	}
 
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public ExecutionScope createExecutionScope() {
+		ExecutionScopeImpl executionScope = new ExecutionScopeImpl();
+		return executionScope;
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public ExecutionRegion createExecutionRegion() {
+		ExecutionRegionImpl executionRegion = new ExecutionRegionImpl();
+		return executionRegion;
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public ExecutionEntry createExecutionEntry() {
+		ExecutionEntryImpl executionEntry = new ExecutionEntryImpl();
+		return executionEntry;
+	}
+
 	/**
 	 * <!-- begin-user-doc -->
 	 * <!-- end-user-doc -->

+ 100 - 10
plugins/org.yakindu.sct.model.sexec/src/org/yakindu/sct/model/sexec/impl/SexecPackageImpl.java

@@ -17,8 +17,11 @@ import org.yakindu.sct.model.sexec.CheckRef;
 import org.yakindu.sct.model.sexec.EnterState;
 import org.yakindu.sct.model.sexec.Execution;
 import org.yakindu.sct.model.sexec.ExecutionChoice;
+import org.yakindu.sct.model.sexec.ExecutionEntry;
 import org.yakindu.sct.model.sexec.ExecutionFlow;
 import org.yakindu.sct.model.sexec.ExecutionNode;
+import org.yakindu.sct.model.sexec.ExecutionRegion;
+import org.yakindu.sct.model.sexec.ExecutionScope;
 import org.yakindu.sct.model.sexec.ExecutionState;
 import org.yakindu.sct.model.sexec.ExitState;
 import org.yakindu.sct.model.sexec.If;
@@ -70,6 +73,27 @@ public class SexecPackageImpl extends EPackageImpl implements SexecPackage {
 	 */
 	private EClass executionStateEClass = null;
 
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	private EClass executionScopeEClass = null;
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	private EClass executionRegionEClass = null;
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	private EClass executionEntryEClass = null;
+
 	/**
 	 * <!-- begin-user-doc -->
 	 * <!-- end-user-doc -->
@@ -334,7 +358,7 @@ public class SexecPackageImpl extends EPackageImpl implements SexecPackage {
 	 * <!-- end-user-doc -->
 	 * @generated
 	 */
-	public EReference getExecutionFlow_StateVector() {
+	public EReference getExecutionFlow_ExitSequence() {
 		return (EReference)executionFlowEClass.getEStructuralFeatures().get(2);
 	}
 
@@ -343,7 +367,7 @@ public class SexecPackageImpl extends EPackageImpl implements SexecPackage {
 	 * <!-- end-user-doc -->
 	 * @generated
 	 */
-	public EReference getExecutionFlow_ExitSequence() {
+	public EReference getExecutionFlow_Nodes() {
 		return (EReference)executionFlowEClass.getEStructuralFeatures().get(3);
 	}
 
@@ -352,7 +376,7 @@ public class SexecPackageImpl extends EPackageImpl implements SexecPackage {
 	 * <!-- end-user-doc -->
 	 * @generated
 	 */
-	public EReference getExecutionFlow_Nodes() {
+	public EReference getExecutionFlow_Regions() {
 		return (EReference)executionFlowEClass.getEStructuralFeatures().get(4);
 	}
 
@@ -442,8 +466,53 @@ public class SexecPackageImpl extends EPackageImpl implements SexecPackage {
 	 * <!-- end-user-doc -->
 	 * @generated
 	 */
-	public EReference getExecutionState_StateVector() {
-		return (EReference)executionStateEClass.getEStructuralFeatures().get(5);
+	public EClass getExecutionScope() {
+		return executionScopeEClass;
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public EReference getExecutionScope_StateVector() {
+		return (EReference)executionScopeEClass.getEStructuralFeatures().get(0);
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public EReference getExecutionScope_SubScopes() {
+		return (EReference)executionScopeEClass.getEStructuralFeatures().get(1);
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public EReference getExecutionScope_SuperScope() {
+		return (EReference)executionScopeEClass.getEStructuralFeatures().get(2);
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public EClass getExecutionRegion() {
+		return executionRegionEClass;
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public EClass getExecutionEntry() {
+		return executionEntryEClass;
 	}
 
 	/**
@@ -996,9 +1065,9 @@ public class SexecPackageImpl extends EPackageImpl implements SexecPackage {
 		executionFlowEClass = createEClass(EXECUTION_FLOW);
 		createEReference(executionFlowEClass, EXECUTION_FLOW__STATES);
 		createEReference(executionFlowEClass, EXECUTION_FLOW__ENTER_SEQUENCE);
-		createEReference(executionFlowEClass, EXECUTION_FLOW__STATE_VECTOR);
 		createEReference(executionFlowEClass, EXECUTION_FLOW__EXIT_SEQUENCE);
 		createEReference(executionFlowEClass, EXECUTION_FLOW__NODES);
+		createEReference(executionFlowEClass, EXECUTION_FLOW__REGIONS);
 
 		executionNodeEClass = createEClass(EXECUTION_NODE);
 		createEReference(executionNodeEClass, EXECUTION_NODE__REACTIONS);
@@ -1011,7 +1080,15 @@ public class SexecPackageImpl extends EPackageImpl implements SexecPackage {
 		createEReference(executionStateEClass, EXECUTION_STATE__EXIT_ACTION);
 		createEReference(executionStateEClass, EXECUTION_STATE__ENTER_SEQUENCE);
 		createEReference(executionStateEClass, EXECUTION_STATE__EXIT_SEQUENCE);
-		createEReference(executionStateEClass, EXECUTION_STATE__STATE_VECTOR);
+
+		executionScopeEClass = createEClass(EXECUTION_SCOPE);
+		createEReference(executionScopeEClass, EXECUTION_SCOPE__STATE_VECTOR);
+		createEReference(executionScopeEClass, EXECUTION_SCOPE__SUB_SCOPES);
+		createEReference(executionScopeEClass, EXECUTION_SCOPE__SUPER_SCOPE);
+
+		executionRegionEClass = createEClass(EXECUTION_REGION);
+
+		executionEntryEClass = createEClass(EXECUTION_ENTRY);
 
 		executionChoiceEClass = createEClass(EXECUTION_CHOICE);
 
@@ -1120,10 +1197,15 @@ public class SexecPackageImpl extends EPackageImpl implements SexecPackage {
 
 		// Add supertypes to classes
 		executionFlowEClass.getESuperTypes().add(theSGraphPackage.getScopedElement());
-		executionFlowEClass.getESuperTypes().add(this.getNamedElement());
+		executionFlowEClass.getESuperTypes().add(this.getExecutionScope());
 		executionNodeEClass.getESuperTypes().add(this.getNamedElement());
 		executionNodeEClass.getESuperTypes().add(this.getMappedElement());
 		executionStateEClass.getESuperTypes().add(this.getExecutionNode());
+		executionStateEClass.getESuperTypes().add(this.getExecutionScope());
+		executionScopeEClass.getESuperTypes().add(this.getNamedElement());
+		executionScopeEClass.getESuperTypes().add(this.getMappedElement());
+		executionRegionEClass.getESuperTypes().add(this.getExecutionScope());
+		executionEntryEClass.getESuperTypes().add(this.getExecutionNode());
 		executionChoiceEClass.getESuperTypes().add(this.getExecutionNode());
 		reactionEClass.getESuperTypes().add(this.getNamedElement());
 		reactionEClass.getESuperTypes().add(this.getMappedElement());
@@ -1156,9 +1238,9 @@ public class SexecPackageImpl extends EPackageImpl implements SexecPackage {
 		initEClass(executionFlowEClass, ExecutionFlow.class, "ExecutionFlow", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
 		initEReference(getExecutionFlow_States(), this.getExecutionState(), null, "states", null, 0, -1, ExecutionFlow.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
 		initEReference(getExecutionFlow_EnterSequence(), this.getSequence(), null, "enterSequence", null, 0, 1, ExecutionFlow.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-		initEReference(getExecutionFlow_StateVector(), this.getStateVector(), null, "stateVector", null, 0, 1, ExecutionFlow.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
 		initEReference(getExecutionFlow_ExitSequence(), this.getSequence(), null, "exitSequence", null, 0, 1, ExecutionFlow.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
 		initEReference(getExecutionFlow_Nodes(), this.getExecutionNode(), null, "nodes", null, 0, -1, ExecutionFlow.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+		initEReference(getExecutionFlow_Regions(), this.getExecutionRegion(), null, "regions", null, 0, -1, ExecutionFlow.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
 
 		initEClass(executionNodeEClass, ExecutionNode.class, "ExecutionNode", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
 		initEReference(getExecutionNode_Reactions(), this.getReaction(), null, "reactions", null, 0, -1, ExecutionNode.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
@@ -1171,7 +1253,15 @@ public class SexecPackageImpl extends EPackageImpl implements SexecPackage {
 		initEReference(getExecutionState_ExitAction(), this.getStep(), null, "exitAction", null, 0, 1, ExecutionState.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
 		initEReference(getExecutionState_EnterSequence(), this.getSequence(), null, "enterSequence", null, 0, 1, ExecutionState.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
 		initEReference(getExecutionState_ExitSequence(), this.getSequence(), null, "exitSequence", null, 0, 1, ExecutionState.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-		initEReference(getExecutionState_StateVector(), this.getStateVector(), null, "stateVector", null, 0, 1, ExecutionState.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+
+		initEClass(executionScopeEClass, ExecutionScope.class, "ExecutionScope", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+		initEReference(getExecutionScope_StateVector(), this.getStateVector(), null, "stateVector", null, 0, 1, ExecutionScope.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+		initEReference(getExecutionScope_SubScopes(), this.getExecutionScope(), this.getExecutionScope_SuperScope(), "subScopes", null, 0, -1, ExecutionScope.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+		initEReference(getExecutionScope_SuperScope(), this.getExecutionScope(), this.getExecutionScope_SubScopes(), "superScope", null, 0, 1, ExecutionScope.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+
+		initEClass(executionRegionEClass, ExecutionRegion.class, "ExecutionRegion", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+
+		initEClass(executionEntryEClass, ExecutionEntry.class, "ExecutionEntry", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
 
 		initEClass(executionChoiceEClass, ExecutionChoice.class, "ExecutionChoice", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
 

+ 11 - 0
plugins/org.yakindu.sct.model.sexec/src/org/yakindu/sct/model/sexec/transformation/FactoryExtension.xtend

@@ -39,6 +39,8 @@ import org.yakindu.sct.model.sgraph.RegularState
 import org.yakindu.sct.model.sgraph.FinalState
 import org.yakindu.sct.model.sgraph.Choice
 import org.yakindu.sct.model.sexec.ExecutionChoice
+import org.yakindu.sct.model.sexec.ExecutionRegion
+import org.yakindu.sct.model.sgraph.Region
 
 class FactoryExtension {
 	
@@ -81,6 +83,15 @@ class FactoryExtension {
 		}
 	}
 	
+	
+	def ExecutionRegion create r : sexecFactory.createExecutionRegion create(Region region){
+		if (region != null) {
+			r.name =  region.name
+			r.sourceElement = region	
+		}
+	}
+	
+	
 	def Check create r : sexecFactory.createCheck createCheck(ReactionTrigger tr){
 		r.name = tr.reaction.id
 	}

+ 224 - 83
plugins/org.yakindu.sct.model.sexec/src/org/yakindu/sct/model/sexec/transformation/ModelSequencer.xtend

@@ -73,6 +73,9 @@ import org.yakindu.sct.model.sexec.ExecutionChoice
 import org.yakindu.sct.model.stext.stext.DefaultEvent
 import org.yakindu.sct.model.sexec.ExecutionNode
 import com.google.inject.name.Named
+import org.yakindu.sct.model.sexec.ExecutionRegion
+import org.yakindu.sct.model.sexec.ExecutionScope
+import org.yakindu.sct.model.sexec.StateVector
 
 class ModelSequencer {
 	 
@@ -94,6 +97,7 @@ class ModelSequencer {
 		// during mapping the basic structural elements will be mapped from the source statechart to the execution flow
 		sc.mapScopes(ef)
 		sc.mapRegularStates(ef)
+		sc.mapRegions(ef)
 		sc.mapPseudoStates(ef)
 		sc.mapTimeEvents(ef)
 		
@@ -161,22 +165,32 @@ class ModelSequencer {
 
 		
 	def ExecutionFlow mapRegularStates(Statechart statechart, ExecutionFlow r){
-		var content = EcoreUtil2::eAllContentsAsList(statechart)
 		val allStates = statechart.allRegularStates
 		r.states.addAll(allStates.map( s | s.mapState));
 		return r
 	}
 
 
-	// TODO : move to other extension
-	def List<RegularState> allRegularStates(Statechart sc) {
-		var content = EcoreUtil2::eAllContentsAsList(sc)
-		val allStates = content.filter( typeof(RegularState) )
+	def ExecutionFlow mapRegions(Statechart statechart, ExecutionFlow flow){
+		val allRegions = statechart.allRegions
+		flow.regions.addAll( allRegions.map( r | r.mapRegion));
+		return flow		
+	}
+	
+	
+	def ExecutionRegion mapRegion(Region region) {
+		val _region = region.create
 		
-		return allStates.toList
+		if ( region.composite instanceof Statechart ) _region.superScope = (region.composite as Statechart).create
+		else _region.superScope = (region.composite as State).create
+		
+		_region.subScopes.addAll( region.vertices.filter( typeof(RegularState) ).map( v | v.create as ExecutionScope ) )
+		
+		return _region
 	}
 	
 	
+	
 	def ExecutionFlow mapPseudoStates(Statechart statechart, ExecutionFlow r){
 		var content = EcoreUtil2::eAllContentsAsList(statechart)
 		val allChoices = statechart.allChoices
@@ -185,14 +199,6 @@ class ModelSequencer {
 	}
 
 
-	// TODO : move to other extension
-	def List<Choice> allChoices(Statechart sc) {
-		var content = EcoreUtil2::eAllContentsAsList(sc)
-		val allChoices = content.filter( typeof(Choice) )
-		
-		return allChoices.toList
-	}
-	
 
 	
 	def dispatch ExecutionState mapState(FinalState state) {
@@ -213,6 +219,8 @@ class ModelSequencer {
 	 
 	def dispatch ExecutionState mapState(RegularState state) {}
 	
+	
+	
 
 	/** Time trigger will be mapped to execution model time events for each real state. */
 	def ExecutionFlow mapTimeEvents(Statechart statechart, ExecutionFlow r) {
@@ -320,10 +328,49 @@ class ModelSequencer {
 	}
 
 
+	def dispatch StateVector stateVector(Vertex v) {
+		null	
+	}
+	
+	def dispatch StateVector stateVector(RegularState s) {
+		s.create.stateVector	
+	}
+	
+	def dispatch StateVector stateVector(Choice choice) {
+		choice.parentRegion.create.stateVector	
+	}
+	
+	def last(StateVector sv) {
+		sv.offset + sv.size -1
+	}
+	
+	def first(StateVector sv) {
+		sv.offset
+	}
+	
 	def Sequence mapToEffect(Transition t, Reaction r) {
 		val sequence = sexecFactory.createSequence 
 
 		// define exit behavior of transition
+		
+		// first process the exit behavior of orthogonal states that hase to be performed before source exit
+		val topExitState = t.exitStates.last
+		if ( topExitState != null ) {
+			val List<RegularState> leafStates = topExitState.collectLeafStates(new ArrayList<RegularState>())
+			val topVector = topExitState.stateVector
+			val sourceVector = t.source.stateVector
+		
+			val prepositions = (topVector.offset .. sourceVector.offset).take(sourceVector.offset - topVector.offset)
+			
+			for ( i: prepositions ) {
+						
+				// create a state switch for each state configuration vector position
+				var StateSwitch sSwitch = topExitState.defineExitSwitch(leafStates, i)
+				sequence.steps.add(sSwitch);
+			}
+		}
+		
+		// second process the exit path behavior from the the source state
 		if (t.source != null && t.source instanceof RegularState) {
 			sequence.steps.add((t.source as RegularState).create.exitSequence.newCall)	
 		}
@@ -337,8 +384,24 @@ class ModelSequencer {
 			
 			seq
 		}])
+
+
+		// third process the exit behavior of orthogonal states that hase to be performed after source exit
+		if ( topExitState != null ) {
+			val List<RegularState> leafStates = topExitState.collectLeafStates(new ArrayList<RegularState>())
+			val topVector = topExitState.stateVector
+			val sourceVector = t.source.stateVector
+		
+			val postpositions = (sourceVector.last .. topVector.last).drop(1)
+			
+			for ( i: postpositions ) {
+						
+				// create a state switch for each state configuration vector position
+				var StateSwitch sSwitch = topExitState.defineExitSwitch(leafStates, i)
+				sequence.steps.add(sSwitch);
+			}
+		}
 		
-//		if (t.source != null) sequence.steps.add(newExitStateStep(t.source as State))
 		
 		// map transition actions
 		if (t.effect != null) sequence.steps.add(t.effect.mapEffect)	
@@ -348,39 +411,60 @@ class ModelSequencer {
 		// define entry behavior of the transition
 		
 		// first process all composite states on the path to the target state in top-down-order
-		t.entryStates().reverse.fold(sequence, [seq, state | {
-			if (state != t.target) { // since we call the entry sequence of the target state we have to exclude it here
+//		t.entryStates().reverse.fold(sequence, [seq, state | {
+//			if (state != t.target) { // since we call the entry sequence of the target state we have to exclude it here
+//			
+//				// in the case of orthogonal states we also have to enter sibling states.
+//				val siblingRegions = state.parentRegion.composite.regions
+//				
+//				if (state.parentRegion != t.source.parentRegion) {
+//					// process higher order sibling regions
+//					for ( region : siblingRegions.take(siblingRegions.indexOf(state.parentRegion)) ) {
+//						seq.addEnterRegion(region)
+//					} 
+//				}
+//				
+//				// perform entry on the transition path 			
+//				if (state.create.entryAction != null) seq.steps.add(state.create.entryAction.newCall)
+//				if ( _addTraceSteps ) seq.steps += newTraceStateEntered(state.create)
+//				
+//			}
+//			seq
+//		}])
+		t.entryScopes().drop(1).toList.reverse.fold(sequence, [seq, scope | {
+			if (scope instanceof ExecutionRegion) { 
+				// if we enter a region than we have to process the sibling regions
 			
-				// in the case of orthogonal states we also have to enter sibling states.
-				val siblingRegions = state.parentRegion.composite.regions
+				val siblingRegions = scope.superScope.subScopes
 				
-				if (state.parentRegion != t.source.parentRegion) {
-					// process higher order sibling regions
-					for ( region : siblingRegions.take(siblingRegions.indexOf(state.parentRegion)) ) {
-						seq.addEnterRegion(region)
-					} 
+				// process higher order sibling regions
+				for ( region : siblingRegions.take(siblingRegions.indexOf(scope)) ) {
+					seq.addEnterRegion(region)
 				}
-				
+			} 
+			
+			if (scope instanceof ExecutionState) {
 				// perform entry on the transition path 			
-				if (state.create.entryAction != null) seq.steps.add(state.create.entryAction.newCall)
-				if ( _addTraceSteps ) seq.steps += newTraceStateEntered(state.create)
+				if ((scope as ExecutionState).entryAction != null) seq.steps.add((scope as ExecutionState).entryAction.newCall)
+				if ( _addTraceSteps ) seq.steps += newTraceStateEntered((scope as ExecutionState))
 				
 			}
 			seq
 		}])
 		
+		
 		// second process the target state entry behavior
 		if (t.target != null ) {
 
 			// in the case of orthogonal states we also have to enter sibling states.
 			val siblingRegions = t.target.parentRegion.composite.regions
 			
-			if (t.target.parentRegion != t.source.parentRegion) {
-				// process higher order sibling regions
-				for ( region : siblingRegions.take(siblingRegions.indexOf(t.target.parentRegion)) ) {
-					sequence.addEnterRegion(region)
-				} 	
-			}
+//			if (t.target.parentRegion != t.source.parentRegion) {
+//				// process higher order sibling regions
+//				for ( region : siblingRegions.take(siblingRegions.indexOf(t.target.parentRegion)) ) {
+//					sequence.addEnterRegion(region)
+//				} 	
+//			}
 			
 			// perform entry on the transition path 			
 			if ( t.target instanceof RegularState) {
@@ -389,39 +473,52 @@ class ModelSequencer {
 				sequence.steps.add((t.target as Choice).create.reactSequence.newCall )	
 			}
 				
-			if (t.target.parentRegion != t.source.parentRegion) {
-				// process lower order sibling regions 
-				for ( region : siblingRegions.drop(siblingRegions.indexOf(t.target.parentRegion)+1) ) {
-					sequence.addEnterRegion(region)
-				} 	
-			}
+//			if (t.target.parentRegion != t.source.parentRegion) {
+//				// process lower order sibling regions 
+//				for ( region : siblingRegions.drop(siblingRegions.indexOf(t.target.parentRegion)+1) ) {
+//					sequence.addEnterRegion(region)
+//				} 	
+//			}
 		}
 		
 		
 		// third - process all entry behavior that has to be executed after the target state behavior in bottom-up-order
-		t.entryStates().fold(sequence, [seq, state | {
-			if (state != t.target) { // since we call the entry sequence of the target state we have to exclude it here
+//		t.entryStates().fold(sequence, [seq, state | {
+//			if (state != t.target) { // since we call the entry sequence of the target state we have to exclude it here
+//			
+//				// in the case of orthogonal states we also have to enter sibling states.
+//				val siblingRegions = state.parentRegion.composite.regions
+//				
+//				if (state.parentRegion != t.source.parentRegion) {
+//					// process lower order sibling regions 
+//					for ( region : siblingRegions.drop(siblingRegions.indexOf(state.parentRegion)+1) ) {
+//						seq.addEnterRegion(region)
+//					} 				
+//				}
+//			}
+//			seq
+//		}])
+		
+		t.entryScopes().drop(1).fold(sequence, [seq, scope | {
+			if (scope instanceof ExecutionRegion) { 
+				// if we enter a region than we have to process the sibling regions
 			
-				// in the case of orthogonal states we also have to enter sibling states.
-				val siblingRegions = state.parentRegion.composite.regions
+				val siblingRegions = scope.superScope.subScopes
 				
-				if (state.parentRegion != t.source.parentRegion) {
-					// process lower order sibling regions 
-					for ( region : siblingRegions.drop(siblingRegions.indexOf(state.parentRegion)+1) ) {
-						seq.addEnterRegion(region)
-					} 				
-				}
-			}
+				// process lower order sibling regions 
+				for ( region : siblingRegions.drop(siblingRegions.indexOf(scope)+1) ) {
+					seq.addEnterRegion(region)
+				} 				
+			} 
 			seq
 		}])
-		
 			
 		return sequence
 	}	
 	
 	
 	
-	def addEnterRegion(Sequence seq, Region r) {
+	def dispatch addEnterRegion(Sequence seq, Region r) {
 		val entryState = r.entry?.target?.create
 					
 		if (entryState != null && entryState.enterSequence != null) 
@@ -429,6 +526,15 @@ class ModelSequencer {
 	}
 
 
+	// TODO: refactor - don't access source element...
+	def dispatch addEnterRegion(Sequence seq, ExecutionRegion r) {
+		val entryState = (r.sourceElement as Region).entry?.target?.create
+					
+		if (entryState != null && entryState.enterSequence != null) 
+				seq.steps.add(entryState.enterSequence.newCall);
+	}
+
+
 	def newTraceReactionFired(Reaction r) {
 		val rf = sexecFactory.createReactionFired
 		rf.reaction = r
@@ -467,6 +573,25 @@ class ModelSequencer {
 		l.filter( typeof(State) ).toList
 	}
 	
+	def List<ExecutionScope> exitScopes(Transition t) {
+//		val l = t.source.containers
+//		l.removeAll(t.target.containers)
+//		l.filter( typeof(State) ).toList
+		null
+	}
+	
+	def List<ExecutionScope> entryScopes(Transition t) {
+		val l = t.target.containers
+		l.removeAll(t.source.containers)
+		l.map( c | 
+			if ( c instanceof RegularState ) (c as RegularState).create as ExecutionScope
+			else if ( c instanceof Region ) (c as Region).create as ExecutionScope
+			else (c as Statechart).create as ExecutionScope
+		).toList
+	}
+	
+	
+	
 	// TODO: rename since this list also includes the start state or change implementation and usages
 	def List<RegularState> parentStates(RegularState s) {
 		s.containers.filter( typeof(RegularState) ).toList		
@@ -828,14 +953,22 @@ class ModelSequencer {
 
 	/** calculates the maximum orthogonality (maximum number of possible active leaf states) of a region */
 	def int defineStateVectors(Region r, int offset) {
-		r.vertices.fold(0, [s, v | {
+		val maxOrthogonality = r.vertices.fold(0, [s, v | {
 			val mo = v.defineStateVectors(offset)
 			if (mo > s) mo else s }])
+			
+		val er = r.create
+		er.stateVector = sexecFactory.createStateVector
+		er.stateVector.offset = offset;
+		er.stateVector.size = maxOrthogonality			
+	
+		return maxOrthogonality
 	}
 
 	/** the maximum orthogonality of all  pseudo states is 0 */
 	def dispatch int defineStateVectors(Vertex v, int offset) { 0 }
 	
+		
 	/** calculates the maximum orthogonality (maximum number of possible active leaf states) of a state */
 	def dispatch int defineStateVectors(State s, int offset) { 
 		var int maxOrthogonality = 0
@@ -966,6 +1099,7 @@ class ModelSequencer {
 		execState.exitSequence = seq
 	}
 	
+	// TODO : refactor
 	def dispatch void defineStateExitSequence(State state) {
 		
 		val execState = state.create
@@ -988,36 +1122,8 @@ class ModelSequencer {
 	
 			for ( i: sVector.offset .. sVector.offset + sVector.size - 1 ) {
 						
-				val idx = i
-				// create a state switch
-				var StateSwitch sSwitch = sexecFactory.createStateSwitch
-				sSwitch.stateConfigurationIdx = i
-				sSwitch.comment = "Handle exit of all possible states on position " + sSwitch.stateConfigurationIdx + "..."
-								
-				val List<RegularState> posStates = leafStates.filter( rs | rs.create.stateVector.size == 1 && rs.create.stateVector.offset == idx).toList					
-				
-				// create a case for each leaf state				
-				for ( s : posStates ) {
-	
-					val caseSeq = sexecFactory.createSequence
-					caseSeq.steps += s.create.exitSequence.newCall
-
-	
-					val exitStates = s.parentStates
-					exitStates.removeAll(state.parentStates)
-					exitStates.remove(s)
-					
-					// include exitAction calls up to the direct child level.
-					exitStates.fold(caseSeq , [ cs, exitState | {
-						 if (exitState.create.exitAction != null) cs.steps.add(exitState.create.exitAction.newCall)
-						 if ( _addTraceSteps ) cs.steps.add(exitState.create.newTraceStateExited)
-						 cs
-					}]) 
-					
-					if (s.create.exitSequence != null) sSwitch.cases.add(s.create.newCase(caseSeq))
-					
-				}
-
+				// create a state switch for each state configuration vector position
+				var StateSwitch sSwitch = state.defineExitSwitch(leafStates, i)
 				seq.steps.add(sSwitch);
 
 			}
@@ -1034,6 +1140,41 @@ class ModelSequencer {
 	
 	
 	
+	def StateSwitch defineExitSwitch(State state, List<RegularState> states, int pos) {
+
+		// create a state switch
+		var StateSwitch sSwitch = sexecFactory.createStateSwitch
+		sSwitch.stateConfigurationIdx = pos
+		sSwitch.comment = "Handle exit of all possible states on position " + sSwitch.stateConfigurationIdx + "..."
+						
+		val List<RegularState> posStates = states.filter( rs | rs.create.stateVector.size == 1 && rs.create.stateVector.offset == pos).toList					
+		
+		// create a case for each leaf state				
+		for ( s : posStates ) {
+
+			val caseSeq = sexecFactory.createSequence
+			caseSeq.steps += s.create.exitSequence.newCall
+
+
+			val exitStates = s.parentStates
+			exitStates.removeAll(state.parentStates)
+			exitStates.remove(s)
+			
+			// include exitAction calls up to the direct child level.
+			exitStates.fold(caseSeq , [ cs, exitState | {
+				 if (exitState.create.exitAction != null) cs.steps.add(exitState.create.exitAction.newCall)
+				 if ( _addTraceSteps ) cs.steps.add(exitState.create.newTraceStateExited)
+				 cs
+			}]) 
+			
+			if (s.create.exitSequence != null) sSwitch.cases.add(s.create.newCase(caseSeq))
+			
+		}
+		
+		return sSwitch
+	}
+	
+	
 	def List<RegularState> collectLeafStates(RegularState state, List<RegularState> leafStates) {
 		if ( state.isLeaf ) 
 			leafStates += state

+ 29 - 0
plugins/org.yakindu.sct.model.sexec/src/org/yakindu/sct/model/sexec/transformation/StatechartExtensions.xtend

@@ -14,6 +14,8 @@ import org.eclipse.xtext.EcoreUtil2
 import org.yakindu.sct.model.stext.stext.LocalReaction
 import org.yakindu.sct.model.sgraph.ReactiveElement
 import org.yakindu.sct.model.sgraph.Scope
+import org.yakindu.sct.model.sgraph.RegularState
+import org.yakindu.sct.model.sgraph.Choice
 
 class StatechartExtensions {
 	
@@ -101,6 +103,33 @@ class StatechartExtensions {
 		if (s.eContainer instanceof ReactiveElement) s.eContainer as ReactiveElement
 	}	
 	
+	def List<RegularState> allRegularStates(Statechart sc) {
+		var content = EcoreUtil2::eAllContentsAsList(sc)
+		val allStates = content.filter( typeof(RegularState) )
+		
+		return allStates.toList
+	}
+	
+	
+	
+	def List<Region> allRegions(Statechart sc) {
+		var content = EcoreUtil2::eAllContentsAsList(sc)
+		val allRegions = content.filter( typeof(Region) )
+		
+		return allRegions.toList
+	}
+	
+	
+	
+	def List<Choice> allChoices(Statechart sc) {
+		var content = EcoreUtil2::eAllContentsAsList(sc)
+		val allChoices = content.filter( typeof(Choice) )
+		
+		return allChoices.toList
+	}
+	
+	
+	
 	//=================================================================
 	// naming util extensions
 	//

+ 54 - 0
plugins/org.yakindu.sct.model.sexec/src/org/yakindu/sct/model/sexec/util/SexecAdapterFactory.java

@@ -117,6 +117,18 @@ public class SexecAdapterFactory extends AdapterFactoryImpl {
 				return createExecutionStateAdapter();
 			}
 			@Override
+			public Adapter caseExecutionScope(ExecutionScope object) {
+				return createExecutionScopeAdapter();
+			}
+			@Override
+			public Adapter caseExecutionRegion(ExecutionRegion object) {
+				return createExecutionRegionAdapter();
+			}
+			@Override
+			public Adapter caseExecutionEntry(ExecutionEntry object) {
+				return createExecutionEntryAdapter();
+			}
+			@Override
 			public Adapter caseExecutionChoice(ExecutionChoice object) {
 				return createExecutionChoiceAdapter();
 			}
@@ -282,6 +294,48 @@ public class SexecAdapterFactory extends AdapterFactoryImpl {
 		return null;
 	}
 
+	/**
+	 * Creates a new adapter for an object of class '{@link org.yakindu.sct.model.sexec.ExecutionScope <em>Execution Scope</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.yakindu.sct.model.sexec.ExecutionScope
+	 * @generated
+	 */
+	public Adapter createExecutionScopeAdapter() {
+		return null;
+	}
+
+	/**
+	 * Creates a new adapter for an object of class '{@link org.yakindu.sct.model.sexec.ExecutionRegion <em>Execution Region</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.yakindu.sct.model.sexec.ExecutionRegion
+	 * @generated
+	 */
+	public Adapter createExecutionRegionAdapter() {
+		return null;
+	}
+
+	/**
+	 * Creates a new adapter for an object of class '{@link org.yakindu.sct.model.sexec.ExecutionEntry <em>Execution Entry</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.yakindu.sct.model.sexec.ExecutionEntry
+	 * @generated
+	 */
+	public Adapter createExecutionEntryAdapter() {
+		return null;
+	}
+
 	/**
 	 * Creates a new adapter for an object of class '{@link org.yakindu.sct.model.sexec.ExecutionChoice <em>Execution Choice</em>}'.
 	 * <!-- begin-user-doc -->

+ 74 - 0
plugins/org.yakindu.sct.model.sexec/src/org/yakindu/sct/model/sexec/util/SexecSwitch.java

@@ -112,7 +112,9 @@ public class SexecSwitch<T> extends Switch<T> {
 				ExecutionFlow executionFlow = (ExecutionFlow)theEObject;
 				T result = caseExecutionFlow(executionFlow);
 				if (result == null) result = caseScopedElement(executionFlow);
+				if (result == null) result = caseExecutionScope(executionFlow);
 				if (result == null) result = caseNamedElement(executionFlow);
+				if (result == null) result = caseMappedElement(executionFlow);
 				if (result == null) result = defaultCase(theEObject);
 				return result;
 			}
@@ -128,11 +130,38 @@ public class SexecSwitch<T> extends Switch<T> {
 				ExecutionState executionState = (ExecutionState)theEObject;
 				T result = caseExecutionState(executionState);
 				if (result == null) result = caseExecutionNode(executionState);
+				if (result == null) result = caseExecutionScope(executionState);
 				if (result == null) result = caseNamedElement(executionState);
 				if (result == null) result = caseMappedElement(executionState);
 				if (result == null) result = defaultCase(theEObject);
 				return result;
 			}
+			case SexecPackage.EXECUTION_SCOPE: {
+				ExecutionScope executionScope = (ExecutionScope)theEObject;
+				T result = caseExecutionScope(executionScope);
+				if (result == null) result = caseNamedElement(executionScope);
+				if (result == null) result = caseMappedElement(executionScope);
+				if (result == null) result = defaultCase(theEObject);
+				return result;
+			}
+			case SexecPackage.EXECUTION_REGION: {
+				ExecutionRegion executionRegion = (ExecutionRegion)theEObject;
+				T result = caseExecutionRegion(executionRegion);
+				if (result == null) result = caseExecutionScope(executionRegion);
+				if (result == null) result = caseNamedElement(executionRegion);
+				if (result == null) result = caseMappedElement(executionRegion);
+				if (result == null) result = defaultCase(theEObject);
+				return result;
+			}
+			case SexecPackage.EXECUTION_ENTRY: {
+				ExecutionEntry executionEntry = (ExecutionEntry)theEObject;
+				T result = caseExecutionEntry(executionEntry);
+				if (result == null) result = caseExecutionNode(executionEntry);
+				if (result == null) result = caseNamedElement(executionEntry);
+				if (result == null) result = caseMappedElement(executionEntry);
+				if (result == null) result = defaultCase(theEObject);
+				return result;
+			}
 			case SexecPackage.EXECUTION_CHOICE: {
 				ExecutionChoice executionChoice = (ExecutionChoice)theEObject;
 				T result = caseExecutionChoice(executionChoice);
@@ -360,6 +389,51 @@ public class SexecSwitch<T> extends Switch<T> {
 		return null;
 	}
 
+	/**
+	 * Returns the result of interpreting the object as an instance of '<em>Execution Scope</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>Execution Scope</em>'.
+	 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+	 * @generated
+	 */
+	public T caseExecutionScope(ExecutionScope object) {
+		return null;
+	}
+
+	/**
+	 * Returns the result of interpreting the object as an instance of '<em>Execution Region</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>Execution Region</em>'.
+	 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+	 * @generated
+	 */
+	public T caseExecutionRegion(ExecutionRegion object) {
+		return null;
+	}
+
+	/**
+	 * Returns the result of interpreting the object as an instance of '<em>Execution Entry</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>Execution Entry</em>'.
+	 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+	 * @generated
+	 */
+	public T caseExecutionEntry(ExecutionEntry object) {
+		return null;
+	}
+
 	/**
 	 * Returns the result of interpreting the object as an instance of '<em>Execution Choice</em>'.
 	 * <!-- begin-user-doc -->

+ 36 - 10
plugins/org.yakindu.sct.model.sexec/xtend-gen/org/yakindu/sct/model/sexec/transformation/FactoryExtension.java

@@ -17,6 +17,7 @@ import org.yakindu.sct.model.sexec.Check;
 import org.yakindu.sct.model.sexec.CheckRef;
 import org.yakindu.sct.model.sexec.ExecutionChoice;
 import org.yakindu.sct.model.sexec.ExecutionFlow;
+import org.yakindu.sct.model.sexec.ExecutionRegion;
 import org.yakindu.sct.model.sexec.ExecutionState;
 import org.yakindu.sct.model.sexec.ScheduleTimeEvent;
 import org.yakindu.sct.model.sexec.Sequence;
@@ -212,6 +213,31 @@ public class FactoryExtension {
     return r;
   }
   
+  private final HashMap<ArrayList<?>,ExecutionRegion> _createCache_create_7 = new HashMap<ArrayList<?>,ExecutionRegion>();
+  
+  public ExecutionRegion create(final Region region) {
+    final ArrayList<?>_cacheKey = CollectionLiterals.newArrayList(region);
+    ExecutionRegion r;
+    synchronized (_createCache_create_7) {
+      if (_createCache_create_7.containsKey(_cacheKey)) {
+        return _createCache_create_7.get(_cacheKey);
+      }
+      SexecFactory _sexecFactory = this.sexecFactory();
+      ExecutionRegion _createExecutionRegion = _sexecFactory.createExecutionRegion();
+      r = _createExecutionRegion;
+      _createCache_create_7.put(_cacheKey, r);
+    }
+    boolean _operator_notEquals = ObjectExtensions.operator_notEquals(region, null);
+    if (_operator_notEquals) {
+      {
+        String _name = region.getName();
+        r.setName(_name);
+        r.setSourceElement(region);
+      }
+    }
+    return r;
+  }
+  
   private final HashMap<ArrayList<?>,Check> _createCache_createCheck = new HashMap<ArrayList<?>,Check>();
   
   public Check createCheck(final ReactionTrigger tr) {
@@ -232,19 +258,19 @@ public class FactoryExtension {
     return r;
   }
   
-  private final HashMap<ArrayList<?>,org.yakindu.sct.model.sexec.Reaction> _createCache_create_7 = new HashMap<ArrayList<?>,org.yakindu.sct.model.sexec.Reaction>();
+  private final HashMap<ArrayList<?>,org.yakindu.sct.model.sexec.Reaction> _createCache_create_8 = new HashMap<ArrayList<?>,org.yakindu.sct.model.sexec.Reaction>();
   
   public org.yakindu.sct.model.sexec.Reaction create(final Transition tr) {
     final ArrayList<?>_cacheKey = CollectionLiterals.newArrayList(tr);
     org.yakindu.sct.model.sexec.Reaction r;
-    synchronized (_createCache_create_7) {
-      if (_createCache_create_7.containsKey(_cacheKey)) {
-        return _createCache_create_7.get(_cacheKey);
+    synchronized (_createCache_create_8) {
+      if (_createCache_create_8.containsKey(_cacheKey)) {
+        return _createCache_create_8.get(_cacheKey);
       }
       SexecFactory _sexecFactory = this.sexecFactory();
       org.yakindu.sct.model.sexec.Reaction _createReaction = _sexecFactory.createReaction();
       r = _createReaction;
-      _createCache_create_7.put(_cacheKey, r);
+      _createCache_create_8.put(_cacheKey, r);
     }
     {
       String _id = this.sce.id(tr);
@@ -255,19 +281,19 @@ public class FactoryExtension {
     return r;
   }
   
-  private final HashMap<ArrayList<?>,org.yakindu.sct.model.sexec.Reaction> _createCache_create_8 = new HashMap<ArrayList<?>,org.yakindu.sct.model.sexec.Reaction>();
+  private final HashMap<ArrayList<?>,org.yakindu.sct.model.sexec.Reaction> _createCache_create_9 = new HashMap<ArrayList<?>,org.yakindu.sct.model.sexec.Reaction>();
   
   public org.yakindu.sct.model.sexec.Reaction create(final LocalReaction lr) {
     final ArrayList<?>_cacheKey = CollectionLiterals.newArrayList(lr);
     org.yakindu.sct.model.sexec.Reaction r;
-    synchronized (_createCache_create_8) {
-      if (_createCache_create_8.containsKey(_cacheKey)) {
-        return _createCache_create_8.get(_cacheKey);
+    synchronized (_createCache_create_9) {
+      if (_createCache_create_9.containsKey(_cacheKey)) {
+        return _createCache_create_9.get(_cacheKey);
       }
       SexecFactory _sexecFactory = this.sexecFactory();
       org.yakindu.sct.model.sexec.Reaction _createReaction = _sexecFactory.createReaction();
       r = _createReaction;
-      _createCache_create_8.put(_cacheKey, r);
+      _createCache_create_9.put(_cacheKey, r);
     }
     {
       String _id = this.sce.id(lr);

+ 454 - 271
plugins/org.yakindu.sct.model.sexec/xtend-gen/org/yakindu/sct/model/sexec/transformation/ModelSequencer.java

@@ -29,6 +29,8 @@ import org.yakindu.sct.model.sexec.Execution;
 import org.yakindu.sct.model.sexec.ExecutionChoice;
 import org.yakindu.sct.model.sexec.ExecutionFlow;
 import org.yakindu.sct.model.sexec.ExecutionNode;
+import org.yakindu.sct.model.sexec.ExecutionRegion;
+import org.yakindu.sct.model.sexec.ExecutionScope;
 import org.yakindu.sct.model.sexec.ExecutionState;
 import org.yakindu.sct.model.sexec.ExitState;
 import org.yakindu.sct.model.sexec.If;
@@ -115,6 +117,7 @@ public class ModelSequencer {
       final ExecutionFlow ef = _create;
       this.mapScopes(sc, ef);
       this.mapRegularStates(sc, ef);
+      this.mapRegions(sc, ef);
       this.mapPseudoStates(sc, ef);
       this.mapTimeEvents(sc, ef);
       this.defineStateVector(ef, sc);
@@ -196,9 +199,7 @@ public class ModelSequencer {
   
   public ExecutionFlow mapRegularStates(final Statechart statechart, final ExecutionFlow r) {
     {
-      List<EObject> _eAllContentsAsList = EcoreUtil2.eAllContentsAsList(statechart);
-      List<EObject> content = _eAllContentsAsList;
-      List<RegularState> _allRegularStates = this.allRegularStates(statechart);
+      List<RegularState> _allRegularStates = this.sct.allRegularStates(statechart);
       final List<RegularState> allStates = _allRegularStates;
       EList<ExecutionState> _states = r.getStates();
       final Function1<RegularState,ExecutionState> _function = new Function1<RegularState,ExecutionState>() {
@@ -213,14 +214,49 @@ public class ModelSequencer {
     }
   }
   
-  public List<RegularState> allRegularStates(final Statechart sc) {
+  public ExecutionFlow mapRegions(final Statechart statechart, final ExecutionFlow flow) {
     {
-      List<EObject> _eAllContentsAsList = EcoreUtil2.eAllContentsAsList(sc);
-      List<EObject> content = _eAllContentsAsList;
-      Iterable<RegularState> _filter = IterableExtensions.<RegularState>filter(content, org.yakindu.sct.model.sgraph.RegularState.class);
-      final Iterable<RegularState> allStates = _filter;
-      List<RegularState> _list = IterableExtensions.<RegularState>toList(allStates);
-      return _list;
+      List<Region> _allRegions = this.sct.allRegions(statechart);
+      final List<Region> allRegions = _allRegions;
+      EList<ExecutionRegion> _regions = flow.getRegions();
+      final Function1<Region,ExecutionRegion> _function = new Function1<Region,ExecutionRegion>() {
+          public ExecutionRegion apply(final Region r) {
+            ExecutionRegion _mapRegion = ModelSequencer.this.mapRegion(r);
+            return _mapRegion;
+          }
+        };
+      List<ExecutionRegion> _map = ListExtensions.<Region, ExecutionRegion>map(allRegions, _function);
+      _regions.addAll(_map);
+      return flow;
+    }
+  }
+  
+  public ExecutionRegion mapRegion(final Region region) {
+    {
+      ExecutionRegion _create = this.factory.create(region);
+      final ExecutionRegion _region = _create;
+      CompositeElement _composite = region.getComposite();
+      if ((_composite instanceof org.yakindu.sct.model.sgraph.Statechart)) {
+        CompositeElement _composite_1 = region.getComposite();
+        ExecutionFlow _create_1 = this.factory.create(((Statechart) _composite_1));
+        _region.setSuperScope(_create_1);
+      } else {
+        CompositeElement _composite_2 = region.getComposite();
+        ExecutionState _create_2 = this.factory.create(((State) _composite_2));
+        _region.setSuperScope(_create_2);
+      }
+      EList<ExecutionScope> _subScopes = _region.getSubScopes();
+      EList<Vertex> _vertices = region.getVertices();
+      Iterable<RegularState> _filter = IterableExtensions.<RegularState>filter(_vertices, org.yakindu.sct.model.sgraph.RegularState.class);
+      final Function1<RegularState,ExecutionScope> _function = new Function1<RegularState,ExecutionScope>() {
+          public ExecutionScope apply(final RegularState v) {
+            ExecutionState _create_3 = ModelSequencer.this.factory.create(v);
+            return ((ExecutionScope) _create_3);
+          }
+        };
+      Iterable<ExecutionScope> _map = IterableExtensions.<RegularState, ExecutionScope>map(_filter, _function);
+      CollectionExtensions.<ExecutionScope>addAll(_subScopes, _map);
+      return _region;
     }
   }
   
@@ -228,7 +264,7 @@ public class ModelSequencer {
     {
       List<EObject> _eAllContentsAsList = EcoreUtil2.eAllContentsAsList(statechart);
       List<EObject> content = _eAllContentsAsList;
-      List<Choice> _allChoices = this.allChoices(statechart);
+      List<Choice> _allChoices = this.sct.allChoices(statechart);
       final List<Choice> allChoices = _allChoices;
       EList<ExecutionNode> _nodes = r.getNodes();
       final Function1<Choice,ExecutionChoice> _function = new Function1<Choice,ExecutionChoice>() {
@@ -243,17 +279,6 @@ public class ModelSequencer {
     }
   }
   
-  public List<Choice> allChoices(final Statechart sc) {
-    {
-      List<EObject> _eAllContentsAsList = EcoreUtil2.eAllContentsAsList(sc);
-      List<EObject> content = _eAllContentsAsList;
-      Iterable<Choice> _filter = IterableExtensions.<Choice>filter(content, org.yakindu.sct.model.sgraph.Choice.class);
-      final Iterable<Choice> allChoices = _filter;
-      List<Choice> _list = IterableExtensions.<Choice>toList(allChoices);
-      return _list;
-    }
-  }
-  
   protected ExecutionState _mapState(final FinalState state) {
     {
       ExecutionState _create = this.factory.create(state);
@@ -331,7 +356,7 @@ public class ModelSequencer {
   
   public ExecutionFlow mapChoiceTransitions(final Statechart statechart, final ExecutionFlow r) {
     {
-      List<Choice> _allChoices = this.allChoices(statechart);
+      List<Choice> _allChoices = this.sct.allChoices(statechart);
       final Function1<Choice,ExecutionChoice> _function = new Function1<Choice,ExecutionChoice>() {
           public ExecutionChoice apply(final Choice choice) {
             ExecutionChoice _mapChoiceTransition = ModelSequencer.this.mapChoiceTransition(choice);
@@ -520,52 +545,114 @@ public class ModelSequencer {
     }
   }
   
+  protected StateVector _stateVector(final Vertex v) {
+    return null;
+  }
+  
+  protected StateVector _stateVector(final RegularState s) {
+    ExecutionState _create = this.factory.create(s);
+    StateVector _stateVector = _create.getStateVector();
+    return _stateVector;
+  }
+  
+  protected StateVector _stateVector(final Choice choice) {
+    Region _parentRegion = choice.getParentRegion();
+    ExecutionRegion _create = this.factory.create(_parentRegion);
+    StateVector _stateVector = _create.getStateVector();
+    return _stateVector;
+  }
+  
+  public int last(final StateVector sv) {
+    int _offset = sv.getOffset();
+    int _size = sv.getSize();
+    int _operator_plus = IntegerExtensions.operator_plus(((Integer)_offset), ((Integer)_size));
+    int _operator_minus = IntegerExtensions.operator_minus(((Integer)_operator_plus), ((Integer)1));
+    return _operator_minus;
+  }
+  
+  public int first(final StateVector sv) {
+    int _offset = sv.getOffset();
+    return _offset;
+  }
+  
   public Sequence mapToEffect(final Transition t, final Reaction r) {
     {
       SexecFactory _sexecFactory = this.sexecFactory();
       Sequence _createSequence = _sexecFactory.createSequence();
       final Sequence sequence = _createSequence;
+      List<State> _exitStates = this.exitStates(t);
+      State _last = IterableExtensions.<State>last(_exitStates);
+      final State topExitState = _last;
+      boolean _operator_notEquals = ObjectExtensions.operator_notEquals(topExitState, null);
+      if (_operator_notEquals) {
+        {
+          ArrayList<RegularState> _arrayList = new ArrayList<RegularState>();
+          List<RegularState> _collectLeafStates = this.collectLeafStates(topExitState, _arrayList);
+          final List<RegularState> leafStates = _collectLeafStates;
+          StateVector _stateVector = this.stateVector(topExitState);
+          final StateVector topVector = _stateVector;
+          Vertex _source = t.getSource();
+          StateVector _stateVector_1 = this.stateVector(_source);
+          final StateVector sourceVector = _stateVector_1;
+          int _offset = topVector.getOffset();
+          int _offset_1 = sourceVector.getOffset();
+          Iterable<Integer> _operator_upTo = IntegerExtensions.operator_upTo(((Integer)_offset), ((Integer)_offset_1));
+          int _offset_2 = sourceVector.getOffset();
+          int _offset_3 = topVector.getOffset();
+          int _operator_minus = IntegerExtensions.operator_minus(((Integer)_offset_2), ((Integer)_offset_3));
+          Iterable<Integer> _take = IterableExtensions.<Integer>take(_operator_upTo, _operator_minus);
+          final Iterable<Integer> prepositions = _take;
+          for (Integer i : prepositions) {
+            {
+              StateSwitch _defineExitSwitch = this.defineExitSwitch(topExitState, leafStates, i);
+              StateSwitch sSwitch = _defineExitSwitch;
+              EList<Step> _steps = sequence.getSteps();
+              _steps.add(sSwitch);
+            }
+          }
+        }
+      }
       boolean _operator_and = false;
-      Vertex _source = t.getSource();
-      boolean _operator_notEquals = ObjectExtensions.operator_notEquals(_source, null);
-      if (!_operator_notEquals) {
+      Vertex _source_1 = t.getSource();
+      boolean _operator_notEquals_1 = ObjectExtensions.operator_notEquals(_source_1, null);
+      if (!_operator_notEquals_1) {
         _operator_and = false;
       } else {
-        Vertex _source_1 = t.getSource();
-        _operator_and = BooleanExtensions.operator_and(_operator_notEquals, (_source_1 instanceof org.yakindu.sct.model.sgraph.RegularState));
+        Vertex _source_2 = t.getSource();
+        _operator_and = BooleanExtensions.operator_and(_operator_notEquals_1, (_source_2 instanceof org.yakindu.sct.model.sgraph.RegularState));
       }
       if (_operator_and) {
-        EList<Step> _steps = sequence.getSteps();
-        Vertex _source_2 = t.getSource();
-        ExecutionState _create = this.factory.create(((RegularState) _source_2));
+        EList<Step> _steps_1 = sequence.getSteps();
+        Vertex _source_3 = t.getSource();
+        ExecutionState _create = this.factory.create(((RegularState) _source_3));
         Sequence _exitSequence = _create.getExitSequence();
         Call _newCall = this.factory.newCall(_exitSequence);
-        _steps.add(_newCall);
+        _steps_1.add(_newCall);
       }
-      List<State> _exitStates = this.exitStates(t);
+      List<State> _exitStates_1 = this.exitStates(t);
       final Function2<Sequence,State,Sequence> _function = new Function2<Sequence,State,Sequence>() {
           public Sequence apply(final Sequence seq , final State state) {
             Sequence _xblockexpression = null;
             {
-              Vertex _source_3 = t.getSource();
-              boolean _operator_notEquals_1 = ObjectExtensions.operator_notEquals(state, _source_3);
-              if (_operator_notEquals_1) {
+              Vertex _source_4 = t.getSource();
+              boolean _operator_notEquals_2 = ObjectExtensions.operator_notEquals(state, _source_4);
+              if (_operator_notEquals_2) {
                 {
                   ExecutionState _create_1 = ModelSequencer.this.factory.create(state);
                   Step _exitAction = _create_1.getExitAction();
-                  boolean _operator_notEquals_2 = ObjectExtensions.operator_notEquals(_exitAction, null);
-                  if (_operator_notEquals_2) {
-                    EList<Step> _steps_1 = seq.getSteps();
+                  boolean _operator_notEquals_3 = ObjectExtensions.operator_notEquals(_exitAction, null);
+                  if (_operator_notEquals_3) {
+                    EList<Step> _steps_2 = seq.getSteps();
                     ExecutionState _create_2 = ModelSequencer.this.factory.create(state);
                     Step _exitAction_1 = _create_2.getExitAction();
                     Call _newCall_1 = ModelSequencer.this.factory.newCall(_exitAction_1);
-                    _steps_1.add(_newCall_1);
+                    _steps_2.add(_newCall_1);
                   }
                   if (ModelSequencer.this._addTraceSteps) {
-                    EList<Step> _steps_2 = seq.getSteps();
+                    EList<Step> _steps_3 = seq.getSteps();
                     ExecutionState _create_3 = ModelSequencer.this.factory.create(state);
                     TraceStateExited _newTraceStateExited = ModelSequencer.this.newTraceStateExited(_create_3);
-                    CollectionExtensions.<TraceStateExited>operator_add(_steps_2, _newTraceStateExited);
+                    CollectionExtensions.<TraceStateExited>operator_add(_steps_3, _newTraceStateExited);
                   }
                 }
               }
@@ -574,61 +661,80 @@ public class ModelSequencer {
             return _xblockexpression;
           }
         };
-      IterableExtensions.<State, Sequence>fold(_exitStates, sequence, _function);
+      IterableExtensions.<State, Sequence>fold(_exitStates_1, sequence, _function);
+      boolean _operator_notEquals_4 = ObjectExtensions.operator_notEquals(topExitState, null);
+      if (_operator_notEquals_4) {
+        {
+          ArrayList<RegularState> _arrayList_1 = new ArrayList<RegularState>();
+          List<RegularState> _collectLeafStates_1 = this.collectLeafStates(topExitState, _arrayList_1);
+          final List<RegularState> leafStates_1 = _collectLeafStates_1;
+          StateVector _stateVector_2 = this.stateVector(topExitState);
+          final StateVector topVector_1 = _stateVector_2;
+          Vertex _source_5 = t.getSource();
+          StateVector _stateVector_3 = this.stateVector(_source_5);
+          final StateVector sourceVector_1 = _stateVector_3;
+          int _last_1 = this.last(sourceVector_1);
+          int _last_2 = this.last(topVector_1);
+          Iterable<Integer> _operator_upTo_1 = IntegerExtensions.operator_upTo(((Integer)_last_1), ((Integer)_last_2));
+          Iterable<Integer> _drop = IterableExtensions.<Integer>drop(_operator_upTo_1, 1);
+          final Iterable<Integer> postpositions = _drop;
+          for (Integer i_1 : postpositions) {
+            {
+              StateSwitch _defineExitSwitch_1 = this.defineExitSwitch(topExitState, leafStates_1, i_1);
+              StateSwitch sSwitch_1 = _defineExitSwitch_1;
+              EList<Step> _steps_4 = sequence.getSteps();
+              _steps_4.add(sSwitch_1);
+            }
+          }
+        }
+      }
       Effect _effect = t.getEffect();
-      boolean _operator_notEquals_3 = ObjectExtensions.operator_notEquals(_effect, null);
-      if (_operator_notEquals_3) {
-        EList<Step> _steps_3 = sequence.getSteps();
+      boolean _operator_notEquals_5 = ObjectExtensions.operator_notEquals(_effect, null);
+      if (_operator_notEquals_5) {
+        EList<Step> _steps_5 = sequence.getSteps();
         Effect _effect_1 = t.getEffect();
         Sequence _mapEffect = this.mapEffect(_effect_1);
-        _steps_3.add(_mapEffect);
+        _steps_5.add(_mapEffect);
       }
       if (this._addTraceSteps) {
-        EList<Step> _steps_4 = sequence.getSteps();
+        EList<Step> _steps_6 = sequence.getSteps();
         ReactionFired _newTraceReactionFired = this.newTraceReactionFired(r);
-        CollectionExtensions.<ReactionFired>operator_add(_steps_4, _newTraceReactionFired);
+        CollectionExtensions.<ReactionFired>operator_add(_steps_6, _newTraceReactionFired);
       }
-      List<State> _entryStates = this.entryStates(t);
-      List<State> _reverse = ListExtensions.<State>reverse(_entryStates);
-      final Function2<Sequence,State,Sequence> _function_1 = new Function2<Sequence,State,Sequence>() {
-          public Sequence apply(final Sequence seq_1 , final State state_1) {
+      List<ExecutionScope> _entryScopes = this.entryScopes(t);
+      Iterable<ExecutionScope> _drop_1 = IterableExtensions.<ExecutionScope>drop(_entryScopes, 1);
+      List<ExecutionScope> _list = IterableExtensions.<ExecutionScope>toList(_drop_1);
+      List<ExecutionScope> _reverse = ListExtensions.<ExecutionScope>reverse(_list);
+      final Function2<Sequence,ExecutionScope,Sequence> _function_1 = new Function2<Sequence,ExecutionScope,Sequence>() {
+          public Sequence apply(final Sequence seq_1 , final ExecutionScope scope) {
             Sequence _xblockexpression_1 = null;
             {
-              Vertex _target = t.getTarget();
-              boolean _operator_notEquals_4 = ObjectExtensions.operator_notEquals(state_1, _target);
-              if (_operator_notEquals_4) {
+              if ((scope instanceof org.yakindu.sct.model.sexec.ExecutionRegion)) {
                 {
-                  Region _parentRegion = state_1.getParentRegion();
-                  CompositeElement _composite = _parentRegion.getComposite();
-                  EList<Region> _regions = _composite.getRegions();
-                  final EList<Region> siblingRegions = _regions;
-                  Region _parentRegion_1 = state_1.getParentRegion();
-                  Vertex _source_4 = t.getSource();
-                  Region _parentRegion_2 = _source_4.getParentRegion();
-                  boolean _operator_notEquals_5 = ObjectExtensions.operator_notEquals(_parentRegion_1, _parentRegion_2);
-                  if (_operator_notEquals_5) {
-                    Region _parentRegion_3 = state_1.getParentRegion();
-                    int _indexOf = siblingRegions.indexOf(_parentRegion_3);
-                    Iterable<Region> _take = IterableExtensions.<Region>take(siblingRegions, _indexOf);
-                    for (Region region : _take) {
-                      ModelSequencer.this.addEnterRegion(seq_1, region);
-                    }
+                  ExecutionScope _superScope = scope.getSuperScope();
+                  EList<ExecutionScope> _subScopes = _superScope.getSubScopes();
+                  final EList<ExecutionScope> siblingRegions = _subScopes;
+                  int _indexOf = siblingRegions.indexOf(scope);
+                  Iterable<ExecutionScope> _take_1 = IterableExtensions.<ExecutionScope>take(siblingRegions, _indexOf);
+                  for (ExecutionScope region : _take_1) {
+                    ModelSequencer.this.addEnterRegion(seq_1, region);
                   }
-                  ExecutionState _create_4 = ModelSequencer.this.factory.create(state_1);
-                  Step _entryAction = _create_4.getEntryAction();
+                }
+              }
+              if ((scope instanceof org.yakindu.sct.model.sexec.ExecutionState)) {
+                {
+                  Step _entryAction = ((ExecutionState) scope).getEntryAction();
                   boolean _operator_notEquals_6 = ObjectExtensions.operator_notEquals(_entryAction, null);
                   if (_operator_notEquals_6) {
-                    EList<Step> _steps_5 = seq_1.getSteps();
-                    ExecutionState _create_5 = ModelSequencer.this.factory.create(state_1);
-                    Step _entryAction_1 = _create_5.getEntryAction();
+                    EList<Step> _steps_7 = seq_1.getSteps();
+                    Step _entryAction_1 = ((ExecutionState) scope).getEntryAction();
                     Call _newCall_2 = ModelSequencer.this.factory.newCall(_entryAction_1);
-                    _steps_5.add(_newCall_2);
+                    _steps_7.add(_newCall_2);
                   }
                   if (ModelSequencer.this._addTraceSteps) {
-                    EList<Step> _steps_6 = seq_1.getSteps();
-                    ExecutionState _create_6 = ModelSequencer.this.factory.create(state_1);
-                    TraceStateEntered _newTraceStateEntered = ModelSequencer.this.newTraceStateEntered(_create_6);
-                    CollectionExtensions.<TraceStateEntered>operator_add(_steps_6, _newTraceStateEntered);
+                    EList<Step> _steps_8 = seq_1.getSteps();
+                    TraceStateEntered _newTraceStateEntered = ModelSequencer.this.newTraceStateEntered(((ExecutionState) scope));
+                    CollectionExtensions.<TraceStateEntered>operator_add(_steps_8, _newTraceStateEntered);
                   }
                 }
               }
@@ -637,91 +743,53 @@ public class ModelSequencer {
             return _xblockexpression_1;
           }
         };
-      IterableExtensions.<State, Sequence>fold(_reverse, sequence, _function_1);
-      Vertex _target_1 = t.getTarget();
-      boolean _operator_notEquals_7 = ObjectExtensions.operator_notEquals(_target_1, null);
+      IterableExtensions.<ExecutionScope, Sequence>fold(_reverse, sequence, _function_1);
+      Vertex _target = t.getTarget();
+      boolean _operator_notEquals_7 = ObjectExtensions.operator_notEquals(_target, null);
       if (_operator_notEquals_7) {
         {
+          Vertex _target_1 = t.getTarget();
+          Region _parentRegion = _target_1.getParentRegion();
+          CompositeElement _composite = _parentRegion.getComposite();
+          EList<Region> _regions = _composite.getRegions();
+          final EList<Region> siblingRegions_1 = _regions;
           Vertex _target_2 = t.getTarget();
-          Region _parentRegion_4 = _target_2.getParentRegion();
-          CompositeElement _composite_1 = _parentRegion_4.getComposite();
-          EList<Region> _regions_1 = _composite_1.getRegions();
-          final EList<Region> siblingRegions_1 = _regions_1;
-          Vertex _target_3 = t.getTarget();
-          Region _parentRegion_5 = _target_3.getParentRegion();
-          Vertex _source_5 = t.getSource();
-          Region _parentRegion_6 = _source_5.getParentRegion();
-          boolean _operator_notEquals_8 = ObjectExtensions.operator_notEquals(_parentRegion_5, _parentRegion_6);
-          if (_operator_notEquals_8) {
-            Vertex _target_4 = t.getTarget();
-            Region _parentRegion_7 = _target_4.getParentRegion();
-            int _indexOf_1 = siblingRegions_1.indexOf(_parentRegion_7);
-            Iterable<Region> _take_1 = IterableExtensions.<Region>take(siblingRegions_1, _indexOf_1);
-            for (Region region_1 : _take_1) {
-              this.addEnterRegion(sequence, region_1);
-            }
-          }
-          Vertex _target_5 = t.getTarget();
-          if ((_target_5 instanceof org.yakindu.sct.model.sgraph.RegularState)) {
-            EList<Step> _steps_7 = sequence.getSteps();
-            Vertex _target_6 = t.getTarget();
-            ExecutionState _create_7 = this.factory.create(((RegularState) _target_6));
-            Sequence _enterSequence = _create_7.getEnterSequence();
+          if ((_target_2 instanceof org.yakindu.sct.model.sgraph.RegularState)) {
+            EList<Step> _steps_9 = sequence.getSteps();
+            Vertex _target_3 = t.getTarget();
+            ExecutionState _create_4 = this.factory.create(((RegularState) _target_3));
+            Sequence _enterSequence = _create_4.getEnterSequence();
             Call _newCall_3 = this.factory.newCall(_enterSequence);
-            _steps_7.add(_newCall_3);
+            _steps_9.add(_newCall_3);
           } else {
-            Vertex _target_7 = t.getTarget();
-            if ((_target_7 instanceof org.yakindu.sct.model.sgraph.Choice)) {
-              EList<Step> _steps_8 = sequence.getSteps();
-              Vertex _target_8 = t.getTarget();
-              ExecutionChoice _create_8 = this.factory.create(((Choice) _target_8));
-              Sequence _reactSequence = _create_8.getReactSequence();
+            Vertex _target_4 = t.getTarget();
+            if ((_target_4 instanceof org.yakindu.sct.model.sgraph.Choice)) {
+              EList<Step> _steps_10 = sequence.getSteps();
+              Vertex _target_5 = t.getTarget();
+              ExecutionChoice _create_5 = this.factory.create(((Choice) _target_5));
+              Sequence _reactSequence = _create_5.getReactSequence();
               Call _newCall_4 = this.factory.newCall(_reactSequence);
-              _steps_8.add(_newCall_4);
-            }
-          }
-          Vertex _target_9 = t.getTarget();
-          Region _parentRegion_8 = _target_9.getParentRegion();
-          Vertex _source_6 = t.getSource();
-          Region _parentRegion_9 = _source_6.getParentRegion();
-          boolean _operator_notEquals_9 = ObjectExtensions.operator_notEquals(_parentRegion_8, _parentRegion_9);
-          if (_operator_notEquals_9) {
-            Vertex _target_10 = t.getTarget();
-            Region _parentRegion_10 = _target_10.getParentRegion();
-            int _indexOf_2 = siblingRegions_1.indexOf(_parentRegion_10);
-            int _operator_plus = IntegerExtensions.operator_plus(((Integer)_indexOf_2), ((Integer)1));
-            Iterable<Region> _drop = IterableExtensions.<Region>drop(siblingRegions_1, _operator_plus);
-            for (Region region_2 : _drop) {
-              this.addEnterRegion(sequence, region_2);
+              _steps_10.add(_newCall_4);
             }
           }
         }
       }
-      List<State> _entryStates_1 = this.entryStates(t);
-      final Function2<Sequence,State,Sequence> _function_2 = new Function2<Sequence,State,Sequence>() {
-          public Sequence apply(final Sequence seq_2 , final State state_2) {
+      List<ExecutionScope> _entryScopes_1 = this.entryScopes(t);
+      Iterable<ExecutionScope> _drop_2 = IterableExtensions.<ExecutionScope>drop(_entryScopes_1, 1);
+      final Function2<Sequence,ExecutionScope,Sequence> _function_2 = new Function2<Sequence,ExecutionScope,Sequence>() {
+          public Sequence apply(final Sequence seq_2 , final ExecutionScope scope_1) {
             Sequence _xblockexpression_2 = null;
             {
-              Vertex _target_11 = t.getTarget();
-              boolean _operator_notEquals_10 = ObjectExtensions.operator_notEquals(state_2, _target_11);
-              if (_operator_notEquals_10) {
+              if ((scope_1 instanceof org.yakindu.sct.model.sexec.ExecutionRegion)) {
                 {
-                  Region _parentRegion_11 = state_2.getParentRegion();
-                  CompositeElement _composite_2 = _parentRegion_11.getComposite();
-                  EList<Region> _regions_2 = _composite_2.getRegions();
-                  final EList<Region> siblingRegions_2 = _regions_2;
-                  Region _parentRegion_12 = state_2.getParentRegion();
-                  Vertex _source_7 = t.getSource();
-                  Region _parentRegion_13 = _source_7.getParentRegion();
-                  boolean _operator_notEquals_11 = ObjectExtensions.operator_notEquals(_parentRegion_12, _parentRegion_13);
-                  if (_operator_notEquals_11) {
-                    Region _parentRegion_14 = state_2.getParentRegion();
-                    int _indexOf_3 = siblingRegions_2.indexOf(_parentRegion_14);
-                    int _operator_plus_1 = IntegerExtensions.operator_plus(((Integer)_indexOf_3), ((Integer)1));
-                    Iterable<Region> _drop_1 = IterableExtensions.<Region>drop(siblingRegions_2, _operator_plus_1);
-                    for (Region region_3 : _drop_1) {
-                      ModelSequencer.this.addEnterRegion(seq_2, region_3);
-                    }
+                  ExecutionScope _superScope_1 = scope_1.getSuperScope();
+                  EList<ExecutionScope> _subScopes_1 = _superScope_1.getSubScopes();
+                  final EList<ExecutionScope> siblingRegions_2 = _subScopes_1;
+                  int _indexOf_1 = siblingRegions_2.indexOf(scope_1);
+                  int _operator_plus = IntegerExtensions.operator_plus(((Integer)_indexOf_1), ((Integer)1));
+                  Iterable<ExecutionScope> _drop_3 = IterableExtensions.<ExecutionScope>drop(siblingRegions_2, _operator_plus);
+                  for (ExecutionScope region_1 : _drop_3) {
+                    ModelSequencer.this.addEnterRegion(seq_2, region_1);
                   }
                 }
               }
@@ -730,12 +798,12 @@ public class ModelSequencer {
             return _xblockexpression_2;
           }
         };
-      IterableExtensions.<State, Sequence>fold(_entryStates_1, sequence, _function_2);
+      IterableExtensions.<ExecutionScope, Sequence>fold(_drop_2, sequence, _function_2);
       return sequence;
     }
   }
   
-  public Boolean addEnterRegion(final Sequence seq, final Region r) {
+  protected Boolean _addEnterRegion(final Sequence seq, final Region r) {
     Boolean _xblockexpression = null;
     {
       Entry _entry = this.entry(r);
@@ -764,6 +832,36 @@ public class ModelSequencer {
     return _xblockexpression;
   }
   
+  protected Boolean _addEnterRegion(final Sequence seq, final ExecutionRegion r) {
+    Boolean _xblockexpression = null;
+    {
+      EObject _sourceElement = r.getSourceElement();
+      Entry _entry = this.entry(((Region) _sourceElement));
+      State _target = this==null?(State)null:this.target(_entry);
+      ExecutionState _create = this.factory==null?(ExecutionState)null:this.factory.create(_target);
+      final ExecutionState entryState = _create;
+      Boolean _xifexpression = null;
+      boolean _operator_and = false;
+      boolean _operator_notEquals = ObjectExtensions.operator_notEquals(entryState, null);
+      if (!_operator_notEquals) {
+        _operator_and = false;
+      } else {
+        Sequence _enterSequence = entryState.getEnterSequence();
+        boolean _operator_notEquals_1 = ObjectExtensions.operator_notEquals(_enterSequence, null);
+        _operator_and = BooleanExtensions.operator_and(_operator_notEquals, _operator_notEquals_1);
+      }
+      if (_operator_and) {
+        EList<Step> _steps = seq.getSteps();
+        Sequence _enterSequence_1 = entryState.getEnterSequence();
+        Call _newCall = this.factory.newCall(_enterSequence_1);
+        boolean _add = _steps.add(_newCall);
+        _xifexpression = _add;
+      }
+      _xblockexpression = (_xifexpression);
+    }
+    return _xblockexpression;
+  }
+  
   public ReactionFired newTraceReactionFired(final Reaction r) {
     ReactionFired _xblockexpression = null;
     {
@@ -844,6 +942,46 @@ public class ModelSequencer {
     return _xblockexpression;
   }
   
+  public List<ExecutionScope> exitScopes(final Transition t) {
+    return null;
+  }
+  
+  public List<ExecutionScope> entryScopes(final Transition t) {
+    List<ExecutionScope> _xblockexpression = null;
+    {
+      Vertex _target = t.getTarget();
+      List<EObject> _containers = this.containers(_target);
+      final List<EObject> l = _containers;
+      Vertex _source = t.getSource();
+      List<EObject> _containers_1 = this.containers(_source);
+      l.removeAll(_containers_1);
+      final Function1<EObject,ExecutionScope> _function = new Function1<EObject,ExecutionScope>() {
+          public ExecutionScope apply(final EObject c) {
+            ExecutionScope _xifexpression = null;
+            if ((c instanceof org.yakindu.sct.model.sgraph.RegularState)) {
+              ExecutionState _create = ModelSequencer.this.factory.create(((RegularState) c));
+              _xifexpression = ((ExecutionScope) _create);
+            } else {
+              ExecutionScope _xifexpression_1 = null;
+              if ((c instanceof org.yakindu.sct.model.sgraph.Region)) {
+                ExecutionRegion _create_1 = ModelSequencer.this.factory.create(((Region) c));
+                _xifexpression_1 = ((ExecutionScope) _create_1);
+              } else {
+                ExecutionFlow _create_2 = ModelSequencer.this.factory.create(((Statechart) c));
+                _xifexpression_1 = ((ExecutionScope) _create_2);
+              }
+              _xifexpression = _xifexpression_1;
+            }
+            return _xifexpression;
+          }
+        };
+      List<ExecutionScope> _map = ListExtensions.<EObject, ExecutionScope>map(l, _function);
+      List<ExecutionScope> _list = IterableExtensions.<ExecutionScope>toList(_map);
+      _xblockexpression = (_list);
+    }
+    return _xblockexpression;
+  }
+  
   public List<RegularState> parentStates(final RegularState s) {
     List<EObject> _containers = this.containers(s);
     Iterable<RegularState> _filter = IterableExtensions.<RegularState>filter(_containers, org.yakindu.sct.model.sgraph.RegularState.class);
@@ -1149,7 +1287,7 @@ public class ModelSequencer {
   
   public ExecutionFlow defineRegularStateReactions(final ExecutionFlow flow, final Statechart sc) {
     {
-      List<RegularState> _allRegularStates = this.allRegularStates(sc);
+      List<RegularState> _allRegularStates = this.sct.allRegularStates(sc);
       final List<RegularState> states = _allRegularStates;
       Iterable<State> _filter = IterableExtensions.<State>filter(states, org.yakindu.sct.model.sgraph.State.class);
       final Function1<State,Boolean> _function = new Function1<State,Boolean>() {
@@ -1179,7 +1317,7 @@ public class ModelSequencer {
   }
   
   public void definePseudoStateReactions(final ExecutionFlow flow, final Statechart sc) {
-    List<Choice> _allChoices = this.allChoices(sc);
+    List<Choice> _allChoices = this.sct.allChoices(sc);
     final Function1<Choice,Sequence> _function = new Function1<Choice,Sequence>() {
         public Sequence apply(final Choice choice) {
           Sequence _defineReaction = ModelSequencer.this.defineReaction(choice);
@@ -1659,27 +1797,39 @@ public class ModelSequencer {
   }
   
   public int defineStateVectors(final Region r, final int offset) {
-    EList<Vertex> _vertices = r.getVertices();
-    final Function2<Integer,Vertex,Integer> _function = new Function2<Integer,Vertex,Integer>() {
-        public Integer apply(final Integer s , final Vertex v) {
-          int _xblockexpression = (int) 0;
-          {
-            int _defineStateVectors = ModelSequencer.this.defineStateVectors(v, ((Integer)offset));
-            final int mo = _defineStateVectors;
-            int _xifexpression = (int) 0;
-            boolean _operator_greaterThan = ComparableExtensions.<Integer>operator_greaterThan(((Integer)mo), s);
-            if (_operator_greaterThan) {
-              _xifexpression = mo;
-            } else {
-              _xifexpression = s;
+    {
+      EList<Vertex> _vertices = r.getVertices();
+      final Function2<Integer,Vertex,Integer> _function = new Function2<Integer,Vertex,Integer>() {
+          public Integer apply(final Integer s , final Vertex v) {
+            int _xblockexpression = (int) 0;
+            {
+              int _defineStateVectors = ModelSequencer.this.defineStateVectors(v, ((Integer)offset));
+              final int mo = _defineStateVectors;
+              int _xifexpression = (int) 0;
+              boolean _operator_greaterThan = ComparableExtensions.<Integer>operator_greaterThan(((Integer)mo), s);
+              if (_operator_greaterThan) {
+                _xifexpression = mo;
+              } else {
+                _xifexpression = s;
+              }
+              _xblockexpression = (_xifexpression);
             }
-            _xblockexpression = (_xifexpression);
+            return ((Integer)_xblockexpression);
           }
-          return ((Integer)_xblockexpression);
-        }
-      };
-    Integer _fold = IterableExtensions.<Vertex, Integer>fold(_vertices, ((Integer)0), _function);
-    return _fold;
+        };
+      Integer _fold = IterableExtensions.<Vertex, Integer>fold(_vertices, ((Integer)0), _function);
+      final Integer maxOrthogonality = _fold;
+      ExecutionRegion _create = this.factory.create(r);
+      final ExecutionRegion er = _create;
+      SexecFactory _sexecFactory = this.sexecFactory();
+      StateVector _createStateVector = _sexecFactory.createStateVector();
+      er.setStateVector(_createStateVector);
+      StateVector _stateVector = er.getStateVector();
+      _stateVector.setOffset(offset);
+      StateVector _stateVector_1 = er.getStateVector();
+      _stateVector_1.setSize(maxOrthogonality);
+      return maxOrthogonality;
+    }
   }
   
   protected int _defineStateVectors(final Vertex v, final int offset) {
@@ -1902,112 +2052,119 @@ public class ModelSequencer {
           Iterable<Integer> _operator_upTo = IntegerExtensions.operator_upTo(((Integer)_offset), ((Integer)_operator_minus));
           for (Integer i : _operator_upTo) {
             {
-              final Integer idx = i;
-              SexecFactory _sexecFactory_1 = this.sexecFactory();
-              StateSwitch _createStateSwitch = _sexecFactory_1.createStateSwitch();
-              StateSwitch sSwitch = _createStateSwitch;
-              sSwitch.setStateConfigurationIdx(i);
-              int _stateConfigurationIdx = sSwitch.getStateConfigurationIdx();
-              String _operator_plus_2 = StringExtensions.operator_plus("Handle exit of all possible states on position ", ((Integer)_stateConfigurationIdx));
-              String _operator_plus_3 = StringExtensions.operator_plus(_operator_plus_2, "...");
-              sSwitch.setComment(_operator_plus_3);
-              final Function1<RegularState,Boolean> _function_1 = new Function1<RegularState,Boolean>() {
-                  public Boolean apply(final RegularState rs) {
-                    boolean _operator_and = false;
-                    ExecutionState _create_1 = ModelSequencer.this.factory.create(rs);
-                    StateVector _stateVector_1 = _create_1.getStateVector();
-                    int _size_1 = _stateVector_1.getSize();
-                    boolean _operator_equals = ObjectExtensions.operator_equals(((Integer)_size_1), ((Integer)1));
-                    if (!_operator_equals) {
-                      _operator_and = false;
-                    } else {
-                      ExecutionState _create_2 = ModelSequencer.this.factory.create(rs);
-                      StateVector _stateVector_2 = _create_2.getStateVector();
-                      int _offset_2 = _stateVector_2.getOffset();
-                      boolean _operator_equals_1 = ObjectExtensions.operator_equals(((Integer)_offset_2), idx);
-                      _operator_and = BooleanExtensions.operator_and(_operator_equals, _operator_equals_1);
-                    }
-                    return ((Boolean)_operator_and);
-                  }
-                };
-              Iterable<RegularState> _filter = IterableExtensions.<RegularState>filter(leafStates, _function_1);
-              List<RegularState> _list = IterableExtensions.<RegularState>toList(_filter);
-              final List<RegularState> posStates = _list;
-              for (RegularState s : posStates) {
-                {
-                  SexecFactory _sexecFactory_2 = this.sexecFactory();
-                  Sequence _createSequence_1 = _sexecFactory_2.createSequence();
-                  final Sequence caseSeq = _createSequence_1;
-                  EList<Step> _steps_1 = caseSeq.getSteps();
-                  ExecutionState _create_3 = this.factory.create(s);
-                  Sequence _exitSequence = _create_3.getExitSequence();
-                  Call _newCall = this.factory.newCall(_exitSequence);
-                  CollectionExtensions.<Call>operator_add(_steps_1, _newCall);
-                  List<RegularState> _parentStates = this.parentStates(s);
-                  final List<RegularState> exitStates = _parentStates;
-                  List<RegularState> _parentStates_1 = this.parentStates(state);
-                  exitStates.removeAll(_parentStates_1);
-                  exitStates.remove(s);
-                  final Function2<Sequence,RegularState,Sequence> _function_2 = new Function2<Sequence,RegularState,Sequence>() {
-                      public Sequence apply(final Sequence cs , final RegularState exitState) {
-                        Sequence _xblockexpression_1 = null;
-                        {
-                          ExecutionState _create_4 = ModelSequencer.this.factory.create(exitState);
-                          Step _exitAction = _create_4.getExitAction();
-                          boolean _operator_notEquals = ObjectExtensions.operator_notEquals(_exitAction, null);
-                          if (_operator_notEquals) {
-                            EList<Step> _steps_2 = cs.getSteps();
-                            ExecutionState _create_5 = ModelSequencer.this.factory.create(exitState);
-                            Step _exitAction_1 = _create_5.getExitAction();
-                            Call _newCall_1 = ModelSequencer.this.factory.newCall(_exitAction_1);
-                            _steps_2.add(_newCall_1);
-                          }
-                          if (ModelSequencer.this._addTraceSteps) {
-                            EList<Step> _steps_3 = cs.getSteps();
-                            ExecutionState _create_6 = ModelSequencer.this.factory.create(exitState);
-                            TraceStateExited _newTraceStateExited = ModelSequencer.this.newTraceStateExited(_create_6);
-                            _steps_3.add(_newTraceStateExited);
-                          }
-                          _xblockexpression_1 = (cs);
-                        }
-                        return _xblockexpression_1;
-                      }
-                    };
-                  IterableExtensions.<RegularState, Sequence>fold(exitStates, caseSeq, _function_2);
-                  ExecutionState _create_7 = this.factory.create(s);
-                  Sequence _exitSequence_1 = _create_7.getExitSequence();
-                  boolean _operator_notEquals_1 = ObjectExtensions.operator_notEquals(_exitSequence_1, null);
-                  if (_operator_notEquals_1) {
-                    EList<StateCase> _cases = sSwitch.getCases();
-                    ExecutionState _create_8 = this.factory.create(s);
-                    StateCase _newCase = this.newCase(_create_8, caseSeq);
-                    _cases.add(_newCase);
-                  }
-                }
-              }
-              EList<Step> _steps_4 = seq.getSteps();
-              _steps_4.add(sSwitch);
+              StateSwitch _defineExitSwitch = this.defineExitSwitch(state, leafStates, i);
+              StateSwitch sSwitch = _defineExitSwitch;
+              EList<Step> _steps_1 = seq.getSteps();
+              _steps_1.add(sSwitch);
             }
           }
         }
       }
-      Step _exitAction_2 = execState.getExitAction();
-      boolean _operator_notEquals_2 = ObjectExtensions.operator_notEquals(_exitAction_2, null);
-      if (_operator_notEquals_2) {
-        EList<Step> _steps_5 = seq.getSteps();
-        Step _exitAction_3 = execState.getExitAction();
-        Call _newCall_2 = this.factory.newCall(_exitAction_3);
-        _steps_5.add(_newCall_2);
+      Step _exitAction = execState.getExitAction();
+      boolean _operator_notEquals = ObjectExtensions.operator_notEquals(_exitAction, null);
+      if (_operator_notEquals) {
+        EList<Step> _steps_2 = seq.getSteps();
+        Step _exitAction_1 = execState.getExitAction();
+        Call _newCall = this.factory.newCall(_exitAction_1);
+        _steps_2.add(_newCall);
       }
       if (this._addTraceSteps) {
-        EList<Step> _steps_6 = seq.getSteps();
-        TraceStateExited _newTraceStateExited_1 = this.newTraceStateExited(execState);
-        CollectionExtensions.<TraceStateExited>operator_add(_steps_6, _newTraceStateExited_1);
+        EList<Step> _steps_3 = seq.getSteps();
+        TraceStateExited _newTraceStateExited = this.newTraceStateExited(execState);
+        CollectionExtensions.<TraceStateExited>operator_add(_steps_3, _newTraceStateExited);
       }
       execState.setExitSequence(seq);
     }
   }
   
+  public StateSwitch defineExitSwitch(final State state, final List<RegularState> states, final int pos) {
+    {
+      SexecFactory _sexecFactory = this.sexecFactory();
+      StateSwitch _createStateSwitch = _sexecFactory.createStateSwitch();
+      StateSwitch sSwitch = _createStateSwitch;
+      sSwitch.setStateConfigurationIdx(pos);
+      int _stateConfigurationIdx = sSwitch.getStateConfigurationIdx();
+      String _operator_plus = StringExtensions.operator_plus("Handle exit of all possible states on position ", ((Integer)_stateConfigurationIdx));
+      String _operator_plus_1 = StringExtensions.operator_plus(_operator_plus, "...");
+      sSwitch.setComment(_operator_plus_1);
+      final Function1<RegularState,Boolean> _function = new Function1<RegularState,Boolean>() {
+          public Boolean apply(final RegularState rs) {
+            boolean _operator_and = false;
+            ExecutionState _create = ModelSequencer.this.factory.create(rs);
+            StateVector _stateVector = _create.getStateVector();
+            int _size = _stateVector.getSize();
+            boolean _operator_equals = ObjectExtensions.operator_equals(((Integer)_size), ((Integer)1));
+            if (!_operator_equals) {
+              _operator_and = false;
+            } else {
+              ExecutionState _create_1 = ModelSequencer.this.factory.create(rs);
+              StateVector _stateVector_1 = _create_1.getStateVector();
+              int _offset = _stateVector_1.getOffset();
+              boolean _operator_equals_1 = ObjectExtensions.operator_equals(((Integer)_offset), ((Integer)pos));
+              _operator_and = BooleanExtensions.operator_and(_operator_equals, _operator_equals_1);
+            }
+            return ((Boolean)_operator_and);
+          }
+        };
+      Iterable<RegularState> _filter = IterableExtensions.<RegularState>filter(states, _function);
+      List<RegularState> _list = IterableExtensions.<RegularState>toList(_filter);
+      final List<RegularState> posStates = _list;
+      for (RegularState s : posStates) {
+        {
+          SexecFactory _sexecFactory_1 = this.sexecFactory();
+          Sequence _createSequence = _sexecFactory_1.createSequence();
+          final Sequence caseSeq = _createSequence;
+          EList<Step> _steps = caseSeq.getSteps();
+          ExecutionState _create_2 = this.factory.create(s);
+          Sequence _exitSequence = _create_2.getExitSequence();
+          Call _newCall = this.factory.newCall(_exitSequence);
+          CollectionExtensions.<Call>operator_add(_steps, _newCall);
+          List<RegularState> _parentStates = this.parentStates(s);
+          final List<RegularState> exitStates = _parentStates;
+          List<RegularState> _parentStates_1 = this.parentStates(state);
+          exitStates.removeAll(_parentStates_1);
+          exitStates.remove(s);
+          final Function2<Sequence,RegularState,Sequence> _function_1 = new Function2<Sequence,RegularState,Sequence>() {
+              public Sequence apply(final Sequence cs , final RegularState exitState) {
+                Sequence _xblockexpression = null;
+                {
+                  ExecutionState _create_3 = ModelSequencer.this.factory.create(exitState);
+                  Step _exitAction = _create_3.getExitAction();
+                  boolean _operator_notEquals = ObjectExtensions.operator_notEquals(_exitAction, null);
+                  if (_operator_notEquals) {
+                    EList<Step> _steps_1 = cs.getSteps();
+                    ExecutionState _create_4 = ModelSequencer.this.factory.create(exitState);
+                    Step _exitAction_1 = _create_4.getExitAction();
+                    Call _newCall_1 = ModelSequencer.this.factory.newCall(_exitAction_1);
+                    _steps_1.add(_newCall_1);
+                  }
+                  if (ModelSequencer.this._addTraceSteps) {
+                    EList<Step> _steps_2 = cs.getSteps();
+                    ExecutionState _create_5 = ModelSequencer.this.factory.create(exitState);
+                    TraceStateExited _newTraceStateExited = ModelSequencer.this.newTraceStateExited(_create_5);
+                    _steps_2.add(_newTraceStateExited);
+                  }
+                  _xblockexpression = (cs);
+                }
+                return _xblockexpression;
+              }
+            };
+          IterableExtensions.<RegularState, Sequence>fold(exitStates, caseSeq, _function_1);
+          ExecutionState _create_6 = this.factory.create(s);
+          Sequence _exitSequence_1 = _create_6.getExitSequence();
+          boolean _operator_notEquals_1 = ObjectExtensions.operator_notEquals(_exitSequence_1, null);
+          if (_operator_notEquals_1) {
+            EList<StateCase> _cases = sSwitch.getCases();
+            ExecutionState _create_7 = this.factory.create(s);
+            StateCase _newCase = this.newCase(_create_7, caseSeq);
+            _cases.add(_newCase);
+          }
+        }
+      }
+      return sSwitch;
+    }
+  }
+  
   public List<RegularState> collectLeafStates(final RegularState state, final List<RegularState> leafStates) {
     {
       boolean _isLeaf = this.isLeaf(state);
@@ -2380,6 +2537,32 @@ public class ModelSequencer {
     }
   }
   
+  public StateVector stateVector(final Vertex choice) {
+    if ((choice instanceof Choice)) {
+      return _stateVector((Choice)choice);
+    } else if ((choice instanceof RegularState)) {
+      return _stateVector((RegularState)choice);
+    } else if ((choice instanceof Vertex)) {
+      return _stateVector((Vertex)choice);
+    } else {
+      throw new IllegalArgumentException("Unhandled parameter types: " +
+        java.util.Arrays.<Object>asList(choice).toString());
+    }
+  }
+  
+  public Boolean addEnterRegion(final Sequence seq, final EObject r) {
+    if ((seq instanceof Sequence)
+         && (r instanceof ExecutionRegion)) {
+      return _addEnterRegion((Sequence)seq, (ExecutionRegion)r);
+    } else if ((seq instanceof Sequence)
+         && (r instanceof Region)) {
+      return _addEnterRegion((Sequence)seq, (Region)r);
+    } else {
+      throw new IllegalArgumentException("Unhandled parameter types: " +
+        java.util.Arrays.<Object>asList(seq, r).toString());
+    }
+  }
+  
   public Sequence mapEffect(final Effect effect) {
     if ((effect instanceof ReactionEffect)) {
       return _mapEffect((ReactionEffect)effect);

+ 35 - 0
plugins/org.yakindu.sct.model.sexec/xtend-gen/org/yakindu/sct/model/sexec/transformation/StatechartExtensions.java

@@ -12,9 +12,11 @@ import org.eclipse.xtext.xbase.lib.IntegerExtensions;
 import org.eclipse.xtext.xbase.lib.IterableExtensions;
 import org.eclipse.xtext.xbase.lib.ObjectExtensions;
 import org.eclipse.xtext.xbase.lib.StringExtensions;
+import org.yakindu.sct.model.sgraph.Choice;
 import org.yakindu.sct.model.sgraph.Reaction;
 import org.yakindu.sct.model.sgraph.ReactiveElement;
 import org.yakindu.sct.model.sgraph.Region;
+import org.yakindu.sct.model.sgraph.RegularState;
 import org.yakindu.sct.model.sgraph.Scope;
 import org.yakindu.sct.model.sgraph.State;
 import org.yakindu.sct.model.sgraph.Statechart;
@@ -200,6 +202,39 @@ public class StatechartExtensions {
     return _xifexpression;
   }
   
+  public List<RegularState> allRegularStates(final Statechart sc) {
+    {
+      List<EObject> _eAllContentsAsList = EcoreUtil2.eAllContentsAsList(sc);
+      List<EObject> content = _eAllContentsAsList;
+      Iterable<RegularState> _filter = IterableExtensions.<RegularState>filter(content, org.yakindu.sct.model.sgraph.RegularState.class);
+      final Iterable<RegularState> allStates = _filter;
+      List<RegularState> _list = IterableExtensions.<RegularState>toList(allStates);
+      return _list;
+    }
+  }
+  
+  public List<Region> allRegions(final Statechart sc) {
+    {
+      List<EObject> _eAllContentsAsList = EcoreUtil2.eAllContentsAsList(sc);
+      List<EObject> content = _eAllContentsAsList;
+      Iterable<Region> _filter = IterableExtensions.<Region>filter(content, org.yakindu.sct.model.sgraph.Region.class);
+      final Iterable<Region> allRegions = _filter;
+      List<Region> _list = IterableExtensions.<Region>toList(allRegions);
+      return _list;
+    }
+  }
+  
+  public List<Choice> allChoices(final Statechart sc) {
+    {
+      List<EObject> _eAllContentsAsList = EcoreUtil2.eAllContentsAsList(sc);
+      List<EObject> content = _eAllContentsAsList;
+      Iterable<Choice> _filter = IterableExtensions.<Choice>filter(content, org.yakindu.sct.model.sgraph.Choice.class);
+      final Iterable<Choice> allChoices = _filter;
+      List<Choice> _list = IterableExtensions.<Choice>toList(allChoices);
+      return _list;
+    }
+  }
+  
   protected String _id(final Object obj) {
     return null;
   }

+ 309 - 5
test-plugins/org.yakindu.sct.model.sexec.test/src/org/yakindu/sct/model/sexec/transformation/test/ModelSequencerOrthogonalityTest.java

@@ -4,10 +4,13 @@ import static org.junit.Assert.*;
 import static org.yakindu.sct.model.sexec.transformation.test.SCTTestUtil.*;
 
 import org.junit.Test;
+import org.yakindu.sct.model.sexec.Call;
 import org.yakindu.sct.model.sexec.ExecutionFlow;
 import org.yakindu.sct.model.sexec.ExecutionState;
 import org.yakindu.sct.model.sexec.Reaction;
 import org.yakindu.sct.model.sexec.Sequence;
+import org.yakindu.sct.model.sexec.StateSwitch;
+import org.yakindu.sct.model.sexec.Step;
 import org.yakindu.sct.model.sgraph.Entry;
 import org.yakindu.sct.model.sgraph.EntryKind;
 import org.yakindu.sct.model.sgraph.Region;
@@ -119,7 +122,7 @@ public class ModelSequencerOrthogonalityTest extends ModelSequencerTest {
 		assertTrue(_t.isTransition());
 		
 		Sequence _effect = (Sequence) _t.getEffect();
-		assertEquals(4, _effect.getSteps().size());
+		assertEquals("wrong sequence: " + stepList(_effect), 4, _effect.getSteps().size());
 		
 		assertCall(_effect, 0, _s5.getExitSequence());
 		assertCall(_effect, 1, _s2.getEnterSequence());
@@ -206,7 +209,7 @@ public class ModelSequencerOrthogonalityTest extends ModelSequencerTest {
 		assertTrue(_t.isTransition());
 		
 		Sequence _effect = (Sequence) _t.getEffect();
-		assertEquals(7, _effect.getSteps().size());
+		assertEquals("wrong sequence: " + stepList(_effect), 7, _effect.getSteps().size());
 		
 		assertCall(_effect, 0, _s5.getExitSequence());
 		assertCall(_effect, 1, _s2.getEnterSequence());
@@ -220,7 +223,7 @@ public class ModelSequencerOrthogonalityTest extends ModelSequencerTest {
 	
 
 	/**
-	 * Local transition within a region with orthogonal siblings does not have to invoke sibling region entries.
+	 * Local transition within a region with orthogonal siblings does not have to invoke sibling region entries or exists.
 	 */
 	@Test public void testSiblingStateTransition() {
 		
@@ -306,10 +309,11 @@ public class ModelSequencerOrthogonalityTest extends ModelSequencerTest {
 		assertCall(_effect, 1, _s3b2.getEnterSequence());
 	}
 	
+	
 	/**
 	 * A transition from a state with orthogonal siblings that dives into a non orthogonal sibling state must exclude the source state sibling entry behavior.
 	 */
-	@Test public void testSourceSiblingExclusion() {
+	@Test public void testSourceSiblingEnterExclusion() {
 		
 		Statechart sc = _createStatechart("sc"); {  
 			
@@ -390,7 +394,7 @@ public class ModelSequencerOrthogonalityTest extends ModelSequencerTest {
 		assertTrue(_t.isTransition());
 		
 		Sequence _effect = (Sequence) _t.getEffect();
-		assertEquals(5, _effect.getSteps().size());
+		assertEquals("wrong sequence: " + stepList(_effect),  5, _effect.getSteps().size());
 		
 		assertCall(_effect, 0, _s3z.getExitSequence());
 		assertCall(_effect, 1, _s3.getEntryAction());
@@ -400,6 +404,306 @@ public class ModelSequencerOrthogonalityTest extends ModelSequencerTest {
 	}
 	
 
+	/* -------------------------------------------------------------------------------------------
+	 * Exit behavior tests
+	 * -------------------------------------------------------------------------------------------
+	 */
+
+	/**
+	 * The transition from a leaf state with orthogonal siblings must invoke the exit sequence of the orthogonal sibling regions. 
+	 */
+	@Test public void testSiblingRegionExitFromSourceState() {
+		
+		Statechart sc = _createStatechart("sc"); {  
+			
+			InterfaceScope s_scope = _createInterfaceScope("Interface", sc);
+			VariableDefinition v1 = _createVariableDefinition("v1", TYPE_INTEGER, s_scope);
+
+			Region r = _createRegion("r", sc); {
+				Entry r_entry = _createEntry(EntryKind.INITIAL, null, r);
+				State s1 = _createState("s1", r); {
+
+					Region r2 = _createRegion("r2", s1); {
+						Entry r2_entry = _createEntry(EntryKind.INITIAL, null, r2);
+						State s2 = _createState("s2", r2);
+						_createTransition(r2_entry, s2);
+						State s2b = _createState("s2b", r2);
+
+					}
+							
+					Region r3 = _createRegion("r3", s1); {
+						Entry r3_entry = _createEntry(EntryKind.INITIAL, null, r3);
+						State s3 = _createState("s3", r3);
+						_createTransition(r3_entry, s3);
+					}
+
+					Region r4 = _createRegion("r4", s1); {
+						Entry r4_entry = _createEntry(EntryKind.INITIAL, null, r4);
+						State s4 = _createState("s4", r4);
+						_createTransition(r4_entry, s4);
+						State s4b = _createState("s4b", r4);
+
+					}
+				}		
+				_createTransition(r_entry, s1);
+				State s5 = _createState("s5", r);
+				_createTransition(findState(sc, "s3"), s5);
+			}
+		}
+			
+		ExecutionFlow flow = sequencer.transform(sc);
+		
+		ExecutionState _s2 = flow.getStates().get(1);
+		assertEquals("sc.r.s1.r2.s2", _s2.getName());
+		ExecutionState _s2b = flow.getStates().get(2);
+		assertEquals("sc.r.s1.r2.s2b", _s2b.getName());
+		ExecutionState _s3 = flow.getStates().get(3);
+		assertEquals("sc.r.s1.r3.s3", _s3.getName());
+		ExecutionState _s4 = flow.getStates().get(4);
+		assertEquals("sc.r.s1.r4.s4", _s4.getName());
+		ExecutionState _s4b = flow.getStates().get(5);
+		assertEquals("sc.r.s1.r4.s4b", _s4b.getName());
+		ExecutionState _s5 = flow.getStates().get(6);
+		assertEquals("sc.r.s5", _s5.getName());
+
+		
+		Reaction _t = _s3.getReactions().get(0);
+		assertTrue(_t.isTransition());
+		
+		Sequence _effect = (Sequence) _t.getEffect();
+		assertEquals(4, _effect.getSteps().size());
+		
+		Step _switch =  _effect.getSteps().get(0);
+		assertStateSwitch(_switch, _s2, _s2b);
+		assertCall( assertedSequence(assertedStateCase(_switch, _s2).getStep()), 0, _s2.getExitSequence());
+		assertCall( assertedSequence(assertedStateCase(_switch, _s2b).getStep()), 0, _s2b.getExitSequence());
 
+		assertCall(_effect, 1, _s3.getExitSequence());
+
+		_switch =  _effect.getSteps().get(2);
+		assertStateSwitch(_switch, _s4, _s4b);
+		assertCall( assertedSequence(assertedStateCase(_switch, _s4).getStep()), 0, _s4.getExitSequence());
+		assertCall( assertedSequence(assertedStateCase(_switch, _s4b).getStep()), 0, _s4b.getExitSequence());
+	
+		assertCall(_effect, 3, _s5.getEnterSequence());
+	}
+
+	
+	
+	/**
+	 * For a transition all composite state with orthogonal siblings on the exit path must invoke the exit sequence of the orthogonal sibling regions. 
+	 */
+	@Test public void testSiblingRegionExitOnComposite() {
+		
+		Statechart sc = _createStatechart("sc"); {  
+			
+			InterfaceScope s_scope = _createInterfaceScope("Interface", sc);
+			VariableDefinition v1 = _createVariableDefinition("v1", TYPE_INTEGER, s_scope);
+
+			Region r = _createRegion("r", sc); {
+				Entry r_entry = _createEntry(EntryKind.INITIAL, null, r);
+				State s1 = _createState("s1", r); {
+
+					Region r2 = _createRegion("r2", s1); {
+						Entry r2_entry = _createEntry(EntryKind.INITIAL, null, r2);
+						State s2 = _createState("s2", r2);
+						_createTransition(r2_entry, s2);
+					}
+							
+					Region r3 = _createRegion("r3", s1); {
+						Entry r3_entry = _createEntry(EntryKind.INITIAL, null, r3);
+						State s3 = _createState("s3", r3); {
+							Region r3a = _createRegion("r3a", s3); {
+								Entry r3a_entry = _createEntry(EntryKind.INITIAL, null, r3a);
+								State s3a = _createState("s3a", r3a);
+								_createTransition(r3a_entry, s3a);
+							}
+							Region r3b = _createRegion("r3b", s3); {
+								Entry r3b_entry = _createEntry(EntryKind.INITIAL, null, r3b);
+								State s3b = _createState("s3b", r3b);
+								_createTransition(r3b_entry, s3b);
+							}
+							Region r3c = _createRegion("r3c", s3); {
+								Entry r3c_entry = _createEntry(EntryKind.INITIAL, null, r3c);
+								State s3c = _createState("s3c", r3c);
+								_createTransition(r3c_entry, s3c);
+							}
+						}
+						_createEntryAssignment(v1, s3, 42);
+						_createTransition(r3_entry, s3);					
+					}
+
+					Region r4 = _createRegion("r4", s1); {
+						Entry r4_entry = _createEntry(EntryKind.INITIAL, null, r4);
+						State s4 = _createState("s4", r4);
+						_createTransition(r4_entry, s4);
+					}
+				}		
+				_createTransition(r_entry, s1);
+				State s5 = _createState("s5", r);
+				
+				_createTransition(findState(sc, "s3b"), s5);
+			}
+		}
+			
+		ExecutionFlow flow = sequencer.transform(sc);
+		
+		ExecutionState _s2 = flow.getStates().get(1);
+		assertEquals("sc.r.s1.r2.s2", _s2.getName());
+		ExecutionState _s3 = flow.getStates().get(2);
+		assertEquals("sc.r.s1.r3.s3", _s3.getName());
+		ExecutionState _s3a = flow.getStates().get(3);
+		assertEquals("sc.r.s1.r3.s3.r3a.s3a", _s3a.getName());
+		ExecutionState _s3b = flow.getStates().get(4);
+		assertEquals("sc.r.s1.r3.s3.r3b.s3b", _s3b.getName());
+		ExecutionState _s3c = flow.getStates().get(5);
+		assertEquals("sc.r.s1.r3.s3.r3c.s3c", _s3c.getName());
+		ExecutionState _s4 = flow.getStates().get(6);
+		assertEquals("sc.r.s1.r4.s4", _s4.getName());
+		ExecutionState _s5 = flow.getStates().get(7);
+		assertEquals("sc.r.s5", _s5.getName());
+
+		
+		Reaction _t = _s3b.getReactions().get(0);
+		assertTrue(_t.isTransition());
+		
+		Sequence _effect = (Sequence) _t.getEffect();
+		assertEquals(6, _effect.getSteps().size());
+		
+		Step _switch =  _effect.getSteps().get(0);
+		assertStateSwitch(_switch, _s2);
+		assertCall( assertedSequence(assertedStateCase(_switch, _s2).getStep()), 0, _s2.getExitSequence());
+
+		_switch =  _effect.getSteps().get(1);
+		assertStateSwitch(_switch, _s3a);
+		assertCall( assertedSequence(assertedStateCase(_switch, _s3a).getStep()), 0, _s3a.getExitSequence());
+
+		assertCall(_effect, 2, _s3b.getExitSequence());
+
+		_switch =  _effect.getSteps().get(3);
+		assertStateSwitch(_switch, _s3c);
+		assertCall( assertedSequence(assertedStateCase(_switch, _s3c).getStep()), 0, _s3c.getExitSequence());
+
+		_switch =  _effect.getSteps().get(4);
+		assertStateSwitch(_switch, _s4);
+		assertCall( assertedSequence(assertedStateCase(_switch, _s4).getStep()), 0, _s4.getExitSequence());
+	
+		assertCall(_effect, 5, _s5.getEnterSequence());
+	}
+	
+
+	/**
+	 * A transition to a state with orthogonal siblings that comes out of a non orthogonal sibling state must exclude the source state sibling exit or enter behavior.
+	 */
+	@Test public void testSourceSiblingExitExclusion() {
+		
+		Statechart sc = _createStatechart("sc"); {  
+			
+			InterfaceScope s_scope = _createInterfaceScope("Interface", sc);
+			VariableDefinition v1 = _createVariableDefinition("v1", TYPE_INTEGER, s_scope);
+
+			Region r = _createRegion("r", sc); {
+				Entry r_entry = _createEntry(EntryKind.INITIAL, null, r);
+				State s1 = _createState("s1", r); {
+
+					Region r2 = _createRegion("r2", s1); {
+						Entry r2_entry = _createEntry(EntryKind.INITIAL, null, r2);
+						State s2 = _createState("s2", r2);
+						_createTransition(r2_entry, s2);
+					}
+							
+					Region r3 = _createRegion("r3", s1); {
+						Entry r3_entry = _createEntry(EntryKind.INITIAL, null, r3);
+						State s3 = _createState("s3", r3); {
+							Region r3a = _createRegion("r3a", s3); {
+								Entry r3a_entry = _createEntry(EntryKind.INITIAL, null, r3a);
+								State s3a = _createState("s3a", r3a);
+								_createTransition(r3a_entry, s3a);
+							}
+							Region r3b = _createRegion("r3b", s3); {
+								Entry r3b_entry = _createEntry(EntryKind.INITIAL, null, r3b);
+								State s3b = _createState("s3b", r3b);
+								State s3b2 = _createState("s3b2", r3b);
+								_createTransition(r3b_entry, s3b);
+							}
+							Region r3c = _createRegion("r3c", s3); {
+								Entry r3c_entry = _createEntry(EntryKind.INITIAL, null, r3c);
+								State s3c = _createState("s3c", r3c);
+								_createTransition(r3c_entry, s3c);
+							}
+						}
+						State s3z = _createState("s3z", r3);
+						_createEntryAssignment(v1, s3, 42);
+						_createTransition(r3_entry, s3);					
+					}
+
+					Region r4 = _createRegion("r4", s1); {
+						Entry r4_entry = _createEntry(EntryKind.INITIAL, null, r4);
+						State s4 = _createState("s4", r4);
+						_createTransition(r4_entry, s4);
+					}
+				}		
+				_createTransition(r_entry, s1);
+				State s5 = _createState("s5", r);
+				
+				_createTransition(findState(sc, "s3b2"), findState(sc, "s3z"));
+			}
+		}
+			
+		ExecutionFlow flow = sequencer.transform(sc);
+		
+		ExecutionState _s2 = flow.getStates().get(1);
+		assertEquals("sc.r.s1.r2.s2", _s2.getName());
+		ExecutionState _s3 = flow.getStates().get(2);
+		assertEquals("sc.r.s1.r3.s3", _s3.getName());
+		ExecutionState _s3a = flow.getStates().get(3);
+		assertEquals("sc.r.s1.r3.s3.r3a.s3a", _s3a.getName());
+		ExecutionState _s3b = flow.getStates().get(4);
+		assertEquals("sc.r.s1.r3.s3.r3b.s3b", _s3b.getName());
+		ExecutionState _s3b2 = flow.getStates().get(5);
+		assertEquals("sc.r.s1.r3.s3.r3b.s3b2", _s3b2.getName());
+		ExecutionState _s3c = flow.getStates().get(6);
+		assertEquals("sc.r.s1.r3.s3.r3c.s3c", _s3c.getName());
+		ExecutionState _s3z = flow.getStates().get(7);
+		assertEquals("sc.r.s1.r3.s3z", _s3z.getName());
+		ExecutionState _s4 = flow.getStates().get(8);
+		assertEquals("sc.r.s1.r4.s4", _s4.getName());
+		ExecutionState _s5 = flow.getStates().get(9);
+		assertEquals("sc.r.s5", _s5.getName());
+
+		
+		Reaction _t = _s3b2.getReactions().get(0);
+		assertTrue(_t.isTransition());
+		
+		Sequence _effect = (Sequence) _t.getEffect();
+		assertEquals("wrong steps: " + stepList(_effect), 4, _effect.getSteps().size());
+		
+		Step _switch =  _effect.getSteps().get(0);
+		assertStateSwitch(_switch, _s3a);
+		assertCall( assertedSequence(assertedStateCase(_switch, _s3a).getStep()), 0, _s3a.getExitSequence());
+
+		assertCall(_effect, 1, _s3b2.getExitSequence());
+
+		_switch =  _effect.getSteps().get(2);
+		assertStateSwitch(_switch, _s3c);
+		assertCall( assertedSequence(assertedStateCase(_switch, _s3c).getStep()), 0, _s3c.getExitSequence());
+	
+		assertCall(_effect, 3, _s3z.getEnterSequence());
+
+	}
+	
+	protected String stepList(Sequence seq) {
+		String r = "";
+		
+		for ( Step s : seq.getSteps() ) {
+			if (s instanceof Call) r += "call to : " + ((Call)s).getStep().getComment(); 
+			else if (s instanceof StateSwitch) r += "switch on " + ((StateSwitch)s).getStateConfigurationIdx(); 
+			else  r += s; 
+			
+			r += "; ";
+		}
+		
+		return r;
+	}
 
 }

+ 2 - 2
test-plugins/org.yakindu.sct.model.sexec.test/src/org/yakindu/sct/model/sexec/transformation/test/ModelSequencerStateTest.java

@@ -292,7 +292,7 @@ public class ModelSequencerStateTest extends ModelSequencerTest {
 	
 	/**
 	 * A composite state must have a exit sequence. 
-	 * This exit sequence consists of an exit action call and a state switch for all final states.
+	 * This exit sequence consists of an exit action call and a state switch for all leaf states.
 	 */
 	@Test public void testCompositeStateExitSequence() {
 		Statechart sc = _createStatechart("cs"); {
@@ -364,7 +364,7 @@ public class ModelSequencerStateTest extends ModelSequencerTest {
 	
 	/**
 	 * A composite state must have a exit sequence. 
-	 * This exit sequence consists of an exit action call and a state switch for all final states.
+	 * This exit sequence consists of an exit action call and a state switch for all leaf states.
 	 */
 	@Test public void testCompositeStateExitSequence_Deep() {