Przeglądaj źródła

Fixed bug of disfunctional histories when regions are exited using pseudo states. ( YAKHMI-1028 )

terfloth@itemis.de 11 lat temu
rodzic
commit
c04f3c167c
30 zmienionych plików z 1209 dodań i 73 usunięć
  1. 7 4
      plugins/org.yakindu.sct.model.sexec/src/org/yakindu/sct/model/sexec/transformation/SequenceBuilder.xtend
  2. 39 0
      test-plugins/org.yakindu.sct.generator.c.test/gtests/HistoryWithExitPoint/HistoryWithExitPoint.cc
  3. 8 0
      test-plugins/org.yakindu.sct.generator.c.test/gtests/HistoryWithExitPoint/HistoryWithExitPoint.sgen
  4. 12 0
      test-plugins/org.yakindu.sct.generator.c.test/model/test.sgen
  5. 4 3
      test-plugins/org.yakindu.sct.generator.c.test/test-gen/org/yakindu/sct/generator/c/test/AllTests.java
  6. 39 0
      test-plugins/org.yakindu.sct.generator.c.test/test-gen/org/yakindu/sct/generator/c/test/HistoryWithExitPoint.java
  7. 8 0
      test-plugins/org.yakindu.sct.generator.cpp.test/gtests/HistoryWithExitPointTest/HistoryWithExitPoint.sgen
  8. 36 0
      test-plugins/org.yakindu.sct.generator.cpp.test/gtests/HistoryWithExitPointTest/HistoryWithExitPointTest.cc
  9. 12 0
      test-plugins/org.yakindu.sct.generator.cpp.test/model/test.sgen
  10. 6 6
      test-plugins/org.yakindu.sct.generator.cpp.test/test-gen/org/yakindu/sct/generator/cpp/test/AllTestsTest.java
  11. 39 0
      test-plugins/org.yakindu.sct.generator.cpp.test/test-gen/org/yakindu/sct/generator/cpp/test/HistoryWithExitPointTest.java
  12. 12 0
      test-plugins/org.yakindu.sct.generator.java.test/model/model.sgen
  13. 8 0
      test-plugins/org.yakindu.sct.generator.java.test/model/test.sgen
  14. 10 0
      test-plugins/org.yakindu.sct.generator.java.test/src-gen/org/yakindu/scr/ckeywords/CKeywordsStatemachine.java
  15. 10 6
      test-plugins/org.yakindu.sct.generator.java.test/src-gen/org/yakindu/scr/deepentry/DeepEntryStatemachine.java
  16. 34 20
      test-plugins/org.yakindu.sct.generator.java.test/src-gen/org/yakindu/scr/deephistory/DeepHistoryStatemachine.java
  17. 297 0
      test-plugins/org.yakindu.sct.generator.java.test/src-gen/org/yakindu/scr/historywithexitpoint/HistoryWithExitPointStatemachine.java
  18. 15 0
      test-plugins/org.yakindu.sct.generator.java.test/src-gen/org/yakindu/scr/historywithexitpoint/IHistoryWithExitPointStatemachine.java
  19. 10 4
      test-plugins/org.yakindu.sct.generator.java.test/src-gen/org/yakindu/scr/historywithoutinitialstep/HistoryWithoutInitialStepStatemachine.java
  20. 18 0
      test-plugins/org.yakindu.sct.generator.java.test/src-gen/org/yakindu/scr/javakeywords/JavaKeywordsStatemachine.java
  21. 146 4
      test-plugins/org.yakindu.sct.generator.java.test/src-gen/org/yakindu/scr/performancetest/PerformanceTestStatemachine.java
  22. 30 14
      test-plugins/org.yakindu.sct.generator.java.test/src-gen/org/yakindu/scr/shallowhistory/ShallowHistoryStatemachine.java
  23. 6 6
      test-plugins/org.yakindu.sct.generator.java.test/test-gen/org/yakindu/sct/generator/java/test/AllTestsTest.java
  24. 59 0
      test-plugins/org.yakindu.sct.generator.java.test/test-gen/org/yakindu/sct/generator/java/test/HistoryWithExitPointTest.java
  25. 8 0
      test-plugins/org.yakindu.sct.simulation.core.sexec.test/model/test.sgen
  26. 6 6
      test-plugins/org.yakindu.sct.simulation.core.sexec.test/test-gen/org/yakindu/sct/simulation/core/sexec/test/AllTestsTest.java
  27. 56 0
      test-plugins/org.yakindu.sct.simulation.core.sexec.test/test-gen/org/yakindu/sct/simulation/core/sexec/test/HistoryWithExitPointTest.java
  28. 242 0
      test-plugins/org.yakindu.sct.test.models/testmodels/SCTUnit/HistoryWithExitPoint.sct
  29. 1 0
      test-plugins/org.yakindu.sct.test.models/tests/AllTests.sctunit
  30. 31 0
      test-plugins/org.yakindu.sct.test.models/tests/HistoryWithExitPoint.sctunit

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

@@ -242,6 +242,13 @@ class SequenceBuilder {
 					}
 				}
 			}
+			
+			// save the history on entering a state 
+			val execRegion = state.parentRegion.create
+			if (execRegion.historyVector != null) {
+				seq.steps += execRegion.newSaveHistory()
+			}
+			
 
 			execState.enterSequences += seq
 		}
@@ -268,10 +275,6 @@ class SequenceBuilder {
 		for (s : r.vertices)
 			defineStateExitSequence(s)
 
-		if (execRegion.historyVector != null) {
-			seq.steps += execRegion.newSaveHistory()
-		}
-
 		// collect leaf states
 		val Iterable<ExecutionState> leafStates = r.collectLeafStates(new ArrayList<RegularState>()).map(rs|rs.create)
 		val sVector = execRegion.stateVector

+ 39 - 0
test-plugins/org.yakindu.sct.generator.c.test/gtests/HistoryWithExitPoint/HistoryWithExitPoint.cc

@@ -0,0 +1,39 @@
+/**
+* Copyright (c) 2014 committers of YAKINDU and others.
+* All rights reserved. This program and the accompanying materials
+* are made available under the terms of the Eclipse Public License v1.0
+* which accompanies this distribution, and is available at
+* http://www.eclipse.org/legal/epl-v10.html
+*
+* Contributors:
+*     committers of YAKINDU - initial API and implementation
+*/
+#include <string>
+#include "gtest/gtest.h"
+#include "HistoryWithExitPoint.h"
+
+
+HistoryWithExitPoint handle;
+
+TEST(StatemachineTest, historyEntryAfterExit) {
+	historyWithExitPoint_init(&handle);
+	historyWithExitPoint_enter(&handle);
+	EXPECT_TRUE(historyWithExitPoint_isActive(&handle, HistoryWithExitPoint_X1));
+	historyWithExitPointIface_raise_push(&handle);
+	historyWithExitPoint_runCycle(&handle);
+	EXPECT_TRUE(historyWithExitPoint_isActive(&handle, HistoryWithExitPoint_B));
+	historyWithExitPointIface_raise_back(&handle);
+	historyWithExitPoint_runCycle(&handle);
+	EXPECT_TRUE(historyWithExitPoint_isActive(&handle, HistoryWithExitPoint_X1));
+	historyWithExitPointIface_raise_next(&handle);
+	historyWithExitPoint_runCycle(&handle);
+	EXPECT_TRUE(historyWithExitPoint_isActive(&handle, HistoryWithExitPoint_X2));
+	historyWithExitPointIface_raise_push(&handle);
+	historyWithExitPoint_runCycle(&handle);
+	EXPECT_TRUE(historyWithExitPoint_isActive(&handle, HistoryWithExitPoint_B));
+	historyWithExitPointIface_raise_back(&handle);
+	historyWithExitPoint_runCycle(&handle);
+	EXPECT_TRUE(historyWithExitPoint_isActive(&handle, HistoryWithExitPoint_X2));
+}
+
+		

+ 8 - 0
test-plugins/org.yakindu.sct.generator.c.test/gtests/HistoryWithExitPoint/HistoryWithExitPoint.sgen

@@ -0,0 +1,8 @@
+GeneratorModel for yakindu::c {
+	statechart HistoryWithExitPoint {
+		feature Outlet {
+			targetProject = "gtests"
+			targetFolder = "HistoryWithExitPoint"
+		}
+	}
+}

+ 12 - 0
test-plugins/org.yakindu.sct.generator.c.test/model/test.sgen

@@ -252,6 +252,18 @@ GeneratorModel for sctunit::c {
 		}			
 	}
 	
