Browse Source

Changed history representation in execution model
Tests activated

benjamin.schwertfeger@gmail.com 13 years ago
parent
commit
403d510f7d
17 changed files with 150 additions and 51 deletions
  1. 26 13
      plugins/org.yakindu.sct.generator.java/src/org/yakindu/sct/generator/java/templates/CustomCycleBasedStatemachine.xpt
  2. 1 4
      plugins/org.yakindu.sct.generator.java/src/org/yakindu/sct/generator/java/templates/ExecutionModelExtensions.ext
  3. 9 1
      plugins/org.yakindu.sct.generator.java/src/org/yakindu/sct/generator/java/templates/Naming.ext
  4. BIN
      plugins/org.yakindu.sct.model.sexec.edit/icons/full/ctool16/CreateExecutionFlow_historyVector_StateVector.gif
  5. BIN
      plugins/org.yakindu.sct.model.sexec.edit/icons/full/ctool16/CreateExecutionRegion_deepEnterSequence_Sequence.gif
  6. BIN
      plugins/org.yakindu.sct.model.sexec.edit/icons/full/ctool16/CreateExecutionRegion_historyVector_StateVector.gif
  7. BIN
      plugins/org.yakindu.sct.model.sexec.edit/icons/full/ctool16/CreateExecutionRegion_shallowEnterSequence_Sequence.gif
  8. 4 0
      plugins/org.yakindu.sct.model.sexec.edit/plugin.properties
  9. 9 0
      plugins/org.yakindu.sct.model.sexec.edit/src/org/yakindu/sct/model/sexec/provider/ExecutionFlowItemProvider.java
  10. 21 5
      plugins/org.yakindu.sct.model.sexec.edit/src/org/yakindu/sct/model/sexec/provider/ExecutionRegionItemProvider.java
  11. 2 2
      plugins/org.yakindu.sct.model.sexec.interpreter/src/org/yakindu/sct/model/sexec/interpreter/impl/ExecutionFlowInterpreter.xtend
  12. 65 16
      plugins/org.yakindu.sct.model.sexec.interpreter/xtend-gen/org/yakindu/sct/model/sexec/interpreter/impl/ExecutionFlowInterpreter.java
  13. 2 2
      plugins/org.yakindu.sct.model.sexec/src/org/yakindu/sct/model/sexec/transformation/SequenceBuilder.xtend
  14. 2 2
      plugins/org.yakindu.sct.model.sexec/src/org/yakindu/sct/model/sexec/transformation/StateVectorBuilder.xtend
  15. 2 2
      plugins/org.yakindu.sct.model.sexec/xtend-gen/org/yakindu/sct/model/sexec/transformation/SequenceBuilder.java
  16. 4 2
      plugins/org.yakindu.sct.model.sexec/xtend-gen/org/yakindu/sct/model/sexec/transformation/StateVectorBuilder.java
  17. 3 2
      test-plugins/org.yakindu.sct.model.sexec.test/src/org/yakindu/sct/model/sexec/transformation/test/AllTests.java

+ 26 - 13
plugins/org.yakindu.sct.generator.java/src/org/yakindu/sct/generator/java/templates/CustomCycleBasedStatemachine.xpt

@@ -29,7 +29,7 @@ Contributors:
 «DEFINE ActionCode FOR StateSwitch-»
 	«getComment()»
 	«IF historyRegion!=null-»
