Browse Source

added TypeAlias model, Interpreter Test. Modified StextInterpreter to compute origins of Types for Aliases

bohl@itemis.de 10 years ago
parent
commit
c9d22dc972

+ 365 - 0
plugins/org.yakindu.sct.generator.genmodel.ui/plugin.xml_gen

@@ -0,0 +1,365 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.0"?>
+
+<plugin>
+
+    <extension
+            point="org.eclipse.ui.editors">
+        <editor
+            class="org.yakindu.sct.generator.genmodel.ui.SGenExecutableExtensionFactory:org.eclipse.xtext.ui.editor.XtextEditor"
+            contributorClass="org.eclipse.ui.editors.text.TextEditorActionContributor"
+            default="true"
+            extensions="sgen"
+            id="org.yakindu.sct.generator.genmodel.SGen"
+            name="SGen Editor">
+        </editor>
+    </extension>
+    <extension
+        point="org.eclipse.ui.handlers">
+        <handler
+            class="org.yakindu.sct.generator.genmodel.ui.SGenExecutableExtensionFactory:org.eclipse.xtext.ui.editor.hyperlinking.OpenDeclarationHandler"
+            commandId="org.eclipse.xtext.ui.editor.hyperlinking.OpenDeclaration">
+            <activeWhen>
+                <reference
+                    definitionId="org.yakindu.sct.generator.genmodel.SGen.Editor.opened">
+                </reference>
+            </activeWhen>
+        </handler>
+        <handler
+            class="org.yakindu.sct.generator.genmodel.ui.SGenExecutableExtensionFactory:org.eclipse.xtext.ui.editor.handler.ValidateActionHandler"
+            commandId="org.yakindu.sct.generator.genmodel.SGen.validate">
+         <activeWhen>
+            <reference
+                    definitionId="org.yakindu.sct.generator.genmodel.SGen.Editor.opened">
+            </reference>
+         </activeWhen>
+      	</handler>
+      	<!-- copy qualified name -->
+        <handler
+            class="org.yakindu.sct.generator.genmodel.ui.SGenExecutableExtensionFactory:org.eclipse.xtext.ui.editor.copyqualifiedname.EditorCopyQualifiedNameHandler"
+            commandId="org.eclipse.xtext.ui.editor.copyqualifiedname.EditorCopyQualifiedName">
+            <activeWhen>
+				<reference definitionId="org.yakindu.sct.generator.genmodel.SGen.Editor.opened" />
+            </activeWhen>
+        </handler>
+        <handler
+            class="org.yakindu.sct.generator.genmodel.ui.SGenExecutableExtensionFactory:org.eclipse.xtext.ui.editor.copyqualifiedname.OutlineCopyQualifiedNameHandler"
+            commandId="org.eclipse.xtext.ui.editor.copyqualifiedname.OutlineCopyQualifiedName">
+            <activeWhen>
+            	<and>
+            		<reference definitionId="org.yakindu.sct.generator.genmodel.SGen.XtextEditor.opened" />
+	                <iterate>
+						<adapt type="org.eclipse.xtext.ui.editor.outline.IOutlineNode" />
+					</iterate>
+				</and>
+            </activeWhen>
+        </handler>
+    </extension>
+    <extension point="org.eclipse.core.expressions.definitions">
+        <definition id="org.yakindu.sct.generator.genmodel.SGen.Editor.opened">
+            <and>
+                <reference definitionId="isActiveEditorAnInstanceOfXtextEditor"/>
+                <with variable="activeEditor">
+                    <test property="org.eclipse.xtext.ui.editor.XtextEditor.languageName" 
+                        value="org.yakindu.sct.generator.genmodel.SGen" 
+                        forcePluginActivation="true"/>
+                </with>        
+            </and>
+        </definition>
+        <definition id="org.yakindu.sct.generator.genmodel.SGen.XtextEditor.opened">
+            <and>
+                <reference definitionId="isXtextEditorActive"/>
+                <with variable="activeEditor">
+                    <test property="org.eclipse.xtext.ui.editor.XtextEditor.languageName" 
+                        value="org.yakindu.sct.generator.genmodel.SGen" 
+                        forcePluginActivation="true"/>
+                </with>        
+            </and>
+        </definition>
+    </extension>
+    <extension
+            point="org.eclipse.ui.preferencePages">
+        <page
+            class="org.yakindu.sct.generator.genmodel.ui.SGenExecutableExtensionFactory:org.eclipse.xtext.ui.editor.preferences.LanguageRootPreferencePage"
+            id="org.yakindu.sct.generator.genmodel.SGen"
+            name="SGen">
+            <keywordReference id="org.yakindu.sct.generator.genmodel.ui.keyword_SGen"/>
+        </page>
+        <page
+            category="org.yakindu.sct.generator.genmodel.SGen"
+            class="org.yakindu.sct.generator.genmodel.ui.SGenExecutableExtensionFactory:org.eclipse.xtext.ui.editor.syntaxcoloring.SyntaxColoringPreferencePage"
+            id="org.yakindu.sct.generator.genmodel.SGen.coloring"
+            name="Syntax Coloring">
+            <keywordReference id="org.yakindu.sct.generator.genmodel.ui.keyword_SGen"/>
+        </page>
+        <page
+            category="org.yakindu.sct.generator.genmodel.SGen"
+            class="org.yakindu.sct.generator.genmodel.ui.SGenExecutableExtensionFactory:org.eclipse.xtext.ui.editor.templates.XtextTemplatePreferencePage"
+            id="org.yakindu.sct.generator.genmodel.SGen.templates"
+            name="Templates">
+            <keywordReference id="org.yakindu.sct.generator.genmodel.ui.keyword_SGen"/>
+        </page>
+    </extension>
+    <extension
+            point="org.eclipse.ui.propertyPages">
+        <page
+            class="org.yakindu.sct.generator.genmodel.ui.SGenExecutableExtensionFactory:org.eclipse.xtext.ui.editor.preferences.LanguageRootPreferencePage"
+            id="org.yakindu.sct.generator.genmodel.SGen"
+            name="SGen">
+            <keywordReference id="org.yakindu.sct.generator.genmodel.ui.keyword_SGen"/>
+            <enabledWhen>
+	            <adapt type="org.eclipse.core.resources.IProject"/>
+			</enabledWhen>
+	        <filter name="projectNature" value="org.eclipse.xtext.ui.shared.xtextNature"/>
+        </page>
+    </extension>
+    <extension
+        point="org.eclipse.ui.keywords">
+        <keyword
+            id="org.yakindu.sct.generator.genmodel.ui.keyword_SGen"
+            label="SGen"/>
+    </extension>
+    <extension
+         point="org.eclipse.ui.commands">
+      <command
+            description="Trigger expensive validation"
+            id="org.yakindu.sct.generator.genmodel.SGen.validate"
+            name="Validate">
+      </command>
+      <!-- copy qualified name -->
+      <command
+            id="org.eclipse.xtext.ui.editor.copyqualifiedname.EditorCopyQualifiedName"
+            categoryId="org.eclipse.ui.category.edit"
+            description="Copy the qualified name for the selected element"
+            name="Copy Qualified Name">
+      </command>
+      <command
+            id="org.eclipse.xtext.ui.editor.copyqualifiedname.OutlineCopyQualifiedName"
+            categoryId="org.eclipse.ui.category.edit"
+            description="Copy the qualified name for the selected element"
+            name="Copy Qualified Name">
+      </command>
+    </extension>
+    <extension point="org.eclipse.ui.menus">
+        <menuContribution
+            locationURI="popup:#TextEditorContext?after=group.edit">
+             <command
+                 commandId="org.yakindu.sct.generator.genmodel.SGen.validate"
+                 style="push"
+                 tooltip="Trigger expensive validation">
+            <visibleWhen checkEnabled="false">
+                <reference
+                    definitionId="org.yakindu.sct.generator.genmodel.SGen.Editor.opened">
+                </reference>
+            </visibleWhen>
+         </command>  
+         </menuContribution>
+         <!-- copy qualified name -->
+         <menuContribution locationURI="popup:#TextEditorContext?after=copy">
+         	<command commandId="org.eclipse.xtext.ui.editor.copyqualifiedname.EditorCopyQualifiedName" 
+         		style="push" tooltip="Copy Qualified Name">
+            	<visibleWhen checkEnabled="false">
+                	<reference definitionId="org.yakindu.sct.generator.genmodel.SGen.Editor.opened" />
+            	</visibleWhen>
+         	</command>  
+         </menuContribution>
+         <menuContribution locationURI="menu:edit?after=copy">
+         	<command commandId="org.eclipse.xtext.ui.editor.copyqualifiedname.EditorCopyQualifiedName"
+            	style="push" tooltip="Copy Qualified Name">
+            	<visibleWhen checkEnabled="false">
+                	<reference definitionId="org.yakindu.sct.generator.genmodel.SGen.Editor.opened" />
+            	</visibleWhen>
+         	</command>  
+         </menuContribution>
+         <menuContribution locationURI="popup:org.eclipse.xtext.ui.outline?after=additions">
+			<command commandId="org.eclipse.xtext.ui.editor.copyqualifiedname.OutlineCopyQualifiedName" 
+				style="push" tooltip="Copy Qualified Name">
+         		<visibleWhen checkEnabled="false">
+	            	<and>
+	            		<reference definitionId="org.yakindu.sct.generator.genmodel.SGen.XtextEditor.opened" />
+						<iterate>
+							<adapt type="org.eclipse.xtext.ui.editor.outline.IOutlineNode" />
+						</iterate>
+					</and>
+				</visibleWhen>
+			</command>
+         </menuContribution>
+    </extension>
+    <extension point="org.eclipse.ui.menus">
+		<menuContribution locationURI="popup:#TextEditorContext?endof=group.find">
+			<command commandId="org.eclipse.xtext.ui.editor.FindReferences">
+				<visibleWhen checkEnabled="false">
+                	<reference definitionId="org.yakindu.sct.generator.genmodel.SGen.Editor.opened">
+                	</reference>
+            	</visibleWhen>
+			</command>
+		</menuContribution>
+	</extension>
+	<extension point="org.eclipse.ui.handlers">
+	    <handler
+            class="org.yakindu.sct.generator.genmodel.ui.SGenExecutableExtensionFactory:org.eclipse.xtext.ui.editor.findrefs.FindReferencesHandler"
+            commandId="org.eclipse.xtext.ui.editor.FindReferences">
+            <activeWhen>
+                <reference
+                    definitionId="org.yakindu.sct.generator.genmodel.SGen.Editor.opened">
+                </reference>
+            </activeWhen>
+        </handler>
+    </extension>   
+
+<!-- adding resource factories -->
+
+	<extension
+		point="org.eclipse.emf.ecore.extension_parser">
+		<parser
+			class="org.yakindu.sct.generator.genmodel.ui.SGenExecutableExtensionFactory:org.eclipse.xtext.resource.IResourceFactory"
+			type="sgen">
+		</parser>
+	</extension>
+	<extension point="org.eclipse.xtext.extension_resourceServiceProvider">
+        <resourceServiceProvider
+            class="org.yakindu.sct.generator.genmodel.ui.SGenExecutableExtensionFactory:org.eclipse.xtext.ui.resource.IResourceUIServiceProvider"
+            uriExtension="sgen">
+        </resourceServiceProvider>
+    </extension>
+
+
+    <!-- marker definitions for org.yakindu.sct.generator.genmodel.SGen -->
+    <extension
+            id="sgen.check.fast"
+            name="SGen Problem"
+            point="org.eclipse.core.resources.markers">
+        <super type="org.eclipse.xtext.ui.check.fast"/>
+        <persistent value="true"/>
+    </extension>
+    <extension
+            id="sgen.check.normal"
+            name="SGen Problem"
+            point="org.eclipse.core.resources.markers">
+        <super type="org.eclipse.xtext.ui.check.normal"/>
+        <persistent value="true"/>
+    </extension>
+    <extension
+            id="sgen.check.expensive"
+            name="SGen Problem"
+            point="org.eclipse.core.resources.markers">
+        <super type="org.eclipse.xtext.ui.check.expensive"/>
+        <persistent value="true"/>
+    </extension>
+
+	<!-- Quick Outline -->
+	<extension
+		point="org.eclipse.ui.handlers">
+		<handler 
+			class="org.yakindu.sct.generator.genmodel.ui.SGenExecutableExtensionFactory:org.eclipse.xtext.ui.editor.outline.quickoutline.ShowQuickOutlineActionHandler"
+			commandId="org.eclipse.xtext.ui.editor.outline.QuickOutline">
+			<activeWhen>
+				<reference
+					definitionId="org.yakindu.sct.generator.genmodel.SGen.Editor.opened">
+				</reference>
+			</activeWhen>
+		</handler>
+	</extension>
+	<extension
+		point="org.eclipse.ui.commands">
+		<command
+			description="Open the quick outline."
+			id="org.eclipse.xtext.ui.editor.outline.QuickOutline"
+			name="Quick Outline">
+		</command>
+	</extension>
+	<extension point="org.eclipse.ui.menus">
+		<menuContribution
+			locationURI="popup:#TextEditorContext?after=group.open">
+			<command commandId="org.eclipse.xtext.ui.editor.outline.QuickOutline"
+				style="push"
+				tooltip="Open Quick Outline">
+				<visibleWhen checkEnabled="false">
+					<reference definitionId="org.yakindu.sct.generator.genmodel.SGen.Editor.opened"/>
+				</visibleWhen>
+			</command>
+		</menuContribution>
+	</extension>
+    <!-- quickfix marker resolution generator for org.yakindu.sct.generator.genmodel.SGen -->
+    <extension
+            point="org.eclipse.ui.ide.markerResolution">
+        <markerResolutionGenerator
+            class="org.yakindu.sct.generator.genmodel.ui.SGenExecutableExtensionFactory:org.eclipse.xtext.ui.editor.quickfix.MarkerResolutionGenerator"
+            markerType="org.yakindu.sct.generator.genmodel.ui.sgen.check.fast">
+            <attribute
+                name="FIXABLE_KEY"
+                value="true">
+            </attribute>
+        </markerResolutionGenerator>
+        <markerResolutionGenerator
+            class="org.yakindu.sct.generator.genmodel.ui.SGenExecutableExtensionFactory:org.eclipse.xtext.ui.editor.quickfix.MarkerResolutionGenerator"
+            markerType="org.yakindu.sct.generator.genmodel.ui.sgen.check.normal">
+            <attribute
+                name="FIXABLE_KEY"
+                value="true">
+            </attribute>
+        </markerResolutionGenerator>
+        <markerResolutionGenerator
+            class="org.yakindu.sct.generator.genmodel.ui.SGenExecutableExtensionFactory:org.eclipse.xtext.ui.editor.quickfix.MarkerResolutionGenerator"
+            markerType="org.yakindu.sct.generator.genmodel.ui.sgen.check.expensive">
+            <attribute
+                name="FIXABLE_KEY"
+                value="true">
+            </attribute>
+        </markerResolutionGenerator>
+    </extension>
+   	<!-- Rename Refactoring -->
+	<extension point="org.eclipse.ui.handlers">
+		<handler 
+			class="org.yakindu.sct.generator.genmodel.ui.SGenExecutableExtensionFactory:org.eclipse.xtext.ui.refactoring.ui.DefaultRenameElementHandler"
+			commandId="org.eclipse.xtext.ui.refactoring.RenameElement">
+			<activeWhen>
+				<reference
+					definitionId="org.yakindu.sct.generator.genmodel.SGen.Editor.opened">
+				</reference>
+			</activeWhen>
+		</handler>
+	</extension>
+    <extension point="org.eclipse.ui.menus">
+         <menuContribution
+            locationURI="popup:#TextEditorContext?after=group.edit">
+         <command commandId="org.eclipse.xtext.ui.refactoring.RenameElement"
+               style="push">
+            <visibleWhen checkEnabled="false">
+               <reference
+                     definitionId="org.yakindu.sct.generator.genmodel.SGen.Editor.opened">
+               </reference>
+            </visibleWhen>
+         </command>
+      </menuContribution>
+   </extension>
+   <extension point="org.eclipse.ui.preferencePages">
+	    <page
+	        category="org.yakindu.sct.generator.genmodel.SGen"
+	        class="org.yakindu.sct.generator.genmodel.ui.SGenExecutableExtensionFactory:org.eclipse.xtext.ui.refactoring.ui.RefactoringPreferencePage"
+	        id="org.yakindu.sct.generator.genmodel.SGen.refactoring"
+	        name="Refactoring">
+	        <keywordReference id="org.yakindu.sct.generator.genmodel.ui.keyword_SGen"/>
+	    </page>
+	</extension>
+
+  <extension point="org.eclipse.compare.contentViewers">
+    <viewer id="org.yakindu.sct.generator.genmodel.SGen.compare.contentViewers"
+            class="org.yakindu.sct.generator.genmodel.ui.SGenExecutableExtensionFactory:org.eclipse.xtext.ui.compare.InjectableViewerCreator"
+            extensions="sgen">
+    </viewer>
+  </extension>
+  <extension point="org.eclipse.compare.contentMergeViewers">
+    <viewer id="org.yakindu.sct.generator.genmodel.SGen.compare.contentMergeViewers"
+            class="org.yakindu.sct.generator.genmodel.ui.SGenExecutableExtensionFactory:org.eclipse.xtext.ui.compare.InjectableViewerCreator"
+            extensions="sgen" label="SGen Compare">
+     </viewer>
+  </extension>
+  <extension point="org.eclipse.ui.editors.documentProviders">
+    <provider id="org.yakindu.sct.generator.genmodel.SGen.editors.documentProviders"
+            class="org.yakindu.sct.generator.genmodel.ui.SGenExecutableExtensionFactory:org.eclipse.xtext.ui.editor.model.XtextDocumentProvider"
+            extensions="sgen">
+    </provider>
+  </extension>
+
+</plugin>

