ソースを参照

Added tests for isExecutable() method of refactorings. Adapted testmodels and fixed refactorings.

tomqc86@googlemail.com 12 年 前
コミット
aef3b4f9f6
21 ファイル変更556 行追加55 行削除
  1. 11 7
      plugins/org.yakindu.sct.refactoring/src/org/yakindu/sct/refactoring/refactor/impl/FoldIncomingActionsRefactoring.java
  2. 11 7
      plugins/org.yakindu.sct.refactoring/src/org/yakindu/sct/refactoring/refactor/impl/FoldOutgoingActionsRefactoring.java
  3. 16 6
      plugins/org.yakindu.sct.refactoring/src/org/yakindu/sct/refactoring/refactor/impl/UnfoldEntryActionsRefactoring.java
  4. 15 6
      plugins/org.yakindu.sct.refactoring/src/org/yakindu/sct/refactoring/refactor/impl/UnfoldExitActionsRefactoring.java
  5. 20 0
      plugins/org.yakindu.sct.refactoring/src/org/yakindu/sct/refactoring/utils/RefactoringHelper.java
  6. 12 0
      test-plugins/org.yakindu.sct.refactoring.tests/src/org/yakindu/sct/refactoring/refactor/FoldIncomingActionsRefactoringTest.java
  7. 15 0
      test-plugins/org.yakindu.sct.refactoring.tests/src/org/yakindu/sct/refactoring/refactor/FoldOutgoingActionsRefactoringTest.java
  8. 25 2
      test-plugins/org.yakindu.sct.refactoring.tests/src/org/yakindu/sct/refactoring/refactor/RenameRefactoringTest.java
  9. 38 5
      test-plugins/org.yakindu.sct.refactoring.tests/src/org/yakindu/sct/refactoring/refactor/StateBasedRefactoringTest.java
  10. 27 0
      test-plugins/org.yakindu.sct.refactoring.tests/src/org/yakindu/sct/refactoring/refactor/UnfoldEntryActionsRefactoringTest.java
  11. 31 2
      test-plugins/org.yakindu.sct.refactoring.tests/src/org/yakindu/sct/refactoring/refactor/UnfoldExitActionsRefactoringTest.java
  12. 67 0
      test-plugins/org.yakindu.sct.refactoring.tests/src/org/yakindu/sct/refactoring/refactor/util/SctEqualityHelper.java
  13. 7 10
      test-plugins/org.yakindu.sct.refactoring.tests/src/org/yakindu/sct/refactoring/refactor/util/TestHelper.java
  14. 29 2
      test-plugins/org.yakindu.sct.test.models/testmodels/refactoring/fold_inc_action/after.sct
  15. 41 2
      test-plugins/org.yakindu.sct.test.models/testmodels/refactoring/fold_inc_action/before.sct
  16. 41 1
      test-plugins/org.yakindu.sct.test.models/testmodels/refactoring/fold_out_action/after.sct
  17. 41 1
      test-plugins/org.yakindu.sct.test.models/testmodels/refactoring/fold_out_action/before.sct
  18. 17 0
      test-plugins/org.yakindu.sct.test.models/testmodels/refactoring/unfold_entry_action/after.sct
  19. 30 1
      test-plugins/org.yakindu.sct.test.models/testmodels/refactoring/unfold_entry_action/before.sct
  20. 32 2
      test-plugins/org.yakindu.sct.test.models/testmodels/refactoring/unfold_exit_action/after.sct
  21. 30 1
      test-plugins/org.yakindu.sct.test.models/testmodels/refactoring/unfold_exit_action/before.sct

+ 11 - 7
plugins/org.yakindu.sct.refactoring/src/org/yakindu/sct/refactoring/refactor/impl/FoldIncomingActionsRefactoring.java

@@ -54,17 +54,21 @@ public class FoldIncomingActionsRefactoring extends AbstractRefactoring<State> {
 	}
 
 	/**
-	 * Checks if one of the incoming transitions enters a parent composite state
-	 * of its target. If so, false is returned if this parent composite state
-	 * has entry actions.
-	 * 
-	 * @return true if all preconditions are fulfilled, false otherwise
+	 * {@inheritDoc}
 	 */
 	@Override
 	public boolean isExecutable() {
-		// TODO check if there is at least one action on each transition
 		return super.isExecutable()
-				&& !helper.oneIncomingTransitionEntersCompositeWithEntryActions(getContextObject());
+				&& allIncomingTransitionsHaveAtLeastOneAction()
+				&& noIncomingTransitionEntersCompositeWithEntryActions();
+	}
+
+	private boolean noIncomingTransitionEntersCompositeWithEntryActions() {
+		return !helper.oneIncomingTransitionEntersCompositeWithEntryActions(getContextObject());
+	}
+
+	private boolean allIncomingTransitionsHaveAtLeastOneAction() {
+		return helper.haveAllAtLeastOneAction(getContextObject().getIncomingTransitions());
 	}
 
 

+ 11 - 7
plugins/org.yakindu.sct.refactoring/src/org/yakindu/sct/refactoring/refactor/impl/FoldOutgoingActionsRefactoring.java