-	switch(«historyRegion.getHistoryVectorName()»[«stateConfigurationIdx»]) {
+	switch(historyVector[«historyRegion.historyVector.offset»]) {
 	«ELSE-»
 	switch(stateVector[«stateConfigurationIdx»]) {
 	«ENDIF-»
@@ -113,15 +113,16 @@ else {
 «ENDDEFINE»
 
 «DEFINE ActionCode FOR HistoryEntry»
-	«IF historyStep != null-»
+	«getComment()»
+	if (historyVector[«region.historyVector.offset»] != State.$NullState$) {
 		«EXPAND ActionCode FOR historyStep-»
-	«ELSE-»
+	} else {
 		«EXPAND ActionCode FOR initialStep-»
-	«ENDIF-»
+	}
 «ENDDEFINE»
 
 «DEFINE ActionCode FOR SaveHistory»
-	«region.getHistoryVectorName()» = Arrays.copyOfRange(stateVector, «region.stateVector.offset», «region.stateVector.size»);
+	historyVector[«region.historyVector.offset»] = stateVector[«region.stateVector.offset»];
 «ENDDEFINE»
 
 «DEFINE ConditionMethodsImplement FOR ExecutionNode-»
@@ -193,6 +194,20 @@ else {
 	}
 	«ENDIF-»
 «ENDDEFINE»
+«DEFINE DeepEnterSequenceImplement FOR ExecutionRegion»
+	«IF deepEnterSequence.steps.size > 0 && deepEnterSequence.caller.size > 0-»
+	private void «deepEnterSequenceName()»() {
+		«EXPAND ActionCode FOREACH deepEnterSequence.steps-»
+	}
+	«ENDIF-»
+«ENDDEFINE»
+«DEFINE ShallowEnterSequenceImplement FOR ExecutionRegion»
+	«IF shallowEnterSequence.steps.size > 0 && shallowEnterSequence.caller.size > 0-»
+	private void «shallowEnterSequenceName()»() {
+		«EXPAND ActionCode FOREACH shallowEnterSequence.steps-»
+	}
+	«ENDIF-»
+«ENDDEFINE»
 
 «DEFINE ExitSequenceImplement FOR ExecutionRegion-»
 	«IF exitSequence.steps.size > 0 && exitSequence.caller.size > 0-»
@@ -268,9 +283,7 @@ public class 
 	
 	«ENDFOREACH-»
 	
-	«FOREACH getHistoryRegions() AS region-»
-		private State[] «region.getHistoryVectorName()» = new State[«region.historyStateVector.size»];
-	«ENDFOREACH-»
+	private State[] historyVector = new State[«historyVector.size»];
 
 	private final State[] stateVector = new State[«stateVector.size»];
 	
@@ -313,11 +326,9 @@ public class 
 		for (int i = 0; i < stateVector.length; i++) {
 			stateVector[i] = State.$NullState$;
 		}
-		«FOREACH getHistoryRegions() AS region-»
-			for (int i = 0; i < «region.getHistoryVectorName()».length; i++) {
-			«region.getHistoryVectorName()»[i] = State.$NullState$;
-			}
-		«ENDFOREACH-»
+		for (int i = 0; i < «historyVector.size»; i++) {
+			historyVector[i] = State.$NullState$;
+		}
 		occuredEvents.clear();
 	}
 	
@@ -412,6 +423,8 @@ public class 
 «EXPAND ExitSequenceImplement FOREACH this.states-»
 «EXPAND EnterSequenceImplement FOREACH this.regions-»
 «EXPAND ExitSequenceImplement FOREACH this.regions-»
+«EXPAND DeepEnterSequenceImplement FOREACH this.regions-»
+«EXPAND ShallowEnterSequenceImplement FOREACH this.regions-»
 «EXPAND ReactMethodsImplement FOREACH this.states-»
 «EXPAND ReactMethodsImplement FOREACH this.nodes-»
 	public void runCycle() {

+ 1 - 4
plugins/org.yakindu.sct.generator.java/src/org/yakindu/sct/generator/java/templates/ExecutionModelExtensions.ext

@@ -28,9 +28,6 @@ getInternalScopeVariables(ExecutionFlow this) :	getInternalScopeDeclarations().t
 getInternalScopeEvents(ExecutionFlow this) : getInternalScopeDeclarations().typeSelect(EventDefinition);
 getInternalScopeVoidEvents(ExecutionFlow this) :getInternalScopeEvents().select(e|e.type.isVoid());
 getInternalScopeValuedEvents(ExecutionFlow this) : getInternalScopeEvents().select(e|!e.type.isVoid());
-
-getHistoryRegions(ExecutionFlow this) : 
-	regions.select(region|region.historyStateVector.size > 0);
 	
 getTimeEvents(ExecutionFlow this) : scopes.typeSelect(Scope).declarations.typeSelect(TimeEvent);
 
@@ -53,7 +50,7 @@ boolean hasVariables(Scope this) :
 	!declarations.typeSelect(VariableDefinition).isEmpty;
 
 boolean hasHistory(ExecutionFlow this) :
-	!getHistoryRegions().isEmpty;
+	historyVector.size > 0;
 
 boolean hasUnvaluedEvents(Scope this) :
 	!declarations.typeSelect(EventDefinition).select(event|event.type.isVoid()).isEmpty;

+ 9 - 1
plugins/org.yakindu.sct.generator.java/src/org/yakindu/sct/generator/java/templates/Naming.ext

@@ -110,9 +110,11 @@ cached String functionName(Step step) :
 	(step.isEntryAction()) ? step.entryActionFunctionName() : ( 
 	(step.isExitAction()) ? step.exitActionFunctionName() :  (
 	(step.isEnterSequence()) ? step.enterSequenceName() : (
+	(step.isDeepEnterSequence()) ? step.deepEnterSequenceName() : (
+	(step.isShallowEnterSequence()) ? step.shallowEnterSequenceName() : (
 	(step.isExitSequence()) ? step.exitSequenceName() : (
 	(step.isReactSequence()) ? step.reactSequenceName() :
-	" // unknown function type "+step ))))));
+	" // unknown function type "+step ))))))));
  
 String statemachineEntryFunctionName(EnterState this):
 	if (this.name != null) then