BIN
plugins/org.yakindu.sct.generator.genmodel/.antlr-generator-3.2.0-patch.jar


+ 1 - 1
plugins/org.yakindu.sct.simulation.core.sexec/src/org/yakindu/sct/simulation/core/sexec/container/DefaultExecutionContextInitializer.xtend

@@ -143,7 +143,7 @@ class DefaultExecutionContextInitializer implements IExecutionContextInitializer
 	}
 
 	def Object initialValue(Type type) {
-		return type.defaultValue
+		return type.originType.defaultValue
 	}
 	
 }

+ 1 - 1
plugins/org.yakindu.sct.simulation.core.sexec/src/org/yakindu/sct/simulation/core/sexec/interpreter/StextStatementInterpreter.xtend

@@ -88,7 +88,7 @@ class StextStatementInterpreter extends AbstractStatementInterpreter {
 
 	def dispatch Object execute(TypeCastExpression expression) {
 		var operand = expression.operand.execute
-		typeCast(operand, expression.type)
+		typeCast(operand, expression.type.originType)
 	}
 
 	def dispatch Object typeCast(Long value, Type type) {

+ 6 - 0
test-plugins/org.yakindu.sct.simulation.core.sexec.test/.project

@@ -25,11 +25,17 @@
 			<arguments>
 			</arguments>
 		</buildCommand>
+		<buildCommand>
+			<name>org.yakindu.sct.builder.SCTBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
 	</buildSpec>
 	<natures>
 		<nature>org.eclipse.pde.PluginNature</nature>
 		<nature>org.eclipse.jdt.core.javanature</nature>
 		<nature>org.eclipse.xtext.ui.shared.xtextNature</nature>
+		<nature>org.yakindu.sct.builder.SCTNature</nature>
 	</natures>
 	<filteredResources>
 		<filter>

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

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

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

@@ -0,0 +1,12 @@
+GeneratorModel for sctunit::interpreter {
+
+	test ValuedEvents2{ 
+		
+		feature Outlet{ 
+			targetProject = "org.yakindu.sct.simulation.core.sexec.test" 
+			targetFolder = "test-gen"			
+		}			
+	}
+
+
+}

+ 50 - 0
test-plugins/org.yakindu.sct.simulation.core.sexec.test/test-gen/org/yakindu/sct/simulation/core/sexec/test/TypeAliasTest.java

@@ -0,0 +1,50 @@
+/**
+ * Copyright (c) 2015 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 TypeAlias
+ */
+@SuppressWarnings("all")
+@RunWith(XtextRunner.class)
+@InjectWith(SExecInjectionProvider.class)
+public class TypeAliasTest extends AbstractExecutionFlowTest {
+	@Before
+	public void setup() throws Exception {
+		ExecutionFlow flow = models
+				.loadExecutionFlowFromResource("TypeAlias.sct");
+		initInterpreter(flow);
+	}
+	@Test
+	public void TypeAliasTest() throws Exception {
+		interpreter.enter();
+		assertTrue(isActive("Start"));
+		assertTrue(getInteger("myVar") == 1);
+		interpreter.runCycle();
+		assertTrue(isActive("Mid"));
+		assertTrue(getString("myString").equals("TypeSystem"));
+		interpreter.runCycle();
+		assertTrue(isActive("Mid2"));
+		raiseEvent("myEvent");
+		interpreter.runCycle();
+		assertTrue(isActive("End"));
+	}
+}

+ 45 - 0
test-plugins/org.yakindu.sct.simulation.core.sexec.test/test-gen/org/yakindu/sct/simulation/core/sexec/test/ValuedEvents2Test.java

@@ -0,0 +1,45 @@
+/**
+ * Copyright (c) 2015 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 ValuedEvents2
+ */
+@SuppressWarnings("all")
+@RunWith(XtextRunner.class)
+@InjectWith(SExecInjectionProvider.class)
+public class ValuedEvents2Test extends AbstractExecutionFlowTest {
+	@Before
+	public void setup() throws Exception {
+		ExecutionFlow flow = models
+				.loadExecutionFlowFromResource("ValuedEvents2.sct");
+		initInterpreter(flow);
+	}
+	@Test
+	public void ValuedEvents2Test() throws Exception {
+		interpreter.enter();
+		assertTrue(isActive("A"));
+		raiseEvent("IntegerEvent", 42);
+		interpreter.runCycle();
+		assertTrue(isActive("B"));
+		assertTrue(getInteger("myVar") == 42);
+	}
+}

+ 2 - 0
test-plugins/org.yakindu.sct.test.models/.settings/org.eclipse.core.resources.prefs

@@ -27,6 +27,8 @@ encoding//testmodels/SCTUnit/SyncJoin.sct=UTF-8
 encoding//testmodels/SCTUnit/TimedTransitions.sct=UTF-8
 encoding//testmodels/SCTUnit/TransitionWithoutCondition.sct=UTF-8
 encoding//testmodels/SCTUnit/TriggerGuardExpressions.sct=UTF-8
+encoding//testmodels/SCTUnit/TypeAlias.sct=UTF-8
+encoding//testmodels/SCTUnit/ValuedEvents2.sct=UTF-8
 encoding//testmodels/SCTUnit/VariableInitialization.sct=UTF-8
 encoding//testmodels/validation/EntryTransitionToParentState.sct=UTF-8
 encoding//testmodels/validation/NoTriggerOnTransitionWithExitPointSpec.sct=UTF-8

+ 2 - 0
test-plugins/org.yakindu.sct.test.models/src/org/yakindu/sct/test/models/SCTUnitTestModels.java

@@ -81,6 +81,7 @@ public class SCTUnitTestModels extends AbstractTestModelsUtil {
 	public static final String TIMED_TRANSITIONS = "TimedTransitions.sct";
 	public static final String TRANSITIONS_WITHOUT_CONDITION = "TransitionWithoutCondition.sct";
 	public static final String TRIFFER_GUARD_EXPRESSIONS = "TriggerGuardExpressions.sct";
+	public static final String TYPE_ALIAS = "TypeAlias.sct";
 	public static final String VALUED_EVENTS = "ValuedEvents.sct";
 	public static final String VARIABLE_INITIALIZATION = "VariableInitialization.sct";
 	
@@ -117,6 +118,7 @@ public class SCTUnitTestModels extends AbstractTestModelsUtil {
 			String value = (String) field.get(this);
 			if (value.endsWith(requestedStatechart)) {
 				result  = (loadStatechartFromResource(value));
+				break;
 			}			
 		}
 		return result;

+ 158 - 0
test-plugins/org.yakindu.sct.test.models/testmodels/SCTUnit/TypeAlias.sct

@@ -0,0 +1,158 @@
+<?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="_SauPcLw7EeSHlq6-_VhMYQ" specification="interface:&#xD;&#xA;alias inti : integer&#xD;&#xA;alias word : string&#xD;&#xA;var myVar : inti&#xD;&#xA;var myString : word&#xD;&#xA;in event myEvent&#xD;&#xA;" name="TypeAlias">
+    <regions xmi:id="_SbH4ELw7EeSHlq6-_VhMYQ" name="main region">
+      <vertices xsi:type="sgraph:Entry" xmi:id="_SbnnULw7EeSHlq6-_VhMYQ">
+        <outgoingTransitions xmi:id="_SbwKMLw7EeSHlq6-_VhMYQ" target="_SbqDkLw7EeSHlq6-_VhMYQ"/>
+      </vertices>
+      <vertices xsi:type="sgraph:State" xmi:id="_SbqDkLw7EeSHlq6-_VhMYQ" specification="entry / myVar = 1 " name="Start" incomingTransitions="_SbwKMLw7EeSHlq6-_VhMYQ">
+        <outgoingTransitions xmi:id="_UGTAcLw7EeSHlq6-_VhMYQ" specification="[myVar == 1]" target="_Tww1ULw7EeSHlq6-_VhMYQ"/>
+      </vertices>
+      <vertices xsi:type="sgraph:State" xmi:id="_Tww1ULw7EeSHlq6-_VhMYQ" specification="entry / &#xD;&#xA;myString = &quot;TypeSystem&quot;" name="Mid" incomingTransitions="_UGTAcLw7EeSHlq6-_VhMYQ">
+        <outgoingTransitions xmi:id="_Io-zILw8EeSHlq6-_VhMYQ" specification="[myString == &quot;TypeSystem&quot;]" target="_IUyr0Lw8EeSHlq6-_VhMYQ"/>
+      </vertices>
+      <vertices xsi:type="sgraph:State" xmi:id="_IUyr0Lw8EeSHlq6-_VhMYQ" specification="" name="Mid2" incomingTransitions="_Io-zILw8EeSHlq6-_VhMYQ">
+        <outgoingTransitions xmi:id="_VhNp0Lw8EeSHlq6-_VhMYQ" specification="myEvent" target="_VIj5QLw8EeSHlq6-_VhMYQ"/>
+      </vertices>
+      <vertices xsi:type="sgraph:State" xmi:id="_VIj5QLw8EeSHlq6-_VhMYQ" name="End" incomingTransitions="_VhNp0Lw8EeSHlq6-_VhMYQ"/>
+    </regions>
+  </sgraph:Statechart>
+  <notation:Diagram xmi:id="_SbGp8Lw7EeSHlq6-_VhMYQ" type="org.yakindu.sct.ui.editor.editor.StatechartDiagramEditor" element="_SauPcLw7EeSHlq6-_VhMYQ" measurementUnit="Pixel">
+    <children xmi:id="_SbMJgLw7EeSHlq6-_VhMYQ" type="Region" element="_SbH4ELw7EeSHlq6-_VhMYQ">
+      <children xsi:type="notation:DecorationNode" xmi:id="_SbjV4Lw7EeSHlq6-_VhMYQ" type="RegionName">
+        <styles xsi:type="notation:ShapeStyle" xmi:id="_SbjV4bw7EeSHlq6-_VhMYQ"/>
+        <layoutConstraint xsi:type="notation:Location" xmi:id="_SbjV4rw7EeSHlq6-_VhMYQ"/>
+      </children>
+      <children xsi:type="notation:Shape" xmi:id="_SbkkALw7EeSHlq6-_VhMYQ" type="RegionCompartment" fontName="Verdana" lineColor="4210752">
+        <children xmi:id="_SbnnUbw7EeSHlq6-_VhMYQ" type="Entry" element="_SbnnULw7EeSHlq6-_VhMYQ">
+          <children xmi:id="_SboOYLw7EeSHlq6-_VhMYQ" type="BorderItemLabelContainer">
+            <children xsi:type="notation:DecorationNode" xmi:id="_SboOY7w7EeSHlq6-_VhMYQ" type="BorderItemLabel">
+              <styles xsi:type="notation:ShapeStyle" xmi:id="_SboOZLw7EeSHlq6-_VhMYQ"/>
+              <layoutConstraint xsi:type="notation:Location" xmi:id="_SboOZbw7EeSHlq6-_VhMYQ"/>
+            </children>
+            <styles xsi:type="notation:ShapeStyle" xmi:id="_SboOYbw7EeSHlq6-_VhMYQ" fontName="Verdana" lineColor="4210752"/>
+            <layoutConstraint xsi:type="notation:Bounds" xmi:id="_SboOYrw7EeSHlq6-_VhMYQ"/>
+          </children>
+          <styles xsi:type="notation:ShapeStyle" xmi:id="_SbnnUrw7EeSHlq6-_VhMYQ" fontName="Verdana" lineColor="4210752"/>
+          <layoutConstraint xsi:type="notation:Bounds" xmi:id="_SboOZrw7EeSHlq6-_VhMYQ" x="70" y="20"/>
+        </children>
+        <children xmi:id="_Sbr4wbw7EeSHlq6-_VhMYQ" type="State" element="_SbqDkLw7EeSHlq6-_VhMYQ">
+          <children xsi:type="notation:DecorationNode" xmi:id="_Sbsf0Lw7EeSHlq6-_VhMYQ" type="StateName">
+            <styles xsi:type="notation:ShapeStyle" xmi:id="_Sbsf0bw7EeSHlq6-_VhMYQ"/>
+            <layoutConstraint xsi:type="notation:Location" xmi:id="_Sbsf0rw7EeSHlq6-_VhMYQ"/>
+          </children>
+          <children xsi:type="notation:Compartment" xmi:id="_Sbtt8Lw7EeSHlq6-_VhMYQ" type="StateTextCompartment">
+            <children xsi:type="notation:Shape" xmi:id="_Sbtt8bw7EeSHlq6-_VhMYQ" type="StateTextCompartmentExpression" fontName="Verdana" lineColor="4210752">
+              <layoutConstraint xsi:type="notation:Bounds" xmi:id="_Sbtt8rw7EeSHlq6-_VhMYQ"/>
+            </children>
+          </children>
+          <children xsi:type="notation:Compartment" xmi:id="_Sbtt87w7EeSHlq6-_VhMYQ" type="StateFigureCompartment"/>
+          <styles xsi:type="notation:ShapeStyle" xmi:id="_Sbr4wrw7EeSHlq6-_VhMYQ" fontName="Verdana" fillColor="15981773" lineColor="12632256"/>
+          <styles xsi:type="notation:FontStyle" xmi:id="_Sbr4w7w7EeSHlq6-_VhMYQ"/>
+          <styles xsi:type="notation:BooleanValueStyle" xmi:id="_SbuVALw7EeSHlq6-_VhMYQ" name="isHorizontal" booleanValue="true"/>
+          <layoutConstraint xsi:type="notation:Bounds" xmi:id="_Sbu8ELw7EeSHlq6-_VhMYQ" x="40" y="80"/>
+        </children>
+        <children xmi:id="_Tw1GwLw7EeSHlq6-_VhMYQ" type="State" element="_Tww1ULw7EeSHlq6-_VhMYQ">
+          <children xsi:type="notation:DecorationNode" xmi:id="_Tw278Lw7EeSHlq6-_VhMYQ" type="StateName">
+            <styles xsi:type="notation:ShapeStyle" xmi:id="_Tw278bw7EeSHlq6-_VhMYQ"/>
+            <layoutConstraint xsi:type="notation:Location" xmi:id="_Tw3jALw7EeSHlq6-_VhMYQ"/>
+          </children>
+          <children xsi:type="notation:Compartment" xmi:id="_Tw3jAbw7EeSHlq6-_VhMYQ" type="StateTextCompartment">
+            <children xsi:type="notation:Shape" xmi:id="_Tw4KELw7EeSHlq6-_VhMYQ" type="StateTextCompartmentExpression" fontName="Verdana" lineColor="4210752">
+              <layoutConstraint xsi:type="notation:Bounds" xmi:id="_Tw4KEbw7EeSHlq6-_VhMYQ"/>
+            </children>
+          </children>
+          <children xsi:type="notation:Compartment" xmi:id="_Tw4xILw7EeSHlq6-_VhMYQ" type="StateFigureCompartment"/>
+          <styles xsi:type="notation:ShapeStyle" xmi:id="_Tw1Gwbw7EeSHlq6-_VhMYQ" fontName="Verdana" fillColor="15981773" lineColor="12632256"/>
+          <styles xsi:type="notation:FontStyle" xmi:id="_Tw1Gwrw7EeSHlq6-_VhMYQ"/>
+          <styles xsi:type="notation:BooleanValueStyle" xmi:id="_Tw5YMLw7EeSHlq6-_VhMYQ" name="isHorizontal" booleanValue="true"/>
+          <layoutConstraint xsi:type="notation:Bounds" xmi:id="_Tw1Gw7w7EeSHlq6-_VhMYQ" x="479" y="42" height="96"/>
+        </children>
+        <children xmi:id="_IU1IELw8EeSHlq6-_VhMYQ" type="State" element="_IUyr0Lw8EeSHlq6-_VhMYQ">
+          <children xsi:type="notation:DecorationNode" xmi:id="_IU2WMLw8EeSHlq6-_VhMYQ" type="StateName">
+            <styles xsi:type="notation:ShapeStyle" xmi:id="_IU2WMbw8EeSHlq6-_VhMYQ"/>
+            <layoutConstraint xsi:type="notation:Location" xmi:id="_IU29QLw8EeSHlq6-_VhMYQ"/>
+          </children>
+          <children xsi:type="notation:Compartment" xmi:id="_IU5ZgLw8EeSHlq6-_VhMYQ" type="StateTextCompartment">
+            <children xsi:type="notation:Shape" xmi:id="_IU6AkLw8EeSHlq6-_VhMYQ" type="StateTextCompartmentExpression" fontName="Verdana" lineColor="4210752">
+              <layoutConstraint xsi:type="notation:Bounds" xmi:id="_IU6Akbw8EeSHlq6-_VhMYQ"/>
+            </children>
+          </children>
+          <children xsi:type="notation:Compartment" xmi:id="_IU6noLw8EeSHlq6-_VhMYQ" type="StateFigureCompartment"/>
+          <styles xsi:type="notation:ShapeStyle" xmi:id="_IU1IEbw8EeSHlq6-_VhMYQ" fontName="Verdana" fillColor="15981773" lineColor="12632256"/>
+          <styles xsi:type="notation:FontStyle" xmi:id="_IU1IErw8EeSHlq6-_VhMYQ"/>
+          <styles xsi:type="notation:BooleanValueStyle" xmi:id="_IU7OsLw8EeSHlq6-_VhMYQ" name="isHorizontal" booleanValue="true"/>
+          <layoutConstraint xsi:type="notation:Bounds" xmi:id="_IU1IE7w8EeSHlq6-_VhMYQ" x="482" y="266" width="208" height="102"/>
+        </children>
+        <children xmi:id="_VImVgLw8EeSHlq6-_VhMYQ" type="State" element="_VIj5QLw8EeSHlq6-_VhMYQ">
+          <children xsi:type="notation:DecorationNode" xmi:id="_VInjoLw8EeSHlq6-_VhMYQ" type="StateName">
+            <styles xsi:type="notation:ShapeStyle" xmi:id="_VInjobw8EeSHlq6-_VhMYQ"/>
+            <layoutConstraint xsi:type="notation:Location" xmi:id="_VIoKsLw8EeSHlq6-_VhMYQ"/>
+          </children>
+          <children xsi:type="notation:Compartment" xmi:id="_VIoKsbw8EeSHlq6-_VhMYQ" type="StateTextCompartment">
+            <children xsi:type="notation:Shape" xmi:id="_VIoKsrw8EeSHlq6-_VhMYQ" type="StateTextCompartmentExpression" fontName="Verdana" lineColor="4210752">
+              <layoutConstraint xsi:type="notation:Bounds" xmi:id="_VIoxwLw8EeSHlq6-_VhMYQ"/>
+            </children>
+          </children>
+          <children xsi:type="notation:Compartment" xmi:id="_VIpY0Lw8EeSHlq6-_VhMYQ" type="StateFigureCompartment"/>
+          <styles xsi:type="notation:ShapeStyle" xmi:id="_VImVgbw8EeSHlq6-_VhMYQ" fontName="Verdana" fillColor="15981773" lineColor="12632256"/>
+          <styles xsi:type="notation:FontStyle" xmi:id="_VImVgrw8EeSHlq6-_VhMYQ"/>
+          <styles xsi:type="notation:BooleanValueStyle" xmi:id="_VIpY0bw8EeSHlq6-_VhMYQ" name="isHorizontal" booleanValue="true"/>
+          <layoutConstraint xsi:type="notation:Bounds" xmi:id="_VImVg7w8EeSHlq6-_VhMYQ" x="59" y="282"/>
+        </children>
+        <layoutConstraint xsi:type="notation:Bounds" xmi:id="_SbkkAbw7EeSHlq6-_VhMYQ"/>
+      </children>
+      <styles xsi:type="notation:ShapeStyle" xmi:id="_SbMJgbw7EeSHlq6-_VhMYQ" fontName="Verdana" fillColor="15790320" lineColor="12632256"/>
+      <layoutConstraint xsi:type="notation:Bounds" xmi:id="_SblLELw7EeSHlq6-_VhMYQ" x="220" y="10" width="781" height="421"/>
+    </children>
+    <children xsi:type="notation:Shape" xmi:id="_Sb2Q0Lw7EeSHlq6-_VhMYQ" type="StatechartText" fontName="Verdana" lineColor="4210752">
+      <children xsi:type="notation:DecorationNode" xmi:id="_Sb2Q0rw7EeSHlq6-_VhMYQ" type="StatechartName">
+        <styles xsi:type="notation:ShapeStyle" xmi:id="_Sb2Q07w7EeSHlq6-_VhMYQ"/>
+        <layoutConstraint xsi:type="notation:Location" xmi:id="_Sb2Q1Lw7EeSHlq6-_VhMYQ"/>
+      </children>
+      <children xsi:type="notation:Shape" xmi:id="_Sb2Q1bw7EeSHlq6-_VhMYQ" type="StatechartTextExpression" fontName="Verdana" lineColor="4210752">
+        <layoutConstraint xsi:type="notation:Bounds" xmi:id="_Sb2Q1rw7EeSHlq6-_VhMYQ"/>
+      </children>
+      <layoutConstraint xsi:type="notation:Bounds" xmi:id="_Sb234Lw7EeSHlq6-_VhMYQ" x="10" y="10" width="200" height="400"/>
+    </children>
+    <styles xsi:type="notation:DiagramStyle" xmi:id="_SbGp8bw7EeSHlq6-_VhMYQ"/>
+    <edges xmi:id="_Sb1CsLw7EeSHlq6-_VhMYQ" type="Transition" element="_SbwKMLw7EeSHlq6-_VhMYQ" source="_SbnnUbw7EeSHlq6-_VhMYQ" target="_Sbr4wbw7EeSHlq6-_VhMYQ">
+      <children xsi:type="notation:DecorationNode" xmi:id="_Sb1pwbw7EeSHlq6-_VhMYQ" type="TransitionExpression">
+        <styles xsi:type="notation:ShapeStyle" xmi:id="_Sb1pwrw7EeSHlq6-_VhMYQ"/>
+        <layoutConstraint xsi:type="notation:Location" xmi:id="_Sb1pw7w7EeSHlq6-_VhMYQ" y="10"/>
+      </children>
+      <styles xsi:type="notation:ConnectorStyle" xmi:id="_Sb1Csbw7EeSHlq6-_VhMYQ" lineColor="4210752"/>
+      <styles xsi:type="notation:FontStyle" xmi:id="_Sb1pwLw7EeSHlq6-_VhMYQ" fontName="Verdana"/>
+      <bendpoints xsi:type="notation:RelativeBendpoints" xmi:id="_Sb1Csrw7EeSHlq6-_VhMYQ" points="[0, 0, 0, 0]$[0, 0, 0, 0]"/>
+    </edges>
+    <edges xmi:id="_UGXR4Lw7EeSHlq6-_VhMYQ" type="Transition" element="_UGTAcLw7EeSHlq6-_VhMYQ" source="_Sbr4wbw7EeSHlq6-_VhMYQ" target="_Tw1GwLw7EeSHlq6-_VhMYQ">
+      <children xsi:type="notation:DecorationNode" xmi:id="_UGYgAbw7EeSHlq6-_VhMYQ" type="TransitionExpression">
+        <styles xsi:type="notation:ShapeStyle" xmi:id="_UGYgArw7EeSHlq6-_VhMYQ"/>
+        <layoutConstraint xsi:type="notation:Location" xmi:id="_UGZHELw7EeSHlq6-_VhMYQ" y="10"/>
+      </children>
+      <styles xsi:type="notation:ConnectorStyle" xmi:id="_UGXR4bw7EeSHlq6-_VhMYQ" lineColor="4210752"/>
+      <styles xsi:type="notation:FontStyle" xmi:id="_UGYgALw7EeSHlq6-_VhMYQ" fontName="Verdana"/>
+      <bendpoints xsi:type="notation:RelativeBendpoints" xmi:id="_UGXR4rw7EeSHlq6-_VhMYQ" points="[24, 1, -235, -8]$[264, 29, 5, 20]"/>
+      <targetAnchor xsi:type="notation:IdentityAnchor" xmi:id="_UHq5cLw7EeSHlq6-_VhMYQ" id="(0.88,0.5849056603773585)"/>
+    </edges>
+    <edges xmi:id="_IpABQLw8EeSHlq6-_VhMYQ" type="Transition" element="_Io-zILw8EeSHlq6-_VhMYQ" source="_Tw1GwLw7EeSHlq6-_VhMYQ" target="_IU1IELw8EeSHlq6-_VhMYQ">
+      <children xsi:type="notation:DecorationNode" xmi:id="_IpAoULw8EeSHlq6-_VhMYQ" type="TransitionExpression">
+        <styles xsi:type="notation:ShapeStyle" xmi:id="_IpAoUbw8EeSHlq6-_VhMYQ"/>
+        <layoutConstraint xsi:type="notation:Location" xmi:id="_IpAoUrw8EeSHlq6-_VhMYQ" x="-37" y="-91"/>
+      </children>
+      <styles xsi:type="notation:ConnectorStyle" xmi:id="_IpABQbw8EeSHlq6-_VhMYQ" lineColor="4210752"/>
+      <styles xsi:type="notation:FontStyle" xmi:id="_IpABQ7w8EeSHlq6-_VhMYQ" fontName="Verdana"/>
+      <bendpoints xsi:type="notation:RelativeBendpoints" xmi:id="_IpABQrw8EeSHlq6-_VhMYQ" points="[-9, 29, 45, -157]$[-57, 210, -3, 24]"/>
+    </edges>
+    <edges xmi:id="_VhRUMLw8EeSHlq6-_VhMYQ" type="Transition" element="_VhNp0Lw8EeSHlq6-_VhMYQ" source="_IU1IELw8EeSHlq6-_VhMYQ" target="_VImVgLw8EeSHlq6-_VhMYQ">
+      <children xsi:type="notation:DecorationNode" xmi:id="_VhR7Qbw8EeSHlq6-_VhMYQ" type="TransitionExpression">
+        <styles xsi:type="notation:ShapeStyle" xmi:id="_VhR7Qrw8EeSHlq6-_VhMYQ"/>
+        <layoutConstraint xsi:type="notation:Location" xmi:id="_VhSiULw8EeSHlq6-_VhMYQ" y="10"/>
+      </children>
+      <styles xsi:type="notation:ConnectorStyle" xmi:id="_VhRUMbw8EeSHlq6-_VhMYQ" lineColor="4210752"/>
+      <styles xsi:type="notation:FontStyle" xmi:id="_VhR7QLw8EeSHlq6-_VhMYQ" fontName="Verdana"/>
+      <bendpoints xsi:type="notation:RelativeBendpoints" xmi:id="_VhRUMrw8EeSHlq6-_VhMYQ" points="[-22, 2, 321, 3]$[-339, 20, 4, 21]"/>
+      <targetAnchor xsi:type="notation:IdentityAnchor" xmi:id="_VijtoLw8EeSHlq6-_VhMYQ" id="(0.7733333333333333,0.5660377358490566)"/>
+    </edges>
+  </notation:Diagram>
+</xmi:XMI>

+ 101 - 0
test-plugins/org.yakindu.sct.test.models/testmodels/SCTUnit/ValuedEvents2.sct

@@ -0,0 +1,101 @@
+<?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="_0Q0NgMDYEeSET7jqufuZHA" specification="interface:&#xD;&#xA;in event IntegerEvent : integer&#xD;&#xA;var myVar : integer" name="ValuedEvents2">
+    <regions xmi:id="_0Q2CssDYEeSET7jqufuZHA" name="main region">
+      <vertices xsi:type="sgraph:Entry" xmi:id="_0Q4e8cDYEeSET7jqufuZHA">
+        <outgoingTransitions xmi:id="_0Q6UIcDYEeSET7jqufuZHA" target="_0Q5GBMDYEeSET7jqufuZHA"/>
+      </vertices>
+      <vertices xsi:type="sgraph:State" xmi:id="_0Q5GBMDYEeSET7jqufuZHA" name="A" incomingTransitions="_0Q6UIcDYEeSET7jqufuZHA">
+        <outgoingTransitions xmi:id="_6UausMDYEeSET7jqufuZHA" specification="IntegerEvent / myVar = valueof(IntegerEvent)" target="_5-0SIMDYEeSET7jqufuZHA"/>
+      </vertices>
+      <vertices xsi:type="sgraph:State" xmi:id="_5-0SIMDYEeSET7jqufuZHA" name="B" incomingTransitions="_6UausMDYEeSET7jqufuZHA"/>
+    </regions>
+  </sgraph:Statechart>
+  <notation:Diagram xmi:id="_0Q2CsMDYEeSET7jqufuZHA" type="org.yakindu.sct.ui.editor.editor.StatechartDiagramEditor" element="_0Q0NgMDYEeSET7jqufuZHA" measurementUnit="Pixel">
+    <children xmi:id="_0Q2pwMDYEeSET7jqufuZHA" type="Region" element="_0Q2CssDYEeSET7jqufuZHA">
+      <children xsi:type="notation:DecorationNode" xmi:id="_0Q334MDYEeSET7jqufuZHA" type="RegionName">
+        <styles xsi:type="notation:ShapeStyle" xmi:id="_0Q334cDYEeSET7jqufuZHA"/>
+        <layoutConstraint xsi:type="notation:Location" xmi:id="_0Q334sDYEeSET7jqufuZHA"/>
+      </children>
+      <children xsi:type="notation:Shape" xmi:id="_0Q3348DYEeSET7jqufuZHA" type="RegionCompartment" fontName="Verdana" lineColor="4210752">
+        <children xmi:id="_0Q4e8sDYEeSET7jqufuZHA" type="Entry" element="_0Q4e8cDYEeSET7jqufuZHA">
+          <children xmi:id="_0Q4e9cDYEeSET7jqufuZHA" type="BorderItemLabelContainer">
+            <children xsi:type="notation:DecorationNode" xmi:id="_0Q5GAMDYEeSET7jqufuZHA" type="BorderItemLabel">
+              <styles xsi:type="notation:ShapeStyle" xmi:id="_0Q5GAcDYEeSET7jqufuZHA"/>
+              <layoutConstraint xsi:type="notation:Location" xmi:id="_0Q5GAsDYEeSET7jqufuZHA"/>
+            </children>
+            <styles xsi:type="notation:ShapeStyle" xmi:id="_0Q4e9sDYEeSET7jqufuZHA" fontName="Verdana" lineColor="4210752"/>
+            <layoutConstraint xsi:type="notation:Bounds" xmi:id="_0Q4e98DYEeSET7jqufuZHA"/>
+          </children>
+          <styles xsi:type="notation:ShapeStyle" xmi:id="_0Q4e88DYEeSET7jqufuZHA" fontName="Verdana" lineColor="4210752"/>
+          <layoutConstraint xsi:type="notation:Bounds" xmi:id="_0Q5GA8DYEeSET7jqufuZHA" x="70" y="20"/>
+        </children>
+        <children xmi:id="_0Q5GB8DYEeSET7jqufuZHA" type="State" element="_0Q5GBMDYEeSET7jqufuZHA">
+          <children xsi:type="notation:DecorationNode" xmi:id="_0Q5tEMDYEeSET7jqufuZHA" type="StateName">
+            <styles xsi:type="notation:ShapeStyle" xmi:id="_0Q5tEcDYEeSET7jqufuZHA"/>
+            <layoutConstraint xsi:type="notation:Location" xmi:id="_0Q5tEsDYEeSET7jqufuZHA"/>
+          </children>
+          <children xsi:type="notation:Compartment" xmi:id="_0Q5tE8DYEeSET7jqufuZHA" type="StateTextCompartment">
+            <children xsi:type="notation:Shape" xmi:id="_0Q5tFMDYEeSET7jqufuZHA" type="StateTextCompartmentExpression" fontName="Verdana" lineColor="4210752">
+              <layoutConstraint xsi:type="notation:Bounds" xmi:id="_0Q5tFcDYEeSET7jqufuZHA"/>
+            </children>
+          </children>
+          <children xsi:type="notation:Compartment" xmi:id="_0Q5tFsDYEeSET7jqufuZHA" type="StateFigureCompartment"/>
+          <styles xsi:type="notation:ShapeStyle" xmi:id="_0Q5GCMDYEeSET7jqufuZHA" fontName="Verdana" fillColor="15981773" lineColor="12632256"/>
+          <styles xsi:type="notation:FontStyle" xmi:id="_0Q5GCcDYEeSET7jqufuZHA"/>
+          <styles xsi:type="notation:BooleanValueStyle" xmi:id="_0Q5tF8DYEeSET7jqufuZHA" name="isHorizontal" booleanValue="true"/>
+          <layoutConstraint xsi:type="notation:Bounds" xmi:id="_0Q6UIMDYEeSET7jqufuZHA" x="40" y="80"/>
+        </children>
+        <children xmi:id="_5-2uYMDYEeSET7jqufuZHA" type="State" element="_5-0SIMDYEeSET7jqufuZHA">
+          <children xsi:type="notation:DecorationNode" xmi:id="_5-3VcMDYEeSET7jqufuZHA" type="StateName">
+            <styles xsi:type="notation:ShapeStyle" xmi:id="_5-3VccDYEeSET7jqufuZHA"/>
+            <layoutConstraint xsi:type="notation:Location" xmi:id="_5-3VcsDYEeSET7jqufuZHA"/>
+          </children>
+          <children xsi:type="notation:Compartment" xmi:id="_5-3Vc8DYEeSET7jqufuZHA" type="StateTextCompartment">
+            <children xsi:type="notation:Shape" xmi:id="_5-38gMDYEeSET7jqufuZHA" type="StateTextCompartmentExpression" fontName="Verdana" lineColor="4210752">
+              <layoutConstraint xsi:type="notation:Bounds" xmi:id="_5-38gcDYEeSET7jqufuZHA"/>
+            </children>
+          </children>
+          <children xsi:type="notation:Compartment" xmi:id="_5-38gsDYEeSET7jqufuZHA" type="StateFigureCompartment"/>
+          <styles xsi:type="notation:ShapeStyle" xmi:id="_5-2uYcDYEeSET7jqufuZHA" fontName="Verdana" fillColor="15981773" lineColor="12632256"/>
+          <styles xsi:type="notation:FontStyle" xmi:id="_5-2uYsDYEeSET7jqufuZHA"/>
+          <styles xsi:type="notation:BooleanValueStyle" xmi:id="_5-38g8DYEeSET7jqufuZHA" name="isHorizontal" booleanValue="true"/>
+          <layoutConstraint xsi:type="notation:Bounds" xmi:id="_5-2uY8DYEeSET7jqufuZHA" x="469" y="80"/>
+        </children>
+        <layoutConstraint xsi:type="notation:Bounds" xmi:id="_0Q335MDYEeSET7jqufuZHA"/>
+      </children>
+      <styles xsi:type="notation:ShapeStyle" xmi:id="_0Q2pwcDYEeSET7jqufuZHA" fontName="Verdana" fillColor="15790320" lineColor="12632256"/>
+      <layoutConstraint xsi:type="notation:Bounds" xmi:id="_0Q4e8MDYEeSET7jqufuZHA" x="265" y="10" width="596" height="400"/>
+    </children>
+    <children xsi:type="notation:Shape" xmi:id="_0Q7iQMDYEeSET7jqufuZHA" type="StatechartText" fontName="Verdana" lineColor="4210752">
+      <children xsi:type="notation:DecorationNode" xmi:id="_0Q7iQsDYEeSET7jqufuZHA" type="StatechartName">
+        <styles xsi:type="notation:ShapeStyle" xmi:id="_0Q7iQ8DYEeSET7jqufuZHA"/>
+        <layoutConstraint xsi:type="notation:Location" xmi:id="_0Q7iRMDYEeSET7jqufuZHA"/>
+      </children>
+      <children xsi:type="notation:Shape" xmi:id="_0Q7iRcDYEeSET7jqufuZHA" type="StatechartTextExpression" fontName="Verdana" lineColor="4210752">
+        <layoutConstraint xsi:type="notation:Bounds" xmi:id="_0Q7iRsDYEeSET7jqufuZHA"/>
+      </children>
+      <layoutConstraint xsi:type="notation:Bounds" xmi:id="_0Q8JUMDYEeSET7jqufuZHA" x="10" y="10" width="246" height="400"/>
+    </children>
+    <styles xsi:type="notation:DiagramStyle" xmi:id="_0Q2CscDYEeSET7jqufuZHA"/>
+    <edges xmi:id="_0Q67MMDYEeSET7jqufuZHA" type="Transition" element="_0Q6UIcDYEeSET7jqufuZHA" source="_0Q4e8sDYEeSET7jqufuZHA" target="_0Q5GB8DYEeSET7jqufuZHA">
+      <children xsi:type="notation:DecorationNode" xmi:id="_0Q67NMDYEeSET7jqufuZHA" type="TransitionExpression">
+        <styles xsi:type="notation:ShapeStyle" xmi:id="_0Q67NcDYEeSET7jqufuZHA"/>
+        <layoutConstraint xsi:type="notation:Location" xmi:id="_0Q67NsDYEeSET7jqufuZHA" y="10"/>
+      </children>
+      <styles xsi:type="notation:ConnectorStyle" xmi:id="_0Q67McDYEeSET7jqufuZHA" lineColor="4210752"/>
+      <styles xsi:type="notation:FontStyle" xmi:id="_0Q67M8DYEeSET7jqufuZHA" fontName="Verdana"/>
+      <bendpoints xsi:type="notation:RelativeBendpoints" xmi:id="_0Q67MsDYEeSET7jqufuZHA" points="[0, 0, 0, 0]$[0, 0, 0, 0]"/>
+    </edges>
+    <edges xmi:id="_6UdK8MDYEeSET7jqufuZHA" type="Transition" element="_6UausMDYEeSET7jqufuZHA" source="_0Q5GB8DYEeSET7jqufuZHA" target="_5-2uYMDYEeSET7jqufuZHA">
+      <children xsi:type="notation:DecorationNode" xmi:id="_6UdyAcDYEeSET7jqufuZHA" type="TransitionExpression">
+        <styles xsi:type="notation:ShapeStyle" xmi:id="_6UdyAsDYEeSET7jqufuZHA"/>
+        <layoutConstraint xsi:type="notation:Location" xmi:id="_6UeZEMDYEeSET7jqufuZHA" x="4" y="-18"/>
+      </children>
+      <styles xsi:type="notation:ConnectorStyle" xmi:id="_6UdK8cDYEeSET7jqufuZHA" lineColor="4210752"/>
+      <styles xsi:type="notation:FontStyle" xmi:id="_6UdyAMDYEeSET7jqufuZHA" fontName="Verdana"/>
+      <bendpoints xsi:type="notation:RelativeBendpoints" xmi:id="_6UdK8sDYEeSET7jqufuZHA" points="[18, 10, -197, -119]$[216, 116, 1, -13]"/>
+      <targetAnchor xsi:type="notation:IdentityAnchor" xmi:id="_6VmacMDYEeSET7jqufuZHA" id="(0.14666666666666667,0.2830188679245283)"/>
+    </edges>
+  </notation:Diagram>
+</xmi:XMI>

+ 23 - 0
test-plugins/org.yakindu.sct.test.models/tests/TypeAlias.sctunit

@@ -0,0 +1,23 @@
+
+testgroup TypeAlias for statechart TypeAlias{
+	test TypeAliasTest { 
+		enter
+		assert active(TypeAlias.main_region.Start)
+		assert myVar == 1
+		
+		cycle
+		
+		assert active(TypeAlias.main_region.Mid)
+		assert myString == "TypeSystem"
+		
+		cycle
+		
+		assert active(TypeAlias.main_region.Mid2)
+		
+		raise myEvent 
+		cycle
+		
+		assert active(TypeAlias.main_region.End)		 
+	} 
+}
+