@@ -54,17 +54,21 @@ public class FoldOutgoingActionsRefactoring extends AbstractRefactoring<State> {
 	}
 
 	/**
-	 * Checks if one of the outgoing transitions leaves a parent composite state
-	 * of its source. If so, false is returned if this parent composite state
-	 * has exit actions.
-	 * 
-	 * @return true if all preconditions are fulfilled, false otherwise
+	 * {@inheritDoc}
 	 */
 	@Override
 	public boolean isExecutable() {
-		// TODO check if there is at least one action on each transition
 		return super.isExecutable()
-				&& !helper.oneOutgoingTransitionLeavesCompositeWithExitActions(getContextObject());
+				&& allOutgoingTransitionsHaveAtLeastOneAction()
+				&& noOutgoingTransitionLeavesCompositeWithExitActions();
+	}
+
+	private boolean noOutgoingTransitionLeavesCompositeWithExitActions() {
+		return !helper.oneOutgoingTransitionLeavesCompositeWithExitActions(getContextObject());
+	}
+
+	private boolean allOutgoingTransitionsHaveAtLeastOneAction() {
+		return helper.haveAllAtLeastOneAction(getContextObject().getOutgoingTransitions());
 	}
 
 	private List<Expression> getFoldableActions(EList<Transition> transitions) {

+ 16 - 6
plugins/org.yakindu.sct.refactoring/src/org/yakindu/sct/refactoring/refactor/impl/UnfoldEntryActionsRefactoring.java

@@ -47,16 +47,26 @@ public class UnfoldEntryActionsRefactoring extends AbstractRefactoring<State> {
 	}
 
 	/**
-	 * Checks if one of the incoming transitions enters a parent composite state
-	 * of its target. If so, false is returned if this parent composite state
-	 * has entry actions.
-	 * 
-	 * @return true if all preconditions are fulfilled, false otherwise
+	 * {@inheritDoc}
 	 */
 	@Override
 	public boolean isExecutable() {
 		return super.isExecutable()
-				&& !helper.oneIncomingTransitionEntersCompositeWithEntryActions(getContextObject());
+				&& hasAtLeastOneEntryAction()
+				&& hasAtLeastOneIncomingTransition()
+				&& noIncomingTransitionEntersCompositeWithEntryActions();
+	}
+
+	private boolean noIncomingTransitionEntersCompositeWithEntryActions() {
+		return !helper.oneIncomingTransitionEntersCompositeWithEntryActions(getContextObject());
+	}
+
+	private boolean hasAtLeastOneEntryAction() {
+		return helper.hasEntryAction(getContextObject());
+	}
+
+	private boolean hasAtLeastOneIncomingTransition() {
+		return !getContextObject().getIncomingTransitions().isEmpty();
 	}
 
 	private void unfoldEntryActions() {

+ 15 - 6
plugins/org.yakindu.sct.refactoring/src/org/yakindu/sct/refactoring/refactor/impl/UnfoldExitActionsRefactoring.java

@@ -33,6 +33,7 @@ import org.yakindu.sct.refactoring.refactor.AbstractRefactoring;
  * Preconditions:
  * <ul>
  * <li>At least one exit action exists.</li>
+ * <li>At least one outgoing transition exists.</li>
  * <li>No outgoing transition leaves a parent composite state of the context state with exit actions.</li>
  * </ul>
  * 
@@ -47,19 +48,27 @@ public class UnfoldExitActionsRefactoring extends AbstractRefactoring<State> {
 	}
 
 	/**
-	 * Checks if one of the outgoing transitions leaves a parent composite state
-	 * of its source. If so, false is returned if this parent composite state
-	 * has exit actions.
-	 * 
-	 * @return true if all preconditions are fulfilled, false otherwise
+	 * {@inheritDoc}
 	 */
 	@Override
 	public boolean isExecutable() {
 		return super.isExecutable()
-				&& !helper.oneOutgoingTransitionLeavesCompositeWithExitActions(getContextObject());
+				&& hasAtLeastOneExitAction()
+				&& hasAtLeastOneOutgoingTransition()
+				&& noOutgoingTransitionLeavesCompositeWithExitActions();
 	}
 
+	private boolean hasAtLeastOneExitAction() {
+		return helper.hasExitAction(getContextObject());
+	}
+
+	private boolean noOutgoingTransitionLeavesCompositeWithExitActions() {
+		return !helper.oneOutgoingTransitionLeavesCompositeWithExitActions(getContextObject());
+	}
 
+	private boolean hasAtLeastOneOutgoingTransition() {
+		return !getContextObject().getOutgoingTransitions().isEmpty();
+	}
 
 	private void unfoldExitActions() {
 		List<Expression> actionsToUnfold = new ArrayList<Expression>(

+ 20 - 0
plugins/org.yakindu.sct.refactoring/src/org/yakindu/sct/refactoring/utils/RefactoringHelper.java

@@ -272,5 +272,25 @@ public class RefactoringHelper {
 		}
 		return true;
 	}
+
+	/**
+	 * Checks if all given transitions have at least one action.
+	 * Returns false for empty lists.
+	 * 
+	 * @param transitions
+	 * @return
+	 */
+	public boolean haveAllAtLeastOneAction(
+			EList<Transition> transitions) {
+		if (transitions.isEmpty())
+			return false;
+		
+		for (Transition transition : transitions) {
+			if (!hasAtLeastOneAction(transition)) {
+				return false;
+			}
+		}
+		return true;
+	}
 	
 }

+ 12 - 0
test-plugins/org.yakindu.sct.refactoring.tests/src/org/yakindu/sct/refactoring/refactor/FoldIncomingActionsRefactoringTest.java

@@ -35,6 +35,18 @@ public class FoldIncomingActionsRefactoringTest extends
 		testRefactoringOnState(FOLD_INCOMING_ACTIONS + INITIAL_STATECHART,
 				FOLD_INCOMING_ACTIONS + EXPECTED_STATECHART, "B");
 	}
+	
+	@Test
+	public void testIsExecutable() {
+		testRefactoringIsExecutableOnState(FOLD_INCOMING_ACTIONS + INITIAL_STATECHART,
+				FOLD_INCOMING_ACTIONS + EXPECTED_STATECHART, "B", true);
+		
+		testRefactoringIsExecutableOnState(FOLD_INCOMING_ACTIONS + INITIAL_STATECHART,
+				FOLD_INCOMING_ACTIONS + EXPECTED_STATECHART, "C", false);
+		
+		testRefactoringIsExecutableOnState(FOLD_INCOMING_ACTIONS + INITIAL_STATECHART,
+				FOLD_INCOMING_ACTIONS + EXPECTED_STATECHART, "InnerState", false);
+	}
 
 	protected AbstractRefactoring<?> getRefactoring(State state) {
 		FoldIncomingActionsRefactoring foldIncomingActionsRefactoring = new FoldIncomingActionsRefactoring();

+ 15 - 0
test-plugins/org.yakindu.sct.refactoring.tests/src/org/yakindu/sct/refactoring/refactor/FoldOutgoingActionsRefactoringTest.java

@@ -34,6 +34,21 @@ public class FoldOutgoingActionsRefactoringTest extends
 		testRefactoringOnState(FOLD_OUTGOING_ACTIONS + INITIAL_STATECHART,
 				FOLD_OUTGOING_ACTIONS + EXPECTED_STATECHART, "A");
 	}
+	
+	@Test
+	public void testIsExecutable() {
+		testRefactoringIsExecutableOnState(FOLD_OUTGOING_ACTIONS + INITIAL_STATECHART,
+				FOLD_OUTGOING_ACTIONS + EXPECTED_STATECHART, "A", true);
+		
+		testRefactoringIsExecutableOnState(FOLD_OUTGOING_ACTIONS + INITIAL_STATECHART,
+				FOLD_OUTGOING_ACTIONS + EXPECTED_STATECHART, "InnerState", false);
+		
+		testRefactoringIsExecutableOnState(FOLD_OUTGOING_ACTIONS + INITIAL_STATECHART,
+				FOLD_OUTGOING_ACTIONS + EXPECTED_STATECHART, "D", false);
+		
+		testRefactoringIsExecutableOnState(FOLD_OUTGOING_ACTIONS + INITIAL_STATECHART,
+				FOLD_OUTGOING_ACTIONS + EXPECTED_STATECHART, "E", false);
+	}
 
 	@Override
 	protected AbstractRefactoring<?> getRefactoring(State state) {

+ 25 - 2
test-plugins/org.yakindu.sct.refactoring.tests/src/org/yakindu/sct/refactoring/refactor/RenameRefactoringTest.java

@@ -13,10 +13,13 @@ package org.yakindu.sct.refactoring.refactor;
 import static org.junit.Assert.fail;
 import static org.yakindu.sct.test.models.RefactoringTestModels.INITIAL_STATECHART;
 import static org.yakindu.sct.test.models.RefactoringTestModels.RENAMING;
+
+import java.util.List;
+
 import junit.framework.Assert;
 
 import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.util.EcoreUtil;
+import org.eclipse.xtext.EcoreUtil2;
 import org.eclipse.xtext.junit4.InjectWith;
 import org.eclipse.xtext.junit4.XtextRunner;
 import org.eclipse.xtext.parser.IParser;
@@ -24,11 +27,14 @@ import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.yakindu.sct.model.sgraph.Event;
 import org.yakindu.sct.model.sgraph.Scope;
+import org.yakindu.sct.model.sgraph.SpecificationElement;
 import org.yakindu.sct.model.sgraph.Statechart;
 import org.yakindu.sct.model.sgraph.Variable;
 import org.yakindu.sct.model.sgraph.resource.AbstractSCTResource;
+import org.yakindu.sct.model.stext.resource.impl.StextResource;
 import org.yakindu.sct.model.stext.stext.InterfaceScope;
 import org.yakindu.sct.refactoring.refactor.impl.RenameRefactoring;
+import org.yakindu.sct.refactoring.refactor.util.SctEqualityHelper;
 import org.yakindu.sct.refactoring.refactor.util.TestHelper;
 import org.yakindu.sct.refactoring.refactor.util.TestInjectorProvider;
 import org.yakindu.sct.test.models.RefactoringTestModels;
@@ -54,7 +60,8 @@ public class RenameRefactoringTest {
 	protected TestHelper helper = new TestHelper();
 
 	protected void compareStatecharts(Statechart initial, Statechart expected) {
-		if (!EcoreUtil.equals(initial, expected)) {
+		SctEqualityHelper equalityHelper = new SctEqualityHelper();
+		if (!equalityHelper.equals(initial, expected)) {
 			Assert.fail("Equality check on statecharts failed!");
 		}
 	}
@@ -84,6 +91,9 @@ public class RenameRefactoringTest {
 		Statechart expected = models.loadStatechartFromResource(RENAMING
 				+ "AfterRenamingVariable.sct");
 
+		parseAllSpecifications(initial);
+		parseAllSpecifications(expected);
+		
 		compareStatecharts(initial, expected);
 	}
 
@@ -116,6 +126,9 @@ public class RenameRefactoringTest {
 		Statechart expected = models.loadStatechartFromResource(RENAMING
 				+ "AfterRenamingEvent.sct");
 
+		parseAllSpecifications(initial);
+		parseAllSpecifications(expected);
+		
 		compareStatecharts(initial, expected);
 	}
 
@@ -143,6 +156,9 @@ public class RenameRefactoringTest {
 		Statechart expected = models.loadStatechartFromResource(RENAMING
 				+ "AfterRenamingInterface.sct");
 
+		parseAllSpecifications(initial);
+		parseAllSpecifications(expected);
+		
 		compareStatecharts(initial, expected);
 	}
 
@@ -150,5 +166,12 @@ public class RenameRefactoringTest {
 	public void testNoRenamingIntoExistingName() {
 		fail("Not yet implemented.");
 	}
+	
+	private void parseAllSpecifications(Statechart sct) {
+		List<SpecificationElement> allSpecElements = EcoreUtil2.getAllContentsOfType(sct, SpecificationElement.class);
+		for (SpecificationElement specificationElement : allSpecElements) {
+			((StextResource)sct.eResource()).parseSpecificationElement(specificationElement);
+		}
+	}
 
 }

+ 38 - 5
test-plugins/org.yakindu.sct.refactoring.tests/src/org/yakindu/sct/refactoring/refactor/StateBasedRefactoringTest.java

@@ -10,16 +10,21 @@
  */
 package org.yakindu.sct.refactoring.refactor;
 
+import java.util.List;
+
 import junit.framework.Assert;
 
-import org.eclipse.emf.ecore.util.EcoreUtil;
+import org.eclipse.xtext.EcoreUtil2;
 import org.eclipse.xtext.junit4.InjectWith;
 import org.eclipse.xtext.junit4.XtextRunner;
 import org.eclipse.xtext.parser.IParser;
 import org.junit.runner.RunWith;
+import org.yakindu.sct.model.sgraph.SpecificationElement;
 import org.yakindu.sct.model.sgraph.State;
 import org.yakindu.sct.model.sgraph.Statechart;
 import org.yakindu.sct.model.sgraph.resource.AbstractSCTResource;
+import org.yakindu.sct.model.stext.resource.impl.StextResource;
+import org.yakindu.sct.refactoring.refactor.util.SctEqualityHelper;
 import org.yakindu.sct.refactoring.refactor.util.TestHelper;
 import org.yakindu.sct.refactoring.refactor.util.TestInjectorProvider;
 import org.yakindu.sct.test.models.RefactoringTestModels;
@@ -45,7 +50,8 @@ public abstract class StateBasedRefactoringTest {
 	protected TestHelper helper = new TestHelper();
 
 	protected void compareStatecharts(Statechart initial, Statechart expected) {
-		if (!EcoreUtil.equals(initial, expected)) {
+		SctEqualityHelper equalityHelper = new SctEqualityHelper();
+		if (!equalityHelper.equals(initial, expected)) {
 			Assert.fail("Equality check on statecharts failed!");
 		}
 	}
@@ -54,18 +60,45 @@ public abstract class StateBasedRefactoringTest {
 			String pathToExpectedSct, String stateName) {
 		Statechart initial = models
 				.loadStatechartFromResource(pathToInitialSct);
-		State stateB = helper.getStateByName(initial, stateName);
 
-		AbstractRefactoring<?> refactoring = getRefactoring(stateB);
+		State state = helper.getStateByName(initial, stateName);
+
+		AbstractRefactoring<?> refactoring = getRefactoring(state);
 		((AbstractSCTResource) initial.eResource()).setSerializerEnabled(true);
 		refactoring.internalExecute();
 		((AbstractSCTResource) initial.eResource()).setSerializerEnabled(false);
 
 		Statechart expected = models
 				.loadStatechartFromResource(pathToExpectedSct);
-
+		
+		parseAllSpecifications(initial);
+		parseAllSpecifications(expected);
+		
 		compareStatecharts(initial, expected);
 	}
+	
+	protected void testRefactoringIsExecutableOnState(String pathToInitialSct,
+			String pathToExpectedSct, String stateName, boolean expectedResult) {
+		Statechart initial = models
+				.loadStatechartFromResource(pathToInitialSct);
+
+		State state = helper.getStateByName(initial, stateName);
+
+		AbstractRefactoring<?> refactoring = getRefactoring(state);
+		if (expectedResult) {
+			Assert.assertTrue("Refactoring on state '"+stateName+"' was not executable, although it should be.", refactoring.isExecutable());
+		}
+		else {			
+			Assert.assertFalse("Refactoring on state '"+stateName+"' was executable, although it should not be.", refactoring.isExecutable());
+		}
+	}
+
+	private void parseAllSpecifications(Statechart sct) {
+		List<SpecificationElement> allSpecElements = EcoreUtil2.getAllContentsOfType(sct, SpecificationElement.class);
+		for (SpecificationElement specificationElement : allSpecElements) {
+			((StextResource)sct.eResource()).parseSpecificationElement(specificationElement);
+		}
+	}
 
 	protected abstract AbstractRefactoring<?> getRefactoring(State state);
 }

+ 27 - 0
test-plugins/org.yakindu.sct.refactoring.tests/src/org/yakindu/sct/refactoring/refactor/UnfoldEntryActionsRefactoringTest.java

@@ -36,6 +36,33 @@ public class UnfoldEntryActionsRefactoringTest extends
 				UNFOLD_ENTRY_ACTIONS
 						+ EXPECTED_STATECHART, "B");
 	}
+	
+	@Test
+	public void testIsExecutable() {
+		testRefactoringIsExecutableOnState(
+				UNFOLD_ENTRY_ACTIONS + INITIAL_STATECHART,
+				UNFOLD_ENTRY_ACTIONS + EXPECTED_STATECHART,
+				"B",
+				true);
+		
+		testRefactoringIsExecutableOnState(
+				UNFOLD_ENTRY_ACTIONS + INITIAL_STATECHART,
+				UNFOLD_ENTRY_ACTIONS + EXPECTED_STATECHART,
+				"InnerState",
+				false);
+		
+		testRefactoringIsExecutableOnState(
+				UNFOLD_ENTRY_ACTIONS + INITIAL_STATECHART,
+				UNFOLD_ENTRY_ACTIONS + EXPECTED_STATECHART,
+				"A2",
+				false);
+		
+		testRefactoringIsExecutableOnState(
+				UNFOLD_ENTRY_ACTIONS + INITIAL_STATECHART,
+				UNFOLD_ENTRY_ACTIONS + EXPECTED_STATECHART,
+				"F",
+				false);
+	}
 
 	@Override
 	protected AbstractRefactoring<?> getRefactoring(State state) {

+ 31 - 2
test-plugins/org.yakindu.sct.refactoring.tests/src/org/yakindu/sct/refactoring/refactor/UnfoldExitActionsRefactoringTest.java

@@ -31,10 +31,39 @@ public class UnfoldExitActionsRefactoringTest extends StateBasedRefactoringTest
 	@Test
 	public void testUnfoldExitActions() {
 
-		testRefactoringOnState(UNFOLD_EXIT_ACTIONS + INITIAL_STATECHART,
-				UNFOLD_EXIT_ACTIONS + EXPECTED_STATECHART, "A");
+		testRefactoringOnState(
+				UNFOLD_EXIT_ACTIONS + INITIAL_STATECHART,
+				UNFOLD_EXIT_ACTIONS + EXPECTED_STATECHART, 
+				"A");
 	}
 
+	@Test
+	public void testIsExecutable() {
+		testRefactoringIsExecutableOnState(
+				UNFOLD_EXIT_ACTIONS + INITIAL_STATECHART,
+				UNFOLD_EXIT_ACTIONS + EXPECTED_STATECHART, 
+				"A",
+				true);
+		testRefactoringIsExecutableOnState(
+				UNFOLD_EXIT_ACTIONS + INITIAL_STATECHART,
+				UNFOLD_EXIT_ACTIONS + EXPECTED_STATECHART, 
+				"InnerState",
+				false);
+		
+		testRefactoringIsExecutableOnState(
+				UNFOLD_EXIT_ACTIONS + INITIAL_STATECHART,
+				UNFOLD_EXIT_ACTIONS + EXPECTED_STATECHART, 
+				"D",
+				false);
+		
+		testRefactoringIsExecutableOnState(
+				UNFOLD_EXIT_ACTIONS + INITIAL_STATECHART,
+				UNFOLD_EXIT_ACTIONS + EXPECTED_STATECHART, 
+				"E",
+				false);
+		
+	}
+	
 	@Override
 	protected AbstractRefactoring<?> getRefactoring(State state) {
 		UnfoldExitActionsRefactoring unfoldExitActionsRefactoring = new UnfoldExitActionsRefactoring();

+ 67 - 0
test-plugins/org.yakindu.sct.refactoring.tests/src/org/yakindu/sct/refactoring/refactor/util/SctEqualityHelper.java

@@ -0,0 +1,67 @@
+package org.yakindu.sct.refactoring.refactor.util;
+
+import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.util.EcoreUtil;
+import org.eclipse.emf.ecore.util.EcoreUtil.EqualityHelper;
+import org.eclipse.emf.ecore.util.FeatureMap;
+import org.eclipse.emf.ecore.util.FeatureMapUtil;
+
+public class SctEqualityHelper extends EqualityHelper{
+
+	@Override
+	public boolean equals(EObject eObject1, EObject eObject2) {
+		
+		if (eObject1!=null && eObject1.eIsProxy()) {
+			EcoreUtil.resolve(eObject1, eObject2.eResource());
+		}
+		if (eObject2!=null && eObject2.eIsProxy()) {
+			EcoreUtil.resolve(eObject2, eObject1.eResource());
+		}
+		
+		return super.equals(eObject1, eObject2);
+	}
+	
+	@Override
+	protected boolean haveEqualAttribute(EObject eObject1, EObject eObject2,
+			EAttribute attribute) {
+		
+		Object value1 = eObject1.eGet(attribute);
+		Object value2 = eObject2.eGet(attribute);
+
+		// If the first value is null, the second value must be null.
+		//
+		if (value1 == null) {
+			return value2 == null;
+		}
+		
+		// Since the first value isn't null, if the second one is, they aren't equal.
+		//
+		if (value2 == null) {
+			return false;
+		}
+
+		// If this is a feature map...
+		//
+		if (FeatureMapUtil.isFeatureMap(attribute)) {
+			// The feature maps must be equal.
+			//
+			FeatureMap featureMap1 = (FeatureMap)value1;
+			FeatureMap featureMap2 = (FeatureMap)value2;
+			return equalFeatureMaps(featureMap1, featureMap2);
+		}
+		else {
+			if (value1 instanceof String && value2 instanceof String) {
+				String wsFreeValue1 = removeWhitespaces((String)value1);
+				String wsFreeValue2 = removeWhitespaces((String)value2);
+				return wsFreeValue1.equals(wsFreeValue2);
+			}
+			
+			return value1.equals(value2);
+		}
+	}
+
+	private String removeWhitespaces(String input) {
+		return input.replaceAll(" ", "");
+	}
+}

+ 7 - 10
test-plugins/org.yakindu.sct.refactoring.tests/src/org/yakindu/sct/refactoring/refactor/util/TestHelper.java

@@ -10,11 +10,11 @@
  */
 package org.yakindu.sct.refactoring.refactor.util;
 
-import org.eclipse.emf.common.util.EList;
-import org.yakindu.sct.model.sgraph.Region;
+import java.util.List;
+
+import org.eclipse.xtext.EcoreUtil2;
 import org.yakindu.sct.model.sgraph.State;
 import org.yakindu.sct.model.sgraph.Statechart;
-import org.yakindu.sct.model.sgraph.Vertex;
 /**
  * 
  * @author thomas kutz - Initial contribution and API
@@ -23,13 +23,10 @@ import org.yakindu.sct.model.sgraph.Vertex;
 public class TestHelper {
 
 	public State getStateByName(Statechart statechart, String name) {
-		EList<Region> regions = statechart.getRegions();
-		for (Region region : regions) {
-			EList<Vertex> vertices = region.getVertices();
-			for (Vertex vertex : vertices) {
-				if ((vertex instanceof State) && vertex.getName().equals(name)) {
-					return (State) vertex;
-				}
+		List<State> allStates = EcoreUtil2.getAllContentsOfType(statechart, State.class);
+		for (State state : allStates) {
+			if (state.getName().equals(name)) {
+				return state;
 			}
 		}
 		return null;

+ 29 - 2
test-plugins/org.yakindu.sct.test.models/testmodels/refactoring/fold_inc_action/after.sct

@@ -13,12 +13,14 @@
       <vertices xsi:type="sgraph:State" xmi:id="_bKn-0MdlEeGOoP2Ze98WBQ" name="A2" incomingTransitions="_gnvHwMdlEeGOoP2Ze98WBQ">
         <outgoingTransitions xmi:id="_cY-oUMdlEeGOoP2Ze98WBQ" specification="" target="_BE1pEMdiEeGOoP2Ze98WBQ"/>
         <outgoingTransitions xmi:id="_LuJ_MOqjEeG_KKo5r9OX-w" specification="/x+=1" target="_JRcsMOqjEeG_KKo5r9OX-w"/>
+        <outgoingTransitions xmi:id="_WHnAcHIVEeKt7LlJCM3PJg" specification="" target="_TNDT0HIVEeKt7LlJCM3PJg"/>
       </vertices>
       <vertices xsi:type="sgraph:State" xmi:id="_EPdZAOqjEeG_KKo5r9OX-w" specification="entry /&#xA;  x=0" name="CompState">
         <regions xmi:id="_EPgcUOqjEeG_KKo5r9OX-w" name="compInnerRegion">
           <vertices xsi:type="sgraph:State" xmi:id="_JRcsMOqjEeG_KKo5r9OX-w" specification="" name="InnerState" incomingTransitions="_LuJ_MOqjEeG_KKo5r9OX-w"/>
         </regions>
       </vertices>
+      <vertices xsi:type="sgraph:State" xmi:id="_TNDT0HIVEeKt7LlJCM3PJg" name="C" incomingTransitions="_WHnAcHIVEeKt7LlJCM3PJg"/>
     </regions>
   </sgraph:Statechart>
   <notation:Diagram xmi:id="_AU3ksMdiEeGOoP2Ze98WBQ" type="org.yakindu.sct.ui.editor.editor.StatechartDiagramEditor" element="_AU29oMdiEeGOoP2Ze98WBQ" measurementUnit="Pixel">
@@ -132,10 +134,26 @@
           <styles xsi:type="notation:BooleanValueStyle" xmi:id="_EQ1SAOqjEeG_KKo5r9OX-w"/>
           <layoutConstraint xsi:type="notation:Bounds" xmi:id="_EQpEw-qjEeG_KKo5r9OX-w" x="289" y="251" width="177" height="150"/>
         </children>
+        <children xmi:id="_TNCswXIVEeKt7LlJCM3PJg" type="State" element="_TNDT0HIVEeKt7LlJCM3PJg">
+          <children xsi:type="notation:DecorationNode" xmi:id="_TNCswnIVEeKt7LlJCM3PJg" type="StateName">
+            <styles xsi:type="notation:ShapeStyle" xmi:id="_TNCsw3IVEeKt7LlJCM3PJg"/>
+            <layoutConstraint xsi:type="notation:Location" xmi:id="_TNCsxHIVEeKt7LlJCM3PJg"/>
+          </children>
+          <children xsi:type="notation:Compartment" xmi:id="_TNCsxXIVEeKt7LlJCM3PJg" type="StateTextCompartment">
+            <children xsi:type="notation:Shape" xmi:id="_TNCsxnIVEeKt7LlJCM3PJg" type="StateTextCompartmentExpression" fontName="Verdana" lineColor="4210752">
+              <layoutConstraint xsi:type="notation:Bounds" xmi:id="_TNCsx3IVEeKt7LlJCM3PJg"/>
+            </children>
+          </children>
+          <children xsi:type="notation:Compartment" xmi:id="_TNCsyHIVEeKt7LlJCM3PJg" type="StateFigureCompartment"/>
+          <styles xsi:type="notation:ShapeStyle" xmi:id="_TNCsyXIVEeKt7LlJCM3PJg" fontName="Verdana" fillColor="15981773" lineColor="12632256"/>
+          <styles xsi:type="notation:FontStyle" xmi:id="_TNCsynIVEeKt7LlJCM3PJg"/>
+          <styles xsi:type="notation:BooleanValueStyle" xmi:id="_TNCsy3IVEeKt7LlJCM3PJg" name="isHorizontal" booleanValue="true"/>
+          <layoutConstraint xsi:type="notation:Bounds" xmi:id="_TNCszHIVEeKt7LlJCM3PJg" x="301" y="447"/>
+        </children>
         <layoutConstraint xsi:type="notation:Bounds" xmi:id="_AU4LxMdiEeGOoP2Ze98WBQ"/>
       </children>
       <styles xsi:type="notation:ShapeStyle" xmi:id="_AU3ktMdiEeGOoP2Ze98WBQ" fontName="Verdana" fillColor="15790320" lineColor="12632256"/>
-      <layoutConstraint xsi:type="notation:Bounds" xmi:id="_AU4LxcdiEeGOoP2Ze98WBQ" x="220" y="10" width="581" height="435"/>
+      <layoutConstraint xsi:type="notation:Bounds" xmi:id="_AU4LxcdiEeGOoP2Ze98WBQ" x="220" y="10" width="581" height="535"/>
     </children>
     <children xsi:type="notation:Shape" xmi:id="_AU6oBMdiEeGOoP2Ze98WBQ" type="StatechartText" fontName="Verdana" lineColor="4210752">
       <children xsi:type="notation:DecorationNode" xmi:id="_AU6oBsdiEeGOoP2Ze98WBQ" type="StatechartName">
@@ -145,7 +163,7 @@
       <children xsi:type="notation:Shape" xmi:id="_AU7PEMdiEeGOoP2Ze98WBQ" type="StatechartTextExpression" fontName="Verdana" lineColor="4210752">
         <layoutConstraint xsi:type="notation:Bounds" xmi:id="_AU7PEcdiEeGOoP2Ze98WBQ"/>
       </children>
-      <layoutConstraint xsi:type="notation:Bounds" xmi:id="_AU7PEsdiEeGOoP2Ze98WBQ" x="10" y="10" width="200" height="435"/>
+      <layoutConstraint xsi:type="notation:Bounds" xmi:id="_AU7PEsdiEeGOoP2Ze98WBQ" x="10" y="10" width="200" height="535"/>
     </children>
     <styles xsi:type="notation:DiagramStyle" xmi:id="_AU3kscdiEeGOoP2Ze98WBQ"/>
     <edges xmi:id="_AU6A9MdiEeGOoP2Ze98WBQ" type="Transition" element="_AU6A88diEeGOoP2Ze98WBQ" source="_AU4Lx8diEeGOoP2Ze98WBQ" target="_AU5Z4cdiEeGOoP2Ze98WBQ">
@@ -195,5 +213,14 @@
       <styles xsi:type="notation:FontStyle" xmi:id="_LuR7AOqjEeG_KKo5r9OX-w" fontName="Verdana"/>
       <bendpoints xsi:type="notation:RelativeBendpoints" xmi:id="_LuRT8uqjEeG_KKo5r9OX-w" points="[0, 24, -307, -109]$[0, 133, -307, 0]$[278, 133, -29, 0]"/>
     </edges>
+    <edges xmi:id="_WHoOkHIVEeKt7LlJCM3PJg" type="Transition" element="_WHnAcHIVEeKt7LlJCM3PJg" source="_bKusgMdlEeGOoP2Ze98WBQ" target="_TNCswXIVEeKt7LlJCM3PJg">
+      <children xsi:type="notation:DecorationNode" xmi:id="_WHoOlHIVEeKt7LlJCM3PJg" type="TransitionExpression">
+        <styles xsi:type="notation:ShapeStyle" xmi:id="_WHoOlXIVEeKt7LlJCM3PJg"/>
+        <layoutConstraint xsi:type="notation:Location" xmi:id="_WHoOlnIVEeKt7LlJCM3PJg" y="10"/>
+      </children>
+      <styles xsi:type="notation:ConnectorStyle" xmi:id="_WHoOkXIVEeKt7LlJCM3PJg" lineColor="4210752"/>
+      <styles xsi:type="notation:FontStyle" xmi:id="_WHoOk3IVEeKt7LlJCM3PJg" fontName="Verdana"/>
+      <bendpoints xsi:type="notation:RelativeBendpoints" xmi:id="_WHoOknIVEeKt7LlJCM3PJg" points="[0, 27, -239, -226]$[0, 253, -239, 0]$[222, 253, -17, 0]"/>
+    </edges>
   </notation:Diagram>
 </xmi:XMI>

+ 41 - 2
test-plugins/org.yakindu.sct.test.models/testmodels/refactoring/fold_inc_action/before.sct

@@ -13,12 +13,14 @@
       <vertices xsi:type="sgraph:State" xmi:id="_bKn-0MdlEeGOoP2Ze98WBQ" name="A2" incomingTransitions="_gnvHwMdlEeGOoP2Ze98WBQ">
         <outgoingTransitions xmi:id="_cY-oUMdlEeGOoP2Ze98WBQ" specification="/x+=1; y = x + 10 " target="_BE1pEMdiEeGOoP2Ze98WBQ"/>
         <outgoingTransitions xmi:id="_LuJ_MOqjEeG_KKo5r9OX-w" specification="/x+=1" target="_JRcsMOqjEeG_KKo5r9OX-w"/>
+        <outgoingTransitions xmi:id="_pM7lIHINEeK_6a0R9wQhsg" specification="" target="_jvLjAHINEeK_6a0R9wQhsg"/>
       </vertices>
       <vertices xsi:type="sgraph:State" xmi:id="_EPdZAOqjEeG_KKo5r9OX-w" specification="entry /&#xA;  x=0" name="CompState">
         <regions xmi:id="_EPgcUOqjEeG_KKo5r9OX-w" name="compInnerRegion">
           <vertices xsi:type="sgraph:State" xmi:id="_JRcsMOqjEeG_KKo5r9OX-w" specification="" name="InnerState" incomingTransitions="_LuJ_MOqjEeG_KKo5r9OX-w"/>
         </regions>
       </vertices>
+      <vertices xsi:type="sgraph:State" xmi:id="_jvLjAHINEeK_6a0R9wQhsg" name="C" incomingTransitions="_pM7lIHINEeK_6a0R9wQhsg"/>
     </regions>
   </sgraph:Statechart>
   <notation:Diagram xmi:id="_AU3ksMdiEeGOoP2Ze98WBQ" type="org.yakindu.sct.ui.editor.editor.StatechartDiagramEditor" element="_AU29oMdiEeGOoP2Ze98WBQ" measurementUnit="Pixel">
@@ -144,10 +146,38 @@
           <element xsi:nil="true"/>
           <layoutConstraint xsi:type="notation:Bounds" xmi:id="_xdyGw_N2EeGld5XQj3v7aA" x="169" y="302" height="37"/>
         </children>
+        <children xmi:id="_jvPNYHINEeK_6a0R9wQhsg" type="State" element="_jvLjAHINEeK_6a0R9wQhsg">
+          <children xsi:type="notation:DecorationNode" xmi:id="_jvRCkHINEeK_6a0R9wQhsg" type="StateName">
+            <styles xsi:type="notation:ShapeStyle" xmi:id="_jvRCkXINEeK_6a0R9wQhsg"/>
+            <layoutConstraint xsi:type="notation:Location" xmi:id="_jvRpoHINEeK_6a0R9wQhsg"/>
+          </children>
+          <children xsi:type="notation:Compartment" xmi:id="_jvRpoXINEeK_6a0R9wQhsg" type="StateTextCompartment">
+            <children xsi:type="notation:Shape" xmi:id="_jvSQsHINEeK_6a0R9wQhsg" type="StateTextCompartmentExpression" fontName="Verdana" lineColor="4210752">
+              <layoutConstraint xsi:type="notation:Bounds" xmi:id="_jvSQsXINEeK_6a0R9wQhsg"/>
+            </children>
+          </children>
+          <children xsi:type="notation:Compartment" xmi:id="_jvS3wHINEeK_6a0R9wQhsg" type="StateFigureCompartment"/>
+          <styles xsi:type="notation:ShapeStyle" xmi:id="_jvPNYXINEeK_6a0R9wQhsg" fontName="Verdana" fillColor="15981773" lineColor="12632256"/>
+          <styles xsi:type="notation:FontStyle" xmi:id="_jvPNYnINEeK_6a0R9wQhsg"/>
+          <styles xsi:type="notation:BooleanValueStyle" xmi:id="_jvS3wXINEeK_6a0R9wQhsg" name="isHorizontal" booleanValue="true"/>
+          <layoutConstraint xsi:type="notation:Bounds" xmi:id="_jvPNY3INEeK_6a0R9wQhsg" x="291" y="437"/>
+        </children>
+        <children xsi:type="notation:Shape" xmi:id="_sf05QHINEeK_6a0R9wQhsg" type="Note" fontName="Verdana" description="Refactoring disabled" fillColor="13369343" transparency="0" lineColor="6737151" lineWidth="1">
+          <children xsi:type="notation:BasicDecorationNode" xmi:id="_sf1gUHINEeK_6a0R9wQhsg" type="DiagramName">
+            <element xsi:nil="true"/>
+          </children>
+          <children xsi:type="notation:BasicDecorationNode" xmi:id="_sf1gUXINEeK_6a0R9wQhsg" type="Description">
+            <element xsi:nil="true"/>
+          </children>
+          <styles xsi:type="notation:TextStyle" xmi:id="_sf05QXINEeK_6a0R9wQhsg"/>
+          <styles xsi:type="notation:LineTypeStyle" xmi:id="_sf05QnINEeK_6a0R9wQhsg"/>
+          <element xsi:nil="true"/>
+          <layoutConstraint xsi:type="notation:Bounds" xmi:id="_sf05Q3INEeK_6a0R9wQhsg" x="166" y="415" height="31"/>
+        </children>
         <layoutConstraint xsi:type="notation:Bounds" xmi:id="_AU4LxMdiEeGOoP2Ze98WBQ"/>
       </children>
       <styles xsi:type="notation:ShapeStyle" xmi:id="_AU3ktMdiEeGOoP2Ze98WBQ" fontName="Verdana" fillColor="15790320" lineColor="12632256"/>
-      <layoutConstraint xsi:type="notation:Bounds" xmi:id="_AU4LxcdiEeGOoP2Ze98WBQ" x="220" y="10" width="581" height="443"/>
+      <layoutConstraint xsi:type="notation:Bounds" xmi:id="_AU4LxcdiEeGOoP2Ze98WBQ" x="220" y="10" width="581" height="619"/>
     </children>
     <children xsi:type="notation:Shape" xmi:id="_AU6oBMdiEeGOoP2Ze98WBQ" type="StatechartText" fontName="Verdana" lineColor="4210752">
       <children xsi:type="notation:DecorationNode" xmi:id="_AU6oBsdiEeGOoP2Ze98WBQ" type="StatechartName">
@@ -157,7 +187,7 @@
       <children xsi:type="notation:Shape" xmi:id="_AU7PEMdiEeGOoP2Ze98WBQ" type="StatechartTextExpression" fontName="Verdana" lineColor="4210752">
         <layoutConstraint xsi:type="notation:Bounds" xmi:id="_AU7PEcdiEeGOoP2Ze98WBQ"/>
       </children>
-      <layoutConstraint xsi:type="notation:Bounds" xmi:id="_AU7PEsdiEeGOoP2Ze98WBQ" x="10" y="10" width="200" height="443"/>
+      <layoutConstraint xsi:type="notation:Bounds" xmi:id="_AU7PEsdiEeGOoP2Ze98WBQ" x="10" y="10" width="200" height="619"/>
     </children>
     <styles xsi:type="notation:DiagramStyle" xmi:id="_AU3kscdiEeGOoP2Ze98WBQ"/>
     <edges xmi:id="_AU6A9MdiEeGOoP2Ze98WBQ" type="Transition" element="_AU6A88diEeGOoP2Ze98WBQ" source="_AU4Lx8diEeGOoP2Ze98WBQ" target="_AU5Z4cdiEeGOoP2Ze98WBQ">
@@ -207,5 +237,14 @@
       <styles xsi:type="notation:FontStyle" xmi:id="_LuR7AOqjEeG_KKo5r9OX-w" fontName="Verdana"/>
       <bendpoints xsi:type="notation:RelativeBendpoints" xmi:id="_LuRT8uqjEeG_KKo5r9OX-w" points="[0, 24, -307, -109]$[0, 133, -307, 0]$[278, 133, -29, 0]"/>
     </edges>
+    <edges xmi:id="_pM-BYHINEeK_6a0R9wQhsg" type="Transition" element="_pM7lIHINEeK_6a0R9wQhsg" source="_bKusgMdlEeGOoP2Ze98WBQ" target="_jvPNYHINEeK_6a0R9wQhsg">
+      <children xsi:type="notation:DecorationNode" xmi:id="_pM-ocHINEeK_6a0R9wQhsg" type="TransitionExpression">
+        <styles xsi:type="notation:ShapeStyle" xmi:id="_pM-ocXINEeK_6a0R9wQhsg"/>
+        <layoutConstraint xsi:type="notation:Location" xmi:id="_pM-ocnINEeK_6a0R9wQhsg" y="10"/>
+      </children>
+      <styles xsi:type="notation:ConnectorStyle" xmi:id="_pM-BYXINEeK_6a0R9wQhsg" lineColor="4210752"/>
+      <styles xsi:type="notation:FontStyle" xmi:id="_pM-BY3INEeK_6a0R9wQhsg" fontName="Verdana"/>
+      <bendpoints xsi:type="notation:RelativeBendpoints" xmi:id="_pM-BYnINEeK_6a0R9wQhsg" points="[0, 27, -229, -216]$[0, 235, -229, -8]$[212, 235, -17, -8]"/>
+    </edges>
   </notation:Diagram>
 </xmi:XMI>

+ 41 - 1
test-plugins/org.yakindu.sct.test.models/testmodels/refactoring/fold_out_action/after.sct

@@ -20,7 +20,10 @@
           </vertices>
         </regions>
       </vertices>
-      <vertices xsi:type="sgraph:State" xmi:id="_4Tz_4PN1EeGld5XQj3v7aA" name="D" incomingTransitions="_54p2wPN1EeGld5XQj3v7aA"/>
+      <vertices xsi:type="sgraph:State" xmi:id="_4Tz_4PN1EeGld5XQj3v7aA" name="D" incomingTransitions="_54p2wPN1EeGld5XQj3v7aA">
+        <outgoingTransitions xmi:id="_a6Ep4HIVEeKt7LlJCM3PJg" specification="" target="_aLRqPHIVEeKt7LlJCM3PJg"/>
+      </vertices>
+      <vertices xsi:type="sgraph:State" xmi:id="_aLRqPHIVEeKt7LlJCM3PJg" name="E" incomingTransitions="_a6Ep4HIVEeKt7LlJCM3PJg"/>
     </regions>
   </sgraph:Statechart>
   <notation:Diagram xmi:id="_AU3ksMdiEeGOoP2Ze98WBQ" type="org.yakindu.sct.ui.editor.editor.StatechartDiagramEditor" element="_AU29oMdiEeGOoP2Ze98WBQ" measurementUnit="Pixel">
@@ -158,6 +161,34 @@
           <element xsi:nil="true"/>
           <layoutConstraint xsi:type="notation:Bounds" xmi:id="_Sep8I_N2EeGld5XQj3v7aA" x="217" y="343" width="105" height="41"/>
         </children>
+        <children xmi:id="_aLRqMHIVEeKt7LlJCM3PJg" type="State" element="_aLRqPHIVEeKt7LlJCM3PJg">
+          <children xsi:type="notation:DecorationNode" xmi:id="_aLRqMXIVEeKt7LlJCM3PJg" type="StateName">
+            <styles xsi:type="notation:ShapeStyle" xmi:id="_aLRqMnIVEeKt7LlJCM3PJg"/>
+            <layoutConstraint xsi:type="notation:Location" xmi:id="_aLRqM3IVEeKt7LlJCM3PJg"/>
+          </children>
+          <children xsi:type="notation:Compartment" xmi:id="_aLRqNHIVEeKt7LlJCM3PJg" type="StateTextCompartment">
+            <children xsi:type="notation:Shape" xmi:id="_aLRqNXIVEeKt7LlJCM3PJg" type="StateTextCompartmentExpression" fontName="Verdana" lineColor="4210752">
+              <layoutConstraint xsi:type="notation:Bounds" xmi:id="_aLRqNnIVEeKt7LlJCM3PJg"/>
+            </children>
+          </children>
+          <children xsi:type="notation:Compartment" xmi:id="_aLRqN3IVEeKt7LlJCM3PJg" type="StateFigureCompartment"/>
+          <styles xsi:type="notation:ShapeStyle" xmi:id="_aLRqOHIVEeKt7LlJCM3PJg" fontName="Verdana" fillColor="15981773" lineColor="12632256"/>
+          <styles xsi:type="notation:FontStyle" xmi:id="_aLRqOXIVEeKt7LlJCM3PJg"/>
+          <styles xsi:type="notation:BooleanValueStyle" xmi:id="_aLRqOnIVEeKt7LlJCM3PJg" name="isHorizontal" booleanValue="true"/>
+          <layoutConstraint xsi:type="notation:Bounds" xmi:id="_aLRqO3IVEeKt7LlJCM3PJg" x="441" y="391"/>
+        </children>
+        <children xsi:type="notation:Shape" xmi:id="_bVTNUHIVEeKt7LlJCM3PJg" type="Note" fontName="Verdana" description="refactroing disabled" fillColor="13369343" transparency="0" lineColor="6737151" lineWidth="1">
+          <children xsi:type="notation:BasicDecorationNode" xmi:id="_bVT0YHIVEeKt7LlJCM3PJg" type="DiagramName">
+            <element xsi:nil="true"/>
+          </children>
+          <children xsi:type="notation:BasicDecorationNode" xmi:id="_bVT0YXIVEeKt7LlJCM3PJg" type="Description">
+            <element xsi:nil="true"/>
+          </children>
+          <styles xsi:type="notation:TextStyle" xmi:id="_bVTNUXIVEeKt7LlJCM3PJg"/>
+          <styles xsi:type="notation:LineTypeStyle" xmi:id="_bVTNUnIVEeKt7LlJCM3PJg"/>
+          <element xsi:nil="true"/>
+          <layoutConstraint xsi:type="notation:Bounds" xmi:id="_bVTNU3IVEeKt7LlJCM3PJg" x="404" y="349" height="29"/>
+        </children>
         <layoutConstraint xsi:type="notation:Bounds" xmi:id="_AU4LxMdiEeGOoP2Ze98WBQ"/>
       </children>
       <styles xsi:type="notation:ShapeStyle" xmi:id="_AU3ktMdiEeGOoP2Ze98WBQ" fontName="Verdana" fillColor="15790320" lineColor="12632256"/>
@@ -222,5 +253,14 @@
       <bendpoints xsi:type="notation:RelativeBendpoints" xmi:id="_NVCW8vN2EeGld5XQj3v7aA" points="[7, 0, -33, 4]$[42, -17, 2, -13]"/>
       <targetAnchor xsi:type="notation:IdentityAnchor" xmi:id="_NVHPcPN2EeGld5XQj3v7aA" id="(0.203125,0.2830188679245283)"/>
     </edges>
+    <edges xmi:id="_a6F4AHIVEeKt7LlJCM3PJg" type="Transition" element="_a6Ep4HIVEeKt7LlJCM3PJg" source="_4T9w4PN1EeGld5XQj3v7aA" target="_aLRqMHIVEeKt7LlJCM3PJg">
+      <children xsi:type="notation:DecorationNode" xmi:id="_a6GfEHIVEeKt7LlJCM3PJg" type="TransitionExpression">
+        <styles xsi:type="notation:ShapeStyle" xmi:id="_a6GfEXIVEeKt7LlJCM3PJg"/>
+        <layoutConstraint xsi:type="notation:Location" xmi:id="_a6GfEnIVEeKt7LlJCM3PJg" y="10"/>
+      </children>
+      <styles xsi:type="notation:ConnectorStyle" xmi:id="_a6F4AXIVEeKt7LlJCM3PJg" lineColor="4210752"/>
+      <styles xsi:type="notation:FontStyle" xmi:id="_a6F4A3IVEeKt7LlJCM3PJg" fontName="Verdana"/>
+      <bendpoints xsi:type="notation:RelativeBendpoints" xmi:id="_a6F4AnIVEeKt7LlJCM3PJg" points="[18, 6, -102, -9]$[115, -11, -5, -26]"/>
+    </edges>
   </notation:Diagram>
 </xmi:XMI>

+ 41 - 1
test-plugins/org.yakindu.sct.test.models/testmodels/refactoring/fold_out_action/before.sct

@@ -20,7 +20,10 @@
           </vertices>
         </regions>
       </vertices>
-      <vertices xsi:type="sgraph:State" xmi:id="_4Tz_4PN1EeGld5XQj3v7aA" name="D" incomingTransitions="_54p2wPN1EeGld5XQj3v7aA"/>
+      <vertices xsi:type="sgraph:State" xmi:id="_4Tz_4PN1EeGld5XQj3v7aA" name="D" incomingTransitions="_54p2wPN1EeGld5XQj3v7aA">
+        <outgoingTransitions xmi:id="_BvOkUHIQEeKt7LlJCM3PJg" specification="" target="_AmFK8HIQEeKt7LlJCM3PJg"/>
+      </vertices>
+      <vertices xsi:type="sgraph:State" xmi:id="_AmFK8HIQEeKt7LlJCM3PJg" name="E" incomingTransitions="_BvOkUHIQEeKt7LlJCM3PJg"/>
     </regions>
   </sgraph:Statechart>
   <notation:Diagram xmi:id="_AU3ksMdiEeGOoP2Ze98WBQ" type="org.yakindu.sct.ui.editor.editor.StatechartDiagramEditor" element="_AU29oMdiEeGOoP2Ze98WBQ" measurementUnit="Pixel">
@@ -158,6 +161,34 @@
           <element xsi:nil="true"/>
           <layoutConstraint xsi:type="notation:Bounds" xmi:id="_Sep8I_N2EeGld5XQj3v7aA" x="217" y="343" width="105" height="41"/>
         </children>
+        <children xmi:id="_AmpLoHIQEeKt7LlJCM3PJg" type="State" element="_AmFK8HIQEeKt7LlJCM3PJg">
+          <children xsi:type="notation:DecorationNode" xmi:id="_AmrA0HIQEeKt7LlJCM3PJg" type="StateName">
+            <styles xsi:type="notation:ShapeStyle" xmi:id="_AmrA0XIQEeKt7LlJCM3PJg"/>
+            <layoutConstraint xsi:type="notation:Location" xmi:id="_AmrA0nIQEeKt7LlJCM3PJg"/>
+          </children>
+          <children xsi:type="notation:Compartment" xmi:id="_AmrA03IQEeKt7LlJCM3PJg" type="StateTextCompartment">
+            <children xsi:type="notation:Shape" xmi:id="_Amrn4HIQEeKt7LlJCM3PJg" type="StateTextCompartmentExpression" fontName="Verdana" lineColor="4210752">
+              <layoutConstraint xsi:type="notation:Bounds" xmi:id="_Amrn4XIQEeKt7LlJCM3PJg"/>
+            </children>
+          </children>
+          <children xsi:type="notation:Compartment" xmi:id="_Amrn4nIQEeKt7LlJCM3PJg" type="StateFigureCompartment"/>
+          <styles xsi:type="notation:ShapeStyle" xmi:id="_AmpLoXIQEeKt7LlJCM3PJg" fontName="Verdana" fillColor="15981773" lineColor="12632256"/>
+          <styles xsi:type="notation:FontStyle" xmi:id="_AmpLonIQEeKt7LlJCM3PJg"/>
+          <styles xsi:type="notation:BooleanValueStyle" xmi:id="_Amrn43IQEeKt7LlJCM3PJg" name="isHorizontal" booleanValue="true"/>
+          <layoutConstraint xsi:type="notation:Bounds" xmi:id="_AmpLo3IQEeKt7LlJCM3PJg" x="431" y="396"/>
+        </children>
+        <children xsi:type="notation:Shape" xmi:id="_CrkQwHIQEeKt7LlJCM3PJg" type="Note" fontName="Verdana" description="Refactoring disabled" fillColor="13369343" transparency="0" lineColor="6737151" lineWidth="1">
+          <children xsi:type="notation:BasicDecorationNode" xmi:id="_Crk30HIQEeKt7LlJCM3PJg" type="DiagramName">
+            <element xsi:nil="true"/>
+          </children>
+          <children xsi:type="notation:BasicDecorationNode" xmi:id="_Crk30XIQEeKt7LlJCM3PJg" type="Description">
+            <element xsi:nil="true"/>
+          </children>
+          <styles xsi:type="notation:TextStyle" xmi:id="_CrkQwXIQEeKt7LlJCM3PJg"/>
+          <styles xsi:type="notation:LineTypeStyle" xmi:id="_CrkQwnIQEeKt7LlJCM3PJg"/>
+          <element xsi:nil="true"/>
+          <layoutConstraint xsi:type="notation:Bounds" xmi:id="_CrkQw3IQEeKt7LlJCM3PJg" x="355" y="356" height="28"/>
+        </children>
         <layoutConstraint xsi:type="notation:Bounds" xmi:id="_AU4LxMdiEeGOoP2Ze98WBQ"/>
       </children>
       <styles xsi:type="notation:ShapeStyle" xmi:id="_AU3ktMdiEeGOoP2Ze98WBQ" fontName="Verdana" fillColor="15790320" lineColor="12632256"/>
@@ -222,5 +253,14 @@
       <bendpoints xsi:type="notation:RelativeBendpoints" xmi:id="_NVCW8vN2EeGld5XQj3v7aA" points="[7, 0, -33, 4]$[42, -17, 2, -13]"/>
       <targetAnchor xsi:type="notation:IdentityAnchor" xmi:id="_NVHPcPN2EeGld5XQj3v7aA" id="(0.203125,0.2830188679245283)"/>
     </edges>
+    <edges xmi:id="_BvRAkHIQEeKt7LlJCM3PJg" type="Transition" element="_BvOkUHIQEeKt7LlJCM3PJg" source="_4T9w4PN1EeGld5XQj3v7aA" target="_AmpLoHIQEeKt7LlJCM3PJg">
+      <children xsi:type="notation:DecorationNode" xmi:id="_BvRnoHIQEeKt7LlJCM3PJg" type="TransitionExpression">
+        <styles xsi:type="notation:ShapeStyle" xmi:id="_BvRnoXIQEeKt7LlJCM3PJg"/>
+        <layoutConstraint xsi:type="notation:Location" xmi:id="_BvRnonIQEeKt7LlJCM3PJg" y="10"/>
+      </children>
+      <styles xsi:type="notation:ConnectorStyle" xmi:id="_BvRAkXIQEeKt7LlJCM3PJg" lineColor="4210752"/>
+      <styles xsi:type="notation:FontStyle" xmi:id="_BvRAk3IQEeKt7LlJCM3PJg" fontName="Verdana"/>
+      <bendpoints xsi:type="notation:RelativeBendpoints" xmi:id="_BvRAknIQEeKt7LlJCM3PJg" points="[18, -1, -92, -6]$[113, -21, 3, -26]"/>
+    </edges>
   </notation:Diagram>
 </xmi:XMI>

+ 17 - 0
test-plugins/org.yakindu.sct.test.models/testmodels/refactoring/unfold_entry_action/after.sct

@@ -19,6 +19,7 @@
           <vertices xsi:type="sgraph:State" xmi:id="_JRcsMOqjEeG_KKo5r9OX-w" specification="entry /&#xA;  x+=1" name="InnerState" incomingTransitions="_LuJ_MOqjEeG_KKo5r9OX-w"/>
         </regions>
       </vertices>
+      <vertices xsi:type="sgraph:State" xmi:id="_NRRR4HIVEeKt7LlJCM3PJg" specification="entry / x=3" name="F"/>
     </regions>
   </sgraph:Statechart>
   <notation:Diagram xmi:id="_AU3ksMdiEeGOoP2Ze98WBQ" type="org.yakindu.sct.ui.editor.editor.StatechartDiagramEditor" element="_AU29oMdiEeGOoP2Ze98WBQ" measurementUnit="Pixel">
@@ -132,6 +133,22 @@
           <styles xsi:type="notation:BooleanValueStyle" xmi:id="_EQ1SAOqjEeG_KKo5r9OX-w"/>
           <layoutConstraint xsi:type="notation:Bounds" xmi:id="_EQpEw-qjEeG_KKo5r9OX-w" x="289" y="247" width="190" height="178"/>
         </children>
+        <children xmi:id="_NRQq0HIVEeKt7LlJCM3PJg" type="State" element="_NRRR4HIVEeKt7LlJCM3PJg">
+          <children xsi:type="notation:DecorationNode" xmi:id="_NRQq0XIVEeKt7LlJCM3PJg" type="StateName">
+            <styles xsi:type="notation:ShapeStyle" xmi:id="_NRQq0nIVEeKt7LlJCM3PJg"/>
+            <layoutConstraint xsi:type="notation:Location" xmi:id="_NRQq03IVEeKt7LlJCM3PJg"/>
+          </children>
+          <children xsi:type="notation:Compartment" xmi:id="_NRQq1HIVEeKt7LlJCM3PJg" type="StateTextCompartment">
+            <children xsi:type="notation:Shape" xmi:id="_NRQq1XIVEeKt7LlJCM3PJg" type="StateTextCompartmentExpression" fontName="Verdana" lineColor="4210752">
+              <layoutConstraint xsi:type="notation:Bounds" xmi:id="_NRQq1nIVEeKt7LlJCM3PJg"/>
+            </children>
+          </children>
+          <children xsi:type="notation:Compartment" xmi:id="_NRQq13IVEeKt7LlJCM3PJg" type="StateFigureCompartment"/>
+          <styles xsi:type="notation:ShapeStyle" xmi:id="_NRQq2HIVEeKt7LlJCM3PJg" fontName="Verdana" fillColor="15981773" lineColor="12632256"/>
+          <styles xsi:type="notation:FontStyle" xmi:id="_NRQq2XIVEeKt7LlJCM3PJg"/>
+          <styles xsi:type="notation:BooleanValueStyle" xmi:id="_NRQq2nIVEeKt7LlJCM3PJg" name="isHorizontal" booleanValue="true"/>
+          <layoutConstraint xsi:type="notation:Bounds" xmi:id="_NRQq23IVEeKt7LlJCM3PJg" x="415" y="108"/>
+        </children>
         <layoutConstraint xsi:type="notation:Bounds" xmi:id="_AU4LxMdiEeGOoP2Ze98WBQ"/>
       </children>
       <styles xsi:type="notation:ShapeStyle" xmi:id="_AU3ktMdiEeGOoP2Ze98WBQ" fontName="Verdana" fillColor="15790320" lineColor="12632256"/>

+ 30 - 1
test-plugins/org.yakindu.sct.test.models/testmodels/refactoring/unfold_entry_action/before.sct

@@ -19,6 +19,7 @@
           <vertices xsi:type="sgraph:State" xmi:id="_JRcsMOqjEeG_KKo5r9OX-w" specification="entry /&#xA;  x+=1" name="InnerState" incomingTransitions="_LuJ_MOqjEeG_KKo5r9OX-w"/>
         </regions>
       </vertices>
+      <vertices xsi:type="sgraph:State" xmi:id="_wgLhkHITEeKt7LlJCM3PJg" specification="entry / x=3" name="F"/>
     </regions>
   </sgraph:Statechart>
   <notation:Diagram xmi:id="_AU3ksMdiEeGOoP2Ze98WBQ" type="org.yakindu.sct.ui.editor.editor.StatechartDiagramEditor" element="_AU29oMdiEeGOoP2Ze98WBQ" measurementUnit="Pixel">
@@ -70,7 +71,7 @@
           <styles xsi:type="notation:ShapeStyle" xmi:id="_BFBPQcdiEeGOoP2Ze98WBQ" fontName="Verdana" fillColor="15981773" lineColor="12632256"/>
           <styles xsi:type="notation:FontStyle" xmi:id="_BFBPQsdiEeGOoP2Ze98WBQ"/>
           <styles xsi:type="notation:BooleanValueStyle" xmi:id="_BFCdY8diEeGOoP2Ze98WBQ"/>
-          <layoutConstraint xsi:type="notation:Bounds" xmi:id="_BFBPQ8diEeGOoP2Ze98WBQ" x="241" y="79" width="93" height="98"/>
+          <layoutConstraint xsi:type="notation:Bounds" xmi:id="_BFBPQ8diEeGOoP2Ze98WBQ" x="241" y="47" width="114" height="162"/>
         </children>
         <children xmi:id="_bKusgMdlEeGOoP2Ze98WBQ" type="State" element="_bKn-0MdlEeGOoP2Ze98WBQ">
           <children xsi:type="notation:DecorationNode" xmi:id="_bKvTkMdlEeGOoP2Ze98WBQ" type="StateName">
@@ -144,6 +145,34 @@
           <element xsi:nil="true"/>
           <layoutConstraint xsi:type="notation:Bounds" xmi:id="_I5HOQxkSEeKY0Z-c58HwiQ" x="157" y="307" width="121" height="37"/>
         </children>
+        <children xmi:id="_wgMvsHITEeKt7LlJCM3PJg" type="State" element="_wgLhkHITEeKt7LlJCM3PJg">
+          <children xsi:type="notation:DecorationNode" xmi:id="_wgNWwHITEeKt7LlJCM3PJg" type="StateName">
+            <styles xsi:type="notation:ShapeStyle" xmi:id="_wgNWwXITEeKt7LlJCM3PJg"/>
+            <layoutConstraint xsi:type="notation:Location" xmi:id="_wgNWwnITEeKt7LlJCM3PJg"/>
+          </children>
+          <children xsi:type="notation:Compartment" xmi:id="_wgN90HITEeKt7LlJCM3PJg" type="StateTextCompartment">
+            <children xsi:type="notation:Shape" xmi:id="_wgN90XITEeKt7LlJCM3PJg" type="StateTextCompartmentExpression" fontName="Verdana" lineColor="4210752">
+              <layoutConstraint xsi:type="notation:Bounds" xmi:id="_wgN90nITEeKt7LlJCM3PJg"/>
+            </children>
+          </children>
+          <children xsi:type="notation:Compartment" xmi:id="_wgN903ITEeKt7LlJCM3PJg" type="StateFigureCompartment"/>
+          <styles xsi:type="notation:ShapeStyle" xmi:id="_wgMvsXITEeKt7LlJCM3PJg" fontName="Verdana" fillColor="15981773" lineColor="12632256"/>
+          <styles xsi:type="notation:FontStyle" xmi:id="_wgMvsnITEeKt7LlJCM3PJg"/>
+          <styles xsi:type="notation:BooleanValueStyle" xmi:id="_wgN91HITEeKt7LlJCM3PJg" name="isHorizontal" booleanValue="true"/>
+          <layoutConstraint xsi:type="notation:Bounds" xmi:id="_wgMvs3ITEeKt7LlJCM3PJg" x="405" y="98"/>
+        </children>
+        <children xsi:type="notation:Shape" xmi:id="_2Y8rwHITEeKt7LlJCM3PJg" type="Note" fontName="Verdana" description="Refactoring disabled" fillColor="13369343" transparency="0" lineColor="6737151" lineWidth="1">
+          <children xsi:type="notation:BasicDecorationNode" xmi:id="_2Y9S0HITEeKt7LlJCM3PJg" type="DiagramName">
+            <element xsi:nil="true"/>
+          </children>
+          <children xsi:type="notation:BasicDecorationNode" xmi:id="_2Y9S0XITEeKt7LlJCM3PJg" type="Description">
+            <element xsi:nil="true"/>
+          </children>
+          <styles xsi:type="notation:TextStyle" xmi:id="_2Y8rwXITEeKt7LlJCM3PJg"/>
+          <styles xsi:type="notation:LineTypeStyle" xmi:id="_2Y8rwnITEeKt7LlJCM3PJg"/>
+          <element xsi:nil="true"/>
+          <layoutConstraint xsi:type="notation:Bounds" xmi:id="_2Y8rw3ITEeKt7LlJCM3PJg" x="405" y="55" height="28"/>
+        </children>
         <layoutConstraint xsi:type="notation:Bounds" xmi:id="_AU4LxMdiEeGOoP2Ze98WBQ"/>
       </children>
       <styles xsi:type="notation:ShapeStyle" xmi:id="_AU3ktMdiEeGOoP2Ze98WBQ" fontName="Verdana" fillColor="15790320" lineColor="12632256"/>

+ 32 - 2
test-plugins/org.yakindu.sct.test.models/testmodels/refactoring/unfold_exit_action/after.sct

@@ -20,7 +20,10 @@
           </vertices>
         </regions>
       </vertices>
-      <vertices xsi:type="sgraph:State" xmi:id="_4Tz_4PN1EeGld5XQj3v7aA" name="D" incomingTransitions="_54p2wPN1EeGld5XQj3v7aA"/>
+      <vertices xsi:type="sgraph:State" xmi:id="_4Tz_4PN1EeGld5XQj3v7aA" name="D" incomingTransitions="_54p2wPN1EeGld5XQj3v7aA">
+        <outgoingTransitions xmi:id="_QihAMHIVEeKt7LlJCM3PJg" specification="" target="_PsWNPHIVEeKt7LlJCM3PJg"/>
+      </vertices>
+      <vertices xsi:type="sgraph:State" xmi:id="_PsWNPHIVEeKt7LlJCM3PJg" specification="exit / x = 8" name="E" incomingTransitions="_QihAMHIVEeKt7LlJCM3PJg"/>
     </regions>
   </sgraph:Statechart>
   <notation:Diagram xmi:id="_AU3ksMdiEeGOoP2Ze98WBQ" type="org.yakindu.sct.ui.editor.editor.StatechartDiagramEditor" element="_AU29oMdiEeGOoP2Ze98WBQ" measurementUnit="Pixel">
@@ -146,7 +149,7 @@
           <styles xsi:type="notation:BooleanValueStyle" xmi:id="_4T-_AfN1EeGld5XQj3v7aA"/>
           <layoutConstraint xsi:type="notation:Bounds" xmi:id="_4T9w4_N1EeGld5XQj3v7aA" x="321" y="391"/>
         </children>
-        <children xsi:type="notation:Shape" xmi:id="_Sep8IPN2EeGld5XQj3v7aA" type="Note" fontName="Verdana" description="Folding not allowed" fillColor="13369343" transparency="0" lineColor="6737151" lineWidth="1">
+        <children xsi:type="notation:Shape" xmi:id="_Sep8IPN2EeGld5XQj3v7aA" type="Note" fontName="Verdana" description="Unfolding not allowed" fillColor="13369343" transparency="0" lineColor="6737151" lineWidth="1">
           <children xsi:type="notation:BasicDecorationNode" xmi:id="_SerKQPN2EeGld5XQj3v7aA" type="DiagramName">
             <element xsi:nil="true"/>
           </children>
@@ -158,6 +161,22 @@
           <element xsi:nil="true"/>
           <layoutConstraint xsi:type="notation:Bounds" xmi:id="_Sep8I_N2EeGld5XQj3v7aA" x="217" y="343" width="105" height="41"/>
         </children>
+        <children xmi:id="_PsWNMHIVEeKt7LlJCM3PJg" type="State" element="_PsWNPHIVEeKt7LlJCM3PJg">
+          <children xsi:type="notation:DecorationNode" xmi:id="_PsWNMXIVEeKt7LlJCM3PJg" type="StateName">
+            <styles xsi:type="notation:ShapeStyle" xmi:id="_PsWNMnIVEeKt7LlJCM3PJg"/>
+            <layoutConstraint xsi:type="notation:Location" xmi:id="_PsWNM3IVEeKt7LlJCM3PJg"/>
+          </children>
+          <children xsi:type="notation:Compartment" xmi:id="_PsWNNHIVEeKt7LlJCM3PJg" type="StateTextCompartment">
+            <children xsi:type="notation:Shape" xmi:id="_PsWNNXIVEeKt7LlJCM3PJg" type="StateTextCompartmentExpression" fontName="Verdana" lineColor="4210752">
+              <layoutConstraint xsi:type="notation:Bounds" xmi:id="_PsWNNnIVEeKt7LlJCM3PJg"/>
+            </children>
+          </children>
+          <children xsi:type="notation:Compartment" xmi:id="_PsWNN3IVEeKt7LlJCM3PJg" type="StateFigureCompartment"/>
+          <styles xsi:type="notation:ShapeStyle" xmi:id="_PsWNOHIVEeKt7LlJCM3PJg" fontName="Verdana" fillColor="15981773" lineColor="12632256"/>
+          <styles xsi:type="notation:FontStyle" xmi:id="_PsWNOXIVEeKt7LlJCM3PJg"/>
+          <styles xsi:type="notation:BooleanValueStyle" xmi:id="_PsWNOnIVEeKt7LlJCM3PJg" name="isHorizontal" booleanValue="true"/>
+          <layoutConstraint xsi:type="notation:Bounds" xmi:id="_PsWNO3IVEeKt7LlJCM3PJg" x="432" y="390"/>
+        </children>
         <layoutConstraint xsi:type="notation:Bounds" xmi:id="_AU4LxMdiEeGOoP2Ze98WBQ"/>
       </children>
       <styles xsi:type="notation:ShapeStyle" xmi:id="_AU3ktMdiEeGOoP2Ze98WBQ" fontName="Verdana" fillColor="15790320" lineColor="12632256"/>
@@ -222,5 +241,16 @@
       <bendpoints xsi:type="notation:RelativeBendpoints" xmi:id="_NVCW8vN2EeGld5XQj3v7aA" points="[7, 0, -33, 4]$[42, -17, 2, -13]"/>
       <targetAnchor xsi:type="notation:IdentityAnchor" xmi:id="_NVHPcPN2EeGld5XQj3v7aA" id="(0.203125,0.2830188679245283)"/>
     </edges>
+    <edges xmi:id="_QiiOUHIVEeKt7LlJCM3PJg" type="Transition" element="_QihAMHIVEeKt7LlJCM3PJg" source="_4T9w4PN1EeGld5XQj3v7aA" target="_PsWNMHIVEeKt7LlJCM3PJg">
+      <children xsi:type="notation:DecorationNode" xmi:id="_QiiOVHIVEeKt7LlJCM3PJg" type="TransitionExpression">
+        <styles xsi:type="notation:ShapeStyle" xmi:id="_QiiOVXIVEeKt7LlJCM3PJg"/>
+        <layoutConstraint xsi:type="notation:Location" xmi:id="_QiiOVnIVEeKt7LlJCM3PJg" y="10"/>
+      </children>
+      <styles xsi:type="notation:ConnectorStyle" xmi:id="_QiiOUXIVEeKt7LlJCM3PJg" lineColor="4210752"/>
+      <styles xsi:type="notation:FontStyle" xmi:id="_QiiOU3IVEeKt7LlJCM3PJg" fontName="Verdana"/>
+      <bendpoints xsi:type="notation:RelativeBendpoints" xmi:id="_QiiOUnIVEeKt7LlJCM3PJg" points="[21, -3, -91, 16]$[114, 1, 2, 20]"/>
+      <sourceAnchor xsi:type="notation:IdentityAnchor" xmi:id="_QikqkHIVEeKt7LlJCM3PJg" id="(0.825,0.5)"/>
+      <targetAnchor xsi:type="notation:IdentityAnchor" xmi:id="_QikqkXIVEeKt7LlJCM3PJg" id="(0.2236842105263158,0.65)"/>
+    </edges>
   </notation:Diagram>
 </xmi:XMI>

+ 30 - 1
test-plugins/org.yakindu.sct.test.models/testmodels/refactoring/unfold_exit_action/before.sct

@@ -20,7 +20,10 @@
           </vertices>
         </regions>
       </vertices>
-      <vertices xsi:type="sgraph:State" xmi:id="_4Tz_4PN1EeGld5XQj3v7aA" name="D" incomingTransitions="_54p2wPN1EeGld5XQj3v7aA"/>
+      <vertices xsi:type="sgraph:State" xmi:id="_4Tz_4PN1EeGld5XQj3v7aA" name="D" incomingTransitions="_54p2wPN1EeGld5XQj3v7aA">
+        <outgoingTransitions xmi:id="_fg81wHISEeKt7LlJCM3PJg" specification="" target="_dBUxoHISEeKt7LlJCM3PJg"/>
+      </vertices>
+      <vertices xsi:type="sgraph:State" xmi:id="_dBUxoHISEeKt7LlJCM3PJg" specification="exit / x = 8" name="E" incomingTransitions="_fg81wHISEeKt7LlJCM3PJg"/>
     </regions>
   </sgraph:Statechart>
   <notation:Diagram xmi:id="_AU3ksMdiEeGOoP2Ze98WBQ" type="org.yakindu.sct.ui.editor.editor.StatechartDiagramEditor" element="_AU29oMdiEeGOoP2Ze98WBQ" measurementUnit="Pixel">
@@ -158,6 +161,22 @@
           <element xsi:nil="true"/>
           <layoutConstraint xsi:type="notation:Bounds" xmi:id="_Sep8I_N2EeGld5XQj3v7aA" x="257" y="311" width="105" height="41"/>
         </children>
+        <children xmi:id="_dBXN4HISEeKt7LlJCM3PJg" type="State" element="_dBUxoHISEeKt7LlJCM3PJg">
+          <children xsi:type="notation:DecorationNode" xmi:id="_dBX08HISEeKt7LlJCM3PJg" type="StateName">
+            <styles xsi:type="notation:ShapeStyle" xmi:id="_dBX08XISEeKt7LlJCM3PJg"/>
+            <layoutConstraint xsi:type="notation:Location" xmi:id="_dBX08nISEeKt7LlJCM3PJg"/>
+          </children>
+          <children xsi:type="notation:Compartment" xmi:id="_dBX083ISEeKt7LlJCM3PJg" type="StateTextCompartment">
+            <children xsi:type="notation:Shape" xmi:id="_dBX09HISEeKt7LlJCM3PJg" type="StateTextCompartmentExpression" fontName="Verdana" lineColor="4210752">
+              <layoutConstraint xsi:type="notation:Bounds" xmi:id="_dBX09XISEeKt7LlJCM3PJg"/>
+            </children>
+          </children>
+          <children xsi:type="notation:Compartment" xmi:id="_dBYcAHISEeKt7LlJCM3PJg" type="StateFigureCompartment"/>
+          <styles xsi:type="notation:ShapeStyle" xmi:id="_dBXN4XISEeKt7LlJCM3PJg" fontName="Verdana" fillColor="15981773" lineColor="12632256"/>
+          <styles xsi:type="notation:FontStyle" xmi:id="_dBXN4nISEeKt7LlJCM3PJg"/>
+          <styles xsi:type="notation:BooleanValueStyle" xmi:id="_dBYcAXISEeKt7LlJCM3PJg" name="isHorizontal" booleanValue="true"/>
+          <layoutConstraint xsi:type="notation:Bounds" xmi:id="_dBXN43ISEeKt7LlJCM3PJg" x="445" y="363"/>
+        </children>
         <layoutConstraint xsi:type="notation:Bounds" xmi:id="_AU4LxMdiEeGOoP2Ze98WBQ"/>
       </children>
       <styles xsi:type="notation:ShapeStyle" xmi:id="_AU3ktMdiEeGOoP2Ze98WBQ" fontName="Verdana" fillColor="15790320" lineColor="12632256"/>
@@ -222,5 +241,15 @@
       <bendpoints xsi:type="notation:RelativeBendpoints" xmi:id="_NVCW8vN2EeGld5XQj3v7aA" points="[7, 0, -33, 4]$[42, -17, 2, -13]"/>
       <targetAnchor xsi:type="notation:IdentityAnchor" xmi:id="_NVHPcPN2EeGld5XQj3v7aA" id="(0.203125,0.2830188679245283)"/>
     </edges>
+    <edges xmi:id="_fg-q8HISEeKt7LlJCM3PJg" type="Transition" element="_fg81wHISEeKt7LlJCM3PJg" source="_4T9w4PN1EeGld5XQj3v7aA" target="_dBXN4HISEeKt7LlJCM3PJg">
+      <children xsi:type="notation:DecorationNode" xmi:id="_fg-q9HISEeKt7LlJCM3PJg" type="TransitionExpression">
+        <styles xsi:type="notation:ShapeStyle" xmi:id="_fg-q9XISEeKt7LlJCM3PJg"/>
+        <layoutConstraint xsi:type="notation:Location" xmi:id="_fg_SAHISEeKt7LlJCM3PJg" y="10"/>
+      </children>
+      <styles xsi:type="notation:ConnectorStyle" xmi:id="_fg-q8XISEeKt7LlJCM3PJg" lineColor="4210752"/>
+      <styles xsi:type="notation:FontStyle" xmi:id="_fg-q83ISEeKt7LlJCM3PJg" fontName="Verdana"/>
+      <bendpoints xsi:type="notation:RelativeBendpoints" xmi:id="_fg-q8nISEeKt7LlJCM3PJg" points="[18, 9, -82, 3]$[102, 31, 2, 25]"/>
+      <targetAnchor xsi:type="notation:IdentityAnchor" xmi:id="_fhBuQHISEeKt7LlJCM3PJg" id="(0.225,0.5344827586206896)"/>
+    </edges>
   </notation:Diagram>
 </xmi:XMI>