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

History behavior added to sexec transformation and simulator (YAKHMI-500/YAKHMI-504)

benjamin.schwertfeger@gmail.com 14 лет назад
Родитель
Сommit
04acd45792
66 измененных файлов с 1141 добавлено и 18 удалено
  1. BIN
      plugins/org.yakindu.sct.model.sexec.edit/icons/full/ctool16/CreateExecutionState_entryAction_HistoryEntry.gif
  2. BIN
      plugins/org.yakindu.sct.model.sexec.edit/icons/full/ctool16/CreateExecutionState_exitAction_HistoryEntry.gif
  3. BIN
      plugins/org.yakindu.sct.model.sexec.edit/icons/full/ctool16/CreateHistoryEntry_historySequence_Sequence.gif
  4. BIN
      plugins/org.yakindu.sct.model.sexec.edit/icons/full/ctool16/CreateHistoryEntry_historyStep_Call.gif
  5. BIN
      plugins/org.yakindu.sct.model.sexec.edit/icons/full/ctool16/CreateHistoryEntry_historyStep_Check.gif
  6. BIN
      plugins/org.yakindu.sct.model.sexec.edit/icons/full/ctool16/CreateHistoryEntry_historyStep_CheckRef.gif
  7. BIN
      plugins/org.yakindu.sct.model.sexec.edit/icons/full/ctool16/CreateHistoryEntry_historyStep_EnterState.gif
  8. BIN
      plugins/org.yakindu.sct.model.sexec.edit/icons/full/ctool16/CreateHistoryEntry_historyStep_Execution.gif
  9. BIN
      plugins/org.yakindu.sct.model.sexec.edit/icons/full/ctool16/CreateHistoryEntry_historyStep_ExitState.gif
  10. BIN
      plugins/org.yakindu.sct.model.sexec.edit/icons/full/ctool16/CreateHistoryEntry_historyStep_HistoryEntry.gif
  11. BIN
      plugins/org.yakindu.sct.model.sexec.edit/icons/full/ctool16/CreateHistoryEntry_historyStep_If.gif
  12. BIN
      plugins/org.yakindu.sct.model.sexec.edit/icons/full/ctool16/CreateHistoryEntry_historyStep_ReactionFired.gif
  13. BIN
      plugins/org.yakindu.sct.model.sexec.edit/icons/full/ctool16/CreateHistoryEntry_historyStep_SaveHistory.gif
  14. BIN
      plugins/org.yakindu.sct.model.sexec.edit/icons/full/ctool16/CreateHistoryEntry_historyStep_ScheduleTimeEvent.gif
  15. BIN
      plugins/org.yakindu.sct.model.sexec.edit/icons/full/ctool16/CreateHistoryEntry_historyStep_Sequence.gif
  16. BIN
      plugins/org.yakindu.sct.model.sexec.edit/icons/full/ctool16/CreateHistoryEntry_historyStep_StateSwitch.gif
  17. BIN
      plugins/org.yakindu.sct.model.sexec.edit/icons/full/ctool16/CreateHistoryEntry_historyStep_TraceNodeExecuted.gif
  18. BIN
      plugins/org.yakindu.sct.model.sexec.edit/icons/full/ctool16/CreateHistoryEntry_historyStep_TraceStateEntered.gif
  19. BIN
      plugins/org.yakindu.sct.model.sexec.edit/icons/full/ctool16/CreateHistoryEntry_historyStep_TraceStateExited.gif
  20. BIN
      plugins/org.yakindu.sct.model.sexec.edit/icons/full/ctool16/CreateHistoryEntry_historyStep_UnscheduleTimeEvent.gif
  21. BIN
      plugins/org.yakindu.sct.model.sexec.edit/icons/full/ctool16/CreateHistoryEntry_initialSequence_Sequence.gif
  22. BIN
      plugins/org.yakindu.sct.model.sexec.edit/icons/full/ctool16/CreateHistoryEntry_initialStep_Call.gif
  23. BIN
      plugins/org.yakindu.sct.model.sexec.edit/icons/full/ctool16/CreateHistoryEntry_initialStep_Check.gif
  24. BIN
      plugins/org.yakindu.sct.model.sexec.edit/icons/full/ctool16/CreateHistoryEntry_initialStep_CheckRef.gif
  25. BIN
      plugins/org.yakindu.sct.model.sexec.edit/icons/full/ctool16/CreateHistoryEntry_initialStep_EnterState.gif
  26. BIN
      plugins/org.yakindu.sct.model.sexec.edit/icons/full/ctool16/CreateHistoryEntry_initialStep_Execution.gif
  27. BIN
      plugins/org.yakindu.sct.model.sexec.edit/icons/full/ctool16/CreateHistoryEntry_initialStep_ExitState.gif
  28. BIN
      plugins/org.yakindu.sct.model.sexec.edit/icons/full/ctool16/CreateHistoryEntry_initialStep_HistoryEntry.gif
  29. BIN
      plugins/org.yakindu.sct.model.sexec.edit/icons/full/ctool16/CreateHistoryEntry_initialStep_If.gif
  30. BIN
      plugins/org.yakindu.sct.model.sexec.edit/icons/full/ctool16/CreateHistoryEntry_initialStep_ReactionFired.gif
  31. BIN
      plugins/org.yakindu.sct.model.sexec.edit/icons/full/ctool16/CreateHistoryEntry_initialStep_SaveHistory.gif
  32. BIN
      plugins/org.yakindu.sct.model.sexec.edit/icons/full/ctool16/CreateHistoryEntry_initialStep_ScheduleTimeEvent.gif
  33. BIN
      plugins/org.yakindu.sct.model.sexec.edit/icons/full/ctool16/CreateHistoryEntry_initialStep_Sequence.gif
  34. BIN
      plugins/org.yakindu.sct.model.sexec.edit/icons/full/ctool16/CreateHistoryEntry_initialStep_StateSwitch.gif
  35. BIN
      plugins/org.yakindu.sct.model.sexec.edit/icons/full/ctool16/CreateHistoryEntry_initialStep_TraceNodeExecuted.gif
  36. BIN
      plugins/org.yakindu.sct.model.sexec.edit/icons/full/ctool16/CreateHistoryEntry_initialStep_TraceStateEntered.gif
  37. BIN
      plugins/org.yakindu.sct.model.sexec.edit/icons/full/ctool16/CreateHistoryEntry_initialStep_TraceStateExited.gif
  38. BIN
      plugins/org.yakindu.sct.model.sexec.edit/icons/full/ctool16/CreateHistoryEntry_initialStep_UnscheduleTimeEvent.gif
  39. BIN
      plugins/org.yakindu.sct.model.sexec.edit/icons/full/ctool16/CreateReaction_effect_HistoryEntry.gif
  40. BIN
      plugins/org.yakindu.sct.model.sexec.edit/icons/full/ctool16/CreateSequence_steps_HistoryEntry.gif
  41. BIN
      plugins/org.yakindu.sct.model.sexec.edit/icons/full/ctool16/CreateStateCase_step_HistoryEntry.gif
  42. BIN
      plugins/org.yakindu.sct.model.sexec.edit/icons/full/obj16/HistoryEntry.gif
  43. 9 0
      plugins/org.yakindu.sct.model.sexec.edit/plugin.properties
  44. 10 0
      plugins/org.yakindu.sct.model.sexec.edit/src/org/yakindu/sct/model/sexec/provider/ExecutionStateItemProvider.java
  45. 401 0
      plugins/org.yakindu.sct.model.sexec.edit/src/org/yakindu/sct/model/sexec/provider/HistoryEntryItemProvider.java
  46. 5 0
      plugins/org.yakindu.sct.model.sexec.edit/src/org/yakindu/sct/model/sexec/provider/ReactionItemProvider.java
  47. 31 0
      plugins/org.yakindu.sct.model.sexec.edit/src/org/yakindu/sct/model/sexec/provider/SaveHistoryItemProvider.java
  48. 5 0
      plugins/org.yakindu.sct.model.sexec.edit/src/org/yakindu/sct/model/sexec/provider/SequenceItemProvider.java
  49. 24 0
      plugins/org.yakindu.sct.model.sexec.edit/src/org/yakindu/sct/model/sexec/provider/SexecItemProviderAdapterFactory.java
  50. 5 0
      plugins/org.yakindu.sct.model.sexec.edit/src/org/yakindu/sct/model/sexec/provider/StateCaseItemProvider.java
  51. 23 0
      plugins/org.yakindu.sct.model.sexec.edit/src/org/yakindu/sct/model/sexec/provider/StateSwitchItemProvider.java
  52. 36 8
      plugins/org.yakindu.sct.model.sexec.interpreter/src/org/yakindu/sct/model/sexec/interpreter/impl/ExecutionFlowInterpreter.xtend
  53. 2 0
      plugins/org.yakindu.sct.model.sexec/model/sexec.ecore
  54. 2 0
      plugins/org.yakindu.sct.model.sexec/model/sexec.genmodel
  55. 27 0
      plugins/org.yakindu.sct.model.sexec/src/org/yakindu/sct/model/sexec/SaveHistory.java
  56. 59 2
      plugins/org.yakindu.sct.model.sexec/src/org/yakindu/sct/model/sexec/SexecPackage.java
  57. 27 0
      plugins/org.yakindu.sct.model.sexec/src/org/yakindu/sct/model/sexec/StateSwitch.java
  58. 212 0
      plugins/org.yakindu.sct.model.sexec/src/org/yakindu/sct/model/sexec/StateVectorType.java
  59. 67 0
      plugins/org.yakindu.sct.model.sexec/src/org/yakindu/sct/model/sexec/impl/SaveHistoryImpl.java
  60. 1 0
      plugins/org.yakindu.sct.model.sexec/src/org/yakindu/sct/model/sexec/impl/SexecFactoryImpl.java
  61. 24 0
      plugins/org.yakindu.sct.model.sexec/src/org/yakindu/sct/model/sexec/impl/SexecPackageImpl.java
  62. 62 0
      plugins/org.yakindu.sct.model.sexec/src/org/yakindu/sct/model/sexec/impl/StateSwitchImpl.java
  63. 68 4
      plugins/org.yakindu.sct.model.sexec/src/org/yakindu/sct/model/sexec/transformation/SequenceBuilder.xtend
  64. 2 1
      plugins/org.yakindu.sct.model.sexec/src/org/yakindu/sct/model/sexec/transformation/SexecExtensions.xtend
  65. 13 3
      plugins/org.yakindu.sct.simulation.core/src/org/yakindu/sct/simulation/core/runtime/IExecutionContext.java
  66. 26 0
      plugins/org.yakindu.sct.simulation.core/src/org/yakindu/sct/simulation/core/runtime/impl/ExecutionContextImpl.java

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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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