@@ -127,6 +129,10 @@ String exitActionFunctionName(Step this) : "exitAction" + getName(state());
 String enterSequenceName(Step this) : "enterSequence"+getName(state()); 
 String enterSequenceName(ExecutionState this) : "enterSequence"+getName();
 String enterSequenceName(ExecutionRegion this) : "enterSequence"+getName();
+String deepEnterSequenceName(Step this) : ((ExecutionRegion)this.eContainer).deepEnterSequenceName();
+String deepEnterSequenceName(ExecutionRegion this) : "deepEnterSequence"+getName();
+String shallowEnterSequenceName(Step this) : ((ExecutionRegion)this.eContainer).deepEnterSequenceName();
+String shallowEnterSequenceName(ExecutionRegion this) : "shallowEnterSequence"+getName();
 String enterSequenceName(ExecutionFlow this) : "enter";
 String exitSequenceName(Step this) : "exitSequence"+getName(state()); 
 String exitSequenceName(ExecutionState this) : "exitSequence"+getName();
@@ -139,6 +145,8 @@ isReactionCheck(Step step) : Reaction.isInstance(step.eContainer) && Check.isIns
 isEntryAction(Step step) : ExecutionState.isInstance(step.eContainer) && step.state().entryAction == step;
 isExitAction(Step step) : ExecutionState.isInstance(step.eContainer) && step.state().exitAction == step;
 isEnterSequence(Step step) : Sequence.isInstance(step) && step.name == "enterSequence";
+isDeepEnterSequence(Step step) : Sequence.isInstance(step) && step.name == "deepEnterSequence";
+isShallowEnterSequence(Step step) : Sequence.isInstance(step) && step.name == "shallowEnterSequence";
 isExitSequence(Step step) : Sequence.isInstance(step) && step.name == "exitSequence";
 isReactSequence(Step step) : Sequence.isInstance(step) && step.name == "react";
 

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


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


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


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


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

@@ -125,3 +125,7 @@ _UI_HistoryEntry_historyStep_feature = History Step
 _UI_StateSwitch_historyRegion_feature = History Region
 _UI_SaveHistory_deep_feature = Deep
 _UI_ExecutionRegion_historyStateVector_feature = History State Vector
+_UI_ExecutionRegion_deepEnterSequence_feature = Deep Enter Sequence
+_UI_ExecutionRegion_shallowEnterSequence_feature = Shallow Enter Sequence
+_UI_ExecutionFlow_historyVector_feature = History Vector
+_UI_ExecutionRegion_historyVector_feature = History Vector

+ 9 - 0
plugins/org.yakindu.sct.model.sexec.edit/src/org/yakindu/sct/model/sexec/provider/ExecutionFlowItemProvider.java

@@ -177,6 +177,7 @@ public class ExecutionFlowItemProvider
 			childrenFeatures.add(SexecPackage.Literals.EXECUTION_FLOW__STATES);
 			childrenFeatures.add(SexecPackage.Literals.EXECUTION_FLOW__NODES);
 			childrenFeatures.add(SexecPackage.Literals.EXECUTION_FLOW__REGIONS);
