Browse Source

Transformation of entry points as ExecutionNode for entering Regions (YAKHMI-500)

benjamin.schwertfeger@gmail.com 13 years ago
parent
commit
5ca1fa41eb
44 changed files with 1115 additions and 162 deletions
  1. BIN
      plugins/org.yakindu.sct.model.sexec.edit/icons/full/ctool16/CreateExecutionState_entryAction_SaveHistory.gif
  2. BIN
      plugins/org.yakindu.sct.model.sexec.edit/icons/full/ctool16/CreateExecutionState_exitAction_SaveHistory.gif
  3. BIN
      plugins/org.yakindu.sct.model.sexec.edit/icons/full/ctool16/CreateReaction_effect_SaveHistory.gif
  4. BIN
      plugins/org.yakindu.sct.model.sexec.edit/icons/full/ctool16/CreateSequence_steps_SaveHistory.gif
  5. BIN
      plugins/org.yakindu.sct.model.sexec.edit/icons/full/ctool16/CreateStateCase_step_SaveHistory.gif
  6. BIN
      plugins/org.yakindu.sct.model.sexec.edit/icons/full/obj16/SaveHistory.gif
  7. 2 0
      plugins/org.yakindu.sct.model.sexec.edit/plugin.properties
  8. 10 0
      plugins/org.yakindu.sct.model.sexec.edit/src/org/yakindu/sct/model/sexec/provider/ExecutionStateItemProvider.java
  9. 5 0
      plugins/org.yakindu.sct.model.sexec.edit/src/org/yakindu/sct/model/sexec/provider/ReactionItemProvider.java
  10. 139 0
      plugins/org.yakindu.sct.model.sexec.edit/src/org/yakindu/sct/model/sexec/provider/SaveHistoryItemProvider.java
  11. 5 0
      plugins/org.yakindu.sct.model.sexec.edit/src/org/yakindu/sct/model/sexec/provider/SequenceItemProvider.java
  12. 24 0
      plugins/org.yakindu.sct.model.sexec.edit/src/org/yakindu/sct/model/sexec/provider/SexecItemProviderAdapterFactory.java
  13. 5 0
      plugins/org.yakindu.sct.model.sexec.edit/src/org/yakindu/sct/model/sexec/provider/StateCaseItemProvider.java
  14. 3 0
      plugins/org.yakindu.sct.model.sexec/model/sexec.ecore
  15. 3 0
      plugins/org.yakindu.sct.model.sexec/model/sexec.genmodel
  16. 53 0
      plugins/org.yakindu.sct.model.sexec/src/org/yakindu/sct/model/sexec/SaveHistory.java
  17. 9 0
      plugins/org.yakindu.sct.model.sexec/src/org/yakindu/sct/model/sexec/SexecFactory.java
  18. 95 0
      plugins/org.yakindu.sct.model.sexec/src/org/yakindu/sct/model/sexec/SexecPackage.java
  19. 160 0
      plugins/org.yakindu.sct.model.sexec/src/org/yakindu/sct/model/sexec/impl/SaveHistoryImpl.java
  20. 11 0
      plugins/org.yakindu.sct.model.sexec/src/org/yakindu/sct/model/sexec/impl/SexecFactoryImpl.java
  21. 33 0
      plugins/org.yakindu.sct.model.sexec/src/org/yakindu/sct/model/sexec/impl/SexecPackageImpl.java
  22. 3 4
      plugins/org.yakindu.sct.model.sexec/src/org/yakindu/sct/model/sexec/transformation/BehaviorMapping.xtend
  23. 45 14
      plugins/org.yakindu.sct.model.sexec/src/org/yakindu/sct/model/sexec/transformation/SequenceBuilder.xtend
  24. 12 0
      plugins/org.yakindu.sct.model.sexec/src/org/yakindu/sct/model/sexec/transformation/SexecElementMapping.xtend
  25. 7 1
      plugins/org.yakindu.sct.model.sexec/src/org/yakindu/sct/model/sexec/transformation/SexecExtensions.xtend
  26. 3 0
      plugins/org.yakindu.sct.model.sexec/src/org/yakindu/sct/model/sexec/transformation/SgraphExtensions.xtend
  27. 8 0
      plugins/org.yakindu.sct.model.sexec/src/org/yakindu/sct/model/sexec/transformation/StatechartExtensions.xtend
  28. 4 4
      plugins/org.yakindu.sct.model.sexec/src/org/yakindu/sct/model/sexec/transformation/StructureMapping.xtend
  29. 18 0
      plugins/org.yakindu.sct.model.sexec/src/org/yakindu/sct/model/sexec/util/SexecAdapterFactory.java
  30. 23 0
      plugins/org.yakindu.sct.model.sexec/src/org/yakindu/sct/model/sexec/util/SexecSwitch.java
  31. 32 28
      plugins/org.yakindu.sct.model.sexec/xtend-gen/org/yakindu/sct/model/sexec/transformation/BehaviorMapping.java
  32. 129 63
      plugins/org.yakindu.sct.model.sexec/xtend-gen/org/yakindu/sct/model/sexec/transformation/SequenceBuilder.java
  33. 60 15
      plugins/org.yakindu.sct.model.sexec/xtend-gen/org/yakindu/sct/model/sexec/transformation/SexecElementMapping.java
  34. 11 0
      plugins/org.yakindu.sct.model.sexec/xtend-gen/org/yakindu/sct/model/sexec/transformation/SexecExtensions.java
  35. 6 0
      plugins/org.yakindu.sct.model.sexec/xtend-gen/org/yakindu/sct/model/sexec/transformation/SgraphExtensions.java
  36. 11 0
      plugins/org.yakindu.sct.model.sexec/xtend-gen/org/yakindu/sct/model/sexec/transformation/StatechartExtensions.java
  37. 14 3
      plugins/org.yakindu.sct.model.sexec/xtend-gen/org/yakindu/sct/model/sexec/transformation/StructureMapping.java
  38. 19 0
      plugins/org.yakindu.sct.model.sgraph/src/org/yakindu/sct/model/sgraph/naming/SGraphNameProvider.java
  39. 7 9
      test-plugins/org.yakindu.sct.model.sexec.test/src/org/yakindu/sct/model/sexec/transformation/test/AllTests.java
  40. 113 0
      test-plugins/org.yakindu.sct.model.sexec.test/src/org/yakindu/sct/model/sexec/transformation/test/ModelSequencerHistoryTest.java
  41. 16 16
      test-plugins/org.yakindu.sct.model.sexec.test/src/org/yakindu/sct/model/sexec/transformation/test/ModelSequencerOrthogonalityTest.java
  42. 9 3
      test-plugins/org.yakindu.sct.model.sexec.test/src/org/yakindu/sct/model/sexec/transformation/test/ModelSequencerSCTest.java
  43. 7 2
      test-plugins/org.yakindu.sct.model.sexec.test/src/org/yakindu/sct/model/sexec/transformation/test/ModelSequencerStateTest.java
  44. 1 0
      test-plugins/org.yakindu.sct.model.sexec.test/src/org/yakindu/sct/model/sexec/transformation/test/SCTTestUtil.java

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


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


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


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


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


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


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

@@ -113,3 +113,5 @@ _UI_TraceRegionExited_type = Trace Region Exited
 _UI_TraceRegionEntered_type = Trace Region Entered
 _UI_TraceRegionExited_region_feature = Region
 _UI_TraceRegionEntered_region_feature = Region
+_UI_SaveHistory_type = Save History
+_UI_SaveHistory_region_feature = Region

+ 10 - 0
plugins/org.yakindu.sct.model.sexec.edit/src/org/yakindu/sct/model/sexec/provider/ExecutionStateItemProvider.java

@@ -320,6 +320,11 @@ public class ExecutionStateItemProvider
 				(SexecPackage.Literals.EXECUTION_STATE__ENTRY_ACTION,
 				 SexecFactory.eINSTANCE.createTraceStateExited()));
 