@@ -115,3 +115,12 @@ _UI_TraceRegionExited_region_feature = Region
 _UI_TraceRegionEntered_region_feature = Region
 _UI_SaveHistory_type = Save History
 _UI_SaveHistory_region_feature = Region
+_UI_HistoryEntry_type = History Entry
+_UI_HistoryEntry_initialSequence_feature = Initial Sequence
+_UI_HistoryEntry_deep_feature = Deep
+_UI_HistoryEntry_region_feature = Region
+_UI_HistoryEntry_historySequence_feature = History Sequence
+_UI_HistoryEntry_initialStep_feature = Initial Step
+_UI_HistoryEntry_historyStep_feature = History Step
+_UI_StateSwitch_historyRegion_feature = History Region
+_UI_SaveHistory_deep_feature = Deep

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

@@ -325,6 +325,11 @@ public class ExecutionStateItemProvider
 				(SexecPackage.Literals.EXECUTION_STATE__ENTRY_ACTION,
 				 SexecFactory.eINSTANCE.createSaveHistory()));
 
+		newChildDescriptors.add
+			(createChildParameter
+				(SexecPackage.Literals.EXECUTION_STATE__ENTRY_ACTION,
+				 SexecFactory.eINSTANCE.createHistoryEntry()));
+
 		newChildDescriptors.add
 			(createChildParameter
 				(SexecPackage.Literals.EXECUTION_STATE__EXIT_ACTION,
@@ -404,6 +409,11 @@ public class ExecutionStateItemProvider
 			(createChildParameter
 				(SexecPackage.Literals.EXECUTION_STATE__EXIT_ACTION,
 				 SexecFactory.eINSTANCE.createSaveHistory()));
+
+		newChildDescriptors.add
+			(createChildParameter
+				(SexecPackage.Literals.EXECUTION_STATE__EXIT_ACTION,
+				 SexecFactory.eINSTANCE.createHistoryEntry()));
 	}
 
 	/**

+ 401 - 0
plugins/org.yakindu.sct.model.sexec.edit/src/org/yakindu/sct/model/sexec/provider/HistoryEntryItemProvider.java

@@ -0,0 +1,401 @@
+/**
+ * <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.ItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.ViewerNotification;
+
+import org.yakindu.sct.model.sexec.HistoryEntry;
+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.HistoryEntry} object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class HistoryEntryItemProvider
+	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 HistoryEntryItemProvider(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);
+
+			addDeepPropertyDescriptor(object);
+			addRegionPropertyDescriptor(object);
+		}
+		return itemPropertyDescriptors;
+	}
+
+	/**
+	 * This adds a property descriptor for the Deep feature.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	protected void addDeepPropertyDescriptor(Object object) {
+		itemPropertyDescriptors.add
+			(createItemPropertyDescriptor
+				(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
+				 getResourceLocator(),
+				 getString("_UI_HistoryEntry_deep_feature"),
+				 getString("_UI_PropertyDescriptor_description", "_UI_HistoryEntry_deep_feature", "_UI_HistoryEntry_type"),
+				 SexecPackage.Literals.HISTORY_ENTRY__DEEP,
+				 true,
+				 false,
+				 false,
+				 ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE,
+				 null,
+				 null));
+	}
+
+	/**
+	 * 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_HistoryEntry_region_feature"),
+				 getString("_UI_PropertyDescriptor_description", "_UI_HistoryEntry_region_feature", "_UI_HistoryEntry_type"),
+				 SexecPackage.Literals.HISTORY_ENTRY__REGION,
+				 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.HISTORY_ENTRY__INITIAL_STEP);
+			childrenFeatures.add(SexecPackage.Literals.HISTORY_ENTRY__HISTORY_STEP);
+		}
+		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 HistoryEntry.gif.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	@Override
+	public Object getImage(Object object) {
+		return overlayImage(object, getResourceLocator().getImage("full/obj16/HistoryEntry"));
+	}
+
+	/**
+	 * This returns the label text for the adapted class.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	@Override
+	public String getText(Object object) {
+		String label = ((HistoryEntry)object).getName();
+		return label == null || label.length() == 0 ?
+			getString("_UI_HistoryEntry_type") :
+			getString("_UI_HistoryEntry_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(HistoryEntry.class)) {
+			case SexecPackage.HISTORY_ENTRY__DEEP:
+				fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
+				return;
+			case SexecPackage.HISTORY_ENTRY__INITIAL_STEP:
+			case SexecPackage.HISTORY_ENTRY__HISTORY_STEP:
+				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.HISTORY_ENTRY__INITIAL_STEP,
+				 SexecFactory.eINSTANCE.createSequence()));
+
+		newChildDescriptors.add
+			(createChildParameter
+				(SexecPackage.Literals.HISTORY_ENTRY__INITIAL_STEP,
+				 SexecFactory.eINSTANCE.createCheck()));
+
+		newChildDescriptors.add
+			(createChildParameter
+				(SexecPackage.Literals.HISTORY_ENTRY__INITIAL_STEP,
+				 SexecFactory.eINSTANCE.createCheckRef()));
+
+		newChildDescriptors.add
+			(createChildParameter
+				(SexecPackage.Literals.HISTORY_ENTRY__INITIAL_STEP,
+				 SexecFactory.eINSTANCE.createIf()));
+
+		newChildDescriptors.add
+			(createChildParameter
+				(SexecPackage.Literals.HISTORY_ENTRY__INITIAL_STEP,
+				 SexecFactory.eINSTANCE.createExecution()));
+
+		newChildDescriptors.add
+			(createChildParameter
+				(SexecPackage.Literals.HISTORY_ENTRY__INITIAL_STEP,
+				 SexecFactory.eINSTANCE.createEnterState()));
+
+		newChildDescriptors.add
+			(createChildParameter
+				(SexecPackage.Literals.HISTORY_ENTRY__INITIAL_STEP,
+				 SexecFactory.eINSTANCE.createExitState()));
+
+		newChildDescriptors.add
+			(createChildParameter
+				(SexecPackage.Literals.HISTORY_ENTRY__INITIAL_STEP,
+				 SexecFactory.eINSTANCE.createCall()));
+
+		newChildDescriptors.add
+			(createChildParameter
+				(SexecPackage.Literals.HISTORY_ENTRY__INITIAL_STEP,
+				 SexecFactory.eINSTANCE.createScheduleTimeEvent()));
+
+		newChildDescriptors.add
+			(createChildParameter
+				(SexecPackage.Literals.HISTORY_ENTRY__INITIAL_STEP,
+				 SexecFactory.eINSTANCE.createUnscheduleTimeEvent()));
+
+		newChildDescriptors.add
+			(createChildParameter
+				(SexecPackage.Literals.HISTORY_ENTRY__INITIAL_STEP,
+				 SexecFactory.eINSTANCE.createStateSwitch()));
+
+		newChildDescriptors.add
+			(createChildParameter
+				(SexecPackage.Literals.HISTORY_ENTRY__INITIAL_STEP,
+				 SexecFactory.eINSTANCE.createTraceNodeExecuted()));
+
+		newChildDescriptors.add
+			(createChildParameter
+				(SexecPackage.Literals.HISTORY_ENTRY__INITIAL_STEP,
+				 SexecFactory.eINSTANCE.createReactionFired()));
+
+		newChildDescriptors.add
+			(createChildParameter
+				(SexecPackage.Literals.HISTORY_ENTRY__INITIAL_STEP,
+				 SexecFactory.eINSTANCE.createTraceStateEntered()));
+
+		newChildDescriptors.add
+			(createChildParameter
+				(SexecPackage.Literals.HISTORY_ENTRY__INITIAL_STEP,
+				 SexecFactory.eINSTANCE.createTraceStateExited()));
+
+		newChildDescriptors.add
+			(createChildParameter
+				(SexecPackage.Literals.HISTORY_ENTRY__INITIAL_STEP,
+				 SexecFactory.eINSTANCE.createSaveHistory()));
+
+		newChildDescriptors.add
+			(createChildParameter
+				(SexecPackage.Literals.HISTORY_ENTRY__INITIAL_STEP,
+				 SexecFactory.eINSTANCE.createHistoryEntry()));
+
+		newChildDescriptors.add
+			(createChildParameter
+				(SexecPackage.Literals.HISTORY_ENTRY__HISTORY_STEP,
+				 SexecFactory.eINSTANCE.createSequence()));
+
+		newChildDescriptors.add
+			(createChildParameter
+				(SexecPackage.Literals.HISTORY_ENTRY__HISTORY_STEP,
+				 SexecFactory.eINSTANCE.createCheck()));
+
+		newChildDescriptors.add
+			(createChildParameter
+				(SexecPackage.Literals.HISTORY_ENTRY__HISTORY_STEP,
+				 SexecFactory.eINSTANCE.createCheckRef()));
+
+		newChildDescriptors.add
+			(createChildParameter
+				(SexecPackage.Literals.HISTORY_ENTRY__HISTORY_STEP,
+				 SexecFactory.eINSTANCE.createIf()));
+
+		newChildDescriptors.add
+			(createChildParameter
+				(SexecPackage.Literals.HISTORY_ENTRY__HISTORY_STEP,
+				 SexecFactory.eINSTANCE.createExecution()));
+
+		newChildDescriptors.add
+			(createChildParameter
+				(SexecPackage.Literals.HISTORY_ENTRY__HISTORY_STEP,
+				 SexecFactory.eINSTANCE.createEnterState()));
+
+		newChildDescriptors.add
+			(createChildParameter
+				(SexecPackage.Literals.HISTORY_ENTRY__HISTORY_STEP,
+				 SexecFactory.eINSTANCE.createExitState()));
+
+		newChildDescriptors.add
+			(createChildParameter
+				(SexecPackage.Literals.HISTORY_ENTRY__HISTORY_STEP,
+				 SexecFactory.eINSTANCE.createCall()));
+
+		newChildDescriptors.add
+			(createChildParameter
+				(SexecPackage.Literals.HISTORY_ENTRY__HISTORY_STEP,
+				 SexecFactory.eINSTANCE.createScheduleTimeEvent()));
+
+		newChildDescriptors.add
+			(createChildParameter
+				(SexecPackage.Literals.HISTORY_ENTRY__HISTORY_STEP,
+				 SexecFactory.eINSTANCE.createUnscheduleTimeEvent()));
+
+		newChildDescriptors.add
+			(createChildParameter
+				(SexecPackage.Literals.HISTORY_ENTRY__HISTORY_STEP,
+				 SexecFactory.eINSTANCE.createStateSwitch()));
+
+		newChildDescriptors.add
+			(createChildParameter
+				(SexecPackage.Literals.HISTORY_ENTRY__HISTORY_STEP,
+				 SexecFactory.eINSTANCE.createTraceNodeExecuted()));
+
+		newChildDescriptors.add
+			(createChildParameter
+				(SexecPackage.Literals.HISTORY_ENTRY__HISTORY_STEP,
+				 SexecFactory.eINSTANCE.createReactionFired()));
+
+		newChildDescriptors.add
+			(createChildParameter
+				(SexecPackage.Literals.HISTORY_ENTRY__HISTORY_STEP,
+				 SexecFactory.eINSTANCE.createTraceStateEntered()));
+
+		newChildDescriptors.add
+			(createChildParameter
+				(SexecPackage.Literals.HISTORY_ENTRY__HISTORY_STEP,
+				 SexecFactory.eINSTANCE.createTraceStateExited()));
+
+		newChildDescriptors.add
+			(createChildParameter
+				(SexecPackage.Literals.HISTORY_ENTRY__HISTORY_STEP,
+				 SexecFactory.eINSTANCE.createSaveHistory()));
+
+		newChildDescriptors.add
+			(createChildParameter
+				(SexecPackage.Literals.HISTORY_ENTRY__HISTORY_STEP,
+				 SexecFactory.eINSTANCE.createHistoryEntry()));
+	}
+
+	/**
+	 * This returns the label text for {@link org.eclipse.emf.edit.command.CreateChildCommand}.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	@Override
+	public String getCreateChildText(Object owner, Object feature, Object child, Collection<?> selection) {
+		Object childFeature = feature;
+		Object childObject = child;
+
+		boolean qualify =
+			childFeature == SexecPackage.Literals.HISTORY_ENTRY__INITIAL_STEP ||
+			childFeature == SexecPackage.Literals.HISTORY_ENTRY__HISTORY_STEP;
+
+		if (qualify) {
+			return getString
+				("_UI_CreateChild_text2",
+				 new Object[] { getTypeText(childObject), getFeatureText(childFeature), getTypeText(owner) });
+		}
+		return super.getCreateChildText(owner, feature, child, selection);
+	}
+
+}

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

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

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

@@ -21,6 +21,8 @@ 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.ItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.ViewerNotification;
 import org.yakindu.sct.model.sexec.SaveHistory;
 import org.yakindu.sct.model.sexec.SexecPackage;
 
@@ -60,6 +62,7 @@ public class SaveHistoryItemProvider
 			super.getPropertyDescriptors(object);
 
 			addRegionPropertyDescriptor(object);
+			addDeepPropertyDescriptor(object);
 		}
 		return itemPropertyDescriptors;
 	}
@@ -86,6 +89,28 @@ public class SaveHistoryItemProvider
 				 null));
 	}
 
+	/**
+	 * This adds a property descriptor for the Deep feature.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	protected void addDeepPropertyDescriptor(Object object) {
+		itemPropertyDescriptors.add
+			(createItemPropertyDescriptor
+				(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
+				 getResourceLocator(),
+				 getString("_UI_SaveHistory_deep_feature"),
+				 getString("_UI_PropertyDescriptor_description", "_UI_SaveHistory_deep_feature", "_UI_SaveHistory_type"),
+				 SexecPackage.Literals.SAVE_HISTORY__DEEP,
+				 true,
+				 false,
+				 false,
+				 ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE,
+				 null,
+				 null));
+	}
+
 	/**
 	 * This returns SaveHistory.gif.
 	 * <!-- begin-user-doc -->
@@ -121,6 +146,12 @@ public class SaveHistoryItemProvider
 	@Override
 	public void notifyChanged(Notification notification) {
 		updateChildren(notification);
+
+		switch (notification.getFeatureID(SaveHistory.class)) {
+			case SexecPackage.SAVE_HISTORY__DEEP:
+				fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
+				return;
+		}
 		super.notifyChanged(notification);
 	}
 

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

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

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

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

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

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

+ 23 - 0
plugins/org.yakindu.sct.model.sexec.edit/src/org/yakindu/sct/model/sexec/provider/StateSwitchItemProvider.java

@@ -65,6 +65,7 @@ public class StateSwitchItemProvider
 			super.getPropertyDescriptors(object);
 
 			addStateConfigurationIdxPropertyDescriptor(object);
+			addHistoryRegionPropertyDescriptor(object);
 		}
 		return itemPropertyDescriptors;
 	}
@@ -91,6 +92,28 @@ public class StateSwitchItemProvider
 				 null));
 	}
 
+	/**
+	 * This adds a property descriptor for the History Region feature.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	protected void addHistoryRegionPropertyDescriptor(Object object) {
+		itemPropertyDescriptors.add
+			(createItemPropertyDescriptor
+				(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
+				 getResourceLocator(),
+				 getString("_UI_StateSwitch_historyRegion_feature"),
+				 getString("_UI_PropertyDescriptor_description", "_UI_StateSwitch_historyRegion_feature", "_UI_StateSwitch_type"),
+				 SexecPackage.Literals.STATE_SWITCH__HISTORY_REGION,
+				 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

+ 36 - 8
plugins/org.yakindu.sct.model.sexec.interpreter/src/org/yakindu/sct/model/sexec/interpreter/impl/ExecutionFlowInterpreter.xtend

@@ -65,6 +65,8 @@ import org.yakindu.sct.model.sexec.Trace
 import java.util.Arrays
 import org.yakindu.sct.model.sexec.impl.ExecutionStateImpl
 import org.yakindu.sct.simulation.core.runtime.IExecutionContextListener
+import org.yakindu.sct.model.sexec.SaveHistory
+import org.yakindu.sct.model.sexec.HistoryEntry
 
 /**
  * 
@@ -232,6 +234,20 @@ class ExecutionFlowInterpreter extends AbstractExecutionFacade implements IExecu
 		nextSVIdx = enterState.state.stateVector.offset // mark all state vector elements up to this as processed ...		
 		null
 	}
+
+	def dispatch execute(HistoryEntry entry){
+		if (executionContext.getHistoryStateConfiguration(entry.region) != null) {
+			entry.historyStep.execute
+		} else {
+			if (entry.initialStep == null) {
+				//TODO handle model error
+				println("Missing initial transition " + entry)
+			} else {
+				entry.initialStep.execute
+			}
+		}
+		null
+	}
 	
 	def dispatch execute(Execution execution){ 
 		interpreter.evaluateStatement(execution.statement, executionContext)
@@ -260,18 +276,30 @@ class ExecutionFlowInterpreter extends AbstractExecutionFacade implements IExecu
 		null
 	}
 	
-	def dispatch execute(StateSwitch stateSwitch){
-		for(stateCase : stateSwitch.cases)
-			stateCase.execute 
-		null 
+	def dispatch execute(SaveHistory action){
+		executionContext.saveHistoryStateConfiguration(action.region, action.deep);
+		null
 	}
 	
-	def dispatch execute(StateCase stateCase){
-		if(executionContext.stateConfiguration.contains(stateCase.state)){
-			stateCase.step.execute
+	def dispatch execute(StateSwitch stateSwitch){
+		val historyRegion = stateSwitch.historyRegion
+		if (historyRegion != null) {
+			val historyState = executionContext.getHistoryStateConfiguration(historyRegion)
+			for(stateCase : stateSwitch.cases) {
+				if(historyState.contains(stateCase.state)){
+					stateCase.step.execute
+				}
+			}
+			
+		} else {			
+			for(stateCase : stateSwitch.cases)
+				if(executionContext.stateConfiguration.contains(stateCase.state)){
+					stateCase.step.execute
+				} 
 		}
-		null
+		null 
 	}
+	
 	def dispatch execute(ScheduleTimeEvent scheduleTimeEvent){
 		var timeEvent = scheduleTimeEvent.timeEvent
 		var duration = interpreter.evaluateStatement(scheduleTimeEvent.timeValue, executionContext)

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

@@ -117,6 +117,7 @@
         eType="#//StateCase" containment="true"/>
     <eStructuralFeatures xsi:type="ecore:EAttribute" name="stateConfigurationIdx"
         eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt" defaultValueLiteral="0"/>
+    <eStructuralFeatures xsi:type="ecore:EReference" name="historyRegion" eType="#//ExecutionRegion"/>
   </eClassifiers>
   <eClassifiers xsi:type="ecore:EClass" name="StateCase">
     <eStructuralFeatures xsi:type="ecore:EReference" name="state" eType="#//ExecutionState"/>
@@ -137,6 +138,7 @@
   </eClassifiers>
   <eClassifiers xsi:type="ecore:EClass" name="SaveHistory" eSuperTypes="#//Step">
     <eStructuralFeatures xsi:type="ecore:EReference" name="region" eType="#//ExecutionRegion"/>
+    <eStructuralFeatures xsi:type="ecore:EAttribute" name="deep" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"/>
   </eClassifiers>
   <eClassifiers xsi:type="ecore:EClass" name="HistoryEntry" eSuperTypes="#//Step">
     <eStructuralFeatures xsi:type="ecore:EReference" name="initialStep" eType="#//Step"

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

@@ -91,6 +91,7 @@
     <genClasses ecoreClass="sexec.ecore#//StateSwitch">
       <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference sexec.ecore#//StateSwitch/cases"/>
       <genFeatures createChild="false" ecoreFeature="ecore:EAttribute sexec.ecore#//StateSwitch/stateConfigurationIdx"/>
+      <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference sexec.ecore#//StateSwitch/historyRegion"/>
     </genClasses>
     <genClasses ecoreClass="sexec.ecore#//StateCase">
       <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference sexec.ecore#//StateCase/state"/>
@@ -111,6 +112,7 @@
     </genClasses>
     <genClasses ecoreClass="sexec.ecore#//SaveHistory">
       <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference sexec.ecore#//SaveHistory/region"/>
+      <genFeatures createChild="false" ecoreFeature="ecore:EAttribute sexec.ecore#//SaveHistory/deep"/>
     </genClasses>
     <genClasses ecoreClass="sexec.ecore#//HistoryEntry">
       <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference sexec.ecore#//HistoryEntry/initialStep"/>

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

@@ -16,6 +16,7 @@ package org.yakindu.sct.model.sexec;
  * The following features are supported:
  * <ul>
  *   <li>{@link org.yakindu.sct.model.sexec.SaveHistory#getRegion <em>Region</em>}</li>
+ *   <li>{@link org.yakindu.sct.model.sexec.SaveHistory#isDeep <em>Deep</em>}</li>
  * </ul>
  * </p>
  *
@@ -50,4 +51,30 @@ public interface SaveHistory extends Step {
 	 */
 	void setRegion(ExecutionRegion value);
 
+	/**
+	 * Returns the value of the '<em><b>Deep</b></em>' attribute.
+	 * <!-- begin-user-doc -->
+	 * <p>
+	 * If the meaning of the '<em>Deep</em>' attribute isn't clear,
+	 * there really should be more of a description here...
+	 * </p>
+	 * <!-- end-user-doc -->
+	 * @return the value of the '<em>Deep</em>' attribute.
+	 * @see #setDeep(boolean)
+	 * @see org.yakindu.sct.model.sexec.SexecPackage#getSaveHistory_Deep()
+	 * @model
+	 * @generated
+	 */
+	boolean isDeep();
+
+	/**
+	 * Sets the value of the '{@link org.yakindu.sct.model.sexec.SaveHistory#isDeep <em>Deep</em>}' attribute.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @param value the new value of the '<em>Deep</em>' attribute.
+	 * @see #isDeep()
+	 * @generated
+	 */
+	void setDeep(boolean value);
+
 } // SaveHistory