+			childrenFeatures.add(SexecPackage.Literals.EXECUTION_FLOW__HISTORY_VECTOR);
 		}
 		return childrenFeatures;
 	}
@@ -240,6 +241,7 @@ public class ExecutionFlowItemProvider
 			case SexecPackage.EXECUTION_FLOW__STATES:
 			case SexecPackage.EXECUTION_FLOW__NODES:
 			case SexecPackage.EXECUTION_FLOW__REGIONS:
+			case SexecPackage.EXECUTION_FLOW__HISTORY_VECTOR:
 				fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false));
 				return;
 		}
@@ -301,6 +303,11 @@ public class ExecutionFlowItemProvider
 			(createChildParameter
 				(SexecPackage.Literals.EXECUTION_FLOW__REGIONS,
 				 SexecFactory.eINSTANCE.createExecutionRegion()));
+
+		newChildDescriptors.add
+			(createChildParameter
+				(SexecPackage.Literals.EXECUTION_FLOW__HISTORY_VECTOR,
+				 SexecFactory.eINSTANCE.createStateVector()));
 	}
 
 	/**
@@ -315,6 +322,8 @@ public class ExecutionFlowItemProvider
 		Object childObject = child;
 
 		boolean qualify =
+			childFeature == SexecPackage.Literals.EXECUTION_SCOPE__STATE_VECTOR ||
+			childFeature == SexecPackage.Literals.EXECUTION_FLOW__HISTORY_VECTOR ||
 			childFeature == SexecPackage.Literals.EXECUTION_SCOPE__ENTER_SEQUENCE ||
 			childFeature == SexecPackage.Literals.EXECUTION_SCOPE__EXIT_SEQUENCE ||
 			childFeature == SexecPackage.Literals.EXECUTION_FLOW__STATES ||

+ 21 - 5
plugins/org.yakindu.sct.model.sexec.edit/src/org/yakindu/sct/model/sexec/provider/ExecutionRegionItemProvider.java

@@ -77,7 +77,9 @@ public class ExecutionRegionItemProvider
 	public Collection<? extends EStructuralFeature> getChildrenFeatures(Object object) {
 		if (childrenFeatures == null) {
 			super.getChildrenFeatures(object);
-			childrenFeatures.add(SexecPackage.Literals.EXECUTION_REGION__HISTORY_STATE_VECTOR);
+			childrenFeatures.add(SexecPackage.Literals.EXECUTION_REGION__DEEP_ENTER_SEQUENCE);
+			childrenFeatures.add(SexecPackage.Literals.EXECUTION_REGION__SHALLOW_ENTER_SEQUENCE);
+			childrenFeatures.add(SexecPackage.Literals.EXECUTION_REGION__HISTORY_VECTOR);
 		}
 		return childrenFeatures;
 	}
@@ -132,7 +134,9 @@ public class ExecutionRegionItemProvider
 		updateChildren(notification);
 
 		switch (notification.getFeatureID(ExecutionRegion.class)) {
-			case SexecPackage.EXECUTION_REGION__HISTORY_STATE_VECTOR:
+			case SexecPackage.EXECUTION_REGION__DEEP_ENTER_SEQUENCE:
+			case SexecPackage.EXECUTION_REGION__SHALLOW_ENTER_SEQUENCE:
+			case SexecPackage.EXECUTION_REGION__HISTORY_VECTOR:
 				fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false));
 				return;
 		}
@@ -152,7 +156,17 @@ public class ExecutionRegionItemProvider
 
 		newChildDescriptors.add
 			(createChildParameter
-				(SexecPackage.Literals.EXECUTION_REGION__HISTORY_STATE_VECTOR,
+				(SexecPackage.Literals.EXECUTION_REGION__DEEP_ENTER_SEQUENCE,
+				 SexecFactory.eINSTANCE.createSequence()));
+
+		newChildDescriptors.add
+			(createChildParameter
+				(SexecPackage.Literals.EXECUTION_REGION__SHALLOW_ENTER_SEQUENCE,
+				 SexecFactory.eINSTANCE.createSequence()));
+
+		newChildDescriptors.add
+			(createChildParameter
+				(SexecPackage.Literals.EXECUTION_REGION__HISTORY_VECTOR,
 				 SexecFactory.eINSTANCE.createStateVector()));
 	}
 
@@ -169,9 +183,11 @@ public class ExecutionRegionItemProvider
 
 		boolean qualify =
 			childFeature == SexecPackage.Literals.EXECUTION_SCOPE__STATE_VECTOR ||
-			childFeature == SexecPackage.Literals.EXECUTION_REGION__HISTORY_STATE_VECTOR ||
+			childFeature == SexecPackage.Literals.EXECUTION_REGION__HISTORY_VECTOR ||
 			childFeature == SexecPackage.Literals.EXECUTION_SCOPE__ENTER_SEQUENCE ||
-			childFeature == SexecPackage.Literals.EXECUTION_SCOPE__EXIT_SEQUENCE;
+			childFeature == SexecPackage.Literals.EXECUTION_SCOPE__EXIT_SEQUENCE ||
+			childFeature == SexecPackage.Literals.EXECUTION_REGION__DEEP_ENTER_SEQUENCE ||
+			childFeature == SexecPackage.Literals.EXECUTION_REGION__SHALLOW_ENTER_SEQUENCE;
 
 		if (qualify) {
 			return getString

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

@@ -277,7 +277,7 @@ class ExecutionFlowInterpreter extends AbstractExecutionFacade implements IExecu
 	}
 	
 	def dispatch execute(SaveHistory action){
-		executionContext.saveHistoryStateConfiguration(action.region, action.deep);
+		executionContext.saveHistoryStateConfiguration(action.region);
 		null
 	}
 	
@@ -286,7 +286,7 @@ class ExecutionFlowInterpreter extends AbstractExecutionFacade implements IExecu
 		if (historyRegion != null) {
 			val historyState = executionContext.getHistoryStateConfiguration(historyRegion)
 			for(stateCase : stateSwitch.cases) {
-				if(historyState.contains(stateCase.state)){
+				if(historyState == stateCase.state){
 					stateCase.step.execute
 				}
 			}

+ 65 - 16
plugins/org.yakindu.sct.model.sexec.interpreter/xtend-gen/org/yakindu/sct/model/sexec/interpreter/impl/ExecutionFlowInterpreter.java

@@ -4,7 +4,6 @@ import com.google.inject.Inject;
 import com.google.inject.name.Named;
 import java.util.List;
 import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EObject;
 import org.eclipse.xtext.naming.QualifiedName;
 import org.eclipse.xtext.xbase.lib.BooleanExtensions;
 import org.eclipse.xtext.xbase.lib.ComparableExtensions;
@@ -19,9 +18,12 @@ import org.yakindu.sct.model.sexec.Check;
 import org.yakindu.sct.model.sexec.EnterState;
 import org.yakindu.sct.model.sexec.Execution;
 import org.yakindu.sct.model.sexec.ExecutionFlow;
+import org.yakindu.sct.model.sexec.ExecutionRegion;
 import org.yakindu.sct.model.sexec.ExecutionState;
 import org.yakindu.sct.model.sexec.ExitState;
+import org.yakindu.sct.model.sexec.HistoryEntry;
 import org.yakindu.sct.model.sexec.If;
+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.StateCase;
@@ -351,6 +353,31 @@ public class ExecutionFlowInterpreter extends AbstractExecutionFacade implements
     return _xblockexpression;
   }
   
+  protected Object _execute(final HistoryEntry entry) throws ExecutionException {
+    Object _xblockexpression = null;
+    {
+      ExecutionRegion _region = entry.getRegion();
+      ExecutionState _historyStateConfiguration = this.executionContext.getHistoryStateConfiguration(_region);
+      boolean _operator_notEquals = ObjectExtensions.operator_notEquals(_historyStateConfiguration, null);
+      if (_operator_notEquals) {
+        Step _historyStep = entry.getHistoryStep();
+        this.execute(_historyStep);
+      } else {
+        Step _initialStep = entry.getInitialStep();
+        boolean _operator_equals = ObjectExtensions.operator_equals(_initialStep, null);
+        if (_operator_equals) {
+          String _operator_plus = StringExtensions.operator_plus("Missing initial transition ", entry);
+          InputOutput.<String>println(_operator_plus);
+        } else {
+          Step _initialStep_1 = entry.getInitialStep();
+          this.execute(_initialStep_1);
+        }
+      }
+      _xblockexpression = (null);
+    }
+    return _xblockexpression;
+  }
+  
   protected Object _execute(final Execution execution) throws ExecutionException {
     Statement _statement = execution.getStatement();
     Object _evaluateStatement = this.interpreter.evaluateStatement(_statement, this.executionContext);
@@ -404,27 +431,47 @@ public class ExecutionFlowInterpreter extends AbstractExecutionFacade implements
     return _xblockexpression;
   }
   
-  protected Object _execute(final StateSwitch stateSwitch) throws ExecutionException {
+  protected Object _execute(final SaveHistory action) {
     Object _xblockexpression = null;
     {
-      EList<StateCase> _cases = stateSwitch.getCases();
-      for (final StateCase stateCase : _cases) {
-        this.execute(stateCase);
-      }
+      ExecutionRegion _region = action.getRegion();
+      this.executionContext.saveHistoryStateConfiguration(_region);
       _xblockexpression = (null);
     }
     return _xblockexpression;
   }
   
-  protected Object _execute(final StateCase stateCase) throws ExecutionException {
+  protected Object _execute(final StateSwitch stateSwitch) throws ExecutionException {
     Object _xblockexpression = null;
     {
-      ExecutionState[] _stateConfiguration = this.executionContext.getStateConfiguration();
-      ExecutionState _state = stateCase.getState();
-      boolean _contains = ((List<ExecutionState>)Conversions.doWrapArray(_stateConfiguration)).contains(_state);
-      if (_contains) {
-        Step _step = stateCase.getStep();
-        this.execute(_step);
+      ExecutionRegion _historyRegion = stateSwitch.getHistoryRegion();
+      final ExecutionRegion historyRegion = _historyRegion;
+      boolean _operator_notEquals = ObjectExtensions.operator_notEquals(historyRegion, null);
+      if (_operator_notEquals) {
+        {
+          ExecutionState _historyStateConfiguration = this.executionContext.getHistoryStateConfiguration(historyRegion);
+          final ExecutionState historyState = _historyStateConfiguration;
+          EList<StateCase> _cases = stateSwitch.getCases();
+          for (final StateCase stateCase : _cases) {
+            ExecutionState _state = stateCase.getState();
+            boolean _operator_equals = ObjectExtensions.operator_equals(historyState, _state);
+            if (_operator_equals) {
+              Step _step = stateCase.getStep();
+              this.execute(_step);
+            }
+          }
+        }
+      } else {
+        EList<StateCase> _cases_1 = stateSwitch.getCases();
+        for (final StateCase stateCase_1 : _cases_1) {
+          ExecutionState[] _stateConfiguration = this.executionContext.getStateConfiguration();
+          ExecutionState _state_1 = stateCase_1.getState();
+          boolean _contains = ((List<ExecutionState>)Conversions.doWrapArray(_stateConfiguration)).contains(_state_1);
+          if (_contains) {
+            Step _step_1 = stateCase_1.getStep();
+            this.execute(_step_1);
+          }
+        }
       }
       _xblockexpression = (null);
     }
@@ -494,7 +541,7 @@ public class ExecutionFlowInterpreter extends AbstractExecutionFacade implements
     }
   }
   
-  public Object execute(final EObject call) throws ExecutionException {
+  public Object execute(final Step call) throws ExecutionException {
     if ((call instanceof Call)) {
       return _execute((Call)call);
     } else if ((call instanceof Check)) {
@@ -505,8 +552,12 @@ public class ExecutionFlowInterpreter extends AbstractExecutionFacade implements
       return _execute((Execution)call);
     } else if ((call instanceof ExitState)) {
       return _execute((ExitState)call);
+    } else if ((call instanceof HistoryEntry)) {
+      return _execute((HistoryEntry)call);
     } else if ((call instanceof If)) {
       return _execute((If)call);
+    } else if ((call instanceof SaveHistory)) {
+      return _execute((SaveHistory)call);
     } else if ((call instanceof ScheduleTimeEvent)) {
       return _execute((ScheduleTimeEvent)call);
     } else if ((call instanceof Sequence)) {
@@ -519,8 +570,6 @@ public class ExecutionFlowInterpreter extends AbstractExecutionFacade implements
       return _execute((UnscheduleTimeEvent)call);
     } else if ((call instanceof Step)) {
       return _execute((Step)call);
-    } else if ((call instanceof StateCase)) {
-      return _execute((StateCase)call);
     } else {
       throw new IllegalArgumentException("Unhandled parameter types: " +
         java.util.Arrays.<Object>asList(call).toString());

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

@@ -54,7 +54,7 @@ class SequenceBuilder {
 		
 		val execRegion = r.create
 		val seq = sexec.factory.createSequence
-		seq.name = "enterSequence"
+		seq.name = "deepEnterSequence"
 		seq.comment = "deep enterSequence with history in child " + r.name
 		
 		seq.steps += r.defineDeepHistorySwitch
@@ -96,7 +96,7 @@ class SequenceBuilder {
 		for ( r : sc.allContentsIterable.filter(typeof(Region))) {
 			val execRegion = r.create
 			val seq = sexec.factory.createSequence
-			seq.name = "enterSequence"
+			seq.name = "shallowEnterSequence"
 			seq.comment = "shallow enterSequence with history in child " + r.name
 			
 			seq.steps += r.defineShallowHistorySwitch

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

@@ -24,7 +24,7 @@ class StateVectorBuilder {
 	@Inject extension SgraphExtensions sgraph
 	
 	def defineHistoryVector(ExecutionFlow flow, Statechart sc) {
-		var offset = 0
+		var offset = -1
 		for ( r : sc.allContentsIterable.filter(typeof(Region)) ) {
 			if (r.requireHistory) {
 				offset = offset+1
@@ -37,7 +37,7 @@ class StateVectorBuilder {
 		
 		flow.historyVector = sexec.factory.createStateVector
 		flow.historyVector.offset = 0;
-		flow.historyVector.size = offset
+		flow.historyVector.size = offset+1
 	}
 
 	def defineStateVector(ExecutionFlow flow, Statechart sc) {

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

@@ -105,7 +105,7 @@ public class SequenceBuilder {
       SexecFactory _factory = this.sexec.factory();
       Sequence _createSequence = _factory.createSequence();
       final Sequence seq = _createSequence;
-      seq.setName("enterSequence");
+      seq.setName("deepEnterSequence");
       String _name = r.getName();
       String _operator_plus = StringExtensions.operator_plus("deep enterSequence with history in child ", _name);
       seq.setComment(_operator_plus);
@@ -213,7 +213,7 @@ public class SequenceBuilder {
         SexecFactory _factory = this.sexec.factory();
         Sequence _createSequence = _factory.createSequence();
         final Sequence seq = _createSequence;
-        seq.setName("enterSequence");
+        seq.setName("shallowEnterSequence");
         String _name = r.getName();
         String _operator_plus = StringExtensions.operator_plus("shallow enterSequence with history in child ", _name);
         seq.setComment(_operator_plus);

+ 4 - 2
plugins/org.yakindu.sct.model.sexec/xtend-gen/org/yakindu/sct/model/sexec/transformation/StateVectorBuilder.java

@@ -42,7 +42,8 @@ public class StateVectorBuilder {
   
   public void defineHistoryVector(final ExecutionFlow flow, final Statechart sc) {
     {
-      int offset = 0;
+      int _operator_minus = IntegerExtensions.operator_minus(1);
+      int offset = _operator_minus;
       Iterable<EObject> _allContentsIterable = EObjectExtensions.allContentsIterable(sc);
       Iterable<Region> _filter = IterableExtensions.<Region>filter(_allContentsIterable, org.yakindu.sct.model.sgraph.Region.class);
       for (final Region r : _filter) {
@@ -69,7 +70,8 @@ public class StateVectorBuilder {
       StateVector _historyVector_2 = flow.getHistoryVector();
       _historyVector_2.setOffset(0);
       StateVector _historyVector_3 = flow.getHistoryVector();
-      _historyVector_3.setSize(offset);
+      int _operator_plus_1 = IntegerExtensions.operator_plus(((Integer)offset), ((Integer)1));
+      _historyVector_3.setSize(_operator_plus_1);
     }
   }
   

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

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