+		newChildDescriptors.add
+			(createChildParameter
+				(SexecPackage.Literals.EXECUTION_STATE__ENTRY_ACTION,
+				 SexecFactory.eINSTANCE.createSaveHistory()));
+
 		newChildDescriptors.add
 			(createChildParameter
 				(SexecPackage.Literals.EXECUTION_STATE__EXIT_ACTION,
@@ -394,6 +399,11 @@ public class ExecutionStateItemProvider
 			(createChildParameter
 				(SexecPackage.Literals.EXECUTION_STATE__EXIT_ACTION,
 				 SexecFactory.eINSTANCE.createTraceStateExited()));
+
+		newChildDescriptors.add
+			(createChildParameter
+				(SexecPackage.Literals.EXECUTION_STATE__EXIT_ACTION,
+				 SexecFactory.eINSTANCE.createSaveHistory()));
 	}
 
 	/**

+ 5 - 0
plugins/org.yakindu.sct.model.sexec.edit/src/org/yakindu/sct/model/sexec/provider/ReactionItemProvider.java

@@ -285,6 +285,11 @@ public class ReactionItemProvider
 			(createChildParameter
 				(SexecPackage.Literals.REACTION__EFFECT,
 				 SexecFactory.eINSTANCE.createTraceStateExited()));
+
+		newChildDescriptors.add
+			(createChildParameter
+				(SexecPackage.Literals.REACTION__EFFECT,
+				 SexecFactory.eINSTANCE.createSaveHistory()));
 	}
 
 	/**

+ 139 - 0
plugins/org.yakindu.sct.model.sexec.edit/src/org/yakindu/sct/model/sexec/provider/SaveHistoryItemProvider.java

@@ -0,0 +1,139 @@
+/**
+ * <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.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.yakindu.sct.model.sexec.SaveHistory;
+import org.yakindu.sct.model.sexec.SexecPackage;
+
+/**
+ * This is the item provider adapter for a {@link org.yakindu.sct.model.sexec.SaveHistory} object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class SaveHistoryItemProvider
+	extends StepItemProvider
+	implements
+		IEditingDomainItemProvider,
+		IStructuredItemContentProvider,
+		ITreeItemContentProvider,
+		IItemLabelProvider,
+		IItemPropertySource {
+	/**
+	 * This constructs an instance from a factory and a notifier.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public SaveHistoryItemProvider(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);
+
+			addRegionPropertyDescriptor(object);
+		}
+		return itemPropertyDescriptors;
+	}
+
+	/**
+	 * This adds a property descriptor for the Region feature.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	protected void addRegionPropertyDescriptor(Object object) {
+		itemPropertyDescriptors.add
+			(createItemPropertyDescriptor
+				(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
+				 getResourceLocator(),
+				 getString("_UI_SaveHistory_region_feature"),
+				 getString("_UI_PropertyDescriptor_description", "_UI_SaveHistory_region_feature", "_UI_SaveHistory_type"),
+				 SexecPackage.Literals.SAVE_HISTORY__REGION,
+				 true,
+				 false,
+				 true,
+				 null,
+				 null,
+				 null));
+	}
+
+	/**
+	 * This returns SaveHistory.gif.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	@Override
+	public Object getImage(Object object) {
+		return overlayImage(object, getResourceLocator().getImage("full/obj16/SaveHistory"));
+	}
+
+	/**
+	 * This returns the label text for the adapted class.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	@Override
+	public String getText(Object object) {
+		String label = ((SaveHistory)object).getName();
+		return label == null || label.length() == 0 ?
+			getString("_UI_SaveHistory_type") :
+			getString("_UI_SaveHistory_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);
+	}
+
+}

+ 5 - 0
plugins/org.yakindu.sct.model.sexec.edit/src/org/yakindu/sct/model/sexec/provider/SequenceItemProvider.java

@@ -222,6 +222,11 @@ public class SequenceItemProvider
 			(createChildParameter
 				(SexecPackage.Literals.SEQUENCE__STEPS,
 				 SexecFactory.eINSTANCE.createTraceStateExited()));
+
+		newChildDescriptors.add
+			(createChildParameter
+				(SexecPackage.Literals.SEQUENCE__STEPS,
+				 SexecFactory.eINSTANCE.createSaveHistory()));
 	}
 
 }

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

@@ -648,6 +648,29 @@ public class SexecItemProviderAdapterFactory extends SexecAdapterFactory impleme
 		return traceStateExitedItemProvider;
 	}
 
+	/**
+	 * This keeps track of the one adapter used for all {@link org.yakindu.sct.model.sexec.SaveHistory} instances.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	protected SaveHistoryItemProvider saveHistoryItemProvider;
+
+	/**
+	 * This creates an adapter for a {@link org.yakindu.sct.model.sexec.SaveHistory}.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	@Override
+	public Adapter createSaveHistoryAdapter() {
+		if (saveHistoryItemProvider == null) {
+			saveHistoryItemProvider = new SaveHistoryItemProvider(this);
+		}
+
+		return saveHistoryItemProvider;
+	}
+
 	/**
 	 * This keeps track of the one adapter used for all {@link org.yakindu.sct.model.sexec.CheckRef} instances.
 	 * <!-- begin-user-doc -->
@@ -844,6 +867,7 @@ public class SexecItemProviderAdapterFactory extends SexecAdapterFactory impleme
 		if (reactionFiredItemProvider != null) reactionFiredItemProvider.dispose();
 		if (traceStateEnteredItemProvider != null) traceStateEnteredItemProvider.dispose();
 		if (traceStateExitedItemProvider != null) traceStateExitedItemProvider.dispose();
+		if (saveHistoryItemProvider != null) saveHistoryItemProvider.dispose();
 	}
 
 }

+ 5 - 0
plugins/org.yakindu.sct.model.sexec.edit/src/org/yakindu/sct/model/sexec/provider/StateCaseItemProvider.java

@@ -249,6 +249,11 @@ public class StateCaseItemProvider
 			(createChildParameter
 				(SexecPackage.Literals.STATE_CASE__STEP,
 				 SexecFactory.eINSTANCE.createTraceStateExited()));
+
+		newChildDescriptors.add
+			(createChildParameter
+				(SexecPackage.Literals.STATE_CASE__STEP,
+				 SexecFactory.eINSTANCE.createSaveHistory()));
 	}
 
 	/**

+ 3 - 0
plugins/org.yakindu.sct.model.sexec/model/sexec.ecore

@@ -135,4 +135,7 @@
   <eClassifiers xsi:type="ecore:EClass" name="TraceStateExited" eSuperTypes="#//Trace">
     <eStructuralFeatures xsi:type="ecore:EReference" name="state" eType="#//ExecutionState"/>
   </eClassifiers>
+  <eClassifiers xsi:type="ecore:EClass" name="SaveHistory" eSuperTypes="#//Step">
+    <eStructuralFeatures xsi:type="ecore:EReference" name="region" eType="#//ExecutionRegion"/>
+  </eClassifiers>
 </ecore:EPackage>

+ 3 - 0
plugins/org.yakindu.sct.model.sexec/model/sexec.genmodel

@@ -109,5 +109,8 @@
     <genClasses ecoreClass="sexec.ecore#//TraceStateExited">
       <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference sexec.ecore#//TraceStateExited/state"/>
     </genClasses>
+    <genClasses ecoreClass="sexec.ecore#//SaveHistory">
+      <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference sexec.ecore#//SaveHistory/region"/>
+    </genClasses>
   </genPackages>
 </genmodel:GenModel>

+ 53 - 0
plugins/org.yakindu.sct.model.sexec/src/org/yakindu/sct/model/sexec/SaveHistory.java

@@ -0,0 +1,53 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id$
+ */
+package org.yakindu.sct.model.sexec;
+
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>Save History</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * <ul>
+ *   <li>{@link org.yakindu.sct.model.sexec.SaveHistory#getRegion <em>Region</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @see org.yakindu.sct.model.sexec.SexecPackage#getSaveHistory()
+ * @model
+ * @generated
+ */
+public interface SaveHistory extends Step {
+	/**
+	 * Returns the value of the '<em><b>Region</b></em>' reference.
+	 * <!-- begin-user-doc -->
+	 * <p>
+	 * If the meaning of the '<em>Region</em>' reference isn't clear,
+	 * there really should be more of a description here...
+	 * </p>
+	 * <!-- end-user-doc -->
+	 * @return the value of the '<em>Region</em>' reference.
+	 * @see #setRegion(ExecutionRegion)
+	 * @see org.yakindu.sct.model.sexec.SexecPackage#getSaveHistory_Region()
+	 * @model
+	 * @generated
+	 */
+	ExecutionRegion getRegion();
+
+	/**
+	 * Sets the value of the '{@link org.yakindu.sct.model.sexec.SaveHistory#getRegion <em>Region</em>}' reference.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @param value the new value of the '<em>Region</em>' reference.
+	 * @see #getRegion()
+	 * @generated
+	 */
+	void setRegion(ExecutionRegion value);
+
+} // SaveHistory

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

@@ -250,6 +250,15 @@ public interface SexecFactory extends EFactory {
 	 */
 	TraceStateExited createTraceStateExited();
 
+	/**
+	 * Returns a new object of class '<em>Save History</em>'.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @return a new object of class '<em>Save History</em>'.
+	 * @generated
+	 */
+	SaveHistory createSaveHistory();
+
 	/**
 	 * Returns a new object of class '<em>Check Ref</em>'.
 	 * <!-- begin-user-doc -->

+ 95 - 0
plugins/org.yakindu.sct.model.sexec/src/org/yakindu/sct/model/sexec/SexecPackage.java

@@ -1894,6 +1894,62 @@ public interface SexecPackage extends EPackage {
 	int TRACE_STATE_EXITED_FEATURE_COUNT = TRACE_FEATURE_COUNT + 1;
 
 
+	/**
+	 * The meta object id for the '{@link org.yakindu.sct.model.sexec.impl.SaveHistoryImpl <em>Save History</em>}' class.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @see org.yakindu.sct.model.sexec.impl.SaveHistoryImpl
+	 * @see org.yakindu.sct.model.sexec.impl.SexecPackageImpl#getSaveHistory()
+	 * @generated
+	 */
+	int SAVE_HISTORY = 30;
+
+	/**
+	 * The feature id for the '<em><b>Name</b></em>' attribute.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 * @ordered
+	 */
+	int SAVE_HISTORY__NAME = STEP__NAME;
+
+	/**
+	 * The feature id for the '<em><b>Comment</b></em>' attribute.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 * @ordered
+	 */
+	int SAVE_HISTORY__COMMENT = STEP__COMMENT;
+
+	/**
+	 * The feature id for the '<em><b>Caller</b></em>' reference list.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 * @ordered
+	 */
+	int SAVE_HISTORY__CALLER = STEP__CALLER;
+
+	/**
+	 * The feature id for the '<em><b>Region</b></em>' reference.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 * @ordered
+	 */
+	int SAVE_HISTORY__REGION = STEP_FEATURE_COUNT + 0;
+
+	/**
+	 * The number of structural features of the '<em>Save History</em>' class.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 * @ordered
+	 */
+	int SAVE_HISTORY_FEATURE_COUNT = STEP_FEATURE_COUNT + 1;
+
+
 	/**
 	 * Returns the meta object for class '{@link org.yakindu.sct.model.sexec.ExecutionFlow <em>Execution Flow</em>}'.
 	 * <!-- begin-user-doc -->
@@ -2626,6 +2682,27 @@ public interface SexecPackage extends EPackage {
 	 */
 	EReference getTraceStateExited_State();
 
+	/**
+	 * Returns the meta object for class '{@link org.yakindu.sct.model.sexec.SaveHistory <em>Save History</em>}'.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @return the meta object for class '<em>Save History</em>'.
+	 * @see org.yakindu.sct.model.sexec.SaveHistory
+	 * @generated
+	 */
+	EClass getSaveHistory();
+
+	/**
+	 * Returns the meta object for the reference '{@link org.yakindu.sct.model.sexec.SaveHistory#getRegion <em>Region</em>}'.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @return the meta object for the reference '<em>Region</em>'.
+	 * @see org.yakindu.sct.model.sexec.SaveHistory#getRegion()
+	 * @see #getSaveHistory()
+	 * @generated
+	 */
+	EReference getSaveHistory_Region();
+
 	/**
 	 * Returns the meta object for class '{@link org.yakindu.sct.model.sexec.CheckRef <em>Check Ref</em>}'.
 	 * <!-- begin-user-doc -->
@@ -3328,6 +3405,24 @@ public interface SexecPackage extends EPackage {
 		 */
 		EReference TRACE_STATE_EXITED__STATE = eINSTANCE.getTraceStateExited_State();
 
+		/**
+		 * The meta object literal for the '{@link org.yakindu.sct.model.sexec.impl.SaveHistoryImpl <em>Save History</em>}' class.
+		 * <!-- begin-user-doc -->
+		 * <!-- end-user-doc -->
+		 * @see org.yakindu.sct.model.sexec.impl.SaveHistoryImpl
+		 * @see org.yakindu.sct.model.sexec.impl.SexecPackageImpl#getSaveHistory()
+		 * @generated
+		 */
+		EClass SAVE_HISTORY = eINSTANCE.getSaveHistory();
+
+		/**
+		 * The meta object literal for the '<em><b>Region</b></em>' reference feature.
+		 * <!-- begin-user-doc -->
+		 * <!-- end-user-doc -->
+		 * @generated
+		 */
+		EReference SAVE_HISTORY__REGION = eINSTANCE.getSaveHistory_Region();
+
 		/**
 		 * The meta object literal for the '{@link org.yakindu.sct.model.sexec.impl.CheckRefImpl <em>Check Ref</em>}' class.
 		 * <!-- begin-user-doc -->

+ 160 - 0
plugins/org.yakindu.sct.model.sexec/src/org/yakindu/sct/model/sexec/impl/SaveHistoryImpl.java

@@ -0,0 +1,160 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id$
+ */
+package org.yakindu.sct.model.sexec.impl;
+
+import org.eclipse.emf.common.notify.Notification;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.InternalEObject;
+
+import org.eclipse.emf.ecore.impl.ENotificationImpl;
+
+import org.yakindu.sct.model.sexec.ExecutionRegion;
+import org.yakindu.sct.model.sexec.SaveHistory;
+import org.yakindu.sct.model.sexec.SexecPackage;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>Save History</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * <ul>
+ *   <li>{@link org.yakindu.sct.model.sexec.impl.SaveHistoryImpl#getRegion <em>Region</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public class SaveHistoryImpl extends StepImpl implements SaveHistory {
+	/**
+	 * The cached value of the '{@link #getRegion() <em>Region</em>}' reference.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @see #getRegion()
+	 * @generated
+	 * @ordered
+	 */
+	protected ExecutionRegion region;
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	protected SaveHistoryImpl() {
+		super();
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	@Override
+	protected EClass eStaticClass() {
+		return SexecPackage.Literals.SAVE_HISTORY;
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public ExecutionRegion getRegion() {
+		if (region != null && region.eIsProxy()) {
+			InternalEObject oldRegion = (InternalEObject)region;
+			region = (ExecutionRegion)eResolveProxy(oldRegion);
+			if (region != oldRegion) {
+				if (eNotificationRequired())
+					eNotify(new ENotificationImpl(this, Notification.RESOLVE, SexecPackage.SAVE_HISTORY__REGION, oldRegion, region));
+			}
+		}
+		return region;
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public ExecutionRegion basicGetRegion() {
+		return region;
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public void setRegion(ExecutionRegion newRegion) {
+		ExecutionRegion oldRegion = region;
+		region = newRegion;
+		if (eNotificationRequired())
+			eNotify(new ENotificationImpl(this, Notification.SET, SexecPackage.SAVE_HISTORY__REGION, oldRegion, region));
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	@Override
+	public Object eGet(int featureID, boolean resolve, boolean coreType) {
+		switch (featureID) {
+			case SexecPackage.SAVE_HISTORY__REGION:
+				if (resolve) return getRegion();
+				return basicGetRegion();
+		}
+		return super.eGet(featureID, resolve, coreType);
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	@Override
+	public void eSet(int featureID, Object newValue) {
+		switch (featureID) {
+			case SexecPackage.SAVE_HISTORY__REGION:
+				setRegion((ExecutionRegion)newValue);
+				return;
+		}
+		super.eSet(featureID, newValue);
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	@Override
+	public void eUnset(int featureID) {
+		switch (featureID) {
+			case SexecPackage.SAVE_HISTORY__REGION:
+				setRegion((ExecutionRegion)null);
+				return;
+		}
+		super.eUnset(featureID);
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	@Override
+	public boolean eIsSet(int featureID) {
+		switch (featureID) {
+			case SexecPackage.SAVE_HISTORY__REGION:
+				return region != null;
+		}
+		return super.eIsSet(featureID);
+	}
+
+} //SaveHistoryImpl

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

@@ -109,6 +109,7 @@ public class SexecFactoryImpl extends EFactoryImpl implements SexecFactory {
 			case SexecPackage.REACTION_FIRED: return createReactionFired();
 			case SexecPackage.TRACE_STATE_ENTERED: return createTraceStateEntered();
 			case SexecPackage.TRACE_STATE_EXITED: return createTraceStateExited();
+			case SexecPackage.SAVE_HISTORY: return createSaveHistory();
 			default:
 				throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier");
 		}
@@ -364,6 +365,16 @@ public class SexecFactoryImpl extends EFactoryImpl implements SexecFactory {
 		return traceStateExited;
 	}
 
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public SaveHistory createSaveHistory() {
+		SaveHistoryImpl saveHistory = new SaveHistoryImpl();
+		return saveHistory;
+	}
+
 	/**
 	 * <!-- begin-user-doc -->
 	 * <!-- end-user-doc -->

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

@@ -29,6 +29,7 @@ import org.yakindu.sct.model.sexec.MappedElement;
 import org.yakindu.sct.model.sexec.NamedElement;
 import org.yakindu.sct.model.sexec.Reaction;
 import org.yakindu.sct.model.sexec.ReactionFired;
+import org.yakindu.sct.model.sexec.SaveHistory;
 import org.yakindu.sct.model.sexec.ScheduleTimeEvent;
 import org.yakindu.sct.model.sexec.Sequence;
 import org.yakindu.sct.model.sexec.SexecFactory;
@@ -243,6 +244,13 @@ public class SexecPackageImpl extends EPackageImpl implements SexecPackage {
 	 */
 	private EClass traceStateExitedEClass = null;
 
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	private EClass saveHistoryEClass = null;
+
 	/**
 	 * <!-- begin-user-doc -->
 	 * <!-- end-user-doc -->
@@ -949,6 +957,24 @@ public class SexecPackageImpl extends EPackageImpl implements SexecPackage {
 		return (EReference)traceStateExitedEClass.getEStructuralFeatures().get(0);
 	}
 
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public EClass getSaveHistory() {
+		return saveHistoryEClass;
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public EReference getSaveHistory_Region() {
+		return (EReference)saveHistoryEClass.getEStructuralFeatures().get(0);
+	}
+
 	/**
 	 * <!-- begin-user-doc -->
 	 * <!-- end-user-doc -->
@@ -1145,6 +1171,9 @@ public class SexecPackageImpl extends EPackageImpl implements SexecPackage {
 
 		traceStateExitedEClass = createEClass(TRACE_STATE_EXITED);
 		createEReference(traceStateExitedEClass, TRACE_STATE_EXITED__STATE);
+
+		saveHistoryEClass = createEClass(SAVE_HISTORY);
+		createEReference(saveHistoryEClass, SAVE_HISTORY__REGION);
 	}
 
 	/**
@@ -1209,6 +1238,7 @@ public class SexecPackageImpl extends EPackageImpl implements SexecPackage {
 		reactionFiredEClass.getESuperTypes().add(this.getTrace());
 		traceStateEnteredEClass.getESuperTypes().add(this.getTrace());
 		traceStateExitedEClass.getESuperTypes().add(this.getTrace());
+		saveHistoryEClass.getESuperTypes().add(this.getStep());
 
 		// Initialize classes and features; add operations and parameters
 		initEClass(namedElementEClass, NamedElement.class, "NamedElement", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
@@ -1317,6 +1347,9 @@ public class SexecPackageImpl extends EPackageImpl implements SexecPackage {
 		initEClass(traceStateExitedEClass, TraceStateExited.class, "TraceStateExited", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
 		initEReference(getTraceStateExited_State(), this.getExecutionState(), null, "state", null, 0, 1, TraceStateExited.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
 
+		initEClass(saveHistoryEClass, SaveHistory.class, "SaveHistory", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+		initEReference(getSaveHistory_Region(), this.getExecutionRegion(), null, "region", null, 0, 1, SaveHistory.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+
 		// Create resource
 		createResource(eNS_URI);
 	}

+ 3 - 4
plugins/org.yakindu.sct.model.sexec/src/org/yakindu/sct/model/sexec/transformation/BehaviorMapping.xtend

@@ -38,6 +38,7 @@ import org.yakindu.sct.model.sexec.ExecutionScope
 import org.yakindu.sct.model.sgraph.Region
 import org.yakindu.sct.model.sexec.ExecutionRegion
 import org.yakindu.sct.model.sgraph.Choice
+import org.yakindu.sct.model.sgraph.Entry
  
 
 class BehaviorMapping {
@@ -292,15 +293,13 @@ class BehaviorMapping {
 		// 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
-			
-			
 			// perform entry on the transition path 			
 			if ( t.target instanceof RegularState) {
 				sequence.steps.add((t.target as RegularState).create.enterSequence.newCall )	
 			} else if ( t.target instanceof Choice ) {
 				sequence.steps.add((t.target as Choice).create.reactSequence.newCall )	
+			} else if ( t.target instanceof Entry ) {
+				sequence.steps.add((t.target as Entry).create.reactSequence.newCall )	
 			}
 				
 		}

+ 45 - 14
plugins/org.yakindu.sct.model.sexec/src/org/yakindu/sct/model/sexec/transformation/SequenceBuilder.xtend

@@ -19,6 +19,8 @@ import org.yakindu.sct.model.stext.stext.VariableDefinition
 import org.yakindu.sct.model.stext.stext.AssignmentOperator
 import org.yakindu.sct.model.sexec.ExecutionState
 import org.yakindu.sct.model.sexec.ExecutionScope
+import org.yakindu.sct.model.sgraph.Entry
+import org.yakindu.sct.model.sgraph.EntryKind
 
 class SequenceBuilder {
 	
@@ -51,13 +53,36 @@ class SequenceBuilder {
 		// process all vertices of a region
 		for ( s : r.vertices) defineStateEnterSequence(s)
 
-		val entryState = r.entry?.target?.create
-		if (entryState != null && entryState.enterSequence != null) 
-				seq.steps.add(entryState.enterSequence.newCall);
+		val entryNode = r.entry?.create
+		if (entryNode != null && entryNode.reactSequence != null) {
+			seq.steps.add(entryNode.reactSequence.newCall);
+		}
+// Was before
+//		val entryState = r.entry?.target?.create
+//		if (entryState != null && entryState.enterSequence != null) 
+//				seq.steps.add(entryState.enterSequence.newCall);
 		execState.enterSequence = seq
 	}
 	
 
+	/**
+	 * For entries the EnterSequence is the react part which must be defined before
+	 * the target sequence can be calculated.
+	 */
+	def dispatch void defineStateEnterSequence(Entry e) {
+		val execEntry = e.create
+		val seq = sexec.factory.createSequence
+		seq.name = "reactSequence"
+		seq.comment = "Default react sequence for "+switch (e.kind) {
+				case EntryKind::INITIAL: "initial "
+				case EntryKind::DEEP_HISTORY: "deep history "
+				case EntryKind::SHALLOW_HISTORY: "shallow history "
+				default: ""
+			}+"entry " + e.name
+
+		execEntry.reactSequence = seq
+	}
+
 	def dispatch void defineStateEnterSequence(Vertex v) {
 	}	
 	
@@ -106,17 +131,7 @@ class SequenceBuilder {
 		execState.enterSequence = seq
 	}
 
-	// TODO: refactor - don't access source element...
-	def 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);
-	}
-	
-	
-	
-		/**
+	/**
 	 * Defines the exit sequences of all states
 	 */
 	def void defineStateExitSequences(ExecutionFlow flow, Statechart sc) {
@@ -135,6 +150,10 @@ class SequenceBuilder {
 		// process all states of a region
 		for ( s : r.vertices ) defineStateExitSequence(s)
 		
+		if (r.collectEntries.exists(e|e.kind == EntryKind::DEEP_HISTORY || e.kind == EntryKind::SHALLOW_HISTORY)) {
+			seq.steps += execRegion.newSaveHistory
+		}
+		
 		// collect leaf states
 		val Iterable<ExecutionState> leafStates = r.collectLeafStates(new ArrayList<RegularState>()).map(rs|rs.create)
 		val sVector = execRegion.stateVector
@@ -151,6 +170,18 @@ class SequenceBuilder {
 	}
 	
 	def dispatch void defineStateExitSequence(Vertex v) {}
+
+	def dispatch void defineStateExitSequence(Entry e) {
+		val execEntry = e.create
+		val seq = execEntry.reactSequence
+		val target = e.target.create
+		
+		//TODO consider shallow and deep history
+		if (target != null && target.enterSequence != null) {
+			seq.steps += target.enterSequence.newCall
+		}
+		
+	}
 	
 	def dispatch void defineStateExitSequence(FinalState s) {
 		val execState = s.create

+ 12 - 0
plugins/org.yakindu.sct.model.sexec/src/org/yakindu/sct/model/sexec/transformation/SexecElementMapping.xtend

@@ -53,6 +53,8 @@ import org.yakindu.sct.model.stext.stext.AlwaysEvent
 import org.yakindu.sct.model.stext.stext.DefaultEvent
 import org.yakindu.sct.model.stext.stext.OperationCall
 import org.yakindu.sct.model.stext.stext.Operation
+import org.yakindu.sct.model.sgraph.Entry
+import org.yakindu.sct.model.sexec.ExecutionEntry
  
 
 @Singleton class SexecElementMapping {
@@ -104,6 +106,16 @@ import org.yakindu.sct.model.stext.stext.Operation
 			r.reactSequence = sexecFactory.createSequence
 		}
 	}
+
+
+	def ExecutionEntry create r : sexecFactory.createExecutionEntry create(Entry entry){
+		if (entry != null) {
+			r.simpleName =   {if (!entry.name?.empty) entry.name else "Default"} + "_"
+			r.name = entry.fullyQualifiedName.toString.replaceAll(" ", "")	
+			r.sourceElement = entry	
+			r.reactSequence = sexecFactory.createSequence
+		}
+	}
 	
 	
 	def ExecutionRegion create r : sexecFactory.createExecutionRegion create(Region region){

+ 7 - 1
plugins/org.yakindu.sct.model.sexec/src/org/yakindu/sct/model/sexec/transformation/SexecExtensions.xtend

@@ -51,7 +51,13 @@ class SexecExtensions {
 		sCase.step = step
 		return sCase
 	}
-	
+
+	def newSaveHistory(ExecutionRegion r) {
+		val save = factory.createSaveHistory
+		save.region = r
+		return save
+	}
+
 	def dispatch List<ExecutionState> collectLeafStates(ExecutionState state, List<ExecutionState> leafStates) {
 		if ( state.isLeaf ) 
 			leafStates += state

+ 3 - 0
plugins/org.yakindu.sct.model.sexec/src/org/yakindu/sct/model/sexec/transformation/SgraphExtensions.xtend

@@ -42,6 +42,9 @@ class SgraphExtensions {
 		if (obj?.eContainer != null) collectContainers(obj.eContainer, containerList);
 	}
 
+	def collectEntries(Region r) {
+		r.vertices.filter(typeof(Entry))
+	}
 
 	def entry(Region r) {
 		r.vertices.findFirst(v | v instanceof Entry && (v.name == null || "".equals(v.name) || v.name == 'default') ) as Entry

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

@@ -21,6 +21,7 @@ import org.yakindu.sct.model.stext.stext.ExitEvent
 import org.yakindu.sct.model.stext.stext.ReactionTrigger
 import org.yakindu.sct.model.sgraph.SGraphFactory
 import org.yakindu.sct.model.stext.stext.StextFactory
+import org.yakindu.sct.model.sgraph.Entry
  
 class StatechartExtensions {
 	
@@ -131,6 +132,13 @@ class StatechartExtensions {
 		
 		return allChoices.toList
 	}
+
+	def Iterable<Entry> allEntries(Statechart sc) {
+		var content = EcoreUtil2::eAllContentsAsList(sc)
+		val allEntries = content.filter( typeof(Entry) )
+		
+		return allEntries
+	}
 	
 	
 	def List<LocalReaction> entryReactions(State state) {

+ 4 - 4
plugins/org.yakindu.sct.model.sexec/src/org/yakindu/sct/model/sexec/transformation/StructureMapping.xtend

@@ -112,9 +112,9 @@ class StructureMapping {
 		
 		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
 	}
 	
@@ -124,9 +124,9 @@ class StructureMapping {
 	//
 
 	def ExecutionFlow mapPseudoStates(Statechart statechart, ExecutionFlow r){
-		var content = EcoreUtil2::eAllContentsAsList(statechart)
 		val allChoices = statechart.allChoices
-		r.nodes.addAll( allChoices.map( choice | choice.create ) );
+		r.nodes.addAll( statechart.allChoices.map( choice | choice.create ) );
+		r.nodes.addAll( statechart.allEntries.map( entry | entry.create ) );
 		return r
 	}
 

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

@@ -217,6 +217,10 @@ public class SexecAdapterFactory extends AdapterFactoryImpl {
 				return createTraceStateExitedAdapter();
 			}
 			@Override
+			public Adapter caseSaveHistory(SaveHistory object) {
+				return createSaveHistoryAdapter();
+			}
+			@Override
 			public Adapter caseScopedElement(ScopedElement object) {
 				return createScopedElementAdapter();
 			}
@@ -630,6 +634,20 @@ public class SexecAdapterFactory extends AdapterFactoryImpl {
 		return null;
 	}
 
+	/**
+	 * Creates a new adapter for an object of class '{@link org.yakindu.sct.model.sexec.SaveHistory <em>Save History</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.SaveHistory
+	 * @generated
+	 */
+	public Adapter createSaveHistoryAdapter() {
+		return null;
+	}
+
 	/**
 	 * Creates a new adapter for an object of class '{@link org.yakindu.sct.model.sexec.CheckRef <em>Check Ref</em>}'.
 	 * <!-- begin-user-doc -->

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

@@ -340,6 +340,14 @@ public class SexecSwitch<T> extends Switch<T> {
 				if (result == null) result = defaultCase(theEObject);
 				return result;
 			}
+			case SexecPackage.SAVE_HISTORY: {
+				SaveHistory saveHistory = (SaveHistory)theEObject;
+				T result = caseSaveHistory(saveHistory);
+				if (result == null) result = caseStep(saveHistory);
+				if (result == null) result = caseNamedElement(saveHistory);
+				if (result == null) result = defaultCase(theEObject);
+				return result;
+			}
 			default: return defaultCase(theEObject);
 		}
 	}
@@ -749,6 +757,21 @@ public class SexecSwitch<T> extends Switch<T> {
 		return null;
 	}
 
+	/**
+	 * Returns the result of interpreting the object as an instance of '<em>Save History</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>Save History</em>'.
+	 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+	 * @generated
+	 */
+	public T caseSaveHistory(SaveHistory object) {
+		return null;
+	}
+
 	/**
 	 * Returns the result of interpreting the object as an instance of '<em>Check Ref</em>'.
 	 * <!-- begin-user-doc -->

+ 32 - 28
plugins/org.yakindu.sct.model.sexec/xtend-gen/org/yakindu/sct/model/sexec/transformation/BehaviorMapping.java

@@ -20,6 +20,7 @@ import org.yakindu.sct.model.sexec.Call;
 import org.yakindu.sct.model.sexec.Check;
 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.ExecutionRegion;
 import org.yakindu.sct.model.sexec.ExecutionScope;
@@ -42,8 +43,8 @@ import org.yakindu.sct.model.sexec.transformation.StatechartExtensions;
 import org.yakindu.sct.model.sexec.transformation.StextExtensions;
 import org.yakindu.sct.model.sexec.transformation.TraceExtensions;
 import org.yakindu.sct.model.sgraph.Choice;
-import org.yakindu.sct.model.sgraph.CompositeElement;
 import org.yakindu.sct.model.sgraph.Effect;
+import org.yakindu.sct.model.sgraph.Entry;
 import org.yakindu.sct.model.sgraph.Region;
 import org.yakindu.sct.model.sgraph.RegularState;
 import org.yakindu.sct.model.sgraph.State;
@@ -662,29 +663,32 @@ public class BehaviorMapping {
       Vertex _target = t.getTarget();
       boolean _operator_notEquals_3 = ObjectExtensions.operator_notEquals(_target, null);
       if (_operator_notEquals_3) {
-        {
-          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_1 = t.getTarget();
+        if ((_target_1 instanceof org.yakindu.sct.model.sgraph.RegularState)) {
+          EList<Step> _steps_6 = sequence.getSteps();
           Vertex _target_2 = t.getTarget();
-          if ((_target_2 instanceof org.yakindu.sct.model.sgraph.RegularState)) {
-            EList<Step> _steps_6 = sequence.getSteps();
-            Vertex _target_3 = t.getTarget();
-            ExecutionState _create_1 = this.factory.create(((RegularState) _target_3));
-            Sequence _enterSequence_2 = _create_1.getEnterSequence();
-            Call _newCall_3 = this.factory.newCall(_enterSequence_2);
-            _steps_6.add(_newCall_3);
-          } else {
+          ExecutionState _create_1 = this.factory.create(((RegularState) _target_2));
+          Sequence _enterSequence_2 = _create_1.getEnterSequence();
+          Call _newCall_3 = this.factory.newCall(_enterSequence_2);
+          _steps_6.add(_newCall_3);
+        } else {
+          Vertex _target_3 = t.getTarget();
+          if ((_target_3 instanceof org.yakindu.sct.model.sgraph.Choice)) {
+            EList<Step> _steps_7 = sequence.getSteps();
             Vertex _target_4 = t.getTarget();
-            if ((_target_4 instanceof org.yakindu.sct.model.sgraph.Choice)) {
-              EList<Step> _steps_7 = sequence.getSteps();
-              Vertex _target_5 = t.getTarget();
-              ExecutionChoice _create_2 = this.factory.create(((Choice) _target_5));
-              Sequence _reactSequence = _create_2.getReactSequence();
-              Call _newCall_4 = this.factory.newCall(_reactSequence);
-              _steps_7.add(_newCall_4);
+            ExecutionChoice _create_2 = this.factory.create(((Choice) _target_4));
+            Sequence _reactSequence = _create_2.getReactSequence();
+            Call _newCall_4 = this.factory.newCall(_reactSequence);
+            _steps_7.add(_newCall_4);
+          } else {
+            Vertex _target_5 = t.getTarget();
+            if ((_target_5 instanceof org.yakindu.sct.model.sgraph.Entry)) {
+              EList<Step> _steps_8 = sequence.getSteps();
+              Vertex _target_6 = t.getTarget();
+              ExecutionEntry _create_3 = this.factory.create(((Entry) _target_6));
+              Sequence _reactSequence_1 = _create_3.getReactSequence();
+              Call _newCall_5 = this.factory.newCall(_reactSequence_1);
+              _steps_8.add(_newCall_5);
             }
           }
         }
@@ -699,18 +703,18 @@ public class BehaviorMapping {
                 {
                   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);
+                  final EList<ExecutionScope> siblingRegions_1 = _subScopes_1;
+                  int _indexOf_1 = siblingRegions_1.indexOf(scope_1);
                   int _operator_plus = IntegerExtensions.operator_plus(((Integer)_indexOf_1), ((Integer)1));
-                  Iterable<ExecutionScope> _drop_2 = IterableExtensions.<ExecutionScope>drop(siblingRegions_2, _operator_plus);
+                  Iterable<ExecutionScope> _drop_2 = IterableExtensions.<ExecutionScope>drop(siblingRegions_1, _operator_plus);
                   for (final ExecutionScope region_1 : _drop_2) {
                     Sequence _enterSequence_3 = region_1.getEnterSequence();
                     boolean _operator_notEquals_4 = ObjectExtensions.operator_notEquals(_enterSequence_3, null);
                     if (_operator_notEquals_4) {
-                      EList<Step> _steps_8 = seq_1.getSteps();
+                      EList<Step> _steps_9 = seq_1.getSteps();
                       Sequence _enterSequence_4 = region_1.getEnterSequence();
-                      Call _newCall_5 = BehaviorMapping.this.factory.newCall(_enterSequence_4);
-                      _steps_8.add(_newCall_5);
+                      Call _newCall_6 = BehaviorMapping.this.factory.newCall(_enterSequence_4);
+                      _steps_9.add(_newCall_6);
                     }
                   }
                 }

+ 129 - 63
plugins/org.yakindu.sct.model.sexec/xtend-gen/org/yakindu/sct/model/sexec/transformation/SequenceBuilder.java

@@ -5,7 +5,6 @@ import com.google.inject.name.Named;
 import java.util.ArrayList;
 import java.util.List;
 import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EObject;
 import org.eclipse.emf.ecore.util.EcoreUtil;
 import org.eclipse.xtext.xbase.lib.BooleanExtensions;
 import org.eclipse.xtext.xbase.lib.CollectionExtensions;
@@ -19,11 +18,13 @@ import org.eclipse.xtext.xbase.lib.StringExtensions;
 import org.yakindu.sct.model.sexec.Call;
 import org.yakindu.sct.model.sexec.EnterState;
 import org.yakindu.sct.model.sexec.Execution;
+import org.yakindu.sct.model.sexec.ExecutionEntry;
 import org.yakindu.sct.model.sexec.ExecutionFlow;
 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.SaveHistory;
 import org.yakindu.sct.model.sexec.Sequence;
 import org.yakindu.sct.model.sexec.SexecFactory;
 import org.yakindu.sct.model.sexec.StateCase;
@@ -38,6 +39,7 @@ import org.yakindu.sct.model.sexec.transformation.SgraphExtensions;
 import org.yakindu.sct.model.sexec.transformation.StextExtensions;
 import org.yakindu.sct.model.sexec.transformation.TraceExtensions;
 import org.yakindu.sct.model.sgraph.Entry;
+import org.yakindu.sct.model.sgraph.EntryKind;
 import org.yakindu.sct.model.sgraph.FinalState;
 import org.yakindu.sct.model.sgraph.NamedElement;
 import org.yakindu.sct.model.sgraph.Region;
@@ -98,28 +100,69 @@ public class SequenceBuilder {
         this.defineStateEnterSequence(s);
       }
       Entry _entry = this.sgraph.entry(r);
-      State _target = this.sgraph==null?(State)null:this.sgraph.target(_entry);
-      ExecutionState _create_1 = this.mapping==null?(ExecutionState)null:this.mapping.create(_target);
-      final ExecutionState entryState = _create_1;
+      ExecutionEntry _create_1 = this.mapping==null?(ExecutionEntry)null:this.mapping.create(_entry);
+      final ExecutionEntry entryNode = _create_1;
       boolean _operator_and = false;
-      boolean _operator_notEquals = ObjectExtensions.operator_notEquals(entryState, null);
+      boolean _operator_notEquals = ObjectExtensions.operator_notEquals(entryNode, null);
       if (!_operator_notEquals) {
         _operator_and = false;
       } else {
-        Sequence _enterSequence = entryState.getEnterSequence();
-        boolean _operator_notEquals_1 = ObjectExtensions.operator_notEquals(_enterSequence, null);
+        Sequence _reactSequence = entryNode.getReactSequence();
+        boolean _operator_notEquals_1 = ObjectExtensions.operator_notEquals(_reactSequence, 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.mapping.newCall(_enterSequence_1);
+        Sequence _reactSequence_1 = entryNode.getReactSequence();
+        Call _newCall = this.mapping.newCall(_reactSequence_1);
         _steps.add(_newCall);
       }
       execState.setEnterSequence(seq);
     }
   }
   
+  protected void _defineStateEnterSequence(final Entry e) {
+    {
+      ExecutionEntry _create = this.mapping.create(e);
+      final ExecutionEntry execEntry = _create;
+      SexecFactory _factory = this.sexec.factory();
+      Sequence _createSequence = _factory.createSequence();
+      final Sequence seq = _createSequence;
+      seq.setName("reactSequence");
+      String _switchResult = null;
+      EntryKind _kind = e.getKind();
+      final EntryKind __valOfSwitchOver = _kind;
+      boolean matched = false;
+      if (!matched) {
+        if (org.eclipse.xtext.xbase.lib.ObjectExtensions.operator_equals(__valOfSwitchOver,EntryKind.INITIAL)) {
+          matched=true;
+          _switchResult = "initial ";
+        }
+      }
+      if (!matched) {
+        if (org.eclipse.xtext.xbase.lib.ObjectExtensions.operator_equals(__valOfSwitchOver,EntryKind.DEEP_HISTORY)) {
+          matched=true;
+          _switchResult = "deep history ";
+        }
+      }
+      if (!matched) {
+        if (org.eclipse.xtext.xbase.lib.ObjectExtensions.operator_equals(__valOfSwitchOver,EntryKind.SHALLOW_HISTORY)) {
+          matched=true;
+          _switchResult = "shallow history ";
+        }
+      }
+      if (!matched) {
+        _switchResult = "";
+      }
+      String _operator_plus = StringExtensions.operator_plus("Default react sequence for ", _switchResult);
+      String _operator_plus_1 = StringExtensions.operator_plus(_operator_plus, "entry ");
+      String _name = e.getName();
+      String _operator_plus_2 = StringExtensions.operator_plus(_operator_plus_1, _name);
+      seq.setComment(_operator_plus_2);
+      execEntry.setReactSequence(seq);
+    }
+  }
+  
   protected void _defineStateEnterSequence(final Vertex v) {
   }
   
@@ -205,36 +248,6 @@ public class SequenceBuilder {
     }
   }
   
-  public Boolean addEnterRegion(final Sequence seq, final ExecutionRegion r) {
-    Boolean _xblockexpression = null;
-    {
-      EObject _sourceElement = r.getSourceElement();
-      Entry _entry = this.sgraph.entry(((Region) _sourceElement));
-      State _target = this.sgraph==null?(State)null:this.sgraph.target(_entry);
-      ExecutionState _create = this.mapping==null?(ExecutionState)null:this.mapping.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.mapping.newCall(_enterSequence_1);
-        boolean _add = _steps.add(_newCall);
-        _xifexpression = _add;
-      }
-      _xblockexpression = (_xifexpression);
-    }
-    return _xblockexpression;
-  }
-  
   public void defineStateExitSequences(final ExecutionFlow flow, final Statechart sc) {
     EList<Region> _regions = sc.getRegions();
     for (final Region r : _regions) {
@@ -257,15 +270,37 @@ public class SequenceBuilder {
       for (final Vertex s : _vertices) {
         this.defineStateExitSequence(s);
       }
+      Iterable<Entry> _collectEntries = this.sgraph.collectEntries(r);
+      final Function1<Entry,Boolean> _function = new Function1<Entry,Boolean>() {
+          public Boolean apply(final Entry e) {
+            boolean _operator_or = false;
+            EntryKind _kind = e.getKind();
+            boolean _operator_equals = ObjectExtensions.operator_equals(_kind, EntryKind.DEEP_HISTORY);
+            if (_operator_equals) {
+              _operator_or = true;
+            } else {
+              EntryKind _kind_1 = e.getKind();
+              boolean _operator_equals_1 = ObjectExtensions.operator_equals(_kind_1, EntryKind.SHALLOW_HISTORY);
+              _operator_or = BooleanExtensions.operator_or(_operator_equals, _operator_equals_1);
+            }
+            return ((Boolean)_operator_or);
+          }
+        };
+      boolean _exists = IterableExtensions.<Entry>exists(_collectEntries, _function);
+      if (_exists) {
+        EList<Step> _steps = seq.getSteps();
+        SaveHistory _newSaveHistory = this.sexec.newSaveHistory(execRegion);
+        CollectionExtensions.<Step>operator_add(_steps, _newSaveHistory);
+      }
       ArrayList<RegularState> _arrayList = new ArrayList<RegularState>();
       List<RegularState> _collectLeafStates = this.sgraph.collectLeafStates(r, _arrayList);
-      final Function1<RegularState,ExecutionState> _function = new Function1<RegularState,ExecutionState>() {
+      final Function1<RegularState,ExecutionState> _function_1 = new Function1<RegularState,ExecutionState>() {
           public ExecutionState apply(final RegularState rs) {
             ExecutionState _create_1 = SequenceBuilder.this.mapping.create(rs);
             return _create_1;
           }
         };
-      List<ExecutionState> _map = ListExtensions.<RegularState, ExecutionState>map(_collectLeafStates, _function);
+      List<ExecutionState> _map = ListExtensions.<RegularState, ExecutionState>map(_collectLeafStates, _function_1);
       final Iterable<ExecutionState> leafStates = _map;
       StateVector _stateVector = execRegion.getStateVector();
       final StateVector sVector = _stateVector;
@@ -279,8 +314,8 @@ public class SequenceBuilder {
         {
           StateSwitch _defineExitSwitch = this.defineExitSwitch(execRegion, leafStates, i);
           final StateSwitch sSwitch = _defineExitSwitch;
-          EList<Step> _steps = seq.getSteps();
-          _steps.add(sSwitch);
+          EList<Step> _steps_1 = seq.getSteps();
+          _steps_1.add(sSwitch);
         }
       }
       execRegion.setExitSequence(seq);
@@ -290,6 +325,33 @@ public class SequenceBuilder {
   protected void _defineStateExitSequence(final Vertex v) {
   }
   
+  protected void _defineStateExitSequence(final Entry e) {
+    {
+      ExecutionEntry _create = this.mapping.create(e);
+      final ExecutionEntry execEntry = _create;
+      Sequence _reactSequence = execEntry.getReactSequence();
+      final Sequence seq = _reactSequence;
+      State _target = this.sgraph.target(e);
+      ExecutionState _create_1 = this.mapping.create(_target);
+      final ExecutionState target = _create_1;
+      boolean _operator_and = false;
+      boolean _operator_notEquals = ObjectExtensions.operator_notEquals(target, null);
+      if (!_operator_notEquals) {
+        _operator_and = false;
+      } else {
+        Sequence _enterSequence = target.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 = target.getEnterSequence();
+        Call _newCall = this.mapping.newCall(_enterSequence_1);
+        CollectionExtensions.<Step>operator_add(_steps, _newCall);
+      }
+    }
+  }
+  
   protected void _defineStateExitSequence(final FinalState s) {
     {
       ExecutionState _create = this.mapping.create(s);
@@ -560,33 +622,37 @@ public class SequenceBuilder {
     }
   }
   
-  public void defineStateEnterSequence(final NamedElement state) {
-    if ((state instanceof FinalState)) {
-      _defineStateEnterSequence((FinalState)state);
-    } else if ((state instanceof State)) {
-      _defineStateEnterSequence((State)state);
-    } else if ((state instanceof Region)) {
-      _defineStateEnterSequence((Region)state);
-    } else if ((state instanceof Vertex)) {
-      _defineStateEnterSequence((Vertex)state);
+  public void defineStateEnterSequence(final NamedElement e) {
+    if ((e instanceof Entry)) {
+      _defineStateEnterSequence((Entry)e);
+    } else if ((e instanceof FinalState)) {
+      _defineStateEnterSequence((FinalState)e);
+    } else if ((e instanceof State)) {
+      _defineStateEnterSequence((State)e);
+    } else if ((e instanceof Region)) {
+      _defineStateEnterSequence((Region)e);
+    } else if ((e instanceof Vertex)) {
+      _defineStateEnterSequence((Vertex)e);
     } else {
       throw new IllegalArgumentException("Unhandled parameter types: " +
-        java.util.Arrays.<Object>asList(state).toString());
+        java.util.Arrays.<Object>asList(e).toString());
     }
   }
   
-  public void defineStateExitSequence(final NamedElement s) {
-    if ((s instanceof FinalState)) {
-      _defineStateExitSequence((FinalState)s);
-    } else if ((s instanceof State)) {
-      _defineStateExitSequence((State)s);
-    } else if ((s instanceof Region)) {
-      _defineStateExitSequence((Region)s);
-    } else if ((s instanceof Vertex)) {
-      _defineStateExitSequence((Vertex)s);
+  public void defineStateExitSequence(final NamedElement e) {
+    if ((e instanceof Entry)) {
+      _defineStateExitSequence((Entry)e);
+    } else if ((e instanceof FinalState)) {
+      _defineStateExitSequence((FinalState)e);
+    } else if ((e instanceof State)) {
+      _defineStateExitSequence((State)e);
+    } else if ((e instanceof Region)) {
+      _defineStateExitSequence((Region)e);
+    } else if ((e instanceof Vertex)) {
+      _defineStateExitSequence((Vertex)e);
     } else {
       throw new IllegalArgumentException("Unhandled parameter types: " +
-        java.util.Arrays.<Object>asList(s).toString());
+        java.util.Arrays.<Object>asList(e).toString());
     }
   }
 }

+ 60 - 15
plugins/org.yakindu.sct.model.sexec/xtend-gen/org/yakindu/sct/model/sexec/transformation/SexecElementMapping.java

@@ -9,6 +9,7 @@ import org.eclipse.emf.common.util.EList;
 import org.eclipse.emf.ecore.util.EcoreUtil;
 import org.eclipse.xtext.naming.IQualifiedNameProvider;
 import org.eclipse.xtext.naming.QualifiedName;
+import org.eclipse.xtext.xbase.lib.BooleanExtensions;
 import org.eclipse.xtext.xbase.lib.CollectionLiterals;
 import org.eclipse.xtext.xbase.lib.IterableExtensions;
 import org.eclipse.xtext.xbase.lib.ObjectExtensions;
@@ -17,6 +18,7 @@ import org.yakindu.sct.model.sexec.Call;
 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.ExecutionEntry;
 import org.yakindu.sct.model.sexec.ExecutionFlow;
 import org.yakindu.sct.model.sexec.ExecutionRegion;
 import org.yakindu.sct.model.sexec.ExecutionState;
@@ -31,6 +33,7 @@ import org.yakindu.sct.model.sexec.transformation.SgraphExtensions;
 import org.yakindu.sct.model.sexec.transformation.StatechartExtensions;
 import org.yakindu.sct.model.sexec.transformation.StextExtensions;
 import org.yakindu.sct.model.sgraph.Choice;
+import org.yakindu.sct.model.sgraph.Entry;
 import org.yakindu.sct.model.sgraph.Event;
 import org.yakindu.sct.model.sgraph.Reaction;
 import org.yakindu.sct.model.sgraph.Region;
@@ -276,19 +279,61 @@ public class SexecElementMapping {
     return r;
   }
   
-  private final HashMap<ArrayList<?>,ExecutionRegion> _createCache_create_8 = new HashMap<ArrayList<?>,ExecutionRegion>();
+  private final HashMap<ArrayList<?>,ExecutionEntry> _createCache_create_8 = new HashMap<ArrayList<?>,ExecutionEntry>();
   
-  public ExecutionRegion create(final Region region) {
-    final ArrayList<?>_cacheKey = CollectionLiterals.newArrayList(region);
-    final ExecutionRegion r;
+  public ExecutionEntry create(final Entry entry) {
+    final ArrayList<?>_cacheKey = CollectionLiterals.newArrayList(entry);
+    final ExecutionEntry r;
     synchronized (_createCache_create_8) {
       if (_createCache_create_8.containsKey(_cacheKey)) {
         return _createCache_create_8.get(_cacheKey);
       }
       SexecFactory _sexecFactory = this.sexecFactory();
+      ExecutionEntry _createExecutionEntry = _sexecFactory.createExecutionEntry();
+      r = _createExecutionEntry;
+      _createCache_create_8.put(_cacheKey, r);
+    }
+    boolean _operator_notEquals = ObjectExtensions.operator_notEquals(entry, null);
+    if (_operator_notEquals) {
+      {
+        String _xifexpression = null;
+        String _name = entry.getName();
+        boolean _isEmpty = _name==null?false:_name.isEmpty();
+        boolean _operator_not = BooleanExtensions.operator_not(_isEmpty);
+        if (_operator_not) {
+          String _name_1 = entry.getName();
+          _xifexpression = _name_1;
+        } else {
+          _xifexpression = "Default";
+        }
+        String _operator_plus = StringExtensions.operator_plus(_xifexpression, "_");
+        r.setSimpleName(_operator_plus);
+        QualifiedName _fullyQualifiedName = this.qfnProvider.getFullyQualifiedName(entry);
+        String _string = _fullyQualifiedName.toString();
+        String _replaceAll = _string.replaceAll(" ", "");
+        r.setName(_replaceAll);
+        r.setSourceElement(entry);
+        SexecFactory _sexecFactory_1 = this.sexecFactory();
+        Sequence _createSequence = _sexecFactory_1.createSequence();
+        r.setReactSequence(_createSequence);
+      }
+    }
+    return r;
+  }
+  
+  private final HashMap<ArrayList<?>,ExecutionRegion> _createCache_create_9 = new HashMap<ArrayList<?>,ExecutionRegion>();
+  
+  public ExecutionRegion create(final Region region) {
+    final ArrayList<?>_cacheKey = CollectionLiterals.newArrayList(region);
+    final ExecutionRegion r;
+    synchronized (_createCache_create_9) {
+      if (_createCache_create_9.containsKey(_cacheKey)) {
+        return _createCache_create_9.get(_cacheKey);
+      }
+      SexecFactory _sexecFactory = this.sexecFactory();
       ExecutionRegion _createExecutionRegion = _sexecFactory.createExecutionRegion();
       r = _createExecutionRegion;
-      _createCache_create_8.put(_cacheKey, r);
+      _createCache_create_9.put(_cacheKey, r);
     }
     boolean _operator_notEquals = ObjectExtensions.operator_notEquals(region, null);
     if (_operator_notEquals) {
@@ -321,19 +366,19 @@ public class SexecElementMapping {
     return r;
   }
   
-  private final HashMap<ArrayList<?>,org.yakindu.sct.model.sexec.Reaction> _createCache_create_9 = new HashMap<ArrayList<?>,org.yakindu.sct.model.sexec.Reaction>();
+  private final HashMap<ArrayList<?>,org.yakindu.sct.model.sexec.Reaction> _createCache_create_10 = 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);
     final org.yakindu.sct.model.sexec.Reaction r;
-    synchronized (_createCache_create_9) {
-      if (_createCache_create_9.containsKey(_cacheKey)) {
-        return _createCache_create_9.get(_cacheKey);
+    synchronized (_createCache_create_10) {
+      if (_createCache_create_10.containsKey(_cacheKey)) {
+        return _createCache_create_10.get(_cacheKey);
       }
       SexecFactory _sexecFactory = this.sexecFactory();
       org.yakindu.sct.model.sexec.Reaction _createReaction = _sexecFactory.createReaction();
       r = _createReaction;
-      _createCache_create_9.put(_cacheKey, r);
+      _createCache_create_10.put(_cacheKey, r);
     }
     {
       String _id = this.sce.id(tr);
@@ -344,19 +389,19 @@ public class SexecElementMapping {
     return r;
   }
   
-  private final HashMap<ArrayList<?>,org.yakindu.sct.model.sexec.Reaction> _createCache_create_10 = new HashMap<ArrayList<?>,org.yakindu.sct.model.sexec.Reaction>();
+  private final HashMap<ArrayList<?>,org.yakindu.sct.model.sexec.Reaction> _createCache_create_11 = 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);
     final org.yakindu.sct.model.sexec.Reaction r;
-    synchronized (_createCache_create_10) {
-      if (_createCache_create_10.containsKey(_cacheKey)) {
-        return _createCache_create_10.get(_cacheKey);
+    synchronized (_createCache_create_11) {
+      if (_createCache_create_11.containsKey(_cacheKey)) {
+        return _createCache_create_11.get(_cacheKey);
       }
       SexecFactory _sexecFactory = this.sexecFactory();
       org.yakindu.sct.model.sexec.Reaction _createReaction = _sexecFactory.createReaction();
       r = _createReaction;
-      _createCache_create_10.put(_cacheKey, r);
+      _createCache_create_11.put(_cacheKey, r);
     }
     {
       String _id = this.sce.id(lr);

+ 11 - 0
plugins/org.yakindu.sct.model.sexec/xtend-gen/org/yakindu/sct/model/sexec/transformation/SexecExtensions.java

@@ -12,6 +12,7 @@ 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.SaveHistory;
 import org.yakindu.sct.model.sexec.SexecFactory;
 import org.yakindu.sct.model.sexec.StateCase;
 import org.yakindu.sct.model.sexec.StateVector;
@@ -67,6 +68,16 @@ public class SexecExtensions {
     }
   }
   
+  public SaveHistory newSaveHistory(final ExecutionRegion r) {
+    {
+      SexecFactory _factory = this.factory();
+      SaveHistory _createSaveHistory = _factory.createSaveHistory();
+      final SaveHistory save = _createSaveHistory;
+      save.setRegion(r);
+      return save;
+    }
+  }
+  
   protected List<ExecutionState> _collectLeafStates(final ExecutionState state, final List<ExecutionState> leafStates) {
     {
       boolean _isLeaf = state.isLeaf();

+ 6 - 0
plugins/org.yakindu.sct.model.sexec/xtend-gen/org/yakindu/sct/model/sexec/transformation/SgraphExtensions.java

@@ -74,6 +74,12 @@ public class SgraphExtensions {
     }
   }
   
+  public Iterable<Entry> collectEntries(final Region r) {
+    EList<Vertex> _vertices = r.getVertices();
+    Iterable<Entry> _filter = IterableExtensions.<Entry>filter(_vertices, org.yakindu.sct.model.sgraph.Entry.class);
+    return _filter;
+  }
+  
   public Entry entry(final Region r) {
     EList<Vertex> _vertices = r.getVertices();
     final Function1<Vertex,Boolean> _function = new Function1<Vertex,Boolean>() {

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

@@ -13,6 +13,7 @@ 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.Entry;
 import org.yakindu.sct.model.sgraph.Reaction;
 import org.yakindu.sct.model.sgraph.ReactiveElement;
 import org.yakindu.sct.model.sgraph.Region;
@@ -238,6 +239,16 @@ public class StatechartExtensions {
     }
   }
   
+  public Iterable<Entry> allEntries(final Statechart sc) {
+    {
+      List<EObject> _eAllContentsAsList = EcoreUtil2.eAllContentsAsList(sc);
+      List<EObject> content = _eAllContentsAsList;
+      Iterable<Entry> _filter = IterableExtensions.<Entry>filter(content, org.yakindu.sct.model.sgraph.Entry.class);
+      final Iterable<Entry> allEntries = _filter;
+      return allEntries;
+    }
+  }
+  
   public List<LocalReaction> entryReactions(final State state) {
     EList<Reaction> _localReactions = state.getLocalReactions();
     final Function1<Reaction,Boolean> _function = new Function1<Reaction,Boolean>() {

+ 14 - 3
plugins/org.yakindu.sct.model.sexec/xtend-gen/org/yakindu/sct/model/sexec/transformation/StructureMapping.java

@@ -13,6 +13,7 @@ import org.eclipse.xtext.xbase.lib.ListExtensions;
 import org.eclipse.xtext.xbase.lib.ObjectExtensions;
 import org.eclipse.xtext.xbase.lib.StringExtensions;
 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;
@@ -24,6 +25,7 @@ import org.yakindu.sct.model.sexec.transformation.StatechartExtensions;
 import org.yakindu.sct.model.sgraph.Choice;
 import org.yakindu.sct.model.sgraph.CompositeElement;
 import org.yakindu.sct.model.sgraph.Declaration;
+import org.yakindu.sct.model.sgraph.Entry;
 import org.yakindu.sct.model.sgraph.FinalState;
 import org.yakindu.sct.model.sgraph.Region;
 import org.yakindu.sct.model.sgraph.RegularState;
@@ -206,19 +208,28 @@ public class StructureMapping {
   
   public ExecutionFlow mapPseudoStates(final Statechart statechart, final ExecutionFlow r) {
     {
-      List<EObject> _eAllContentsAsList = EcoreUtil2.eAllContentsAsList(statechart);
-      List<EObject> content = _eAllContentsAsList;
       List<Choice> _allChoices = this.sct.allChoices(statechart);
       final List<Choice> allChoices = _allChoices;
       EList<ExecutionNode> _nodes = r.getNodes();
+      List<Choice> _allChoices_1 = this.sct.allChoices(statechart);
       final Function1<Choice,ExecutionChoice> _function = new Function1<Choice,ExecutionChoice>() {
           public ExecutionChoice apply(final Choice choice) {
             ExecutionChoice _create = StructureMapping.this.mapping.create(choice);
             return _create;
           }
         };
-      List<ExecutionChoice> _map = ListExtensions.<Choice, ExecutionChoice>map(allChoices, _function);
+      List<ExecutionChoice> _map = ListExtensions.<Choice, ExecutionChoice>map(_allChoices_1, _function);
       _nodes.addAll(_map);
+      EList<ExecutionNode> _nodes_1 = r.getNodes();
+      Iterable<Entry> _allEntries = this.sct.allEntries(statechart);
+      final Function1<Entry,ExecutionEntry> _function_1 = new Function1<Entry,ExecutionEntry>() {
+          public ExecutionEntry apply(final Entry entry) {
+            ExecutionEntry _create_1 = StructureMapping.this.mapping.create(entry);
+            return _create_1;
+          }
+        };
+      Iterable<ExecutionEntry> _map_1 = IterableExtensions.<Entry, ExecutionEntry>map(_allEntries, _function_1);
+      CollectionExtensions.<ExecutionNode>addAll(_nodes_1, _map_1);
       return r;
     }
   }

+ 19 - 0
plugins/org.yakindu.sct.model.sgraph/src/org/yakindu/sct/model/sgraph/naming/SGraphNameProvider.java

@@ -22,6 +22,7 @@ import org.eclipse.xtext.util.SimpleAttributeResolver;
 import org.eclipse.xtext.util.Strings;
 import org.yakindu.sct.model.sgraph.Choice;
 import org.yakindu.sct.model.sgraph.Declaration;
+import org.yakindu.sct.model.sgraph.Entry;
 import org.yakindu.sct.model.sgraph.FinalState;
 import org.yakindu.sct.model.sgraph.Region;
 import org.yakindu.sct.model.sgraph.Scope;
@@ -43,6 +44,8 @@ import com.google.inject.Inject;
  */
 public class SGraphNameProvider extends DefaultDeclarativeQualifiedNameProvider {
 
+	private static final QualifiedName DEFAULT_ENTRY_NAME = QualifiedName
+			.create("Default");
 	private static final String _FINAL_STATE_NAME = "_final_";
 	private static final String _CHOICE_NAME = "_choice_";
 
@@ -89,6 +92,22 @@ public class SGraphNameProvider extends DefaultDeclarativeQualifiedNameProvider
 		return qualifiedNameFromConverter;
 	}
 
+	public QualifiedName qualifiedName(Entry ele) {
+
+		QualifiedName name = DEFAULT_ENTRY_NAME;
+		if (ele.getName() != null && !ele.getName().isEmpty()) {
+			name = QualifiedName.create(ele.getName());
+		}
+		EObject temp = ele;
+		while (temp.eContainer() != null) {
+			temp = temp.eContainer();
+			QualifiedName parentsQualifiedName = getFullyQualifiedName(temp);
+			if (parentsQualifiedName != null)
+				return parentsQualifiedName.append(name);
+		}
+		return name;
+	}
+
 	public QualifiedName qualifiedName(Scope ele) {
 		QualifiedName name = null;
 		String nameString = SimpleAttributeResolver.NAME_RESOLVER.apply(ele);

+ 7 - 9
test-plugins/org.yakindu.sct.model.sexec.test/src/org/yakindu/sct/model/sexec/transformation/test/AllTests.java

@@ -5,14 +5,12 @@ import org.junit.runners.Suite;
 import org.junit.runners.Suite.SuiteClasses;
 
 @RunWith(Suite.class)
-@SuiteClasses({
-	ModelSequencerSCTest.class,
-	ModelSequencertDeclarationsTest.class,
-	ModelSequencerStateTest.class,
-	ModelSequencerStateReactionTest.class,
-	ModelSequencerHierarchyTest.class,
-	ModelSequencerOrthogonalityTest.class,
-	ModelSequencerStateVectorTest.class})
+@SuiteClasses({ ModelSequencerSCTest.class,
+		ModelSequencertDeclarationsTest.class, ModelSequencerStateTest.class,
+		ModelSequencerStateReactionTest.class,
+		ModelSequencerHierarchyTest.class,
+		ModelSequencerOrthogonalityTest.class,
+		ModelSequencerStateVectorTest.class, ModelSequencerHistoryTest.class })
 public class AllTests {
-	
+
 }

+ 113 - 0
test-plugins/org.yakindu.sct.model.sexec.test/src/org/yakindu/sct/model/sexec/transformation/test/ModelSequencerHistoryTest.java

@@ -0,0 +1,113 @@
+package org.yakindu.sct.model.sexec.transformation.test;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.yakindu.sct.model.sexec.transformation.test.SCTTestUtil.TYPE_INTEGER;
+import static org.yakindu.sct.model.sexec.transformation.test.SCTTestUtil._createEntry;
+import static org.yakindu.sct.model.sexec.transformation.test.SCTTestUtil._createEntryAssignment;
+import static org.yakindu.sct.model.sexec.transformation.test.SCTTestUtil._createInterfaceScope;
+import static org.yakindu.sct.model.sexec.transformation.test.SCTTestUtil._createRegion;
+import static org.yakindu.sct.model.sexec.transformation.test.SCTTestUtil._createState;
+import static org.yakindu.sct.model.sexec.transformation.test.SCTTestUtil._createStatechart;
+import static org.yakindu.sct.model.sexec.transformation.test.SCTTestUtil._createTransition;
+import static org.yakindu.sct.model.sexec.transformation.test.SCTTestUtil._createVariableDefinition;
+import static org.yakindu.sct.model.sexec.transformation.test.SCTTestUtil.findState;
+
+import org.eclipse.emf.common.util.EList;
+import org.junit.Test;
+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.ExecutionState;
+import org.yakindu.sct.model.sexec.Reaction;
+import org.yakindu.sct.model.sexec.SaveHistory;
+import org.yakindu.sct.model.sexec.Sequence;
+import org.yakindu.sct.model.sexec.Step;
+import org.yakindu.sct.model.sexec.transformation.test.SCTTestUtil.MinimalTSC;
+import org.yakindu.sct.model.sexec.transformation.test.SCTTestUtil.InitializingTSC;
+import org.yakindu.sct.model.sexec.transformation.test.SCTTestUtil.OrthogonalFlatTSC;
+import org.yakindu.sct.model.sexec.transformation.test.SCTTestUtil.SimpleFlatTSC;
+import org.yakindu.sct.model.sgraph.Entry;
+import org.yakindu.sct.model.sgraph.EntryKind;
+import org.yakindu.sct.model.sgraph.Region;
+import org.yakindu.sct.model.sgraph.State;
+import org.yakindu.sct.model.sgraph.Statechart;
+import org.yakindu.sct.model.sgraph.Transition;
+import org.yakindu.sct.model.stext.stext.AssignmentOperator;
+import org.yakindu.sct.model.stext.stext.InterfaceScope;
+import org.yakindu.sct.model.stext.stext.VariableDefinition;
+
+public class ModelSequencerHistoryTest extends ModelSequencerTest {
+
+	@Test
+	public void testFlowName() {
+		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);
+				State s2 = _createState("s2", r);
+				{
+
+					Region r2 = _createRegion("r2", s2);
+					{
+						Entry r2_entry1 = _createEntry(
+								EntryKind.SHALLOW_HISTORY, null, r2);
+						Entry r2_entry2 = _createEntry(EntryKind.INITIAL,
+								"Unused_Backup", r2);
+						State s3 = _createState("s3", r2);
+						State s4 = _createState("s4", r2);
+						_createTransition(r2_entry1, s3);
+						_createTransition(r2_entry2, s4);
+						_createTransition(s1, r2_entry1);
+					}
+
+				}
+				_createTransition(s1, s2);
+				Transition _t = _createTransition(s1, s2);
+				_createTransition(r_entry, s1);
+			}
+		}
+
+		ExecutionFlow flow = sequencer.transform(sc);
+
+		ExecutionState _s1 = flow.getStates().get(0);
+		assertEquals("sc.r.s1", _s1.getName());
+		ExecutionState _s2 = flow.getStates().get(1);
+		assertEquals("sc.r.s2", _s2.getName());
+		ExecutionState _s3 = flow.getStates().get(2);
+		assertEquals("sc.r.s2.r2.s3", _s3.getName());
+		ExecutionState _s4 = flow.getStates().get(3);
+		assertEquals("sc.r.s2.r2.s4", _s4.getName());
+		ExecutionNode r2_history_entry = flow.getNodes().get(1);
+
+		EList<Reaction> _t1 = _s1.getReactions();
+		Sequence reactSequence_history = flow.getNodes().get(1)
+				.getReactSequence();
+		assertCall(reactSequence_history, 0, _s3.getEnterSequence());
+		Reaction reaction_history = _t1.get(0);
+		assertCall(assertedSequence(reaction_history.getEffect()), 1,
+				reactSequence_history);
+
+		Sequence reactSequence_initial = flow.getNodes().get(2)
+				.getReactSequence();
+		assertCall(reactSequence_initial, 0, _s4.getEnterSequence());
+		Reaction reaction = _t1.get(1);
+		assertCall(assertedSequence(reaction.getEffect()), 1,
+				_s2.getEnterSequence());
+
+		assertCall(_s3.getSuperScope().getEnterSequence(), 0,
+				r2_history_entry.getReactSequence());
+
+		Step saveStep = _s3.getSuperScope().getExitSequence().getSteps().get(0);
+		assertTrue(saveStep.eClass().toString(),
+				saveStep instanceof SaveHistory);
+	}
+}

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

@@ -146,12 +146,12 @@ public class ModelSequencerOrthogonalityTest extends ModelSequencerTest {
 
 		assertCall(_effect, 0, _s5.getExitSequence());
 		assertCall(_effect, 1, _s2.getSuperScope().getEnterSequence());
-		assertCall(_s2.getSuperScope().getEnterSequence(), 0,
-				_s2.getEnterSequence());
+		assertCall(_s2.getSuperScope().getEnterSequence(), 0, flow.getNodes()
+				.get(1).getReactSequence());
 		assertCall(_effect, 2, _s3.getEnterSequence());
 		assertCall(_effect, 3, _s4.getSuperScope().getEnterSequence());
-		assertCall(_s4.getSuperScope().getEnterSequence(), 0,
-				_s4.getEnterSequence());
+		assertCall(_s4.getSuperScope().getEnterSequence(), 0, flow.getNodes()
+				.get(3).getReactSequence());
 	}
 
 	/**
@@ -255,19 +255,19 @@ public class ModelSequencerOrthogonalityTest extends ModelSequencerTest {
 
 		assertCall(_effect, 0, _s5.getExitSequence());
 		assertCall(_effect, 1, _s2.getSuperScope().getEnterSequence());
-		assertCall(_s2.getSuperScope().getEnterSequence(), 0,
-				_s2.getEnterSequence());
+		assertCall(_s2.getSuperScope().getEnterSequence(), 0, flow.getNodes()
+				.get(1).getReactSequence());
 		assertCall(_effect, 2, _s3.getEntryAction());
 		assertCall(_effect, 3, _s3a.getSuperScope().getEnterSequence());
-		assertCall(_s3a.getSuperScope().getEnterSequence(), 0,
-				_s3a.getEnterSequence());
+		assertCall(_s3a.getSuperScope().getEnterSequence(), 0, flow.getNodes()
+				.get(3).getReactSequence());
 		assertCall(_effect, 4, _s3b.getEnterSequence());
 		assertCall(_effect, 5, _s3c.getSuperScope().getEnterSequence());
-		assertCall(_s3c.getSuperScope().getEnterSequence(), 0,
-				_s3c.getEnterSequence());
+		assertCall(_s3c.getSuperScope().getEnterSequence(), 0, flow.getNodes()
+				.get(5).getReactSequence());
 		assertCall(_effect, 6, _s4.getSuperScope().getEnterSequence());
-		assertCall(_s4.getSuperScope().getEnterSequence(), 0,
-				_s4.getEnterSequence());
+		assertCall(_s4.getSuperScope().getEnterSequence(), 0, flow.getNodes()
+				.get(6).getReactSequence());
 	}
 
 	/**
@@ -484,12 +484,12 @@ public class ModelSequencerOrthogonalityTest extends ModelSequencerTest {
 		assertCall(_effect, 0, _s3z.getExitSequence());
 		assertCall(_effect, 1, _s3.getEntryAction());
 		assertCall(_effect, 2, _s3a.getSuperScope().getEnterSequence());
-		assertCall(_s3a.getSuperScope().getEnterSequence(), 0,
-				_s3a.getEnterSequence());
+		assertCall(_s3a.getSuperScope().getEnterSequence(), 0, flow.getNodes()
+				.get(3).getReactSequence());
 		assertCall(_effect, 3, _s3b2.getEnterSequence());
 		assertCall(_effect, 4, _s3c.getSuperScope().getEnterSequence());
-		assertCall(_s3c.getSuperScope().getEnterSequence(), 0,
-				_s3c.getEnterSequence());
+		assertCall(_s3c.getSuperScope().getEnterSequence(), 0, flow.getNodes()
+				.get(5).getReactSequence());
 	}
 
 	/*

+ 9 - 3
test-plugins/org.yakindu.sct.model.sexec.test/src/org/yakindu/sct/model/sexec/transformation/test/ModelSequencerSCTest.java

@@ -40,7 +40,9 @@ public class ModelSequencerSCTest extends ModelSequencerTest {
 				.getSuperScope().getEnterSequence());
 
 		assertCall(flow.getStates().get(0).getSuperScope().getEnterSequence(),
-				0, flow.getStates().get(0).getEnterSequence());
+				0, flow.getNodes().get(0).getReactSequence());
+		assertCall(flow.getNodes().get(0).getReactSequence(), 0, flow
+				.getStates().get(0).getEnterSequence());
 	}
 
 	/**
@@ -58,12 +60,16 @@ public class ModelSequencerSCTest extends ModelSequencerTest {
 		assertCall(flow.getEnterSequence(), 0, flow.getStates().get(0)
 				.getSuperScope().getEnterSequence());
 		assertCall(flow.getStates().get(0).getSuperScope().getEnterSequence(),
-				0, flow.getStates().get(0).getEnterSequence());
+				0, flow.getNodes().get(0).getReactSequence());
+		assertCall(flow.getNodes().get(0).getReactSequence(), 0, flow
+				.getStates().get(0).getEnterSequence());
 
 		assertCall(flow.getEnterSequence(), 1, flow.getStates().get(2)
 				.getSuperScope().getEnterSequence());
 		assertCall(flow.getStates().get(2).getSuperScope().getEnterSequence(),
-				0, flow.getStates().get(2).getEnterSequence());
+				0, flow.getNodes().get(1).getReactSequence());
+		assertCall(flow.getNodes().get(1).getReactSequence(), 0, flow
+				.getStates().get(2).getEnterSequence());
 
 	}
 

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

@@ -250,11 +250,16 @@ public class ModelSequencerStateTest extends ModelSequencerTest {
 		assertCall(_s1.getEnterSequence(), 0, _s1.getEntryAction());
 		assertCall(_s1.getEnterSequence(), 1, _s2.getSuperScope()
 				.getEnterSequence());
-		assertCall(_s2.getSuperScope().getEnterSequence(), 0,
+		assertCall(_s2.getSuperScope().getEnterSequence(), 0, flow.getNodes()
+				.get(0).getReactSequence());
+		assertCall(flow.getNodes().get(0).getReactSequence(), 0,
 				_s2.getEnterSequence());
+
 		assertCall(_s1.getEnterSequence(), 2, _s3.getSuperScope()
 				.getEnterSequence());
-		assertCall(_s3.getSuperScope().getEnterSequence(), 0,
+		assertCall(_s3.getSuperScope().getEnterSequence(), 0, flow.getNodes()
+				.get(1).getReactSequence());
+		assertCall(flow.getNodes().get(1).getReactSequence(), 0,
 				_s3.getEnterSequence());
 	}
 

+ 1 - 0
test-plugins/org.yakindu.sct.model.sexec.test/src/org/yakindu/sct/model/sexec/transformation/test/SCTTestUtil.java

@@ -43,6 +43,7 @@ import org.yakindu.sct.model.stext.stext.StextFactory;
 import org.yakindu.sct.model.stext.stext.TimeEventSpec;
 import org.yakindu.sct.model.stext.stext.TimeEventType;
 import org.yakindu.sct.model.stext.stext.TimeUnit;
+import org.yakindu.sct.model.stext.stext.TransitionReaction;
 import org.yakindu.sct.model.stext.stext.VariableDefinition;
 
 import com.google.common.base.Predicate;