+ 59 - 2
plugins/org.yakindu.sct.model.sexec/src/org/yakindu/sct/model/sexec/SexecPackage.java

@@ -8,6 +8,7 @@ package org.yakindu.sct.model.sexec;
 
 import org.eclipse.emf.ecore.EAttribute;
 import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EEnum;
 import org.eclipse.emf.ecore.EPackage;
 import org.eclipse.emf.ecore.EReference;
 import org.yakindu.sct.model.sgraph.SGraphPackage;
@@ -1579,6 +1580,15 @@ public interface SexecPackage extends EPackage {
 	 */
 	int STATE_SWITCH__STATE_CONFIGURATION_IDX = STEP_FEATURE_COUNT + 1;
 
+	/**
+	 * The feature id for the '<em><b>History Region</b></em>' reference.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 * @ordered
+	 */
+	int STATE_SWITCH__HISTORY_REGION = STEP_FEATURE_COUNT + 2;
+
 	/**
 	 * The number of structural features of the '<em>State Switch</em>' class.
 	 * <!-- begin-user-doc -->
@@ -1586,7 +1596,7 @@ public interface SexecPackage extends EPackage {
 	 * @generated
 	 * @ordered
 	 */
-	int STATE_SWITCH_FEATURE_COUNT = STEP_FEATURE_COUNT + 2;
+	int STATE_SWITCH_FEATURE_COUNT = STEP_FEATURE_COUNT + 3;
 
 	/**
 	 * The meta object id for the '{@link org.yakindu.sct.model.sexec.impl.StateCaseImpl <em>State Case</em>}' class.
@@ -1940,6 +1950,15 @@ public interface SexecPackage extends EPackage {
 	 */
 	int SAVE_HISTORY__REGION = STEP_FEATURE_COUNT + 0;
 
+	/**
+	 * The feature id for the '<em><b>Deep</b></em>' attribute.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 * @ordered
+	 */
+	int SAVE_HISTORY__DEEP = STEP_FEATURE_COUNT + 1;
+
 	/**
 	 * The number of structural features of the '<em>Save History</em>' class.
 	 * <!-- begin-user-doc -->
@@ -1947,7 +1966,7 @@ public interface SexecPackage extends EPackage {
 	 * @generated
 	 * @ordered
 	 */
-	int SAVE_HISTORY_FEATURE_COUNT = STEP_FEATURE_COUNT + 1;
+	int SAVE_HISTORY_FEATURE_COUNT = STEP_FEATURE_COUNT + 2;
 
 
 	/**
@@ -2639,6 +2658,17 @@ public interface SexecPackage extends EPackage {
 	 */
 	EAttribute getStateSwitch_StateConfigurationIdx();
 
+	/**
+	 * Returns the meta object for the reference '{@link org.yakindu.sct.model.sexec.StateSwitch#getHistoryRegion <em>History Region</em>}'.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @return the meta object for the reference '<em>History Region</em>'.
+	 * @see org.yakindu.sct.model.sexec.StateSwitch#getHistoryRegion()
+	 * @see #getStateSwitch()
+	 * @generated
+	 */
+	EReference getStateSwitch_HistoryRegion();
+
 	/**
 	 * Returns the meta object for class '{@link org.yakindu.sct.model.sexec.StateCase <em>State Case</em>}'.
 	 * <!-- begin-user-doc -->
@@ -2786,6 +2816,17 @@ public interface SexecPackage extends EPackage {
 	 */
 	EReference getSaveHistory_Region();
 
+	/**
+	 * Returns the meta object for the attribute '{@link org.yakindu.sct.model.sexec.SaveHistory#isDeep <em>Deep</em>}'.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @return the meta object for the attribute '<em>Deep</em>'.
+	 * @see org.yakindu.sct.model.sexec.SaveHistory#isDeep()
+	 * @see #getSaveHistory()
+	 * @generated
+	 */
+	EAttribute getSaveHistory_Deep();
+
 	/**
 	 * Returns the meta object for class '{@link org.yakindu.sct.model.sexec.HistoryEntry <em>History Entry</em>}'.
 	 * <!-- begin-user-doc -->
@@ -3434,6 +3475,14 @@ public interface SexecPackage extends EPackage {
 		 */
 		EAttribute STATE_SWITCH__STATE_CONFIGURATION_IDX = eINSTANCE.getStateSwitch_StateConfigurationIdx();
 
+		/**
+		 * The meta object literal for the '<em><b>History Region</b></em>' reference feature.
+		 * <!-- begin-user-doc -->
+		 * <!-- end-user-doc -->
+		 * @generated
+		 */
+		EReference STATE_SWITCH__HISTORY_REGION = eINSTANCE.getStateSwitch_HistoryRegion();
+
 		/**
 		 * The meta object literal for the '{@link org.yakindu.sct.model.sexec.impl.StateCaseImpl <em>State Case</em>}' class.
 		 * <!-- begin-user-doc -->
@@ -3560,6 +3609,14 @@ public interface SexecPackage extends EPackage {
 		 */
 		EReference SAVE_HISTORY__REGION = eINSTANCE.getSaveHistory_Region();
 
+		/**
+		 * The meta object literal for the '<em><b>Deep</b></em>' attribute feature.
+		 * <!-- begin-user-doc -->
+		 * <!-- end-user-doc -->
+		 * @generated
+		 */
+		EAttribute SAVE_HISTORY__DEEP = eINSTANCE.getSaveHistory_Deep();
+
 		/**
 		 * The meta object literal for the '{@link org.yakindu.sct.model.sexec.impl.HistoryEntryImpl <em>History Entry</em>}' class.
 		 * <!-- begin-user-doc -->

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

@@ -18,6 +18,7 @@ import org.eclipse.emf.common.util.EList;
  * <ul>
  *   <li>{@link org.yakindu.sct.model.sexec.StateSwitch#getCases <em>Cases</em>}</li>
  *   <li>{@link org.yakindu.sct.model.sexec.StateSwitch#getStateConfigurationIdx <em>State Configuration Idx</em>}</li>
+ *   <li>{@link org.yakindu.sct.model.sexec.StateSwitch#getHistoryRegion <em>History Region</em>}</li>
  * </ul>
  * </p>
  *
@@ -69,4 +70,30 @@ public interface StateSwitch extends Step {
 	 */
 	void setStateConfigurationIdx(int value);
 
+	/**
+	 * Returns the value of the '<em><b>History Region</b></em>' reference.
+	 * <!-- begin-user-doc -->
+	 * <p>
+	 * If the meaning of the '<em>History 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>History Region</em>' reference.
+	 * @see #setHistoryRegion(ExecutionRegion)
+	 * @see org.yakindu.sct.model.sexec.SexecPackage#getStateSwitch_HistoryRegion()
+	 * @model
+	 * @generated
+	 */
+	ExecutionRegion getHistoryRegion();
+
+	/**
+	 * Sets the value of the '{@link org.yakindu.sct.model.sexec.StateSwitch#getHistoryRegion <em>History Region</em>}' reference.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @param value the new value of the '<em>History Region</em>' reference.
+	 * @see #getHistoryRegion()
+	 * @generated
+	 */
+	void setHistoryRegion(ExecutionRegion value);
+
 } // StateSwitch