+	test HistoryWithExitPoint{
+		
+		feature Outlet{ 
+			targetProject = "org.yakindu.sct.generator.c.test" 
+			targetFolder = "test-gen"			
+		}		
+				
+		feature JUnitWrapper {
+			WrapToJUnit =  "true" 
+		}			
+	}
+	
 	test HistoryWithoutInitialStep{
 		
 		feature Outlet{ 

+ 4 - 3
test-plugins/org.yakindu.sct.generator.c.test/test-gen/org/yakindu/sct/generator/c/test/AllTests.java

@@ -21,9 +21,10 @@ import org.junit.runners.Suite.SuiteClasses;
 		EnterState.class, EntryChoice.class, EntryExitSelfTransition.class,
 		ExitOnSelfTransition.class, ExitState.class, FeatureCalls.class,
 		Guard.class, GuardedEntry.class, GuardedExit.class,
-		HistoryWithoutInitialStep.class, InEventLifeCycle.class,
-		IntegerExpressions.class, InternalEventLifeCycle.class,
-		LocalReactions.class, LogicalAndTests.class, LogicalOrTests.class,
+		HistoryWithExitPoint.class, HistoryWithoutInitialStep.class,
+		InEventLifeCycle.class, IntegerExpressions.class,
+		InternalEventLifeCycle.class, LocalReactions.class,
+		LogicalAndTests.class, LogicalOrTests.class,
 		NamedInterfaceAccess.class, OutEventLifeCycle.class, Parenthesis.class,
 		PriorityValues.class, RaiseEvent.class, SameNameDifferentRegion.class,
 		ShallowHistory.class, SimpleEvent.class,

+ 39 - 0
test-plugins/org.yakindu.sct.generator.c.test/test-gen/org/yakindu/sct/generator/c/test/HistoryWithExitPoint.java

@@ -0,0 +1,39 @@
+/**
+ * Copyright (c) 2014 committers of YAKINDU and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     committers of YAKINDU - initial API and implementation
+ */
+package org.yakindu.sct.generator.c.test;
+
+import java.util.Collection;
+
+import org.junit.Before;
+import org.junit.runner.RunWith;
+import org.yakindu.sct.generator.c.gtest.GTest;
+import org.yakindu.sct.generator.c.gtest.GTestRunner;
+import org.yakindu.sct.generator.c.gtest.GTestHelper;
+
+@GTest(sourceFile = "gtests/HistoryWithExitPoint/HistoryWithExitPoint.cc", program = "gtests/HistoryWithExitPoint/HistoryWithExitPoint", model = "testmodels/SCTUnit/HistoryWithExitPoint.sct")
+@RunWith(GTestRunner.class)
+public class HistoryWithExitPoint {
+
+	protected final GTestHelper helper = new GTestHelper(this) {
+
+		@Override
+		protected void getSourceFiles(Collection<String> files) {
+			super.getSourceFiles(files);
+			files.add(getFileName(getTestProgram()) + ".c");
+		}
+	};
+
+	@Before
+	public void setUp() {
+		helper.generate();
+		helper.compile();
+	}
+}

+ 8 - 0
test-plugins/org.yakindu.sct.generator.cpp.test/gtests/HistoryWithExitPointTest/HistoryWithExitPoint.sgen

@@ -0,0 +1,8 @@
+GeneratorModel for yakindu::cpp {
+	statechart HistoryWithExitPoint {
+		feature Outlet {
+			targetProject = "gtests"
+			targetFolder = "HistoryWithExitPointTest"
+		}
+	}
+}

+ 36 - 0
test-plugins/org.yakindu.sct.generator.cpp.test/gtests/HistoryWithExitPointTest/HistoryWithExitPointTest.cc

@@ -0,0 +1,36 @@
+/**
+* Copyright (c) 2014 committers of YAKINDU and others.
+* All rights reserved. This program and the accompanying materials
+* are made available under the terms of the Eclipse Public License v1.0
+* which accompanies this distribution, and is available at
+* http://www.eclipse.org/legal/epl-v10.html
+*
+* Contributors:
+*     committers of YAKINDU - initial API and implementation
+*/
+#include <string>
+#include "gtest/gtest.h"
+#include "HistoryWithExitPoint.h"
+
+TEST(StatemachineTest, historyEntryAfterExit) {
+	HistoryWithExitPoint* statechart = new HistoryWithExitPoint();
+	statechart->init();
+	statechart->enter();
+	EXPECT_TRUE(statechart->isActive(HistoryWithExitPoint::X1));
+	statechart->raise_push();
+	statechart->runCycle();
+	EXPECT_TRUE(statechart->isActive(HistoryWithExitPoint::B));
+	statechart->raise_back();
+	statechart->runCycle();
+	EXPECT_TRUE(statechart->isActive(HistoryWithExitPoint::X1));
+	statechart->raise_next();
+	statechart->runCycle();
+	EXPECT_TRUE(statechart->isActive(HistoryWithExitPoint::X2));
+	statechart->raise_push();
+	statechart->runCycle();
+	EXPECT_TRUE(statechart->isActive(HistoryWithExitPoint::B));
+	statechart->raise_back();
+	statechart->runCycle();
+	EXPECT_TRUE(statechart->isActive(HistoryWithExitPoint::X2));
+	delete statechart;
+}

+ 12 - 0
test-plugins/org.yakindu.sct.generator.cpp.test/model/test.sgen

@@ -253,6 +253,18 @@ GeneratorModel for sctunit::cpp {
 		}			
 	}
 	
+	test HistoryWithExitPoint {
+		
+		feature Outlet{ 
+			targetProject = "org.yakindu.sct.generator.cpp.test" 
+			targetFolder = "test-gen"			
+		}		
+		
+		feature JUnitWrapper {
+			WrapToJUnit =  "true"
+		}			
+	}
+	
 	test HistoryWithoutInitialStep{
 		
 		feature Outlet{ 

+ 6 - 6
test-plugins/org.yakindu.sct.generator.cpp.test/test-gen/org/yakindu/sct/generator/cpp/test/AllTestsTest.java

@@ -22,12 +22,12 @@ import org.junit.runners.Suite.SuiteClasses;
 		EntryExitSelfTransitionTest.class, ExitOnSelfTransitionTest.class,
 		ExitStateTest.class, FeatureCallsTest.class, GuardTest.class,
 		GuardedEntryTest.class, GuardedExitTest.class,
-		HistoryWithoutInitialStepTest.class, InEventLifeCycleTest.class,
-		IntegerExpressionsTest.class, InternalEventLifeCycleTest.class,
-		LocalReactionsTest.class, LogicalAndTestsTest.class,
-		LogicalOrTestsTest.class, NamedInterfaceAccessTest.class,
-		OutEventLifeCycleTest.class, ParenthesisTest.class,
-		PriorityValuesTest.class, RaiseEventTest.class,
+		HistoryWithExitPointTest.class, HistoryWithoutInitialStepTest.class,
+		InEventLifeCycleTest.class, IntegerExpressionsTest.class,
+		InternalEventLifeCycleTest.class, LocalReactionsTest.class,
+		LogicalAndTestsTest.class, LogicalOrTestsTest.class,
+		NamedInterfaceAccessTest.class, OutEventLifeCycleTest.class,
+		ParenthesisTest.class, PriorityValuesTest.class, RaiseEventTest.class,
 		SameNameDifferentRegionTest.class, ShallowHistoryTest.class,
 		SimpleEventTest.class, StatechartLocalReactionsTest.class,
 		SimpleHierachyTest.class, StateIsActiveTest.class,

+ 39 - 0
test-plugins/org.yakindu.sct.generator.cpp.test/test-gen/org/yakindu/sct/generator/cpp/test/HistoryWithExitPointTest.java

@@ -0,0 +1,39 @@
+/**
+ * Copyright (c) 2014 committers of YAKINDU and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     committers of YAKINDU - initial API and implementation
+ */
+package org.yakindu.sct.generator.cpp.test;
+
+import java.util.Collection;
+
+import org.junit.Before;
+import org.junit.runner.RunWith;
+import org.yakindu.sct.generator.c.gtest.GTest;
+import org.yakindu.sct.generator.c.gtest.GTestRunner;
+import org.yakindu.sct.generator.c.gtest.GTestHelper;
+
+@GTest(sourceFile = "gtests/HistoryWithExitPointTest/HistoryWithExitPointTest.cc", program = "gtests/HistoryWithExitPointTest/HistoryWithExitPoint", model = "testmodels/SCTUnit/HistoryWithExitPoint.sct")
+@RunWith(GTestRunner.class)
+public class HistoryWithExitPointTest {
+
+	protected final GTestHelper helper = new GTestHelper(this) {
+
+		@Override
+		protected void getSourceFiles(Collection<String> files) {
+			super.getSourceFiles(files);
+			files.add(getFileName(getTestProgram()) + ".cpp");
+		}
+	};
+
+	@Before
+	public void setUp() {
+		helper.generate();
+		helper.compile();
+	}
+}

+ 12 - 0
test-plugins/org.yakindu.sct.generator.java.test/model/model.sgen

@@ -245,6 +245,18 @@ GeneratorModel for yakindu::java {
 		}
 	}
 		
+	statechart HistoryWithExitPoint {
+		feature Outlet {
+			targetProject = "org.yakindu.sct.generator.java.test"
+			targetFolder = "src-gen"
+		}
+
+		feature GeneralFeatures {
+			TimerService = true
+			RuntimeService = true
+		}
+	}
+	
 	statechart HistoryWithoutInitialStep {
 		feature Outlet {
 			targetProject = "org.yakindu.sct.generator.java.test"

+ 8 - 0
test-plugins/org.yakindu.sct.generator.java.test/model/test.sgen

@@ -168,6 +168,14 @@ GeneratorModel for sctunit::java {
 		}			
 	}
 	
+	test HistoryWithExitPoint {
+		
+		feature Outlet{ 
+			targetProject = "org.yakindu.sct.generator.java.test" 
+			targetFolder = "test-gen"			
+		}			
+	}
+	
 	test HistoryWithoutInitialStep{
 		
 		feature Outlet{ 

+ 10 - 0
test-plugins/org.yakindu.sct.generator.java.test/src-gen/org/yakindu/scr/ckeywords/CKeywordsStatemachine.java

@@ -746,7 +746,11 @@ public class CKeywordsStatemachine implements ICKeywordsStatemachine {
 
 					nextStateIndex = 0;
 					stateVector[0] = State.auto_const_switch_case_enum_asm;
+
+					historyVector[1] = stateVector[0];
 				}
+
+				historyVector[0] = stateVector[0];
 				break;
 
 			default :
@@ -812,6 +816,8 @@ public class CKeywordsStatemachine implements ICKeywordsStatemachine {
 
 				nextStateIndex = 0;
 				stateVector[0] = State.auto_const_switch_case_enum_asm;
+
+				historyVector[1] = stateVector[0];
 				break;
 
 			default :
@@ -889,7 +895,11 @@ public class CKeywordsStatemachine implements ICKeywordsStatemachine {
 
 					nextStateIndex = 0;
 					stateVector[0] = State.auto_const_switch_case_enum_asm;
+
+					historyVector[1] = stateVector[0];
 				}
+
+				historyVector[0] = stateVector[0];
 			}
 		}
 	}

+ 10 - 6
test-plugins/org.yakindu.sct.generator.java.test/src-gen/org/yakindu/scr/deepentry/DeepEntryStatemachine.java

@@ -115,6 +115,8 @@ public class DeepEntryStatemachine implements IDeepEntryStatemachine {
 
 			nextStateIndex = 2;
 			stateVector[2] = State.r3_D_r_DA_r_DAA;
+
+			historyVector[3] = stateVector[2];
 		}
 	}
 
@@ -153,8 +155,6 @@ public class DeepEntryStatemachine implements IDeepEntryStatemachine {
 				break;
 		}
 
-		historyVector[1] = stateVector[2];
-
 		switch (stateVector[2]) {
 			case r3_D_r_DA_r_DAA :
 				historyVector[3] = stateVector[2];
@@ -274,11 +274,15 @@ public class DeepEntryStatemachine implements IDeepEntryStatemachine {
 
 				nextStateIndex = 1;
 				stateVector[1] = State.r2_B_r_BA_r_BAA;
+
+				historyVector[0] = stateVector[1];
 				break;
 
 			case r2_B_r_BB :
 				nextStateIndex = 1;
 				stateVector[1] = State.r2_B_r_BB;
+
+				historyVector[0] = stateVector[1];
 				break;
 
 			default :
@@ -320,6 +324,8 @@ public class DeepEntryStatemachine implements IDeepEntryStatemachine {
 			case r3_D_r_DA_r_DAA :
 				nextStateIndex = 2;
 				stateVector[2] = State.r3_D_r_DA_r_DAA;
+
+				historyVector[3] = stateVector[2];
 				break;
 
 			default :
@@ -334,8 +340,6 @@ public class DeepEntryStatemachine implements IDeepEntryStatemachine {
 	/* The reactions of state BAA. */
 	private void reactR2_B_r_BA_r_BAA() {
 		if (sCInterface.f) {
-			historyVector[0] = stateVector[1];
-
 			switch (stateVector[1]) {
 				case r2_B_r_BA_r_BAA :
 					nextStateIndex = 1;
@@ -367,6 +371,8 @@ public class DeepEntryStatemachine implements IDeepEntryStatemachine {
 
 				nextStateIndex = 1;
 				stateVector[1] = State.r2_B_r_BB;
+
+				historyVector[0] = stateVector[1];
 			} else {
 			}
 		}
@@ -375,8 +381,6 @@ public class DeepEntryStatemachine implements IDeepEntryStatemachine {
 	/* The reactions of state BB. */
 	private void reactR2_B_r_BB() {
 		if (sCInterface.f) {
-			historyVector[0] = stateVector[1];
-
 			switch (stateVector[1]) {
 				case r2_B_r_BA_r_BAA :
 					nextStateIndex = 1;

+ 34 - 20
test-plugins/org.yakindu.sct.generator.java.test/src-gen/org/yakindu/scr/deephistory/DeepHistoryStatemachine.java

@@ -264,6 +264,8 @@ public class DeepHistoryStatemachine implements IDeepHistoryStatemachine {
 			case mainRegion_State2__region0_a :
 				nextStateIndex = 0;
 				stateVector[0] = State.mainRegion_State2__region0_a;
+
+				historyVector[0] = stateVector[0];
 				break;
 
 			case mainRegion_State2__region0_State4__region0_State6 :
@@ -281,6 +283,8 @@ public class DeepHistoryStatemachine implements IDeepHistoryStatemachine {
 			case mainRegion_State2__region0_State5 :
 				nextStateIndex = 0;
 				stateVector[0] = State.mainRegion_State2__region0_State5;
+
+				historyVector[0] = stateVector[0];
 				break;
 
 			default :
@@ -294,6 +298,8 @@ public class DeepHistoryStatemachine implements IDeepHistoryStatemachine {
 			case mainRegion_State2__region0_State4__region0_State6 :
 				nextStateIndex = 0;
 				stateVector[0] = State.mainRegion_State2__region0_State4__region0_State6;
+
+				historyVector[1] = stateVector[0];
 				break;
 
 			case mainRegion_State2__region0_State4__region0_State7__region0_State8 :
@@ -315,11 +321,15 @@ public class DeepHistoryStatemachine implements IDeepHistoryStatemachine {
 			case mainRegion_State2__region0_State4__region0_State7__region0_State8 :
 				nextStateIndex = 0;
 				stateVector[0] = State.mainRegion_State2__region0_State4__region0_State7__region0_State8;
+
+				historyVector[2] = stateVector[0];
 				break;
 
 			case mainRegion_State2__region0_State4__region0_State7__region0_State9 :
 				nextStateIndex = 0;
 				stateVector[0] = State.mainRegion_State2__region0_State4__region0_State7__region0_State9;
+
+				historyVector[2] = stateVector[0];
 				break;
 
 			default :
@@ -339,6 +349,8 @@ public class DeepHistoryStatemachine implements IDeepHistoryStatemachine {
 			} else {
 				nextStateIndex = 0;
 				stateVector[0] = State.mainRegion_State2__region0_a;
+
+				historyVector[0] = stateVector[0];
 			}
 		}
 	}
@@ -346,8 +358,6 @@ public class DeepHistoryStatemachine implements IDeepHistoryStatemachine {
 	/* The reactions of state a. */
 	private void reactMainRegion_State2_region0_a() {
 		if (sCInterface.event2) {
-			historyVector[0] = stateVector[0];
-
 			switch (stateVector[0]) {
 				case mainRegion_State2__region0_a :
 					nextStateIndex = 0;
@@ -397,6 +407,10 @@ public class DeepHistoryStatemachine implements IDeepHistoryStatemachine {
 
 				nextStateIndex = 0;
 				stateVector[0] = State.mainRegion_State2__region0_State4__region0_State6;
+
+				historyVector[1] = stateVector[0];
+
+				historyVector[0] = stateVector[0];
 			}
 		}
 	}
@@ -404,8 +418,6 @@ public class DeepHistoryStatemachine implements IDeepHistoryStatemachine {
 	/* The reactions of state State6. */
 	private void reactMainRegion_State2_region0_State4_region0_State6() {
 		if (sCInterface.event2) {
-			historyVector[0] = stateVector[0];
-
 			switch (stateVector[0]) {
 				case mainRegion_State2__region0_a :
 					nextStateIndex = 0;
@@ -450,8 +462,6 @@ public class DeepHistoryStatemachine implements IDeepHistoryStatemachine {
 			stateVector[0] = State.mainRegion_State1;
 		} else {
 			if (sCInterface.event4) {
-				historyVector[1] = stateVector[0];
-
 				switch (stateVector[0]) {
 					case mainRegion_State2__region0_State4__region0_State6 :
 						nextStateIndex = 0;
@@ -478,6 +488,8 @@ public class DeepHistoryStatemachine implements IDeepHistoryStatemachine {
 
 				nextStateIndex = 0;
 				stateVector[0] = State.mainRegion_State2__region0_State5;
+
+				historyVector[0] = stateVector[0];
 			} else {
 				if (sCInterface.event5) {
 					nextStateIndex = 0;
@@ -485,6 +497,10 @@ public class DeepHistoryStatemachine implements IDeepHistoryStatemachine {
 
 					nextStateIndex = 0;
 					stateVector[0] = State.mainRegion_State2__region0_State4__region0_State7__region0_State8;
+
+					historyVector[2] = stateVector[0];
+
+					historyVector[1] = stateVector[0];
 				}
 			}
 		}
@@ -493,8 +509,6 @@ public class DeepHistoryStatemachine implements IDeepHistoryStatemachine {
 	/* The reactions of state State8. */
 	private void reactMainRegion_State2_region0_State4_region0_State7_region0_State8() {
 		if (sCInterface.event2) {
-			historyVector[0] = stateVector[0];
-
 			switch (stateVector[0]) {
 				case mainRegion_State2__region0_a :
 					nextStateIndex = 0;
@@ -539,8 +553,6 @@ public class DeepHistoryStatemachine implements IDeepHistoryStatemachine {
 			stateVector[0] = State.mainRegion_State1;
 		} else {
 			if (sCInterface.event4) {
-				historyVector[1] = stateVector[0];
-
 				switch (stateVector[0]) {
 					case mainRegion_State2__region0_State4__region0_State6 :
 						nextStateIndex = 0;
@@ -567,10 +579,10 @@ public class DeepHistoryStatemachine implements IDeepHistoryStatemachine {
 
 				nextStateIndex = 0;
 				stateVector[0] = State.mainRegion_State2__region0_State5;
+
+				historyVector[0] = stateVector[0];
 			} else {
 				if (sCInterface.event6) {
-					historyVector[2] = stateVector[0];
-
 					switch (stateVector[0]) {
 						case mainRegion_State2__region0_State4__region0_State7__region0_State8 :
 							nextStateIndex = 0;
@@ -588,6 +600,8 @@ public class DeepHistoryStatemachine implements IDeepHistoryStatemachine {
 
 					nextStateIndex = 0;
 					stateVector[0] = State.mainRegion_State2__region0_State4__region0_State6;
+
+					historyVector[1] = stateVector[0];
 				} else {
 					if (sCInterface.event7) {
 						nextStateIndex = 0;
@@ -595,6 +609,8 @@ public class DeepHistoryStatemachine implements IDeepHistoryStatemachine {
 
 						nextStateIndex = 0;
 						stateVector[0] = State.mainRegion_State2__region0_State4__region0_State7__region0_State9;
+
+						historyVector[2] = stateVector[0];
 					}
 				}
 			}
@@ -604,8 +620,6 @@ public class DeepHistoryStatemachine implements IDeepHistoryStatemachine {
 	/* The reactions of state State9. */
 	private void reactMainRegion_State2_region0_State4_region0_State7_region0_State9() {
 		if (sCInterface.event2) {
-			historyVector[0] = stateVector[0];
-
 			switch (stateVector[0]) {
 				case mainRegion_State2__region0_a :
 					nextStateIndex = 0;
@@ -650,8 +664,6 @@ public class DeepHistoryStatemachine implements IDeepHistoryStatemachine {
 			stateVector[0] = State.mainRegion_State1;
 		} else {
 			if (sCInterface.event4) {
-				historyVector[1] = stateVector[0];
-
 				switch (stateVector[0]) {
 					case mainRegion_State2__region0_State4__region0_State6 :
 						nextStateIndex = 0;
@@ -678,10 +690,10 @@ public class DeepHistoryStatemachine implements IDeepHistoryStatemachine {
 
 				nextStateIndex = 0;
 				stateVector[0] = State.mainRegion_State2__region0_State5;
+
+				historyVector[0] = stateVector[0];
 			} else {
 				if (sCInterface.event6) {
-					historyVector[2] = stateVector[0];
-
 					switch (stateVector[0]) {
 						case mainRegion_State2__region0_State4__region0_State7__region0_State8 :
 							nextStateIndex = 0;
@@ -699,6 +711,8 @@ public class DeepHistoryStatemachine implements IDeepHistoryStatemachine {
 
 					nextStateIndex = 0;
 					stateVector[0] = State.mainRegion_State2__region0_State4__region0_State6;
+
+					historyVector[1] = stateVector[0];
 				} else {
 					if (sCInterface.event8) {
 						nextStateIndex = 0;
@@ -706,6 +720,8 @@ public class DeepHistoryStatemachine implements IDeepHistoryStatemachine {
 
 						nextStateIndex = 0;
 						stateVector[0] = State.mainRegion_State2__region0_State4__region0_State7__region0_State8;
+
+						historyVector[2] = stateVector[0];
 					}
 				}
 			}
@@ -715,8 +731,6 @@ public class DeepHistoryStatemachine implements IDeepHistoryStatemachine {
 	/* The reactions of state State5. */
 	private void reactMainRegion_State2_region0_State5() {
 		if (sCInterface.event2) {
-			historyVector[0] = stateVector[0];
-
 			switch (stateVector[0]) {
 				case mainRegion_State2__region0_a :
 					nextStateIndex = 0;

+ 297 - 0
test-plugins/org.yakindu.sct.generator.java.test/src-gen/org/yakindu/scr/historywithexitpoint/HistoryWithExitPointStatemachine.java

@@ -0,0 +1,297 @@
+package org.yakindu.scr.historywithexitpoint;
+
+public class HistoryWithExitPointStatemachine
+		implements
+			IHistoryWithExitPointStatemachine {
+
+	private final class SCInterfaceImpl implements SCInterface {
+
+		private boolean push;
+
+		public void raisePush() {
+			push = true;
+		}
+
+		private boolean back;
+
+		public void raiseBack() {
+			back = true;
+		}
+
+		private boolean next;
+
+		public void raiseNext() {
+			next = true;
+		}
+
+		public void clearEvents() {
+			push = false;
+			back = false;
+			next = false;
+		}
+
+	}
+
+	private SCInterfaceImpl sCInterface;
+
+	public enum State {
+		mr_A, mr_A_r_X1, mr_A_r_X2, mr_B, $NullState$
+	};
+
+	private State[] historyVector = new State[1];
+	private final State[] stateVector = new State[1];
+
+	private int nextStateIndex;
+
+	public HistoryWithExitPointStatemachine() {
+
+		sCInterface = new SCInterfaceImpl();
+	}
+
+	public void init() {
+		for (int i = 0; i < 1; i++) {
+			stateVector[i] = State.$NullState$;
+		}
+
+		for (int i = 0; i < 1; i++) {
+			historyVector[i] = State.$NullState$;
+		}
+		clearEvents();
+		clearOutEvents();
+
+	}
+
+	public void enter() {
+		entryAction();
+
+		/* Enter the region with shallow history */
+		if (historyVector[0] != State.$NullState$) {
+			shallowEnterSequenceMr_A_r();
+		} else {
+			nextStateIndex = 0;
+			stateVector[0] = State.mr_A_r_X1;
+
+			historyVector[0] = stateVector[0];
+		}
+	}
+
+	public void exit() {
+		switch (stateVector[0]) {
+			case mr_A_r_X1 :
+				historyVector[0] = stateVector[0];
+
+				nextStateIndex = 0;
+				stateVector[0] = State.$NullState$;
+				break;
+
+			case mr_A_r_X2 :
+				historyVector[0] = stateVector[0];
+
+				nextStateIndex = 0;
+				stateVector[0] = State.$NullState$;
+				break;
+
+			case mr_B :
+				nextStateIndex = 0;
+				stateVector[0] = State.$NullState$;
+				break;
+
+			default :
+				break;
+		}
+
+		exitAction();
+	}
+
+	/**
+	 * This method resets the incoming events (time events included).
+	 */
+	protected void clearEvents() {
+		sCInterface.clearEvents();
+
+	}
+
+	/**
+	 * This method resets the outgoing events.
+	 */
+	protected void clearOutEvents() {
+	}
+
+	/**
+	 * Returns true if the given state is currently active otherwise false.
+	 */
+	public boolean isStateActive(State state) {
+		switch (state) {
+			case mr_A :
+				return stateVector[0].ordinal() >= State.mr_A.ordinal()
+						&& stateVector[0].ordinal() <= State.mr_A_r_X2
+								.ordinal();
+			case mr_A_r_X1 :
+				return stateVector[0] == State.mr_A_r_X1;
+			case mr_A_r_X2 :
+				return stateVector[0] == State.mr_A_r_X2;
+			case mr_B :
+				return stateVector[0] == State.mr_B;
+			default :
+				return false;
+		}
+	}
+
+	public SCInterface getSCInterface() {
+		return sCInterface;
+	}
+
+	public void raisePush() {
+		sCInterface.raisePush();
+	}
+	public void raiseBack() {
+		sCInterface.raiseBack();
+	}
+	public void raiseNext() {
+		sCInterface.raiseNext();
+	}
+
+	/* Entry action for statechart 'HistoryWithExitPoint'. */
+	private void entryAction() {
+	}
+
+	/* Exit action for state 'HistoryWithExitPoint'. */
+	private void exitAction() {
+	}
+
+	/* shallow enterSequence with history in child r */
+	private void shallowEnterSequenceMr_A_r() {
+		switch (historyVector[0]) {
+			case mr_A_r_X1 :
+				nextStateIndex = 0;
+				stateVector[0] = State.mr_A_r_X1;
+
+				historyVector[0] = stateVector[0];
+				break;
+
+			case mr_A_r_X2 :
+				nextStateIndex = 0;
+				stateVector[0] = State.mr_A_r_X2;
+
+				historyVector[0] = stateVector[0];
+				break;
+
+			default :
+				break;
+		}
+	}
+
+	/* The reactions of state X1. */
+	private void reactMr_A_r_X1() {
+		if (sCInterface.next) {
+			nextStateIndex = 0;
+			stateVector[0] = State.$NullState$;
+
+			nextStateIndex = 0;
+			stateVector[0] = State.mr_A_r_X2;
+
+			historyVector[0] = stateVector[0];
+		} else {
+			if (sCInterface.push) {
+				nextStateIndex = 0;
+				stateVector[0] = State.$NullState$;
+
+				switch (stateVector[0]) {
+					case mr_A_r_X1 :
+						nextStateIndex = 0;
+						stateVector[0] = State.$NullState$;
+						break;
+
+					case mr_A_r_X2 :
+						nextStateIndex = 0;
+						stateVector[0] = State.$NullState$;
+						break;
+
+					default :
+						break;
+				}
+
+				nextStateIndex = 0;
+				stateVector[0] = State.mr_B;
+			}
+		}
+	}
+
+	/* The reactions of state X2. */
+	private void reactMr_A_r_X2() {
+		if (sCInterface.next) {
+			nextStateIndex = 0;
+			stateVector[0] = State.$NullState$;
+
+			nextStateIndex = 0;
+			stateVector[0] = State.mr_A_r_X1;
+
+			historyVector[0] = stateVector[0];
+		} else {
+			if (sCInterface.push) {
+				nextStateIndex = 0;
+				stateVector[0] = State.$NullState$;
+
+				switch (stateVector[0]) {
+					case mr_A_r_X1 :
+						nextStateIndex = 0;
+						stateVector[0] = State.$NullState$;
+						break;
+
+					case mr_A_r_X2 :
+						nextStateIndex = 0;
+						stateVector[0] = State.$NullState$;
+						break;
+
+					default :
+						break;
+				}
+
+				nextStateIndex = 0;
+				stateVector[0] = State.mr_B;
+			}
+		}
+	}
+
+	/* The reactions of state B. */
+	private void reactMr_B() {
+		if (sCInterface.back) {
+			nextStateIndex = 0;
+			stateVector[0] = State.$NullState$;
+
+			/* Enter the region with shallow history */
+			if (historyVector[0] != State.$NullState$) {
+				shallowEnterSequenceMr_A_r();
+			} else {
+				nextStateIndex = 0;
+				stateVector[0] = State.mr_A_r_X1;
+
+				historyVector[0] = stateVector[0];
+			}
+		}
+	}
+
+	public void runCycle() {
+
+		clearOutEvents();
+
+		for (nextStateIndex = 0; nextStateIndex < stateVector.length; nextStateIndex++) {
+
+			switch (stateVector[nextStateIndex]) {
+				case mr_A_r_X1 :
+					reactMr_A_r_X1();
+					break;
+				case mr_A_r_X2 :
+					reactMr_A_r_X2();
+					break;
+				case mr_B :
+					reactMr_B();
+					break;
+				default :
+					// $NullState$
+			}
+		}
+
+		clearEvents();
+	}
+}

+ 15 - 0
test-plugins/org.yakindu.sct.generator.java.test/src-gen/org/yakindu/scr/historywithexitpoint/IHistoryWithExitPointStatemachine.java

@@ -0,0 +1,15 @@
+package org.yakindu.scr.historywithexitpoint;
+import org.yakindu.scr.IStatemachine;
+
+public interface IHistoryWithExitPointStatemachine extends IStatemachine {
+
+	public interface SCInterface {
+		public void raisePush();
+		public void raiseBack();
+		public void raiseNext();
+
+	}
+
+	public SCInterface getSCInterface();
+
+}

+ 10 - 4
test-plugins/org.yakindu.sct.generator.java.test/src-gen/org/yakindu/scr/historywithoutinitialstep/HistoryWithoutInitialStepStatemachine.java

@@ -149,11 +149,15 @@ public class HistoryWithoutInitialStepStatemachine
 			case main_region_B_r1_C :
 				nextStateIndex = 0;
 				stateVector[0] = State.main_region_B_r1_C;
+
+				historyVector[0] = stateVector[0];
 				break;
 
 			case main_region_B_r1_D :
 				nextStateIndex = 0;
 				stateVector[0] = State.main_region_B_r1_D;
+
+				historyVector[0] = stateVector[0];
 				break;
 
 			default :
@@ -169,6 +173,8 @@ public class HistoryWithoutInitialStepStatemachine
 
 			nextStateIndex = 0;
 			stateVector[0] = State.main_region_B_r1_C;
+
+			historyVector[0] = stateVector[0];
 		} else {
 			if (sCInterface.e2) {
 				nextStateIndex = 0;
@@ -185,8 +191,6 @@ public class HistoryWithoutInitialStepStatemachine
 	/* The reactions of state C. */
 	private void reactMain_region_B_r1_C() {
 		if (sCInterface.e1) {
-			historyVector[0] = stateVector[0];
-
 			switch (stateVector[0]) {
 				case main_region_B_r1_C :
 					nextStateIndex = 0;
@@ -211,6 +215,8 @@ public class HistoryWithoutInitialStepStatemachine
 
 				nextStateIndex = 0;
 				stateVector[0] = State.main_region_B_r1_D;
+
+				historyVector[0] = stateVector[0];
 			}
 		}
 	}
@@ -218,8 +224,6 @@ public class HistoryWithoutInitialStepStatemachine
 	/* The reactions of state D. */
 	private void reactMain_region_B_r1_D() {
 		if (sCInterface.e1) {
-			historyVector[0] = stateVector[0];
-
 			switch (stateVector[0]) {
 				case main_region_B_r1_C :
 					nextStateIndex = 0;
@@ -244,6 +248,8 @@ public class HistoryWithoutInitialStepStatemachine
 
 				nextStateIndex = 0;
 				stateVector[0] = State.main_region_B_r1_C;
+
+				historyVector[0] = stateVector[0];
 			}
 		}
 	}

+ 18 - 0
test-plugins/org.yakindu.sct.generator.java.test/src-gen/org/yakindu/scr/javakeywords/JavaKeywordsStatemachine.java

@@ -1105,11 +1105,17 @@ public class JavaKeywordsStatemachine implements IJavaKeywordsStatemachine {
 			case goto_void_volatile_transient_throw_false :
 				nextStateIndex = 0;
 				stateVector[0] = State.goto_void_volatile_transient_throw_false;
+
+				historyVector[1] = stateVector[0];
+
+				historyVector[0] = stateVector[0];
 				break;
 
 			case goto_void_volatile_state :
 				nextStateIndex = 0;
 				stateVector[0] = State.goto_void_volatile_state;
+
+				historyVector[0] = stateVector[0];
 				break;
 
 			default :
@@ -1123,6 +1129,8 @@ public class JavaKeywordsStatemachine implements IJavaKeywordsStatemachine {
 			case goto_void_volatile_transient_throw_false :
 				nextStateIndex = 0;
 				stateVector[0] = State.goto_void_volatile_transient_throw_false;
+
+				historyVector[1] = stateVector[0];
 				break;
 
 			default :
@@ -1239,6 +1247,10 @@ public class JavaKeywordsStatemachine implements IJavaKeywordsStatemachine {
 
 			nextStateIndex = 0;
 			stateVector[0] = State.goto_void_volatile_transient_throw_false;
+
+			historyVector[1] = stateVector[0];
+
+			historyVector[0] = stateVector[0];
 		} else {
 			if (sCInterface.ev) {
 				nextStateIndex = 0;
@@ -1250,6 +1262,8 @@ public class JavaKeywordsStatemachine implements IJavaKeywordsStatemachine {
 				} else {
 					nextStateIndex = 0;
 					stateVector[0] = State.goto_void_volatile_state;
+
+					historyVector[0] = stateVector[0];
 				}
 			}
 		}
@@ -1271,7 +1285,11 @@ public class JavaKeywordsStatemachine implements IJavaKeywordsStatemachine {
 			} else {
 				nextStateIndex = 0;
 				stateVector[0] = State.goto_void_volatile_transient_throw_false;
+
+				historyVector[1] = stateVector[0];
 			}
+
+			historyVector[0] = stateVector[0];
 		}
 	}
 

+ 146 - 4
test-plugins/org.yakindu.sct.generator.java.test/src-gen/org/yakindu/scr/performancetest/PerformanceTestStatemachine.java

@@ -387,41 +387,57 @@ public class PerformanceTestStatemachine
 			case mr_B_r1_X :
 				nextStateIndex = 0;
 				stateVector[0] = State.mr_B_r1_X;
+
+				historyVector[0] = stateVector[0];
 				break;
 
 			case mr_B_r1_Y :
 				nextStateIndex = 0;
 				stateVector[0] = State.mr_B_r1_Y;
+
+				historyVector[0] = stateVector[0];
 				break;
 
 			case mr_B_r1_Z :
 				nextStateIndex = 0;
 				stateVector[0] = State.mr_B_r1_Z;
+
+				historyVector[0] = stateVector[0];
 				break;
 
 			case mr_B_r1_V :
 				nextStateIndex = 0;
 				stateVector[0] = State.mr_B_r1_V;
+
+				historyVector[0] = stateVector[0];
 				break;
 
 			case mr_B_r1_W :
 				nextStateIndex = 0;
 				stateVector[0] = State.mr_B_r1_W;
+
+				historyVector[0] = stateVector[0];
 				break;
 
 			case mr_B_r1_S :
 				nextStateIndex = 0;
 				stateVector[0] = State.mr_B_r1_S;
+
+				historyVector[0] = stateVector[0];
 				break;
 
 			case mr_B_r1_T :
 				nextStateIndex = 0;
 				stateVector[0] = State.mr_B_r1_T;
+
+				historyVector[0] = stateVector[0];
 				break;
 
 			case mr_B_r1_U :
 				nextStateIndex = 0;
 				stateVector[0] = State.mr_B_r1_U;
+
+				historyVector[0] = stateVector[0];
 				break;
 
 			default :
@@ -451,6 +467,8 @@ public class PerformanceTestStatemachine
 			} else {
 				nextStateIndex = 0;
 				stateVector[0] = State.mr_B_r1_S;
+
+				historyVector[0] = stateVector[0];
 			}
 
 			nextStateIndex = 1;
@@ -479,35 +497,51 @@ public class PerformanceTestStatemachine
 			if (sCInterface.x == 4) {
 				nextStateIndex = 0;
 				stateVector[0] = State.mr_B_r1_V;
+
+				historyVector[0] = stateVector[0];
 			} else {
 				if (sCInterface.x == 5) {
 					nextStateIndex = 0;
 					stateVector[0] = State.mr_B_r1_W;
+
+					historyVector[0] = stateVector[0];
 				} else {
 					if (sCInterface.x == 6) {
 						nextStateIndex = 0;
 						stateVector[0] = State.mr_B_r1_X;
+
+						historyVector[0] = stateVector[0];
 					} else {
 						if (sCInterface.x == 7) {
 							nextStateIndex = 0;
 							stateVector[0] = State.mr_B_r1_Y;
+
+							historyVector[0] = stateVector[0];
 						} else {
 							if (sCInterface.x == 8) {
 								sCInterface.x = 0;
 
 								nextStateIndex = 0;
 								stateVector[0] = State.mr_B_r1_Z;
+
+								historyVector[0] = stateVector[0];
 							} else {
 								if (sCInterface.x == 3) {
 									nextStateIndex = 0;
 									stateVector[0] = State.mr_B_r1_U;
+
+									historyVector[0] = stateVector[0];
 								} else {
 									if (sCInterface.x == 2) {
 										nextStateIndex = 0;
 										stateVector[0] = State.mr_B_r1_T;
+
+										historyVector[0] = stateVector[0];
 									} else {
 										nextStateIndex = 0;
 										stateVector[0] = State.mr_B_r1_S;
+
+										historyVector[0] = stateVector[0];
 									}
 								}
 							}
@@ -539,35 +573,51 @@ public class PerformanceTestStatemachine
 			if (sCInterface.x == 4) {
 				nextStateIndex = 0;
 				stateVector[0] = State.mr_B_r1_V;
+
+				historyVector[0] = stateVector[0];
 			} else {
 				if (sCInterface.x == 5) {
 					nextStateIndex = 0;
 					stateVector[0] = State.mr_B_r1_W;
+
+					historyVector[0] = stateVector[0];
 				} else {
 					if (sCInterface.x == 6) {
 						nextStateIndex = 0;
 						stateVector[0] = State.mr_B_r1_X;
+
+						historyVector[0] = stateVector[0];
 					} else {
 						if (sCInterface.x == 7) {
 							nextStateIndex = 0;
 							stateVector[0] = State.mr_B_r1_Y;
+
+							historyVector[0] = stateVector[0];
 						} else {
 							if (sCInterface.x == 8) {
 								sCInterface.x = 0;
 
 								nextStateIndex = 0;
 								stateVector[0] = State.mr_B_r1_Z;
+
+								historyVector[0] = stateVector[0];
 							} else {
 								if (sCInterface.x == 3) {
 									nextStateIndex = 0;
 									stateVector[0] = State.mr_B_r1_U;
+
+									historyVector[0] = stateVector[0];
 								} else {
 									if (sCInterface.x == 2) {
 										nextStateIndex = 0;
 										stateVector[0] = State.mr_B_r1_T;
+
+										historyVector[0] = stateVector[0];
 									} else {
 										nextStateIndex = 0;
 										stateVector[0] = State.mr_B_r1_S;
+
+										historyVector[0] = stateVector[0];
 									}
 								}
 							}
@@ -599,35 +649,51 @@ public class PerformanceTestStatemachine
 			if (sCInterface.x == 4) {
 				nextStateIndex = 0;
 				stateVector[0] = State.mr_B_r1_V;
+
+				historyVector[0] = stateVector[0];
 			} else {
 				if (sCInterface.x == 5) {
 					nextStateIndex = 0;
 					stateVector[0] = State.mr_B_r1_W;
+
+					historyVector[0] = stateVector[0];
 				} else {
 					if (sCInterface.x == 6) {
 						nextStateIndex = 0;
 						stateVector[0] = State.mr_B_r1_X;
+
+						historyVector[0] = stateVector[0];
 					} else {
 						if (sCInterface.x == 7) {
 							nextStateIndex = 0;
 							stateVector[0] = State.mr_B_r1_Y;
+
+							historyVector[0] = stateVector[0];
 						} else {
 							if (sCInterface.x == 8) {
 								sCInterface.x = 0;
 
 								nextStateIndex = 0;
 								stateVector[0] = State.mr_B_r1_Z;
+
+								historyVector[0] = stateVector[0];
 							} else {
 								if (sCInterface.x == 3) {
 									nextStateIndex = 0;
 									stateVector[0] = State.mr_B_r1_U;
+
+									historyVector[0] = stateVector[0];
 								} else {
 									if (sCInterface.x == 2) {
 										nextStateIndex = 0;
 										stateVector[0] = State.mr_B_r1_T;
+
+										historyVector[0] = stateVector[0];
 									} else {
 										nextStateIndex = 0;
 										stateVector[0] = State.mr_B_r1_S;
+
+										historyVector[0] = stateVector[0];
 									}
 								}
 							}
@@ -659,35 +725,51 @@ public class PerformanceTestStatemachine
 			if (sCInterface.x == 4) {
 				nextStateIndex = 0;
 				stateVector[0] = State.mr_B_r1_V;
+
+				historyVector[0] = stateVector[0];
 			} else {
 				if (sCInterface.x == 5) {
 					nextStateIndex = 0;
 					stateVector[0] = State.mr_B_r1_W;
+
+					historyVector[0] = stateVector[0];
 				} else {
 					if (sCInterface.x == 6) {
 						nextStateIndex = 0;
 						stateVector[0] = State.mr_B_r1_X;
+
+						historyVector[0] = stateVector[0];
 					} else {
 						if (sCInterface.x == 7) {
 							nextStateIndex = 0;
 							stateVector[0] = State.mr_B_r1_Y;
+
+							historyVector[0] = stateVector[0];
 						} else {
 							if (sCInterface.x == 8) {
 								sCInterface.x = 0;
 
 								nextStateIndex = 0;
 								stateVector[0] = State.mr_B_r1_Z;
+
+								historyVector[0] = stateVector[0];
 							} else {
 								if (sCInterface.x == 3) {
 									nextStateIndex = 0;
 									stateVector[0] = State.mr_B_r1_U;
+
+									historyVector[0] = stateVector[0];
 								} else {
 									if (sCInterface.x == 2) {
 										nextStateIndex = 0;
 										stateVector[0] = State.mr_B_r1_T;
+
+										historyVector[0] = stateVector[0];
 									} else {
 										nextStateIndex = 0;
 										stateVector[0] = State.mr_B_r1_S;
+
+										historyVector[0] = stateVector[0];
 									}
 								}
 							}
@@ -719,35 +801,51 @@ public class PerformanceTestStatemachine
 			if (sCInterface.x == 4) {
 				nextStateIndex = 0;
 				stateVector[0] = State.mr_B_r1_V;
+
+				historyVector[0] = stateVector[0];
 			} else {
 				if (sCInterface.x == 5) {
 					nextStateIndex = 0;
 					stateVector[0] = State.mr_B_r1_W;
+
+					historyVector[0] = stateVector[0];
 				} else {
 					if (sCInterface.x == 6) {
 						nextStateIndex = 0;
 						stateVector[0] = State.mr_B_r1_X;
+
+						historyVector[0] = stateVector[0];
 					} else {
 						if (sCInterface.x == 7) {
 							nextStateIndex = 0;
 							stateVector[0] = State.mr_B_r1_Y;
+
+							historyVector[0] = stateVector[0];
 						} else {
 							if (sCInterface.x == 8) {
 								sCInterface.x = 0;
 
 								nextStateIndex = 0;
 								stateVector[0] = State.mr_B_r1_Z;
+
+								historyVector[0] = stateVector[0];
 							} else {
 								if (sCInterface.x == 3) {
 									nextStateIndex = 0;
 									stateVector[0] = State.mr_B_r1_U;
+
+									historyVector[0] = stateVector[0];
 								} else {
 									if (sCInterface.x == 2) {
 										nextStateIndex = 0;
 										stateVector[0] = State.mr_B_r1_T;
+
+										historyVector[0] = stateVector[0];
 									} else {
 										nextStateIndex = 0;
 										stateVector[0] = State.mr_B_r1_S;
+
+										historyVector[0] = stateVector[0];
 									}
 								}
 							}
@@ -779,35 +877,51 @@ public class PerformanceTestStatemachine
 			if (sCInterface.x == 4) {
 				nextStateIndex = 0;
 				stateVector[0] = State.mr_B_r1_V;
+
+				historyVector[0] = stateVector[0];
 			} else {
 				if (sCInterface.x == 5) {
 					nextStateIndex = 0;
 					stateVector[0] = State.mr_B_r1_W;
+
+					historyVector[0] = stateVector[0];
 				} else {
 					if (sCInterface.x == 6) {
 						nextStateIndex = 0;
 						stateVector[0] = State.mr_B_r1_X;
+
+						historyVector[0] = stateVector[0];
 					} else {
 						if (sCInterface.x == 7) {
 							nextStateIndex = 0;
 							stateVector[0] = State.mr_B_r1_Y;
+
+							historyVector[0] = stateVector[0];
 						} else {
 							if (sCInterface.x == 8) {
 								sCInterface.x = 0;
 
 								nextStateIndex = 0;
 								stateVector[0] = State.mr_B_r1_Z;
+
+								historyVector[0] = stateVector[0];
 							} else {
 								if (sCInterface.x == 3) {
 									nextStateIndex = 0;
 									stateVector[0] = State.mr_B_r1_U;
+
+									historyVector[0] = stateVector[0];
 								} else {
 									if (sCInterface.x == 2) {
 										nextStateIndex = 0;
 										stateVector[0] = State.mr_B_r1_T;
+
+										historyVector[0] = stateVector[0];
 									} else {
 										nextStateIndex = 0;
 										stateVector[0] = State.mr_B_r1_S;
+
+										historyVector[0] = stateVector[0];
 									}
 								}
 							}
@@ -817,8 +931,6 @@ public class PerformanceTestStatemachine
 			}
 		} else {
 			if (true && isStateActive(State.mr_B_r2_W) && sCInterface.e3) {
-				historyVector[0] = stateVector[0];
-
 				switch (stateVector[0]) {
 					case mr_B_r1_X :
 						nextStateIndex = 0;
@@ -920,35 +1032,51 @@ public class PerformanceTestStatemachine
 			if (sCInterface.x == 4) {
 				nextStateIndex = 0;
 				stateVector[0] = State.mr_B_r1_V;
+
+				historyVector[0] = stateVector[0];
 			} else {
 				if (sCInterface.x == 5) {
 					nextStateIndex = 0;
 					stateVector[0] = State.mr_B_r1_W;
+
+					historyVector[0] = stateVector[0];
 				} else {
 					if (sCInterface.x == 6) {
 						nextStateIndex = 0;
 						stateVector[0] = State.mr_B_r1_X;
+
+						historyVector[0] = stateVector[0];
 					} else {
 						if (sCInterface.x == 7) {
 							nextStateIndex = 0;
 							stateVector[0] = State.mr_B_r1_Y;
+
+							historyVector[0] = stateVector[0];
 						} else {
 							if (sCInterface.x == 8) {
 								sCInterface.x = 0;
 
 								nextStateIndex = 0;
 								stateVector[0] = State.mr_B_r1_Z;
+
+								historyVector[0] = stateVector[0];
 							} else {
 								if (sCInterface.x == 3) {
 									nextStateIndex = 0;
 									stateVector[0] = State.mr_B_r1_U;
+
+									historyVector[0] = stateVector[0];
 								} else {
 									if (sCInterface.x == 2) {
 										nextStateIndex = 0;
 										stateVector[0] = State.mr_B_r1_T;
+
+										historyVector[0] = stateVector[0];
 									} else {
 										nextStateIndex = 0;
 										stateVector[0] = State.mr_B_r1_S;
+
+										historyVector[0] = stateVector[0];
 									}
 								}
 							}
@@ -980,35 +1108,51 @@ public class PerformanceTestStatemachine
 			if (sCInterface.x == 4) {
 				nextStateIndex = 0;
 				stateVector[0] = State.mr_B_r1_V;
+
+				historyVector[0] = stateVector[0];
 			} else {
 				if (sCInterface.x == 5) {
 					nextStateIndex = 0;
 					stateVector[0] = State.mr_B_r1_W;
+
+					historyVector[0] = stateVector[0];
 				} else {
 					if (sCInterface.x == 6) {
 						nextStateIndex = 0;
 						stateVector[0] = State.mr_B_r1_X;
+
+						historyVector[0] = stateVector[0];
 					} else {
 						if (sCInterface.x == 7) {
 							nextStateIndex = 0;
 							stateVector[0] = State.mr_B_r1_Y;
+
+							historyVector[0] = stateVector[0];
 						} else {
 							if (sCInterface.x == 8) {
 								sCInterface.x = 0;
 
 								nextStateIndex = 0;
 								stateVector[0] = State.mr_B_r1_Z;
+
+								historyVector[0] = stateVector[0];
 							} else {
 								if (sCInterface.x == 3) {
 									nextStateIndex = 0;
 									stateVector[0] = State.mr_B_r1_U;
+
+									historyVector[0] = stateVector[0];
 								} else {
 									if (sCInterface.x == 2) {
 										nextStateIndex = 0;
 										stateVector[0] = State.mr_B_r1_T;
+
+										historyVector[0] = stateVector[0];
 									} else {
 										nextStateIndex = 0;
 										stateVector[0] = State.mr_B_r1_S;
+
+										historyVector[0] = stateVector[0];
 									}
 								}
 							}
@@ -1082,8 +1226,6 @@ public class PerformanceTestStatemachine
 	/* The reactions of state W. */
 	private void reactMr_B_r2_W() {
 		if (sCInterface.e3 && isStateActive(State.mr_B_r1_S) && true) {
-			historyVector[0] = stateVector[0];
-
 			switch (stateVector[0]) {
 				case mr_B_r1_X :
 					nextStateIndex = 0;

+ 30 - 14
test-plugins/org.yakindu.sct.generator.java.test/src-gen/org/yakindu/scr/shallowhistory/ShallowHistoryStatemachine.java

@@ -248,26 +248,36 @@ public class ShallowHistoryStatemachine implements IShallowHistoryStatemachine {
 			case mainRegion_State2__region0_State3 :
 				nextStateIndex = 0;
 				stateVector[0] = State.mainRegion_State2__region0_State3;
+
+				historyVector[0] = stateVector[0];
 				break;
 
 			case mainRegion_State2__region0_State4__region0_State6 :
 				nextStateIndex = 0;
 				stateVector[0] = State.mainRegion_State2__region0_State4__region0_State6;
+
+				historyVector[0] = stateVector[0];
 				break;
 
 			case mainRegion_State2__region0_State4__region0_State7__region0_State8 :
 				nextStateIndex = 0;
 				stateVector[0] = State.mainRegion_State2__region0_State4__region0_State6;
+
+				historyVector[0] = stateVector[0];
 				break;
 
 			case mainRegion_State2__region0_State4__region0_State7__region0_State9 :
 				nextStateIndex = 0;
 				stateVector[0] = State.mainRegion_State2__region0_State4__region0_State6;
+
+				historyVector[0] = stateVector[0];
 				break;
 
 			case mainRegion_State2__region0_State5 :
 				nextStateIndex = 0;
 				stateVector[0] = State.mainRegion_State2__region0_State5;
+
+				historyVector[0] = stateVector[0];
 				break;
 
 			default :
@@ -281,11 +291,15 @@ public class ShallowHistoryStatemachine implements IShallowHistoryStatemachine {
 			case mainRegion_State2__region0_State4__region0_State7__region0_State8 :
 				nextStateIndex = 0;
 				stateVector[0] = State.mainRegion_State2__region0_State4__region0_State7__region0_State8;
+
+				historyVector[1] = stateVector[0];
 				break;
 
 			case mainRegion_State2__region0_State4__region0_State7__region0_State9 :
 				nextStateIndex = 0;
 				stateVector[0] = State.mainRegion_State2__region0_State4__region0_State7__region0_State9;
+
+				historyVector[1] = stateVector[0];
 				break;
 
 			default :
@@ -305,6 +319,8 @@ public class ShallowHistoryStatemachine implements IShallowHistoryStatemachine {
 			} else {
 				nextStateIndex = 0;
 				stateVector[0] = State.mainRegion_State2__region0_State3;
+
+				historyVector[0] = stateVector[0];
 			}
 		}
 	}
@@ -312,8 +328,6 @@ public class ShallowHistoryStatemachine implements IShallowHistoryStatemachine {
 	/* The reactions of state State3. */
 	private void reactMainRegion_State2_region0_State3() {
 		if (sCInterface.event2) {
-			historyVector[0] = stateVector[0];
-
 			switch (stateVector[0]) {
 				case mainRegion_State2__region0_State3 :
 					nextStateIndex = 0;
@@ -357,6 +371,8 @@ public class ShallowHistoryStatemachine implements IShallowHistoryStatemachine {
 
 				nextStateIndex = 0;
 				stateVector[0] = State.mainRegion_State2__region0_State4__region0_State6;
+
+				historyVector[0] = stateVector[0];
 			}
 		}
 	}
@@ -364,8 +380,6 @@ public class ShallowHistoryStatemachine implements IShallowHistoryStatemachine {
 	/* The reactions of state State6. */
 	private void reactMainRegion_State2_region0_State4_region0_State6() {
 		if (sCInterface.event2) {
-			historyVector[0] = stateVector[0];
-
 			switch (stateVector[0]) {
 				case mainRegion_State2__region0_State3 :
 					nextStateIndex = 0;
@@ -430,6 +444,8 @@ public class ShallowHistoryStatemachine implements IShallowHistoryStatemachine {
 
 				nextStateIndex = 0;
 				stateVector[0] = State.mainRegion_State2__region0_State5;
+
+				historyVector[0] = stateVector[0];
 			} else {
 				if (sCInterface.event5) {
 					nextStateIndex = 0;
@@ -441,6 +457,8 @@ public class ShallowHistoryStatemachine implements IShallowHistoryStatemachine {
 					} else {
 						nextStateIndex = 0;
 						stateVector[0] = State.mainRegion_State2__region0_State4__region0_State7__region0_State8;
+
+						historyVector[1] = stateVector[0];
 					}
 				}
 			}
@@ -450,8 +468,6 @@ public class ShallowHistoryStatemachine implements IShallowHistoryStatemachine {
 	/* The reactions of state State8. */
 	private void reactMainRegion_State2_region0_State4_region0_State7_region0_State8() {
 		if (sCInterface.event2) {
-			historyVector[0] = stateVector[0];
-
 			switch (stateVector[0]) {
 				case mainRegion_State2__region0_State3 :
 					nextStateIndex = 0;
@@ -516,10 +532,10 @@ public class ShallowHistoryStatemachine implements IShallowHistoryStatemachine {
 
 				nextStateIndex = 0;
 				stateVector[0] = State.mainRegion_State2__region0_State5;
+
+				historyVector[0] = stateVector[0];
 			} else {
 				if (sCInterface.event6) {
-					historyVector[1] = stateVector[0];
-
 					switch (stateVector[0]) {
 						case mainRegion_State2__region0_State4__region0_State7__region0_State8 :
 							nextStateIndex = 0;
@@ -544,6 +560,8 @@ public class ShallowHistoryStatemachine implements IShallowHistoryStatemachine {
 
 						nextStateIndex = 0;
 						stateVector[0] = State.mainRegion_State2__region0_State4__region0_State7__region0_State9;
+
+						historyVector[1] = stateVector[0];
 					}
 				}
 			}
@@ -553,8 +571,6 @@ public class ShallowHistoryStatemachine implements IShallowHistoryStatemachine {
 	/* The reactions of state State9. */
 	private void reactMainRegion_State2_region0_State4_region0_State7_region0_State9() {
 		if (sCInterface.event2) {
-			historyVector[0] = stateVector[0];
-
 			switch (stateVector[0]) {
 				case mainRegion_State2__region0_State3 :
 					nextStateIndex = 0;
@@ -619,10 +635,10 @@ public class ShallowHistoryStatemachine implements IShallowHistoryStatemachine {
 
 				nextStateIndex = 0;
 				stateVector[0] = State.mainRegion_State2__region0_State5;
+
+				historyVector[0] = stateVector[0];
 			} else {
 				if (sCInterface.event6) {
-					historyVector[1] = stateVector[0];
-
 					switch (stateVector[0]) {
 						case mainRegion_State2__region0_State4__region0_State7__region0_State8 :
 							nextStateIndex = 0;
@@ -647,6 +663,8 @@ public class ShallowHistoryStatemachine implements IShallowHistoryStatemachine {
 
 						nextStateIndex = 0;
 						stateVector[0] = State.mainRegion_State2__region0_State4__region0_State7__region0_State8;
+
+						historyVector[1] = stateVector[0];
 					}
 				}
 			}
@@ -656,8 +674,6 @@ public class ShallowHistoryStatemachine implements IShallowHistoryStatemachine {
 	/* The reactions of state State5. */
 	private void reactMainRegion_State2_region0_State5() {
 		if (sCInterface.event2) {
-			historyVector[0] = stateVector[0];
-
 			switch (stateVector[0]) {
 				case mainRegion_State2__region0_State3 :
 					nextStateIndex = 0;

+ 6 - 6
test-plugins/org.yakindu.sct.generator.java.test/test-gen/org/yakindu/sct/generator/java/test/AllTestsTest.java

@@ -22,12 +22,12 @@ import org.junit.runners.Suite.SuiteClasses;
 		EntryExitSelfTransitionTest.class, ExitOnSelfTransitionTest.class,
 		ExitStateTest.class, FeatureCallsTest.class, GuardTest.class,
 		GuardedEntryTest.class, GuardedExitTest.class,
-		HistoryWithoutInitialStepTest.class, InEventLifeCycleTest.class,
-		IntegerExpressionsTest.class, InternalEventLifeCycleTest.class,
-		LocalReactionsTest.class, LogicalAndTestsTest.class,
-		LogicalOrTestsTest.class, NamedInterfaceAccessTest.class,
-		OutEventLifeCycleTest.class, ParenthesisTest.class,
-		PriorityValuesTest.class, RaiseEventTest.class,
+		HistoryWithExitPointTest.class, HistoryWithoutInitialStepTest.class,
+		InEventLifeCycleTest.class, IntegerExpressionsTest.class,
+		InternalEventLifeCycleTest.class, LocalReactionsTest.class,
+		LogicalAndTestsTest.class, LogicalOrTestsTest.class,
+		NamedInterfaceAccessTest.class, OutEventLifeCycleTest.class,
+		ParenthesisTest.class, PriorityValuesTest.class, RaiseEventTest.class,
 		SameNameDifferentRegionTest.class, ShallowHistoryTest.class,
 		SimpleEventTest.class, StatechartLocalReactionsTest.class,
 		SimpleHierachyTest.class, StateIsActiveTest.class,

+ 59 - 0
test-plugins/org.yakindu.sct.generator.java.test/test-gen/org/yakindu/sct/generator/java/test/HistoryWithExitPointTest.java

@@ -0,0 +1,59 @@
+/**
+ * Copyright (c) 2014 committers of YAKINDU and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     committers of YAKINDU - initial API and implementation
+ */
+
+package org.yakindu.sct.generator.java.test;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import static org.junit.Assert.*;
+import org.yakindu.scr.historywithexitpoint.HistoryWithExitPointStatemachine;
+import org.yakindu.scr.historywithexitpoint.HistoryWithExitPointStatemachine.State;
+/**
+ *  Unit TestCase for HistoryWithExitPoint
+ */
+@SuppressWarnings("all")
+public class HistoryWithExitPointTest {
+
+	private HistoryWithExitPointStatemachine statemachine;
+
+	@Before
+	public void setUp() {
+		statemachine = new HistoryWithExitPointStatemachine();
+		statemachine.init();
+	}
+
+	@After
+	public void tearDown() {
+		statemachine = null;
+	}
+
+	@Test
+	public void testhistoryEntryAfterExit() {
+		statemachine.enter();
+		assertTrue(statemachine.isStateActive(State.mr_A_r_X1));
+		statemachine.raisePush();
+		statemachine.runCycle();
+		assertTrue(statemachine.isStateActive(State.mr_B));
+		statemachine.raiseBack();
+		statemachine.runCycle();
+		assertTrue(statemachine.isStateActive(State.mr_A_r_X1));
+		statemachine.raiseNext();
+		statemachine.runCycle();
+		assertTrue(statemachine.isStateActive(State.mr_A_r_X2));
+		statemachine.raisePush();
+		statemachine.runCycle();
+		assertTrue(statemachine.isStateActive(State.mr_B));
+		statemachine.raiseBack();
+		statemachine.runCycle();
+		assertTrue(statemachine.isStateActive(State.mr_A_r_X2));
+	}
+}

+ 8 - 0
test-plugins/org.yakindu.sct.simulation.core.sexec.test/model/test.sgen

@@ -170,6 +170,14 @@ GeneratorModel for sctunit::interpreter {
 		}			
 	}
 	
+	test HistoryWithExitPoint{
+		
+		feature Outlet{ 
+			targetProject = "org.yakindu.sct.simulation.core.sexec.test" 
+			targetFolder = "test-gen"			
+		}			
+	}
+	
 	test HistoryWithoutInitialStep{
 		
 		feature Outlet{ 

+ 6 - 6
test-plugins/org.yakindu.sct.simulation.core.sexec.test/test-gen/org/yakindu/sct/simulation/core/sexec/test/AllTestsTest.java

@@ -23,12 +23,12 @@ import org.junit.runners.Suite.SuiteClasses;
 		EntryExitSelfTransitionTest.class, ExitOnSelfTransitionTest.class,
 		ExitStateTest.class, FeatureCallsTest.class, GuardTest.class,
 		GuardedEntryTest.class, GuardedExitTest.class,
-		HistoryWithoutInitialStepTest.class, InEventLifeCycleTest.class,
-		IntegerExpressionsTest.class, InternalEventLifeCycleTest.class,
-		LocalReactionsTest.class, LogicalAndTestsTest.class,
-		LogicalOrTestsTest.class, NamedInterfaceAccessTest.class,
-		OutEventLifeCycleTest.class, ParenthesisTest.class,
-		PriorityValuesTest.class, RaiseEventTest.class,
+		HistoryWithExitPointTest.class, HistoryWithoutInitialStepTest.class,
+		InEventLifeCycleTest.class, IntegerExpressionsTest.class,
+		InternalEventLifeCycleTest.class, LocalReactionsTest.class,
+		LogicalAndTestsTest.class, LogicalOrTestsTest.class,
+		NamedInterfaceAccessTest.class, OutEventLifeCycleTest.class,
+		ParenthesisTest.class, PriorityValuesTest.class, RaiseEventTest.class,
 		SameNameDifferentRegionTest.class, ShallowHistoryTest.class,
 		SimpleEventTest.class, StatechartLocalReactionsTest.class,
 		SimpleHierachyTest.class, StateIsActiveTest.class,

+ 56 - 0
test-plugins/org.yakindu.sct.simulation.core.sexec.test/test-gen/org/yakindu/sct/simulation/core/sexec/test/HistoryWithExitPointTest.java

@@ -0,0 +1,56 @@
+/**
+ * Copyright (c) 2014 committers of YAKINDU and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     committers of YAKINDU - initial API and implementation
+ */
+package org.yakindu.sct.simulation.core.sexec.test;
+import org.eclipse.xtext.junit4.InjectWith;
+import org.eclipse.xtext.junit4.XtextRunner;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.yakindu.sct.model.sexec.ExecutionFlow;
+import org.yakindu.sct.model.sexec.interpreter.test.util.AbstractExecutionFlowTest;
+import org.yakindu.sct.model.sexec.interpreter.test.util.SExecInjectionProvider;
+import org.yakindu.sct.test.models.SCTUnitTestModels;
+import com.google.inject.Inject;
+import static org.junit.Assert.assertTrue;
+/**
+ *  Unit TestCase for HistoryWithExitPoint
+ */
+@SuppressWarnings("all")
+@RunWith(XtextRunner.class)
+@InjectWith(SExecInjectionProvider.class)
+public class HistoryWithExitPointTest extends AbstractExecutionFlowTest {
+	@Before
+	public void setup() throws Exception {
+		ExecutionFlow flow = models
+				.loadExecutionFlowFromResource("HistoryWithExitPoint.sct");
+		initInterpreter(flow);
+	}
+	@Test
+	public void historyEntryAfterExit() throws Exception {
+		interpreter.enter();
+		assertTrue(isActive("X1"));
+		raiseEvent("push");
+		interpreter.runCycle();
+		assertTrue(isActive("B"));
+		raiseEvent("back");
+		interpreter.runCycle();
+		assertTrue(isActive("X1"));
+		raiseEvent("next");
+		interpreter.runCycle();
+		assertTrue(isActive("X2"));
+		raiseEvent("push");
+		interpreter.runCycle();
+		assertTrue(isActive("B"));
+		raiseEvent("back");
+		interpreter.runCycle();
+		assertTrue(isActive("X2"));
+	}
+}

+ 242 - 0
test-plugins/org.yakindu.sct.test.models/testmodels/SCTUnit/HistoryWithExitPoint.sct

@@ -0,0 +1,242 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:notation="http://www.eclipse.org/gmf/runtime/1.0.2/notation" xmlns:sgraph="http://www.yakindu.org/sct/sgraph/2.0.0">
+  <sgraph:Statechart xmi:id="_Vq7iQH00EeOVe4RUhhrB-g" specification="interface:&#xA;in event push&#xA;in event back&#xA;in event next" name="HistoryWithExitPoint">
+    <regions xmi:id="_VrTVsn00EeOVe4RUhhrB-g" name="mr">
+      <vertices xsi:type="sgraph:Entry" xmi:id="_VrT8wX00EeOVe4RUhhrB-g">
+        <outgoingTransitions xmi:id="_VrVK4X00EeOVe4RUhhrB-g" target="_VrT8zH00EeOVe4RUhhrB-g"/>
+      </vertices>
+      <vertices xsi:type="sgraph:State" xmi:id="_VrT8zH00EeOVe4RUhhrB-g" name="A" incomingTransitions="_VrVK4X00EeOVe4RUhhrB-g _6mHboH00EeOVe4RUhhrB-g">
+        <outgoingTransitions xmi:id="_X2aiYH00EeOVe4RUhhrB-g" specification="# exit_to_B >" target="_Xd8_EH00EeOVe4RUhhrB-g"/>
+        <regions xmi:id="_xZ5jsH00EeOVe4RUhhrB-g" name="r">
+          <vertices xsi:type="sgraph:State" xmi:id="_xtSZwH00EeOVe4RUhhrB-g" name="X1" incomingTransitions="__NgdgH00EeOVe4RUhhrB-g _FwCWYH01EeOVe4RUhhrB-g">
+            <outgoingTransitions xmi:id="_0x9EoH00EeOVe4RUhhrB-g" specification="next" target="_0EapMH00EeOVe4RUhhrB-g"/>
+            <outgoingTransitions xmi:id="_E3iysH02EeOVe4RUhhrB-g" specification="push" target="_EWTG0H02EeOVe4RUhhrB-g"/>
+          </vertices>
+          <vertices xsi:type="sgraph:State" xmi:id="_0EapMH00EeOVe4RUhhrB-g" name="X2" incomingTransitions="_0x9EoH00EeOVe4RUhhrB-g">
+            <outgoingTransitions xmi:id="_FwCWYH01EeOVe4RUhhrB-g" specification="next" target="_xtSZwH00EeOVe4RUhhrB-g"/>
+            <outgoingTransitions xmi:id="_Fydi0H02EeOVe4RUhhrB-g" specification="push" target="_EWTG0H02EeOVe4RUhhrB-g"/>
+          </vertices>
+          <vertices xsi:type="sgraph:Entry" xmi:id="_9H1xgH00EeOVe4RUhhrB-g" kind="SHALLOW_HISTORY">
+            <outgoingTransitions xmi:id="__NgdgH00EeOVe4RUhhrB-g" specification="" target="_xtSZwH00EeOVe4RUhhrB-g"/>
+          </vertices>
+          <vertices xsi:type="sgraph:Exit" xmi:id="_EWTG0H02EeOVe4RUhhrB-g" name="exit_to_B" incomingTransitions="_Fydi0H02EeOVe4RUhhrB-g _E3iysH02EeOVe4RUhhrB-g"/>
+        </regions>
+      </vertices>
+      <vertices xsi:type="sgraph:State" xmi:id="_Xd8_EH00EeOVe4RUhhrB-g" name="B" incomingTransitions="_X2aiYH00EeOVe4RUhhrB-g">
+        <outgoingTransitions xmi:id="_6mHboH00EeOVe4RUhhrB-g" specification="back" target="_VrT8zH00EeOVe4RUhhrB-g"/>
+      </vertices>
+    </regions>
+  </sgraph:Statechart>
+  <notation:Diagram xmi:id="_VrTVsH00EeOVe4RUhhrB-g" type="org.yakindu.sct.ui.editor.editor.StatechartDiagramEditor" element="_Vq7iQH00EeOVe4RUhhrB-g" measurementUnit="Pixel">
+    <children xmi:id="_VrTVs300EeOVe4RUhhrB-g" type="Region" element="_VrTVsn00EeOVe4RUhhrB-g">
+      <children xsi:type="notation:DecorationNode" xmi:id="_VrTVtn00EeOVe4RUhhrB-g" type="RegionName">
+        <styles xsi:type="notation:ShapeStyle" xmi:id="_VrTVt300EeOVe4RUhhrB-g"/>
+        <layoutConstraint xsi:type="notation:Location" xmi:id="_VrTVuH00EeOVe4RUhhrB-g"/>
+      </children>
+      <children xsi:type="notation:Shape" xmi:id="_VrTVuX00EeOVe4RUhhrB-g" type="RegionCompartment" fontName="Verdana" lineColor="4210752">
+        <children xmi:id="_VrT8wn00EeOVe4RUhhrB-g" type="Entry" element="_VrT8wX00EeOVe4RUhhrB-g">
+          <children xmi:id="_VrT8xX00EeOVe4RUhhrB-g" type="BorderItemLabelContainer">
+            <children xsi:type="notation:DecorationNode" xmi:id="_VrT8yH00EeOVe4RUhhrB-g" type="BorderItemLabel">
+              <styles xsi:type="notation:ShapeStyle" xmi:id="_VrT8yX00EeOVe4RUhhrB-g"/>
+              <layoutConstraint xsi:type="notation:Location" xmi:id="_VrT8yn00EeOVe4RUhhrB-g"/>
+            </children>
+            <styles xsi:type="notation:ShapeStyle" xmi:id="_VrT8xn00EeOVe4RUhhrB-g" fontName="Verdana" lineColor="4210752"/>
+            <layoutConstraint xsi:type="notation:Bounds" xmi:id="_VrT8x300EeOVe4RUhhrB-g"/>
+          </children>
+          <styles xsi:type="notation:ShapeStyle" xmi:id="_VrT8w300EeOVe4RUhhrB-g" fontName="Verdana" lineColor="4210752"/>
+          <layoutConstraint xsi:type="notation:Bounds" xmi:id="_VrT8y300EeOVe4RUhhrB-g" x="70" y="20" width="15" height="15"/>
+        </children>
+        <children xmi:id="_VrUj0X00EeOVe4RUhhrB-g" type="State" element="_VrT8zH00EeOVe4RUhhrB-g">
+          <children xsi:type="notation:DecorationNode" xmi:id="_VrUj1X00EeOVe4RUhhrB-g" type="StateName">
+            <styles xsi:type="notation:ShapeStyle" xmi:id="_VrUj1n00EeOVe4RUhhrB-g"/>
+            <layoutConstraint xsi:type="notation:Location" xmi:id="_VrUj1300EeOVe4RUhhrB-g"/>
+          </children>
+          <children xsi:type="notation:Compartment" xmi:id="_VrUj2H00EeOVe4RUhhrB-g" type="StateTextCompartment">
+            <children xsi:type="notation:Shape" xmi:id="_VrUj2X00EeOVe4RUhhrB-g" type="StateTextCompartmentExpression" fontName="Verdana" lineColor="4210752">
+              <layoutConstraint xsi:type="notation:Bounds" xmi:id="_VrUj2n00EeOVe4RUhhrB-g"/>
+            </children>
+          </children>
+          <children xsi:type="notation:Compartment" xmi:id="_VrUj2300EeOVe4RUhhrB-g" type="StateFigureCompartment">
+            <children xmi:id="_xZ6KwH00EeOVe4RUhhrB-g" type="Region" element="_xZ5jsH00EeOVe4RUhhrB-g">
+              <children xsi:type="notation:DecorationNode" xmi:id="_xZ6x0H00EeOVe4RUhhrB-g" type="RegionName">
+                <styles xsi:type="notation:ShapeStyle" xmi:id="_xZ6x0X00EeOVe4RUhhrB-g"/>
+                <layoutConstraint xsi:type="notation:Location" xmi:id="_xZ6x0n00EeOVe4RUhhrB-g"/>
+              </children>
+              <children xsi:type="notation:Shape" xmi:id="_xZ6x0300EeOVe4RUhhrB-g" type="RegionCompartment" fontName="Verdana" lineColor="4210752">
+                <children xmi:id="_xtTA0H00EeOVe4RUhhrB-g" type="State" element="_xtSZwH00EeOVe4RUhhrB-g">
+                  <children xsi:type="notation:DecorationNode" xmi:id="_xtTn4H00EeOVe4RUhhrB-g" type="StateName">
+                    <styles xsi:type="notation:ShapeStyle" xmi:id="_xtTn4X00EeOVe4RUhhrB-g"/>
+                    <layoutConstraint xsi:type="notation:Location" xmi:id="_xtTn4n00EeOVe4RUhhrB-g"/>
+                  </children>
+                  <children xsi:type="notation:Compartment" xmi:id="_xtTn4300EeOVe4RUhhrB-g" type="StateTextCompartment">
+                    <children xsi:type="notation:Shape" xmi:id="_xtUO8H00EeOVe4RUhhrB-g" type="StateTextCompartmentExpression" fontName="Verdana" lineColor="4210752">
+                      <layoutConstraint xsi:type="notation:Bounds" xmi:id="_xtUO8X00EeOVe4RUhhrB-g"/>
+                    </children>
+                  </children>
+                  <children xsi:type="notation:Compartment" xmi:id="_xtUO8n00EeOVe4RUhhrB-g" type="StateFigureCompartment"/>
+                  <styles xsi:type="notation:ShapeStyle" xmi:id="_xtTA0X00EeOVe4RUhhrB-g" fontName="Verdana" fillColor="15981773" lineColor="12632256"/>
+                  <styles xsi:type="notation:FontStyle" xmi:id="_xtTA0n00EeOVe4RUhhrB-g"/>
+                  <styles xsi:type="notation:BooleanValueStyle" xmi:id="_xtUO8300EeOVe4RUhhrB-g" name="isHorizontal" booleanValue="true"/>
+                  <layoutConstraint xsi:type="notation:Bounds" xmi:id="_xtTA0300EeOVe4RUhhrB-g" x="74" y="8"/>
+                </children>
+                <children xmi:id="_0EbQQH00EeOVe4RUhhrB-g" type="State" element="_0EapMH00EeOVe4RUhhrB-g">
+                  <children xsi:type="notation:DecorationNode" xmi:id="_0Eb3UH00EeOVe4RUhhrB-g" type="StateName">
+                    <styles xsi:type="notation:ShapeStyle" xmi:id="_0Eb3UX00EeOVe4RUhhrB-g"/>
+                    <layoutConstraint xsi:type="notation:Location" xmi:id="_0Eb3Un00EeOVe4RUhhrB-g"/>
+                  </children>
+                  <children xsi:type="notation:Compartment" xmi:id="_0Eb3U300EeOVe4RUhhrB-g" type="StateTextCompartment">
+                    <children xsi:type="notation:Shape" xmi:id="_0Eb3VH00EeOVe4RUhhrB-g" type="StateTextCompartmentExpression" fontName="Verdana" lineColor="4210752">
+                      <layoutConstraint xsi:type="notation:Bounds" xmi:id="_0Eb3VX00EeOVe4RUhhrB-g"/>
+                    </children>
+                  </children>
+                  <children xsi:type="notation:Compartment" xmi:id="_0EceYH00EeOVe4RUhhrB-g" type="StateFigureCompartment"/>
+                  <styles xsi:type="notation:ShapeStyle" xmi:id="_0EbQQX00EeOVe4RUhhrB-g" fontName="Verdana" fillColor="15981773" lineColor="12632256"/>
+                  <styles xsi:type="notation:FontStyle" xmi:id="_0EbQQn00EeOVe4RUhhrB-g"/>
+                  <styles xsi:type="notation:BooleanValueStyle" xmi:id="_0EceYX00EeOVe4RUhhrB-g" name="isHorizontal" booleanValue="true"/>
+                  <layoutConstraint xsi:type="notation:Bounds" xmi:id="_0EbQQ300EeOVe4RUhhrB-g" x="86" y="117"/>
+                </children>
+                <children xmi:id="_9H2YkH00EeOVe4RUhhrB-g" type="ShallowHistory" element="_9H1xgH00EeOVe4RUhhrB-g">
+                  <children xmi:id="_9H2Yk300EeOVe4RUhhrB-g" type="BorderItemLabelContainer">
+                    <children xsi:type="notation:DecorationNode" xmi:id="_9H2Yln00EeOVe4RUhhrB-g" type="BorderItemLabel">
+                      <styles xsi:type="notation:ShapeStyle" xmi:id="_9H2Yl300EeOVe4RUhhrB-g"/>
+                      <layoutConstraint xsi:type="notation:Location" xmi:id="_9H2_oH00EeOVe4RUhhrB-g"/>
+                    </children>
+                    <styles xsi:type="notation:ShapeStyle" xmi:id="_9H2YlH00EeOVe4RUhhrB-g" fontName="Verdana" lineColor="4210752"/>
+                    <layoutConstraint xsi:type="notation:Bounds" xmi:id="_9H2YlX00EeOVe4RUhhrB-g"/>
+                  </children>
+                  <styles xsi:type="notation:ShapeStyle" xmi:id="_9H2YkX00EeOVe4RUhhrB-g" fontName="Verdana" lineColor="4210752"/>
+                  <layoutConstraint xsi:type="notation:Bounds" xmi:id="_9H2Ykn00EeOVe4RUhhrB-g" x="155" y="-6"/>
+                </children>
+                <children xmi:id="_EWTt4H02EeOVe4RUhhrB-g" type="Exit" element="_EWTG0H02EeOVe4RUhhrB-g">
+                  <children xmi:id="_EWUU8H02EeOVe4RUhhrB-g" type="BorderItemLabelContainer">
+                    <children xsi:type="notation:DecorationNode" xmi:id="_EWU8AH02EeOVe4RUhhrB-g" type="BorderItemLabel">
+                      <styles xsi:type="notation:ShapeStyle" xmi:id="_EWU8AX02EeOVe4RUhhrB-g"/>
+                      <layoutConstraint xsi:type="notation:Location" xmi:id="_EWU8An02EeOVe4RUhhrB-g"/>
+                    </children>
+                    <styles xsi:type="notation:ShapeStyle" xmi:id="_EWUU8X02EeOVe4RUhhrB-g" fontName="Verdana" lineColor="4210752"/>
+                    <layoutConstraint xsi:type="notation:Bounds" xmi:id="_EWUU8n02EeOVe4RUhhrB-g" x="-4" y="19"/>
+                  </children>
+                  <styles xsi:type="notation:ShapeStyle" xmi:id="_EWTt4X02EeOVe4RUhhrB-g" fontName="Verdana" lineColor="4210752"/>
+                  <layoutConstraint xsi:type="notation:Bounds" xmi:id="_EWTt4n02EeOVe4RUhhrB-g" x="248" y="87"/>
+                </children>
+                <layoutConstraint xsi:type="notation:Bounds" xmi:id="_xZ6x1H00EeOVe4RUhhrB-g"/>
+              </children>
+              <styles xsi:type="notation:ShapeStyle" xmi:id="_xZ6KwX00EeOVe4RUhhrB-g" fontName="Verdana" fillColor="15790320" lineColor="12632256"/>
+              <layoutConstraint xsi:type="notation:Bounds" xmi:id="_xZ6Kwn00EeOVe4RUhhrB-g"/>
+            </children>
+          </children>
+          <styles xsi:type="notation:ShapeStyle" xmi:id="_VrUj0n00EeOVe4RUhhrB-g" fontName="Verdana" fillColor="15981773" lineColor="12632256"/>
+          <styles xsi:type="notation:FontStyle" xmi:id="_VrUj0300EeOVe4RUhhrB-g"/>
+          <styles xsi:type="notation:BooleanValueStyle" xmi:id="_VrUj3H00EeOVe4RUhhrB-g" name="isHorizontal" booleanValue="true"/>
+          <layoutConstraint xsi:type="notation:Bounds" xmi:id="_VrVK4H00EeOVe4RUhhrB-g" x="40" y="80" width="327" height="271"/>
+        </children>
+        <children xmi:id="_Xd-NMH00EeOVe4RUhhrB-g" type="State" element="_Xd8_EH00EeOVe4RUhhrB-g">
+          <children xsi:type="notation:DecorationNode" xmi:id="_Xd-0QH00EeOVe4RUhhrB-g" type="StateName">
+            <styles xsi:type="notation:ShapeStyle" xmi:id="_Xd-0QX00EeOVe4RUhhrB-g"/>
+            <layoutConstraint xsi:type="notation:Location" xmi:id="_Xd-0Qn00EeOVe4RUhhrB-g"/>
+          </children>
+          <children xsi:type="notation:Compartment" xmi:id="_Xd-0Q300EeOVe4RUhhrB-g" type="StateTextCompartment">
+            <children xsi:type="notation:Shape" xmi:id="_Xd-0RH00EeOVe4RUhhrB-g" type="StateTextCompartmentExpression" fontName="Verdana" lineColor="4210752">
+              <layoutConstraint xsi:type="notation:Bounds" xmi:id="_Xd-0RX00EeOVe4RUhhrB-g"/>
+            </children>
+          </children>
+          <children xsi:type="notation:Compartment" xmi:id="_Xd_bUH00EeOVe4RUhhrB-g" type="StateFigureCompartment"/>
+          <styles xsi:type="notation:ShapeStyle" xmi:id="_Xd-NMX00EeOVe4RUhhrB-g" fontName="Verdana" fillColor="15981773" lineColor="12632256"/>
+          <styles xsi:type="notation:FontStyle" xmi:id="_Xd-NMn00EeOVe4RUhhrB-g"/>
+          <styles xsi:type="notation:BooleanValueStyle" xmi:id="_Xd_bUX00EeOVe4RUhhrB-g" name="isHorizontal" booleanValue="true"/>
+          <layoutConstraint xsi:type="notation:Bounds" xmi:id="_Xd-NM300EeOVe4RUhhrB-g" x="537" y="213" width="40" height="53"/>
+        </children>
+        <layoutConstraint xsi:type="notation:Bounds" xmi:id="_VrTVun00EeOVe4RUhhrB-g"/>
+      </children>
+      <styles xsi:type="notation:ShapeStyle" xmi:id="_VrTVtH00EeOVe4RUhhrB-g" fontName="Verdana" fillColor="15790320" lineColor="12632256"/>
+      <layoutConstraint xsi:type="notation:Bounds" xmi:id="_VrT8wH00EeOVe4RUhhrB-g" x="220" y="10" width="693" height="401"/>
+    </children>
+    <children xsi:type="notation:Shape" xmi:id="_VrVK6X00EeOVe4RUhhrB-g" type="StatechartText" fontName="Verdana" lineColor="4210752">
+      <children xsi:type="notation:DecorationNode" xmi:id="_VrVK6300EeOVe4RUhhrB-g" type="StatechartName">
+        <styles xsi:type="notation:ShapeStyle" xmi:id="_VrVK7H00EeOVe4RUhhrB-g"/>
+        <layoutConstraint xsi:type="notation:Location" xmi:id="_VrVK7X00EeOVe4RUhhrB-g"/>
+      </children>
+      <children xsi:type="notation:Shape" xmi:id="_VrVx8H00EeOVe4RUhhrB-g" type="StatechartTextExpression" fontName="Verdana" lineColor="4210752">
+        <layoutConstraint xsi:type="notation:Bounds" xmi:id="_VrVx8X00EeOVe4RUhhrB-g"/>
+      </children>
+      <layoutConstraint xsi:type="notation:Bounds" xmi:id="_VrVx8n00EeOVe4RUhhrB-g" x="10" y="10" width="200" height="400"/>
+    </children>
+    <styles xsi:type="notation:DiagramStyle" xmi:id="_VrTVsX00EeOVe4RUhhrB-g"/>
+    <edges xmi:id="_VrVK4n00EeOVe4RUhhrB-g" type="Transition" element="_VrVK4X00EeOVe4RUhhrB-g" source="_VrT8wn00EeOVe4RUhhrB-g" target="_VrUj0X00EeOVe4RUhhrB-g">
+      <children xsi:type="notation:DecorationNode" xmi:id="_VrVK5n00EeOVe4RUhhrB-g" type="TransitionExpression">
+        <styles xsi:type="notation:ShapeStyle" xmi:id="_VrVK5300EeOVe4RUhhrB-g"/>
+        <layoutConstraint xsi:type="notation:Location" xmi:id="_VrVK6H00EeOVe4RUhhrB-g" y="10"/>
+      </children>
+      <styles xsi:type="notation:ConnectorStyle" xmi:id="_VrVK4300EeOVe4RUhhrB-g" lineColor="4210752"/>
+      <styles xsi:type="notation:FontStyle" xmi:id="_VrVK5X00EeOVe4RUhhrB-g" fontName="Verdana"/>
+      <bendpoints xsi:type="notation:RelativeBendpoints" xmi:id="_VrVK5H00EeOVe4RUhhrB-g" points="[0, 0, 0, 0]$[0, 0, 0, 0]"/>
+    </edges>
+    <edges xmi:id="_X2bwgH00EeOVe4RUhhrB-g" type="Transition" element="_X2aiYH00EeOVe4RUhhrB-g" source="_VrUj0X00EeOVe4RUhhrB-g" target="_Xd-NMH00EeOVe4RUhhrB-g">
+      <children xsi:type="notation:DecorationNode" xmi:id="_X2bwhH00EeOVe4RUhhrB-g" type="TransitionExpression">
+        <styles xsi:type="notation:ShapeStyle" xmi:id="_X2bwhX00EeOVe4RUhhrB-g"/>
+        <layoutConstraint xsi:type="notation:Location" xmi:id="_X2bwhn00EeOVe4RUhhrB-g" y="10"/>
+      </children>
+      <styles xsi:type="notation:ConnectorStyle" xmi:id="_X2bwgX00EeOVe4RUhhrB-g" lineColor="4210752"/>
+      <styles xsi:type="notation:FontStyle" xmi:id="_X2bwg300EeOVe4RUhhrB-g" fontName="Verdana"/>
+      <bendpoints xsi:type="notation:RelativeBendpoints" xmi:id="_X2bwgn00EeOVe4RUhhrB-g" points="[18, -3, -175, -4]$[190, -23, -3, -24]"/>
+      <sourceAnchor xsi:type="notation:IdentityAnchor" xmi:id="_X2c-oH00EeOVe4RUhhrB-g" id="(0.9906976744186047,0.6199261992619927)"/>
+    </edges>
+    <edges xmi:id="_0x9rsH00EeOVe4RUhhrB-g" type="Transition" element="_0x9EoH00EeOVe4RUhhrB-g" source="_xtTA0H00EeOVe4RUhhrB-g" target="_0EbQQH00EeOVe4RUhhrB-g">
+      <children xsi:type="notation:DecorationNode" xmi:id="_0x-SwH00EeOVe4RUhhrB-g" type="TransitionExpression">
+        <styles xsi:type="notation:ShapeStyle" xmi:id="_0x-SwX00EeOVe4RUhhrB-g"/>
+        <layoutConstraint xsi:type="notation:Location" xmi:id="_0x-Swn00EeOVe4RUhhrB-g" x="2" y="36"/>
+      </children>
+      <styles xsi:type="notation:ConnectorStyle" xmi:id="_0x9rsX00EeOVe4RUhhrB-g" lineColor="4210752"/>
+      <styles xsi:type="notation:FontStyle" xmi:id="_0x9rs300EeOVe4RUhhrB-g" fontName="Verdana"/>
+      <bendpoints xsi:type="notation:RelativeBendpoints" xmi:id="_0x9rsn00EeOVe4RUhhrB-g" points="[3, 24, -9, -85]$[12, 85, 0, -24]"/>
+    </edges>
+    <edges xmi:id="_6mIpwH00EeOVe4RUhhrB-g" type="Transition" element="_6mHboH00EeOVe4RUhhrB-g" source="_Xd-NMH00EeOVe4RUhhrB-g" target="_VrUj0X00EeOVe4RUhhrB-g">
+      <children xsi:type="notation:DecorationNode" xmi:id="_6mIpxH00EeOVe4RUhhrB-g" type="TransitionExpression">
+        <styles xsi:type="notation:ShapeStyle" xmi:id="_6mIpxX00EeOVe4RUhhrB-g"/>
+        <layoutConstraint xsi:type="notation:Location" xmi:id="_6mIpxn00EeOVe4RUhhrB-g" y="10"/>
+      </children>
+      <styles xsi:type="notation:ConnectorStyle" xmi:id="_6mIpwX00EeOVe4RUhhrB-g" lineColor="4210752"/>
+      <styles xsi:type="notation:FontStyle" xmi:id="_6mIpw300EeOVe4RUhhrB-g" fontName="Verdana"/>
+      <bendpoints xsi:type="notation:RelativeBendpoints" xmi:id="_6mIpwn00EeOVe4RUhhrB-g" points="[0, -24, 200, 51]$[0, -75, 200, 0]$[-192, -75, 8, 0]"/>
+      <targetAnchor xsi:type="notation:IdentityAnchor" xmi:id="_6mKe8H00EeOVe4RUhhrB-g" id="(0.9767441860465116,0.30996309963099633)"/>
+    </edges>
+    <edges xmi:id="__Ni5wH00EeOVe4RUhhrB-g" type="Transition" element="__NgdgH00EeOVe4RUhhrB-g" source="_9H2YkH00EeOVe4RUhhrB-g" target="_xtTA0H00EeOVe4RUhhrB-g">
+      <children xsi:type="notation:DecorationNode" xmi:id="__Njg0X00EeOVe4RUhhrB-g" type="TransitionExpression">
+        <styles xsi:type="notation:ShapeStyle" xmi:id="__Njg0n00EeOVe4RUhhrB-g"/>
+        <layoutConstraint xsi:type="notation:Location" xmi:id="__Njg0300EeOVe4RUhhrB-g" y="10"/>
+      </children>
+      <styles xsi:type="notation:ConnectorStyle" xmi:id="__Ni5wX00EeOVe4RUhhrB-g" lineColor="4210752"/>
+      <styles xsi:type="notation:FontStyle" xmi:id="__Njg0H00EeOVe4RUhhrB-g" fontName="Verdana"/>
+      <bendpoints xsi:type="notation:RelativeBendpoints" xmi:id="__Ni5wn00EeOVe4RUhhrB-g" points="[-2, -7, 42, 135]$[-39, -160, 5, -18]"/>
+      <targetAnchor xsi:type="notation:IdentityAnchor" xmi:id="__Nku8H00EeOVe4RUhhrB-g" id="(0.825,0.37735849056603776)"/>
+    </edges>
+    <edges xmi:id="_FwELkH01EeOVe4RUhhrB-g" type="Transition" element="_FwCWYH01EeOVe4RUhhrB-g" source="_0EbQQH00EeOVe4RUhhrB-g" target="_xtTA0H00EeOVe4RUhhrB-g">
+      <children xsi:type="notation:DecorationNode" xmi:id="_FwEyoH01EeOVe4RUhhrB-g" type="TransitionExpression">
+        <styles xsi:type="notation:ShapeStyle" xmi:id="_FwEyoX01EeOVe4RUhhrB-g"/>
+        <layoutConstraint xsi:type="notation:Location" xmi:id="_FwEyon01EeOVe4RUhhrB-g" x="1" y="24"/>
+      </children>
+      <styles xsi:type="notation:ConnectorStyle" xmi:id="_FwELkX01EeOVe4RUhhrB-g" lineColor="4210752"/>
+      <styles xsi:type="notation:FontStyle" xmi:id="_FwELk301EeOVe4RUhhrB-g" fontName="Verdana"/>
+      <bendpoints xsi:type="notation:RelativeBendpoints" xmi:id="_FwELkn01EeOVe4RUhhrB-g" points="[1, -8, 10, 85]$[1, -69, 10, 24]"/>
+      <sourceAnchor xsi:type="notation:IdentityAnchor" xmi:id="_FwFZsH01EeOVe4RUhhrB-g" id="(0.425,0.16981132075471697)"/>
+    </edges>
+    <edges xmi:id="_E3kA0H02EeOVe4RUhhrB-g" type="Transition" element="_E3iysH02EeOVe4RUhhrB-g" source="_xtTA0H00EeOVe4RUhhrB-g" target="_EWTt4H02EeOVe4RUhhrB-g">
+      <children xsi:type="notation:DecorationNode" xmi:id="_E3kA1H02EeOVe4RUhhrB-g" type="TransitionExpression">
+        <styles xsi:type="notation:ShapeStyle" xmi:id="_E3kA1X02EeOVe4RUhhrB-g"/>
+        <layoutConstraint xsi:type="notation:Location" xmi:id="_E3kA1n02EeOVe4RUhhrB-g" x="47" y="-22"/>
+      </children>
+      <styles xsi:type="notation:ConnectorStyle" xmi:id="_E3kA0X02EeOVe4RUhhrB-g" lineColor="4210752"/>
+      <styles xsi:type="notation:FontStyle" xmi:id="_E3kA0302EeOVe4RUhhrB-g" fontName="Verdana"/>
+      <bendpoints xsi:type="notation:RelativeBendpoints" xmi:id="_E3kA0n02EeOVe4RUhhrB-g" points="[18, 6, -146, -56]$[157, 55, -7, -7]$[159, 57, -5, -5]"/>
+    </edges>
+    <edges xmi:id="_Fyew8H02EeOVe4RUhhrB-g" type="Transition" element="_Fydi0H02EeOVe4RUhhrB-g" source="_0EbQQH00EeOVe4RUhhrB-g" target="_EWTt4H02EeOVe4RUhhrB-g">
+      <children xsi:type="notation:DecorationNode" xmi:id="_FyfYAH02EeOVe4RUhhrB-g" type="TransitionExpression">
+        <styles xsi:type="notation:ShapeStyle" xmi:id="_FyfYAX02EeOVe4RUhhrB-g"/>
+        <layoutConstraint xsi:type="notation:Location" xmi:id="_FyfYAn02EeOVe4RUhhrB-g" y="10"/>
+      </children>
+      <styles xsi:type="notation:ConnectorStyle" xmi:id="_Fyew8X02EeOVe4RUhhrB-g" lineColor="4210752"/>
+      <styles xsi:type="notation:FontStyle" xmi:id="_Fyew8302EeOVe4RUhhrB-g" fontName="Verdana"/>
+      <bendpoints xsi:type="notation:RelativeBendpoints" xmi:id="_Fyew8n02EeOVe4RUhhrB-g" points="[18, 5, -121, 3]$[144, 7, 5, 5]"/>
+    </edges>
+  </notation:Diagram>
+</xmi:XMI>

+ 1 - 0
test-plugins/org.yakindu.sct.test.models/tests/AllTests.sctunit

@@ -19,6 +19,7 @@ testsuite AllTests {
 	Guard, 
 	GuardedEntry, 
 	GuardedExit, 
+	HistoryWithExitPoint,
 	HistoryWithoutInitialStep,
 	InEventLifeCycle, 
 	IntegerExpressions, 

+ 31 - 0
test-plugins/org.yakindu.sct.test.models/tests/HistoryWithExitPoint.sctunit

@@ -0,0 +1,31 @@
+
+testgroup HistoryWithExitPoint for statechart HistoryWithExitPoint {
+	
+	test historyEntryAfterExit {
+		enter
+		
+		assert active ( HistoryWithExitPoint.mr.A.r.X1 )
+		
+		raise push 
+		cycle
+		assert active ( HistoryWithExitPoint.mr.B )
+		
+		raise back
+		cycle
+		assert active ( HistoryWithExitPoint.mr.A.r.X1 )
+		
+		raise next
+		cycle
+		assert active ( HistoryWithExitPoint.mr.A.r.X2 )
+		
+		raise push 
+		cycle
+		assert active ( HistoryWithExitPoint.mr.B )
+		
+		raise back
+		cycle
+		assert active ( HistoryWithExitPoint.mr.A.r.X2 )
+		
+	}
+	
+}