+ 212 - 0
plugins/org.yakindu.sct.model.sexec/src/org/yakindu/sct/model/sexec/StateVectorType.java

@@ -0,0 +1,212 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id$
+ */
+package org.yakindu.sct.model.sexec;
+
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+
+import org.eclipse.emf.common.util.Enumerator;
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the literals of the enumeration '<em><b>State Vector Type</b></em>',
+ * and utility methods for working with them.
+ * <!-- end-user-doc -->
+ * @see org.yakindu.sct.model.sexec.SexecPackage#getStateVectorType()
+ * @model
+ * @generated
+ */
+public enum StateVectorType implements Enumerator {
+	/**
+	 * The '<em><b>Active</b></em>' literal object.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @see #ACTIVE_VALUE
+	 * @generated
+	 * @ordered
+	 */
+	ACTIVE(0, "active", "active"),
+
+	/**
+	 * The '<em><b>History</b></em>' literal object.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @see #HISTORY_VALUE
+	 * @generated
+	 * @ordered
+	 */
+	HISTORY(1, "history", "history");
+
+	/**
+	 * The '<em><b>Active</b></em>' literal value.
+	 * <!-- begin-user-doc -->
+	 * <p>
+	 * If the meaning of '<em><b>Active</b></em>' literal object isn't clear,
+	 * there really should be more of a description here...
+	 * </p>
+	 * <!-- end-user-doc -->
+	 * @see #ACTIVE
+	 * @model name="active"
+	 * @generated
+	 * @ordered
+	 */
+	public static final int ACTIVE_VALUE = 0;
+
+	/**
+	 * The '<em><b>History</b></em>' literal value.
+	 * <!-- begin-user-doc -->
+	 * <p>
+	 * If the meaning of '<em><b>History</b></em>' literal object isn't clear,
+	 * there really should be more of a description here...
+	 * </p>
+	 * <!-- end-user-doc -->
+	 * @see #HISTORY
+	 * @model name="history"
+	 * @generated
+	 * @ordered
+	 */
+	public static final int HISTORY_VALUE = 1;
+
+	/**
+	 * An array of all the '<em><b>State Vector Type</b></em>' enumerators.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	private static final StateVectorType[] VALUES_ARRAY =
+		new StateVectorType[] {
+			ACTIVE,
+			HISTORY,
+		};
+
+	/**
+	 * A public read-only list of all the '<em><b>State Vector Type</b></em>' enumerators.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public static final List<StateVectorType> VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY));
+
+	/**
+	 * Returns the '<em><b>State Vector Type</b></em>' literal with the specified literal value.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public static StateVectorType get(String literal) {
+		for (int i = 0; i < VALUES_ARRAY.length; ++i) {
+			StateVectorType result = VALUES_ARRAY[i];
+			if (result.toString().equals(literal)) {
+				return result;
+			}
+		}
+		return null;
+	}
+
+	/**
+	 * Returns the '<em><b>State Vector Type</b></em>' literal with the specified name.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public static StateVectorType getByName(String name) {
+		for (int i = 0; i < VALUES_ARRAY.length; ++i) {
+			StateVectorType result = VALUES_ARRAY[i];
+			if (result.getName().equals(name)) {
+				return result;
+			}
+		}
+		return null;
+	}
+
+	/**
+	 * Returns the '<em><b>State Vector Type</b></em>' literal with the specified integer value.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public static StateVectorType get(int value) {
+		switch (value) {
+			case ACTIVE_VALUE: return ACTIVE;
+			case HISTORY_VALUE: return HISTORY;
+		}
+		return null;
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	private final int value;
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	private final String name;
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	private final String literal;
+
+	/**
+	 * Only this class can construct instances.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	private StateVectorType(int value, String name, String literal) {
+		this.value = value;
+		this.name = name;
+		this.literal = literal;
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public int getValue() {
+	  return value;
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public String getName() {
+	  return name;
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public String getLiteral() {
+	  return literal;
+	}
+
+	/**
+	 * Returns the literal value of the enumerator, which is its string representation.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	@Override
+	public String toString() {
+		return literal;
+	}
+	
+} //StateVectorType

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

@@ -25,6 +25,7 @@ import org.yakindu.sct.model.sexec.SexecPackage;
  * The following features are implemented:
  * <ul>
  *   <li>{@link org.yakindu.sct.model.sexec.impl.SaveHistoryImpl#getRegion <em>Region</em>}</li>
+ *   <li>{@link org.yakindu.sct.model.sexec.impl.SaveHistoryImpl#isDeep <em>Deep</em>}</li>
  * </ul>
  * </p>
  *
@@ -41,6 +42,25 @@ public class SaveHistoryImpl extends StepImpl implements SaveHistory {
 	 */
 	protected ExecutionRegion region;
 
+	/**
+	 * The default value of the '{@link #isDeep() <em>Deep</em>}' attribute.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @see #isDeep()
+	 * @generated
+	 * @ordered
+	 */
+	protected static final boolean DEEP_EDEFAULT = false;
+	/**
+	 * The cached value of the '{@link #isDeep() <em>Deep</em>}' attribute.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @see #isDeep()
+	 * @generated
+	 * @ordered
+	 */
+	protected boolean deep = DEEP_EDEFAULT;
+
 	/**
 	 * <!-- begin-user-doc -->
 	 * <!-- end-user-doc -->
@@ -98,6 +118,27 @@ public class SaveHistoryImpl extends StepImpl implements SaveHistory {
 			eNotify(new ENotificationImpl(this, Notification.SET, SexecPackage.SAVE_HISTORY__REGION, oldRegion, region));
 	}
 
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public boolean isDeep() {
+		return deep;
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public void setDeep(boolean newDeep) {
+		boolean oldDeep = deep;
+		deep = newDeep;
+		if (eNotificationRequired())
+			eNotify(new ENotificationImpl(this, Notification.SET, SexecPackage.SAVE_HISTORY__DEEP, oldDeep, deep));
+	}
+
 	/**
 	 * <!-- begin-user-doc -->
 	 * <!-- end-user-doc -->
@@ -109,6 +150,8 @@ public class SaveHistoryImpl extends StepImpl implements SaveHistory {
 			case SexecPackage.SAVE_HISTORY__REGION:
 				if (resolve) return getRegion();
 				return basicGetRegion();
+			case SexecPackage.SAVE_HISTORY__DEEP:
+				return isDeep();
 		}
 		return super.eGet(featureID, resolve, coreType);
 	}
@@ -124,6 +167,9 @@ public class SaveHistoryImpl extends StepImpl implements SaveHistory {
 			case SexecPackage.SAVE_HISTORY__REGION:
 				setRegion((ExecutionRegion)newValue);
 				return;
+			case SexecPackage.SAVE_HISTORY__DEEP:
+				setDeep((Boolean)newValue);
+				return;
 		}
 		super.eSet(featureID, newValue);
 	}
@@ -139,6 +185,9 @@ public class SaveHistoryImpl extends StepImpl implements SaveHistory {
 			case SexecPackage.SAVE_HISTORY__REGION:
 				setRegion((ExecutionRegion)null);
 				return;
+			case SexecPackage.SAVE_HISTORY__DEEP:
+				setDeep(DEEP_EDEFAULT);
+				return;
 		}
 		super.eUnset(featureID);
 	}
@@ -153,8 +202,26 @@ public class SaveHistoryImpl extends StepImpl implements SaveHistory {
 		switch (featureID) {
 			case SexecPackage.SAVE_HISTORY__REGION:
 				return region != null;
+			case SexecPackage.SAVE_HISTORY__DEEP:
+				return deep != DEEP_EDEFAULT;
 		}
 		return super.eIsSet(featureID);
 	}
 
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	@Override
+	public String toString() {
+		if (eIsProxy()) return super.toString();
+
+		StringBuffer result = new StringBuffer(super.toString());
+		result.append(" (deep: ");
+		result.append(deep);
+		result.append(')');
+		return result.toString();
+	}
+
 } //SaveHistoryImpl

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

@@ -7,6 +7,7 @@
 package org.yakindu.sct.model.sexec.impl;
 
 import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EDataType;
 import org.eclipse.emf.ecore.EObject;
 import org.eclipse.emf.ecore.EPackage;
 import org.eclipse.emf.ecore.impl.EFactoryImpl;

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

@@ -8,6 +8,7 @@ package org.yakindu.sct.model.sexec.impl;
 
 import org.eclipse.emf.ecore.EAttribute;
 import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EEnum;
 import org.eclipse.emf.ecore.EPackage;
 import org.eclipse.emf.ecore.EReference;
 import org.eclipse.emf.ecore.impl.EPackageImpl;
@@ -38,6 +39,7 @@ import org.yakindu.sct.model.sexec.SexecPackage;
 import org.yakindu.sct.model.sexec.StateCase;
 import org.yakindu.sct.model.sexec.StateSwitch;
 import org.yakindu.sct.model.sexec.StateVector;
+import org.yakindu.sct.model.sexec.StateVectorType;
 import org.yakindu.sct.model.sexec.Step;
 import org.yakindu.sct.model.sexec.TimeEvent;
 import org.yakindu.sct.model.sexec.Trace;
@@ -857,6 +859,15 @@ public class SexecPackageImpl extends EPackageImpl implements SexecPackage {
 		return (EAttribute)stateSwitchEClass.getEStructuralFeatures().get(1);
 	}
 
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public EReference getStateSwitch_HistoryRegion() {
+		return (EReference)stateSwitchEClass.getEStructuralFeatures().get(2);
+	}
+
 	/**
 	 * <!-- begin-user-doc -->
 	 * <!-- end-user-doc -->
@@ -983,6 +994,15 @@ public class SexecPackageImpl extends EPackageImpl implements SexecPackage {
 		return (EReference)saveHistoryEClass.getEStructuralFeatures().get(0);
 	}
 
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public EAttribute getSaveHistory_Deep() {
+		return (EAttribute)saveHistoryEClass.getEStructuralFeatures().get(1);
+	}
+
 	/**
 	 * <!-- begin-user-doc -->
 	 * <!-- end-user-doc -->
@@ -1206,6 +1226,7 @@ public class SexecPackageImpl extends EPackageImpl implements SexecPackage {
 		stateSwitchEClass = createEClass(STATE_SWITCH);
 		createEReference(stateSwitchEClass, STATE_SWITCH__CASES);
 		createEAttribute(stateSwitchEClass, STATE_SWITCH__STATE_CONFIGURATION_IDX);
+		createEReference(stateSwitchEClass, STATE_SWITCH__HISTORY_REGION);
 
 		stateCaseEClass = createEClass(STATE_CASE);
 		createEReference(stateCaseEClass, STATE_CASE__STATE);
@@ -1227,6 +1248,7 @@ public class SexecPackageImpl extends EPackageImpl implements SexecPackage {
 
 		saveHistoryEClass = createEClass(SAVE_HISTORY);
 		createEReference(saveHistoryEClass, SAVE_HISTORY__REGION);
+		createEAttribute(saveHistoryEClass, SAVE_HISTORY__DEEP);
 
 		historyEntryEClass = createEClass(HISTORY_ENTRY);
 		createEReference(historyEntryEClass, HISTORY_ENTRY__INITIAL_STEP);
@@ -1388,6 +1410,7 @@ public class SexecPackageImpl extends EPackageImpl implements SexecPackage {
 		initEClass(stateSwitchEClass, StateSwitch.class, "StateSwitch", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
 		initEReference(getStateSwitch_Cases(), this.getStateCase(), null, "cases", null, 0, -1, StateSwitch.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
 		initEAttribute(getStateSwitch_StateConfigurationIdx(), ecorePackage.getEInt(), "stateConfigurationIdx", "0", 0, 1, StateSwitch.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+		initEReference(getStateSwitch_HistoryRegion(), this.getExecutionRegion(), null, "historyRegion", null, 0, 1, StateSwitch.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
 
 		initEClass(stateCaseEClass, StateCase.class, "StateCase", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
 		initEReference(getStateCase_State(), this.getExecutionState(), null, "state", null, 0, 1, StateCase.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
@@ -1409,6 +1432,7 @@ public class SexecPackageImpl extends EPackageImpl implements SexecPackage {
 
 		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);
+		initEAttribute(getSaveHistory_Deep(), ecorePackage.getEBoolean(), "deep", null, 0, 1, SaveHistory.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
 
 		initEClass(historyEntryEClass, HistoryEntry.class, "HistoryEntry", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
 		initEReference(getHistoryEntry_InitialStep(), this.getStep(), null, "initialStep", null, 0, 1, HistoryEntry.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);

+ 62 - 0
plugins/org.yakindu.sct.model.sexec/src/org/yakindu/sct/model/sexec/impl/StateSwitchImpl.java

@@ -16,9 +16,11 @@ 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.InternalEList;
+import org.yakindu.sct.model.sexec.ExecutionRegion;
 import org.yakindu.sct.model.sexec.SexecPackage;
 import org.yakindu.sct.model.sexec.StateCase;
 import org.yakindu.sct.model.sexec.StateSwitch;
+import org.yakindu.sct.model.sexec.StateVectorType;
 
 /**
  * <!-- begin-user-doc -->
@@ -29,6 +31,7 @@ import org.yakindu.sct.model.sexec.StateSwitch;
  * <ul>
  *   <li>{@link org.yakindu.sct.model.sexec.impl.StateSwitchImpl#getCases <em>Cases</em>}</li>
  *   <li>{@link org.yakindu.sct.model.sexec.impl.StateSwitchImpl#getStateConfigurationIdx <em>State Configuration Idx</em>}</li>
+ *   <li>{@link org.yakindu.sct.model.sexec.impl.StateSwitchImpl#getHistoryRegion <em>History Region</em>}</li>
  * </ul>
  * </p>
  *
@@ -64,6 +67,16 @@ public class StateSwitchImpl extends StepImpl implements StateSwitch {
 	 */
 	protected int stateConfigurationIdx = STATE_CONFIGURATION_IDX_EDEFAULT;
 
+	/**
+	 * The cached value of the '{@link #getHistoryRegion() <em>History Region</em>}' reference.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @see #getHistoryRegion()
+	 * @generated
+	 * @ordered
+	 */
+	protected ExecutionRegion historyRegion;
+
 	/**
 	 * <!-- begin-user-doc -->
 	 * <!-- end-user-doc -->
@@ -116,6 +129,44 @@ public class StateSwitchImpl extends StepImpl implements StateSwitch {
 			eNotify(new ENotificationImpl(this, Notification.SET, SexecPackage.STATE_SWITCH__STATE_CONFIGURATION_IDX, oldStateConfigurationIdx, stateConfigurationIdx));
 	}
 
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public ExecutionRegion getHistoryRegion() {
+		if (historyRegion != null && historyRegion.eIsProxy()) {
+			InternalEObject oldHistoryRegion = (InternalEObject)historyRegion;
+			historyRegion = (ExecutionRegion)eResolveProxy(oldHistoryRegion);
+			if (historyRegion != oldHistoryRegion) {
+				if (eNotificationRequired())
+					eNotify(new ENotificationImpl(this, Notification.RESOLVE, SexecPackage.STATE_SWITCH__HISTORY_REGION, oldHistoryRegion, historyRegion));
+			}
+		}
+		return historyRegion;
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public ExecutionRegion basicGetHistoryRegion() {
+		return historyRegion;
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public void setHistoryRegion(ExecutionRegion newHistoryRegion) {
+		ExecutionRegion oldHistoryRegion = historyRegion;
+		historyRegion = newHistoryRegion;
+		if (eNotificationRequired())
+			eNotify(new ENotificationImpl(this, Notification.SET, SexecPackage.STATE_SWITCH__HISTORY_REGION, oldHistoryRegion, historyRegion));
+	}
+
 	/**
 	 * <!-- begin-user-doc -->
 	 * <!-- end-user-doc -->
@@ -142,6 +193,9 @@ public class StateSwitchImpl extends StepImpl implements StateSwitch {
 				return getCases();
 			case SexecPackage.STATE_SWITCH__STATE_CONFIGURATION_IDX:
 				return getStateConfigurationIdx();
+			case SexecPackage.STATE_SWITCH__HISTORY_REGION:
+				if (resolve) return getHistoryRegion();
+				return basicGetHistoryRegion();
 		}
 		return super.eGet(featureID, resolve, coreType);
 	}
@@ -162,6 +216,9 @@ public class StateSwitchImpl extends StepImpl implements StateSwitch {
 			case SexecPackage.STATE_SWITCH__STATE_CONFIGURATION_IDX:
 				setStateConfigurationIdx((Integer)newValue);
 				return;
+			case SexecPackage.STATE_SWITCH__HISTORY_REGION:
+				setHistoryRegion((ExecutionRegion)newValue);
+				return;
 		}
 		super.eSet(featureID, newValue);
 	}
@@ -180,6 +237,9 @@ public class StateSwitchImpl extends StepImpl implements StateSwitch {
 			case SexecPackage.STATE_SWITCH__STATE_CONFIGURATION_IDX:
 				setStateConfigurationIdx(STATE_CONFIGURATION_IDX_EDEFAULT);
 				return;
+			case SexecPackage.STATE_SWITCH__HISTORY_REGION:
+				setHistoryRegion((ExecutionRegion)null);
+				return;
 		}
 		super.eUnset(featureID);
 	}
@@ -196,6 +256,8 @@ public class StateSwitchImpl extends StepImpl implements StateSwitch {
 				return cases != null && !cases.isEmpty();
 			case SexecPackage.STATE_SWITCH__STATE_CONFIGURATION_IDX:
 				return stateConfigurationIdx != STATE_CONFIGURATION_IDX_EDEFAULT;
+			case SexecPackage.STATE_SWITCH__HISTORY_REGION:
+				return historyRegion != null;
 		}
 		return super.eIsSet(featureID);
 	}

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

@@ -21,6 +21,7 @@ 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
+import org.yakindu.sct.model.sexec.StateVectorType
 
 class SequenceBuilder {
 	
@@ -151,7 +152,7 @@ class SequenceBuilder {
 		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
+			seq.steps += execRegion.newSaveHistory(r.collectEntries.exists(e|e.kind == EntryKind::DEEP_HISTORY))
 		}
 		
 		// collect leaf states
@@ -184,25 +185,31 @@ class SequenceBuilder {
 		} else if (e.kind == EntryKind::SHALLOW_HISTORY) {
 			val entryStep = sexec.factory.createHistoryEntry
 			entryStep.name = "HistoryEntry"
-			entryStep.comment = "Enter the region with shallow history for each active state"
+			entryStep.comment = "Enter the region with shallow history"
 			entryStep.deep = false
+			entryStep.region = (e.eContainer as Region).create
 			
 			//Initial step, if no history is known
 			if (target != null && target.enterSequence != null) {
 				entryStep.initialStep = target.enterSequence.newCall
 			}
-			//TODO handle history (Call for the last active state the enterSequence. Perhaps a StateSwitch)
+			val sSwitch = (e.eContainer as Region).defineShallowHistorySwitch()
+			entryStep.historyStep = sSwitch
 			
 			seq.steps += entryStep
 		} else if (e.kind == EntryKind::DEEP_HISTORY) {
 			val entryStep = sexec.factory.createHistoryEntry
+			entryStep.name = "HistoryEntry"
+			entryStep.comment = "Enter the region with deep history"
+			entryStep.region = (e.eContainer as Region).create
 			entryStep.deep = true
 			
 			//Initial step, if no history is known
 			if (target != null && target.enterSequence != null) {
 				entryStep.initialStep = target.enterSequence.newCall
 			}
-			//TODO handle history
+			val sSwitch = (e.eContainer as Region).defineDeepHistorySwitch()
+			entryStep.historyStep = sSwitch
 
 			seq.steps += entryStep
 		}
@@ -255,6 +262,63 @@ class SequenceBuilder {
 	
 	
 	
+	/**
+	 * Enter switch for a region with a deep history, which must be save before
+	 */
+	def StateSwitch defineDeepHistorySwitch(Region r) {
+		r.defineDeepHistorySwitch(r.create)
+	}
+	
+	def StateSwitch defineDeepHistorySwitch(Region r, ExecutionRegion historyRegion) {
+		val execRegion = r.create
+		
+		val StateSwitch sSwitch = sexec.factory.createStateSwitch
+		sSwitch.stateConfigurationIdx = execRegion.stateVector.offset
+		sSwitch.comment = "Handle shallow history entry of " +r.name
+		sSwitch.historyRegion = historyRegion
+		
+		for (child : r.vertices.filter(typeof(State))) {
+			for (childLeaf : child.collectLeafStates(newArrayList).filter(c|c.create.stateVector.offset == sSwitch.stateConfigurationIdx)) {
+				val execChild = child.create
+				val seq = sexec.factory.createSequence
+				seq.name = "enterSequence"
+				seq.comment = "enterSequence with history in child " + child.name+" for leaf "+childLeaf.name
+				if (execChild.entryAction != null ) seq.steps += execChild.entryAction.newCall
+				if ( _addTraceSteps ) seq.steps += execChild.newTraceStateEntered
+				if ( execChild.leaf ) {
+					seq.steps += execChild.newEnterStateStep
+				} else {
+					for (childRegion : child.regions) {
+						seq.steps += childRegion.defineDeepHistorySwitch(historyRegion)
+					}
+				}
+				sSwitch.cases += childLeaf.create.newCase(seq)
+			}
+		}
+		
+		return sSwitch
+	}
+
+	/**
+	 * Enter switch for a region with a shallow history, which must be save before
+	 */
+	def StateSwitch defineShallowHistorySwitch(Region r) {
+		val execRegion = r.create
+		
+		val StateSwitch sSwitch = sexec.factory.createStateSwitch
+		sSwitch.stateConfigurationIdx = execRegion.stateVector.offset
+		sSwitch.comment = "Handle shallow history entry of " +r.name
+		sSwitch.historyRegion = r.create
+		
+		for (child : r.vertices.filter(typeof(State))) {
+			val execChild = child.create
+			for (childLeaf : child.collectLeafStates(newArrayList).filter(c|c.create.stateVector.offset == sSwitch.stateConfigurationIdx)) {
+				sSwitch.cases += childLeaf.create.newCase(execChild.enterSequence.newCall)
+			}
+		}
+		
+		return sSwitch
+	}
 	def StateSwitch defineExitSwitch(ExecutionScope state, Iterable<ExecutionState> leafStates, int pos) {
 
 		// create a state switch

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

@@ -52,9 +52,10 @@ class SexecExtensions {
 		return sCase
 	}
 
-	def newSaveHistory(ExecutionRegion r) {
+	def newSaveHistory(ExecutionRegion r, boolean deep) {
 		val save = factory.createSaveHistory
 		save.region = r
+		save.deep = deep
 		return save
 	}
 

+ 13 - 3
plugins/org.yakindu.sct.simulation.core/src/org/yakindu/sct/simulation/core/runtime/IExecutionContext.java

@@ -13,6 +13,7 @@ package org.yakindu.sct.simulation.core.runtime;
 import java.util.List;
 import java.util.Set;
 
+import org.yakindu.sct.model.sexec.ExecutionRegion;
 import org.yakindu.sct.model.sexec.ExecutionState;
 import org.yakindu.sct.model.sgraph.RegularState;
 import org.yakindu.sct.simulation.core.runtime.impl.ExecutionEvent;
@@ -117,8 +118,17 @@ public interface IExecutionContext {
 	public double getTimeScaleFactor();
 
 	public void setTimeScaleFactor(double factor);
-	
+
 	public VirtualClock getVirtualClock();
-	
-	
+
+	/**
+	 * 
+	 * @param region
+	 * @return
+	 */
+	public ExecutionState[] getHistoryStateConfiguration(ExecutionRegion region);
+
+	public void saveHistoryStateConfiguration(ExecutionRegion region,
+			boolean deep);
+
 }

+ 26 - 0
plugins/org.yakindu.sct.simulation.core/src/org/yakindu/sct/simulation/core/runtime/impl/ExecutionContextImpl.java

@@ -15,9 +15,11 @@ import java.util.Collection;
 import java.util.Collections;
 import java.util.HashSet;
 import java.util.List;
+import java.util.Map;
 import java.util.Set;
 
 import org.eclipse.emf.ecore.EObject;
+import org.yakindu.sct.model.sexec.ExecutionRegion;
 import org.yakindu.sct.model.sexec.ExecutionState;
 import org.yakindu.sct.model.sgraph.RegularState;
 import org.yakindu.sct.model.sgraph.State;
@@ -25,6 +27,9 @@ import org.yakindu.sct.simulation.core.runtime.ExecutionException;
 import org.yakindu.sct.simulation.core.runtime.IExecutionContext;
 import org.yakindu.sct.simulation.core.runtime.timer.VirtualClock;
 
+import com.google.common.collect.Maps;
+import com.google.common.collect.Multimap;
+
 /**
  * 
  * @author andreas muelder - Initial contribution and API
@@ -37,6 +42,7 @@ public class ExecutionContextImpl extends AbstractExecutionContext implements
 	private List<ExecutionEvent> declaredEvents;
 	private List<ExecutionEvent> raisedEvents;
 	private ExecutionState[] activeStateConfig;
+	private Map<ExecutionRegion, ExecutionState[]> historyStateConfig;
 	private double timeScaleFactor;
 	private VirtualClock virtualClock;
 
@@ -47,6 +53,7 @@ public class ExecutionContextImpl extends AbstractExecutionContext implements
 		timeScaleFactor = 1.0d;
 		virtualClock = new VirtualClock();
 		activeStateConfig = null;
+		historyStateConfig = null;
 	}
 
 	public List<ExecutionEvent> getDeclaredEvents() {
@@ -143,11 +150,30 @@ public class ExecutionContextImpl extends AbstractExecutionContext implements
 		return activeStateConfig;
 	}
 
+	public ExecutionState[] getHistoryStateConfiguration(ExecutionRegion region) {
+		return historyStateConfig.get(region);
+	}
+
+	public void saveHistoryStateConfiguration(ExecutionRegion region,
+			boolean deep) {
+		ExecutionState[] history = null;
+		if (deep) {
+			history = new ExecutionState[region.getStateVector().getSize()];
+			System.arraycopy(activeStateConfig, region.getStateVector()
+					.getOffset(), history, 0, region.getStateVector().getSize());
+		} else {
+			history = new ExecutionState[1];
+			history[1] = activeStateConfig[region.getStateVector().getOffset()];
+		}
+		historyStateConfig.put(region, history);
+	}
+
 	public void initStateConfigurationVector(int size) {
 		activeStateConfig = new ExecutionState[size];
 		for (int i = 0; i < size; i++) {
 			activeStateConfig[i] = null;
 		}
+		historyStateConfig = Maps.newHashMap();
 	}
 
 	public void call(String procedureId) {