Selaa lähdekoodia

Share project "org.yakindu.sct.generator.java.runtime.test" into "https://svn.codespot.com/a/eclipselabs.org/yakindu"

markus.muehlbrandt@itemis.de 14 vuotta sitten
vanhempi
commit
ac3bfc154c
63 muutettua tiedostoa jossa 4605 lisäystä ja 0 poistoa
  1. 8 0
      test-plugins/org.yakindu.sct.generator.java.runtime.test/.classpath
  2. 23 0
      test-plugins/org.yakindu.sct.generator.java.runtime.test/.project
  3. 12 0
      test-plugins/org.yakindu.sct.generator.java.runtime.test/.settings/org.eclipse.jdt.core.prefs
  4. 35 0
      test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/Event.java
  5. 21 0
      test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/EventNotification.java
  6. 17 0
      test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/INotificationListener.java
  7. 18 0
      test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/INotificationSender.java
  8. 18 0
      test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/IStatemachine.java
  9. 21 0
      test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/ITimedStatemachine.java
  10. 18 0
      test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/ITimerHandler.java
  11. 31 0
      test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/Notification.java
  12. 33 0
      test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/NotificationSender.java
  13. 15 0
      test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/NotificationType.java
  14. 29 0
      test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/TimeEvent.java
  15. 68 0
      test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/TimerHandler.java
  16. 30 0
      test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/interfacetest/InterfaceDefault.java
  17. 85 0
      test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/interfacetest/InterfaceDefaultImpl.java
  18. 26 0
      test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/interfacetest/InterfaceOther.java
  19. 61 0
      test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/interfacetest/InterfaceOtherImpl.java
  20. 238 0
      test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/interfacetest/InterfaceTestAbstractBaseStatemachine.java
  21. 29 0
      test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/interfacetest/InterfaceTestCyleBasedStatemachine.java
  22. 37 0
      test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/interfacetest/InterfaceTestEventBasedStatemachine.java
  23. 26 0
      test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/interfacetest/InterfaceThird.java
  24. 67 0
      test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/interfacetest/InterfaceThirdImpl.java
  25. 26 0
      test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/test_deephistory/InterfaceDefault.java
  26. 116 0
      test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/test_deephistory/InterfaceDefaultImpl.java
  27. 247 0
      test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/test_deephistory/Test_DeepHistoryAbstractBaseStatemachine.java
  28. 29 0
      test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/test_deephistory/Test_DeepHistoryCyleBasedStatemachine.java
  29. 37 0
      test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/test_deephistory/Test_DeepHistoryEventBasedStatemachine.java
  30. 33 0
      test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/test_expression/InterfaceDefault.java
  31. 98 0
      test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/test_expression/InterfaceDefaultImpl.java
  32. 148 0
      test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/test_expression/Test_ExpressionAbstractBaseStatemachine.java
  33. 29 0
      test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/test_expression/Test_ExpressionCyleBasedStatemachine.java
  34. 37 0
      test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/test_expression/Test_ExpressionEventBasedStatemachine.java
  35. 37 0
      test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/test_hierarchy/InterfaceDefault.java
  36. 204 0
      test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/test_hierarchy/InterfaceDefaultImpl.java
  37. 483 0
      test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/test_hierarchy/Test_HierarchyAbstractBaseStatemachine.java
  38. 29 0
      test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/test_hierarchy/Test_HierarchyCyleBasedStatemachine.java
  39. 37 0
      test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/test_hierarchy/Test_HierarchyEventBasedStatemachine.java
  40. 27 0
      test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/test_localactions/InterfaceDefault.java
  41. 93 0
      test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/test_localactions/InterfaceDefaultImpl.java
  42. 226 0
      test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/test_localactions/Test_LocalActionsAbstractBaseStatemachine.java
  43. 29 0
      test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/test_localactions/Test_LocalActionsCyleBasedStatemachine.java
  44. 37 0
      test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/test_localactions/Test_LocalActionsEventBasedStatemachine.java
  45. 23 0
      test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/test_parallelregions/InterfaceDefault.java
  46. 86 0
      test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/test_parallelregions/InterfaceDefaultImpl.java
  47. 234 0
      test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/test_parallelregions/Test_ParallelRegionsAbstractBaseStatemachine.java
  48. 29 0
      test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/test_parallelregions/Test_ParallelRegionsCyleBasedStatemachine.java
  49. 37 0
      test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/test_parallelregions/Test_ParallelRegionsEventBasedStatemachine.java
  50. 25 0
      test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/test_shallowhistory/InterfaceDefault.java
  51. 106 0
      test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/test_shallowhistory/InterfaceDefaultImpl.java
  52. 247 0
      test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/test_shallowhistory/Test_ShallowHistoryAbstractBaseStatemachine.java
  53. 29 0
      test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/test_shallowhistory/Test_ShallowHistoryCyleBasedStatemachine.java
  54. 37 0
      test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/test_shallowhistory/Test_ShallowHistoryEventBasedStatemachine.java
  55. 27 0
      test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/test_transition/InterfaceA.java
  56. 76 0
      test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/test_transition/InterfaceAImpl.java
  57. 30 0
      test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/test_transition/InterfaceDefault.java
  58. 84 0
      test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/test_transition/InterfaceDefaultImpl.java
  59. 287 0
      test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/test_transition/Test_TransitionAbstractBaseStatemachine.java
  60. 29 0
      test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/test_transition/Test_TransitionCyleBasedStatemachine.java
  61. 37 0
      test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/test_transition/Test_TransitionEventBasedStatemachine.java
  62. 9 0
      test-plugins/org.yakindu.sct.generator.java.runtime.test/src/org/yakindu/sct/generator/java/runtime/test/AllCycleBasedStatemachineTests.java
  63. 205 0
      test-plugins/org.yakindu.sct.generator.java.runtime.test/src/org/yakindu/sct/generator/java/runtime/test/TestInterfaceTestCycleBasedStatemachine.java

+ 8 - 0
test-plugins/org.yakindu.sct.generator.java.runtime.test/.classpath

@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="src" path="src"/>
+	<classpathentry kind="src" path="src-gen"/>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
+	<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
+	<classpathentry kind="output" path="bin"/>
+</classpath>

+ 23 - 0
test-plugins/org.yakindu.sct.generator.java.runtime.test/.project

@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>org.yakindu.sct.generator.java.runtime.test</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.xtext.ui.shared.xtextBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+		<nature>org.eclipse.xtext.ui.shared.xtextNature</nature>
+	</natures>
+</projectDescription>

+ 12 - 0
test-plugins/org.yakindu.sct.generator.java.runtime.test/.settings/org.eclipse.jdt.core.prefs

@@ -0,0 +1,12 @@
+#Thu Nov 10 10:07:19 CET 2011
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.7
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.7

+ 35 - 0
test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/Event.java

@@ -0,0 +1,35 @@
+/**
+ * Copyright (c) 2011 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.runtime.java;
+
+public class Event<DataType> {
+	
+	private DataType value;
+	
+	private String name;
+	
+	public Event(String name, DataType value) {
+		this.name = name;
+		this.value = value;
+	}
+	
+	public String getName() {
+		return name;
+	}
+
+	public DataType getValue() {
+		return value;
+	}
+	
+	public void setValue(DataType value) {
+		this.value = value;
+	}
+}

+ 21 - 0
test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/EventNotification.java

@@ -0,0 +1,21 @@
+/**
+ * Copyright (c) 2011 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.runtime.java;
+
+import org.yakindu.sct.runtime.java.Event;
+
+public class EventNotification extends Notification<Event<?>> {
+
+	public EventNotification(Event<?> element) {
+		super(NotificationType.EventNotification, element);
+	}
+
+}

+ 17 - 0
test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/INotificationListener.java

@@ -0,0 +1,17 @@
+/**
+ * Copyright (c) 2011 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.runtime.java;
+
+public interface INotificationListener {
+	
+	public void notify(Notification<?> notification);
+	
+}

+ 18 - 0
test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/INotificationSender.java

@@ -0,0 +1,18 @@
+/**
+ * Copyright (c) 2011 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.runtime.java;
+
+public interface INotificationSender {
+	
+	public boolean addNotificationListener(INotificationListener listener);
+	
+	public boolean removeNotificationListener(INotificationListener listener);
+}

+ 18 - 0
test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/IStatemachine.java

@@ -0,0 +1,18 @@
+/**
+ * Copyright (c) 2011 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.runtime.java;
+
+public interface IStatemachine {
+	
+	public void init();
+
+	public void runCycle();
+}

+ 21 - 0
test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/ITimedStatemachine.java

@@ -0,0 +1,21 @@
+/**
+ * Copyright (c) 2011 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.runtime.java;
+
+import org.yakindu.sct.runtime.java.INotificationListener;
+
+public interface ITimedStatemachine extends
+		IStatemachine, INotificationListener {
+
+	public void setTimerHandler(ITimerHandler timerHandler);
+
+	public ITimerHandler getTimerHandler();
+}

+ 18 - 0
test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/ITimerHandler.java

@@ -0,0 +1,18 @@
+/**
+ * Copyright (c) 2011 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.runtime.java;
+
+public interface ITimerHandler {
+	
+	public void setTimer(TimeEvent event, long time);
+	
+	public void resetTimer(TimeEvent event);
+}

+ 31 - 0
test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/Notification.java

@@ -0,0 +1,31 @@
+/**
+ * Copyright (c) 2011 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.runtime.java;
+
+public class Notification<Element> {
+	
+	private NotificationType notificationType;
+	
+	private Element element;
+
+	public Notification(NotificationType notificationType, Element element) {
+		this.notificationType = notificationType;
+		this.element = element;
+	}
+	
+	public NotificationType getNotificationType() {
+		return notificationType;
+	}
+
+	public Element getElement() {
+		return element;
+	}
+}

+ 33 - 0
test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/NotificationSender.java

@@ -0,0 +1,33 @@
+/**
+ * Copyright (c) 2011 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.runtime.java;
+
+import java.util.HashSet;
+import java.util.Set;
+
+public class NotificationSender implements INotificationSender {
+
+	private Set<INotificationListener> listeners = new HashSet<INotificationListener>();
+	
+	public boolean addNotificationListener(INotificationListener listener) {
+		return listeners.add(listener);
+	}
+	
+	public boolean removeNotificationListener(INotificationListener listener) {
+		return listeners.remove(listener);
+	}
+	
+	protected void notifyListeners(Notification<?> notification) {
+		for (INotificationListener listener : listeners) {
+			listener.notify(notification);
+		}
+	}
+}

+ 15 - 0
test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/NotificationType.java

@@ -0,0 +1,15 @@
+/**
+ * Copyright (c) 2011 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.runtime.java;
+
+public enum NotificationType {
+	EventNotification,
+}

+ 29 - 0
test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/TimeEvent.java

@@ -0,0 +1,29 @@
+/**
+ * Copyright (c) 2011 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.runtime.java;
+
+public class TimeEvent extends Event<Boolean> {
+	
+	private long time = -1;
+	
+	public TimeEvent(String name, boolean periodic) {
+		super(name, periodic);
+	}
+	
+	public void setTime(long time){
+		this.time = time;
+	}
+	
+	public long getTime(){
+		return time;
+	}
+}
+

+ 68 - 0
test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/TimerHandler.java

@@ -0,0 +1,68 @@
+/**
+ * Copyright (c) 2011 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.runtime.java;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Timer;
+import java.util.TimerTask;
+
+import org.yakindu.sct.runtime.java.EventNotification;
+
+public class TimerHandler implements ITimerHandler {
+
+	private final ITimedStatemachine statemachine;
+
+	private final Timer timer = new Timer();
+
+	private final Map<TimeEvent, TimerTask> timerTaskMap = new HashMap<TimeEvent, TimerTask>();;
+
+	public TimerHandler(ITimedStatemachine statemachine) {
+		this.statemachine = statemachine;
+	}
+
+	@Override
+	public void setTimer(final TimeEvent event, long time) {
+		// Reset existing TimerTask for event. This step isn't necessary if
+		// timer tasks are properly reset by sexec model.
+		if (timerTaskMap.containsKey(event)) {
+			resetTimer(event);
+		}
+
+		// Create a new TimerTask for given event.
+		timerTaskMap.put(event, new TimerTask() {
+			@Override
+			public void run() {
+				statemachine.notify(new EventNotification(event));
+			}
+		});
+		
+		//set time field of event
+		event.setTime(time);
+		
+		//start scheduling the timer.
+		if (event.getValue()) {
+			timer.scheduleAtFixedRate(timerTaskMap.get(event), time, time);
+		}
+		else {
+			timer.schedule(timerTaskMap.get(event), time);
+		}
+	}
+
+	@Override
+	public void resetTimer(TimeEvent event) {
+		if (timerTaskMap.containsKey(event) && timerTaskMap.get(event) != null) {
+			timerTaskMap.get(event).cancel();
+			timer.purge();
+		}
+		timerTaskMap.remove(event);
+	}
+}

+ 30 - 0
test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/interfacetest/InterfaceDefault.java

@@ -0,0 +1,30 @@
+/**
+ * Copyright (c) 2011 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.runtime.java.interfacetest;
+
+import org.yakindu.sct.runtime.java.Event;
+import org.yakindu.sct.runtime.java.INotificationSender;
+
+public interface InterfaceDefault extends INotificationSender {
+	
+	public void raiseEvent1();
+	public boolean isRaisedEvent2();
+		
+	public Event<Integer> getEventEvent2();
+	
+	
+	public boolean getVarVar1();
+	public void setVarVar1(boolean value);	
+	public double getVarVar2();
+	public void setVarVar2(double value);	
+	public int getVarVar3();
+	public void setVarVar3(int value);	
+}

+ 85 - 0
test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/interfacetest/InterfaceDefaultImpl.java

@@ -0,0 +1,85 @@
+/**
+ * Copyright (c) 2011 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.runtime.java.interfacetest;
+
+import org.yakindu.sct.runtime.java.EventNotification;
+import org.yakindu.sct.runtime.java.Event;
+import org.yakindu.sct.runtime.java.NotificationSender;
+
+public class InterfaceDefaultImpl extends NotificationSender implements InterfaceDefault {
+	
+	private final Event<Void> EventEvent1 = new Event<Void>("event1", null); 
+	private final Event<Integer> EventEvent2 = new Event<Integer>("event2", 0); 
+	
+	private InterfaceTestAbstractBaseStatemachine statemachine; 
+	
+	public InterfaceDefaultImpl(InterfaceTestAbstractBaseStatemachine statemachine) {
+		this.statemachine = statemachine;
+	}
+	
+	public void raiseEvent1() {
+		statemachine.getOccuredEvents().add(EventEvent1);
+	}
+	
+	
+	public Event<Void> getEventEvent1() {
+		return EventEvent1;
+	}
+	
+	public void raiseEvent2() {
+		statemachine.getOccuredEvents().add(EventEvent2);
+		statemachine.getOutEvents().add(EventEvent2);
+		notifyListeners(new EventNotification(EventEvent2));
+	}
+	
+	public void raiseEvent2(int value) {
+		EventEvent2.setValue(value);
+		statemachine.getOccuredEvents().add(EventEvent2);
+		statemachine.getOutEvents().add(EventEvent2);
+		notifyListeners(new EventNotification(EventEvent2));
+	}
+	
+	public Event<Integer> getEventEvent2() {
+		return EventEvent2;
+	}
+	
+	public boolean isRaisedEvent2() {
+		return statemachine.getOutEvents().contains(EventEvent2);
+	}
+	
+	private boolean varVar1;
+	
+	public boolean getVarVar1() {
+		return varVar1;
+	}
+	
+	public void setVarVar1(boolean value) {
+		varVar1 = value;
+	}	
+	private double varVar2 = 2.3;
+	
+	public double getVarVar2() {
+		return varVar2;
+	}
+	
+	public void setVarVar2(double value) {
+		varVar2 = value;
+	}	
+	private int varVar3 = 1;
+	
+	public int getVarVar3() {
+		return varVar3;
+	}
+	
+	public void setVarVar3(int value) {
+		varVar3 = value;
+	}	
+}

+ 26 - 0
test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/interfacetest/InterfaceOther.java

@@ -0,0 +1,26 @@
+/**
+ * Copyright (c) 2011 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.runtime.java.interfacetest;
+
+import org.yakindu.sct.runtime.java.Event;
+import org.yakindu.sct.runtime.java.INotificationSender;
+
+public interface InterfaceOther extends INotificationSender {
+	
+	public void raiseEvent3();
+	public boolean isRaisedEvent4();
+		
+	public Event<Void> getEventEvent4();
+	
+	
+	public int getVarV1();
+	public void setVarV1(int value);	
+}

+ 61 - 0
test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/interfacetest/InterfaceOtherImpl.java

@@ -0,0 +1,61 @@
+/**
+ * Copyright (c) 2011 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.runtime.java.interfacetest;
+
+import org.yakindu.sct.runtime.java.EventNotification;
+import org.yakindu.sct.runtime.java.Event;
+import org.yakindu.sct.runtime.java.NotificationSender;
+
+public class InterfaceOtherImpl extends NotificationSender implements InterfaceOther {
+	
+	private final Event<Void> EventEvent3 = new Event<Void>("event3", null); 
+	private final Event<Void> EventEvent4 = new Event<Void>("event4", null); 
+	
+	private InterfaceTestAbstractBaseStatemachine statemachine; 
+	
+	public InterfaceOtherImpl(InterfaceTestAbstractBaseStatemachine statemachine) {
+		this.statemachine = statemachine;
+	}
+	
+	public void raiseEvent3() {
+		statemachine.getOccuredEvents().add(EventEvent3);
+	}
+	
+	
+	public Event<Void> getEventEvent3() {
+		return EventEvent3;
+	}
+	
+	public void raiseEvent4() {
+		statemachine.getOccuredEvents().add(EventEvent4);
+		statemachine.getOutEvents().add(EventEvent4);
+		notifyListeners(new EventNotification(EventEvent4));
+	}
+	
+	
+	public Event<Void> getEventEvent4() {
+		return EventEvent4;
+	}
+	
+	public boolean isRaisedEvent4() {
+		return statemachine.getOutEvents().contains(EventEvent4);
+	}
+	
+	private int varV1 = 5;
+	
+	public int getVarV1() {
+		return varV1;
+	}
+	
+	public void setVarV1(int value) {
+		varV1 = value;
+	}	
+}

+ 238 - 0
test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/interfacetest/InterfaceTestAbstractBaseStatemachine.java

@@ -0,0 +1,238 @@
+/**
+ * Copyright (c) 2011 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.runtime.java.interfacetest;
+
+import java.util.Collection;
+import java.util.EnumSet;
+import java.util.HashSet;
+import java.util.Set;
+
+import org.yakindu.sct.runtime.java.Event;
+import org.yakindu.sct.runtime.java.ITimedStatemachine;
+import org.yakindu.sct.runtime.java.ITimerHandler;
+import org.yakindu.sct.runtime.java.TimerHandler;
+import org.yakindu.sct.runtime.java.EventNotification;
+import org.yakindu.sct.runtime.java.Notification;
+
+public abstract class InterfaceTestAbstractBaseStatemachine implements ITimedStatemachine {
+	
+	
+	
+	
+	public enum State {
+	      State1,
+	      State2,
+	      State3,
+	      State4,
+	};
+	
+	private InterfaceDefaultImpl interfaceDefault;
+	private InterfaceOtherImpl interfaceOther;
+	private InterfaceThirdImpl interfaceThird;
+	
+	
+
+	private final Set<State> activeStates = EnumSet.noneOf(State.class);
+	
+	private final Collection<Event<?>> occuredEvents;
+	
+	private final Collection<Event<?>> outEvents;
+	
+	private ITimerHandler timerHandler;
+	
+	public InterfaceTestAbstractBaseStatemachine(Collection<Event<?>> occuredEvents) {
+		this.occuredEvents = occuredEvents;
+		this.outEvents = new HashSet<Event<?>>();
+		interfaceDefault = new InterfaceDefaultImpl(this);
+		interfaceOther = new InterfaceOtherImpl(this);
+		interfaceThird = new InterfaceThirdImpl(this);
+	}
+	
+	protected Collection<Event<?>> getOccuredEvents() {
+		return occuredEvents;
+	}
+	
+	protected Collection<Event<?>> getOutEvents(){
+		return outEvents;
+	}
+		
+	public void entry() {
+	activeStates.add(State.State1);
+		
+		
+	}
+	
+	protected boolean eventOccured() {
+		return !getOccuredEvents().isEmpty();
+	}
+	
+	@Override
+	public void init() {
+		
+	}
+
+	@Override
+	public void setTimerHandler(ITimerHandler timerHandler) {
+		this.timerHandler = timerHandler;
+	}
+
+	@Override
+	public ITimerHandler getTimerHandler() {
+		if (timerHandler == null) {
+			timerHandler = new TimerHandler(this);
+		}
+		return timerHandler;
+	}
+	
+	@Override
+	public void notify(Notification<?> notification) {
+		if (notification instanceof EventNotification) {
+			EventNotification eventNotification = (EventNotification) notification;
+			getOccuredEvents().add(eventNotification.getElement());
+		}
+	}
+	
+	public Set<State> getActiveStates(){
+		return EnumSet.copyOf(activeStates);
+	}
+	
+	public InterfaceDefault getInterfaceDefault() {
+		return interfaceDefault;
+	}
+	
+	public InterfaceOther getInterfaceOther() {
+		return interfaceOther;
+	}
+	
+	public InterfaceThird getInterfaceThird() {
+		return interfaceThird;
+	}
+	
+
+	private boolean conditionState1Tr0(Collection<?> events) {
+		return (getOccuredEvents().contains(interfaceDefault.getEventEvent1()) && (interfaceDefault.getVarVar2() > 0));
+	}
+	private boolean conditionState1Tr1(Collection<?> events) {
+		return (getOccuredEvents().contains(interfaceOther.getEventEvent3()) && (interfaceDefault.getVarVar3() == 1));
+	}
+	private boolean conditionState1Tr2(Collection<?> events) {
+		return (getOccuredEvents().contains(interfaceThird.getEventEvent5()) && (interfaceDefault.getVarVar1() == true));
+	}
+	private boolean conditionState2Tr0(Collection<?> events) {
+		return getOccuredEvents().contains(interfaceDefault.getEventEvent1());
+	}
+	private boolean conditionState3Tr0(Collection<?> events) {
+		return getOccuredEvents().contains(interfaceOther.getEventEvent3());
+	}
+	private boolean conditionState4Tr0(Collection<?> events) {
+		return getOccuredEvents().contains(interfaceThird.getEventEvent5());
+	}
+	private void actionsState1Tr0() {
+	activeStates.remove(State.State1);
+	activeStates.add(State.State2);
+entryActionsState2();
+
+	}
+	private void actionsState1Tr1() {
+	activeStates.remove(State.State1);
+	activeStates.add(State.State3);
+entryActionsState3();
+
+	}
+	private void actionsState1Tr2() {
+	activeStates.remove(State.State1);
+	activeStates.add(State.State4);
+entryActionsState4();
+
+	}
+	private void actionsState2Tr0() {
+	activeStates.remove(State.State2);
+	activeStates.add(State.State1);
+
+	}
+	private void actionsState3Tr0() {
+	activeStates.remove(State.State3);
+	activeStates.add(State.State1);
+
+	}
+	private void actionsState4Tr0() {
+	activeStates.remove(State.State4);
+	activeStates.add(State.State1);
+
+	}
+	private void cycleState1(Collection<?> events) {
+if (conditionState1Tr0(events) ) { 
+actionsState1Tr0();
+}
+else {
+if (conditionState1Tr1(events) ) { 
+actionsState1Tr1();
+}
+else {
+if (conditionState1Tr2(events) ) { 
+actionsState1Tr2();
+}
+}
+}
+	}
+	private void cycleState2(Collection<?> events) {
+if (conditionState2Tr0(events) ) { 
+actionsState2Tr0();
+}
+	}
+	private void cycleState3(Collection<?> events) {
+if (conditionState3Tr0(events) ) { 
+actionsState3Tr0();
+}
+	}
+	private void cycleState4(Collection<?> events) {
+if (conditionState4Tr0(events) ) { 
+actionsState4Tr0();
+}
+	}
+	private void entryActionsState2() {
+	interfaceDefault.raiseEvent2(22);
+
+
+	}
+	private void entryActionsState3() {
+	interfaceOther.raiseEvent4();
+
+
+	}
+	private void entryActionsState4() {
+	interfaceThird.raiseEvent6(true);
+
+
+	}
+
+	protected void runCycle(Collection<?> events) {
+		getOutEvents().clear();
+		for (State state : activeStates) {
+			switch (state) {
+    		case State1:
+        		cycleState1(events);
+        		break;
+    		case State2:
+        		cycleState2(events);
+        		break;
+    		case State3:
+        		cycleState3(events);
+        		break;
+    		case State4:
+        		cycleState4(events);
+        		break;
+			default:
+				// no state found
+			}
+		}
+	}
+}

+ 29 - 0
test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/interfacetest/InterfaceTestCyleBasedStatemachine.java

@@ -0,0 +1,29 @@
+
+/**
+ * Copyright (c) 2011 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.runtime.java.interfacetest;
+
+import java.util.HashSet;
+
+import org.yakindu.sct.runtime.java.Event;
+
+public class InterfaceTestCyleBasedStatemachine extends InterfaceTestAbstractBaseStatemachine {
+
+	public InterfaceTestCyleBasedStatemachine() {
+		super(new HashSet<Event<?>>());
+	}
+
+	public void runCycle() {
+		runCycle(getOccuredEvents());
+		// remove all events
+		getOccuredEvents().clear();
+	}
+}

+ 37 - 0
test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/interfacetest/InterfaceTestEventBasedStatemachine.java

@@ -0,0 +1,37 @@
+/**
+ * Copyright (c) 2011 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.runtime.java.interfacetest;
+
+import java.util.Collections;
+import java.util.LinkedList;
+import java.util.Queue;
+
+import org.yakindu.sct.runtime.java.Event;
+
+public class InterfaceTestEventBasedStatemachine extends InterfaceTestAbstractBaseStatemachine {
+
+	public InterfaceTestEventBasedStatemachine() {
+		super(new LinkedList<Event<?>>());
+	}
+	
+	@Override
+	protected Queue<Event<?>> getOccuredEvents() {
+		return (Queue<Event<?>>) super.getOccuredEvents();
+	}
+	
+	@Override
+	public void runCycle() {
+		if (eventOccured()) {
+			Event<?> event = getOccuredEvents().poll();
+			runCycle(Collections.singletonList(event));
+		}
+	}
+}

+ 26 - 0
test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/interfacetest/InterfaceThird.java

@@ -0,0 +1,26 @@
+/**
+ * Copyright (c) 2011 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.runtime.java.interfacetest;
+
+import org.yakindu.sct.runtime.java.Event;
+import org.yakindu.sct.runtime.java.INotificationSender;
+
+public interface InterfaceThird extends INotificationSender {
+	
+	public void raiseEvent5();
+	public boolean isRaisedEvent6();
+		
+	public Event<Boolean> getEventEvent6();
+	
+	
+	public double getVarV1();
+	public void setVarV1(double value);	
+}

+ 67 - 0
test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/interfacetest/InterfaceThirdImpl.java

@@ -0,0 +1,67 @@
+/**
+ * Copyright (c) 2011 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.runtime.java.interfacetest;
+
+import org.yakindu.sct.runtime.java.EventNotification;
+import org.yakindu.sct.runtime.java.Event;
+import org.yakindu.sct.runtime.java.NotificationSender;
+
+public class InterfaceThirdImpl extends NotificationSender implements InterfaceThird {
+	
+	private final Event<Void> EventEvent5 = new Event<Void>("event5", null); 
+	private final Event<Boolean> EventEvent6 = new Event<Boolean>("event6", false); 
+	
+	private InterfaceTestAbstractBaseStatemachine statemachine; 
+	
+	public InterfaceThirdImpl(InterfaceTestAbstractBaseStatemachine statemachine) {
+		this.statemachine = statemachine;
+	}
+	
+	public void raiseEvent5() {
+		statemachine.getOccuredEvents().add(EventEvent5);
+	}
+	
+	
+	public Event<Void> getEventEvent5() {
+		return EventEvent5;
+	}
+	
+	public void raiseEvent6() {
+		statemachine.getOccuredEvents().add(EventEvent6);
+		statemachine.getOutEvents().add(EventEvent6);
+		notifyListeners(new EventNotification(EventEvent6));
+	}
+	
+	public void raiseEvent6(boolean value) {
+		EventEvent6.setValue(value);
+		statemachine.getOccuredEvents().add(EventEvent6);
+		statemachine.getOutEvents().add(EventEvent6);
+		notifyListeners(new EventNotification(EventEvent6));
+	}
+	
+	public Event<Boolean> getEventEvent6() {
+		return EventEvent6;
+	}
+	
+	public boolean isRaisedEvent6() {
+		return statemachine.getOutEvents().contains(EventEvent6);
+	}
+	
+	private double varV1;
+	
+	public double getVarV1() {
+		return varV1;
+	}
+	
+	public void setVarV1(double value) {
+		varV1 = value;
+	}	
+}

+ 26 - 0
test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/test_deephistory/InterfaceDefault.java

@@ -0,0 +1,26 @@
+/**
+ * Copyright (c) 2011 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.runtime.java.test_deephistory;
+
+
+public interface InterfaceDefault {
+	
+	public void raiseEvent1();
+	public void raiseEvent2();
+	public void raiseEvent3();
+	public void raiseEvent4();
+	public void raiseEvent5();
+	public void raiseEvent6();
+	public void raiseEvent7();
+	public void raiseEvent8();
+	public void raiseEvent9();
+	
+}

+ 116 - 0
test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/test_deephistory/InterfaceDefaultImpl.java

@@ -0,0 +1,116 @@
+/**
+ * Copyright (c) 2011 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.runtime.java.test_deephistory;
+
+import org.yakindu.sct.runtime.java.EventNotification;
+import org.yakindu.sct.runtime.java.Event;
+
+public class InterfaceDefaultImpl implements InterfaceDefault {
+	
+	private final Event<Void> EventEvent1 = new Event<Void>("event1", null); 
+	private final Event<Void> EventEvent2 = new Event<Void>("event2", null); 
+	private final Event<Void> EventEvent3 = new Event<Void>("event3", null); 
+	private final Event<Void> EventEvent4 = new Event<Void>("event4", null); 
+	private final Event<Void> EventEvent5 = new Event<Void>("event5", null); 
+	private final Event<Void> EventEvent6 = new Event<Void>("event6", null); 
+	private final Event<Void> EventEvent7 = new Event<Void>("event7", null); 
+	private final Event<Void> EventEvent8 = new Event<Void>("event8", null); 
+	private final Event<Void> EventEvent9 = new Event<Void>("event9", null); 
+	
+	private Test_DeepHistoryAbstractBaseStatemachine statemachine; 
+	
+	public InterfaceDefaultImpl(Test_DeepHistoryAbstractBaseStatemachine statemachine) {
+		this.statemachine = statemachine;
+	}
+	
+	public void raiseEvent1() {
+		statemachine.getOccuredEvents().add(EventEvent1);
+	}
+	
+	
+	public Event<Void> getEventEvent1() {
+		return EventEvent1;
+	}
+	
+	public void raiseEvent2() {
+		statemachine.getOccuredEvents().add(EventEvent2);
+	}
+	
+	
+	public Event<Void> getEventEvent2() {
+		return EventEvent2;
+	}
+	
+	public void raiseEvent3() {
+		statemachine.getOccuredEvents().add(EventEvent3);
+	}
+	
+	
+	public Event<Void> getEventEvent3() {
+		return EventEvent3;
+	}
+	
+	public void raiseEvent4() {
+		statemachine.getOccuredEvents().add(EventEvent4);
+	}
+	
+	
+	public Event<Void> getEventEvent4() {
+		return EventEvent4;
+	}
+	
+	public void raiseEvent5() {
+		statemachine.getOccuredEvents().add(EventEvent5);
+	}
+	
+	
+	public Event<Void> getEventEvent5() {
+		return EventEvent5;
+	}
+	
+	public void raiseEvent6() {
+		statemachine.getOccuredEvents().add(EventEvent6);
+	}
+	
+	
+	public Event<Void> getEventEvent6() {
+		return EventEvent6;
+	}
+	
+	public void raiseEvent7() {
+		statemachine.getOccuredEvents().add(EventEvent7);
+	}
+	
+	
+	public Event<Void> getEventEvent7() {
+		return EventEvent7;
+	}
+	
+	public void raiseEvent8() {
+		statemachine.getOccuredEvents().add(EventEvent8);
+	}
+	
+	
+	public Event<Void> getEventEvent8() {
+		return EventEvent8;
+	}
+	
+	public void raiseEvent9() {
+		statemachine.getOccuredEvents().add(EventEvent9);
+	}
+	
+	
+	public Event<Void> getEventEvent9() {
+		return EventEvent9;
+	}
+	
+	
+}

+ 247 - 0
test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/test_deephistory/Test_DeepHistoryAbstractBaseStatemachine.java

@@ -0,0 +1,247 @@
+/**
+ * Copyright (c) 2011 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.runtime.java.test_deephistory;
+
+import java.util.Collection;
+import java.util.EnumSet;
+import java.util.HashSet;
+import java.util.Set;
+
+import org.yakindu.sct.runtime.java.Event;
+import org.yakindu.sct.runtime.java.ITimedStatemachine;
+import org.yakindu.sct.runtime.java.ITimerHandler;
+import org.yakindu.sct.runtime.java.TimerHandler;
+import org.yakindu.sct.runtime.java.EventNotification;
+import org.yakindu.sct.runtime.java.Notification;
+
+public abstract class Test_DeepHistoryAbstractBaseStatemachine implements ITimedStatemachine {
+	
+	
+	
+	
+	public enum State {
+	      State1,
+	      State2,
+	      State3,
+	      State4,
+	      State6,
+	      State7,
+	      State8,
+	      State9,
+	      State5,
+	};
+	
+	private InterfaceDefaultImpl interfaceDefault;
+	
+	
+
+	private final Set<State> activeStates = EnumSet.noneOf(State.class);
+	
+	private final Collection<Event<?>> occuredEvents;
+	
+	private final Collection<Event<?>> outEvents;
+	
+	private ITimerHandler timerHandler;
+	
+	public Test_DeepHistoryAbstractBaseStatemachine(Collection<Event<?>> occuredEvents) {
+		this.occuredEvents = occuredEvents;
+		this.outEvents = new HashSet<Event<?>>();
+		interfaceDefault = new InterfaceDefaultImpl(this);
+	}
+	
+	protected Collection<Event<?>> getOccuredEvents() {
+		return occuredEvents;
+	}
+	
+	protected Collection<Event<?>> getOutEvents(){
+		return outEvents;
+	}
+		
+	public void entry() {
+	activeStates.add(State.State1);
+		
+		
+	}
+	
+	protected boolean eventOccured() {
+		return !getOccuredEvents().isEmpty();
+	}
+	
+	@Override
+	public void init() {
+		
+	}
+
+	@Override
+	public void setTimerHandler(ITimerHandler timerHandler) {
+		this.timerHandler = timerHandler;
+	}
+
+	@Override
+	public ITimerHandler getTimerHandler() {
+		if (timerHandler == null) {
+			timerHandler = new TimerHandler(this);
+		}
+		return timerHandler;
+	}
+	
+	@Override
+	public void notify(Notification<?> notification) {
+		if (notification instanceof EventNotification) {
+			EventNotification eventNotification = (EventNotification) notification;
+			getOccuredEvents().add(eventNotification.getElement());
+		}
+	}
+	
+	public Set<State> getActiveStates(){
+		return EnumSet.copyOf(activeStates);
+	}
+	
+	public InterfaceDefault getInterfaceDefault() {
+		return interfaceDefault;
+	}
+	
+
+	private boolean conditionState1Tr0(Collection<?> events) {
+		return getOccuredEvents().contains(interfaceDefault.getEventEvent1());
+	}
+	private boolean conditionState2Tr0(Collection<?> events) {
+		return getOccuredEvents().contains(interfaceDefault.getEventEvent2());
+	}
+	private boolean conditionState3Tr0(Collection<?> events) {
+		return getOccuredEvents().contains(interfaceDefault.getEventEvent3());
+	}
+	private boolean conditionState4Tr0(Collection<?> events) {
+		return getOccuredEvents().contains(interfaceDefault.getEventEvent4());
+	}
+	private boolean conditionState6Tr0(Collection<?> events) {
+		return getOccuredEvents().contains(interfaceDefault.getEventEvent5());
+	}
+	private boolean conditionState7Tr0(Collection<?> events) {
+		return getOccuredEvents().contains(interfaceDefault.getEventEvent6());
+	}
+	private boolean conditionState8Tr0(Collection<?> events) {
+		return getOccuredEvents().contains(interfaceDefault.getEventEvent7());
+	}
+	private boolean conditionState9Tr0(Collection<?> events) {
+		return getOccuredEvents().contains(interfaceDefault.getEventEvent8());
+	}
+	private void actionsState1Tr0() {
+	activeStates.remove(State.State1);
+	activeStates.add(State.State2);
+
+	}
+	private void actionsState2Tr0() {
+	activeStates.remove(State.State2);
+	activeStates.add(State.State1);
+
+	}
+	private void actionsState3Tr0() {
+	activeStates.remove(State.State3);
+	activeStates.add(State.State4);
+
+	}
+	private void actionsState4Tr0() {
+	activeStates.remove(State.State4);
+	activeStates.add(State.State5);
+
+	}
+	private void actionsState6Tr0() {
+	activeStates.remove(State.State6);
+	activeStates.add(State.State7);
+
+	}
+	private void actionsState7Tr0() {
+	activeStates.remove(State.State7);
+	activeStates.add(State.State6);
+
+	}
+	private void actionsState8Tr0() {
+	activeStates.remove(State.State8);
+	activeStates.add(State.State9);
+
+	}
+	private void actionsState9Tr0() {
+	activeStates.remove(State.State9);
+	activeStates.add(State.State8);
+
+	}
+	private void cycleState1(Collection<?> events) {
+if (conditionState1Tr0(events) ) { 
+actionsState1Tr0();
+}
+	}
+	private void cycleState2(Collection<?> events) {
+	}
+	private void cycleState3(Collection<?> events) {
+if (conditionState3Tr0(events) ) { 
+actionsState3Tr0();
+}
+	}
+	private void cycleState4(Collection<?> events) {
+	}
+	private void cycleState6(Collection<?> events) {
+if (conditionState6Tr0(events) ) { 
+actionsState6Tr0();
+}
+	}
+	private void cycleState7(Collection<?> events) {
+	}
+	private void cycleState8(Collection<?> events) {
+if (conditionState8Tr0(events) ) { 
+actionsState8Tr0();
+}
+	}
+	private void cycleState9(Collection<?> events) {
+if (conditionState9Tr0(events) ) { 
+actionsState9Tr0();
+}
+	}
+	private void cycleState5(Collection<?> events) {
+	}
+
+	protected void runCycle(Collection<?> events) {
+		getOutEvents().clear();
+		for (State state : activeStates) {
+			switch (state) {
+    		case State1:
+        		cycleState1(events);
+        		break;
+    		case State2:
+        		cycleState2(events);
+        		break;
+    		case State3:
+        		cycleState3(events);
+        		break;
+    		case State4:
+        		cycleState4(events);
+        		break;
+    		case State6:
+        		cycleState6(events);
+        		break;
+    		case State7:
+        		cycleState7(events);
+        		break;
+    		case State8:
+        		cycleState8(events);
+        		break;
+    		case State9:
+        		cycleState9(events);
+        		break;
+    		case State5:
+        		cycleState5(events);
+        		break;
+			default:
+				// no state found
+			}
+		}
+	}
+}

+ 29 - 0
test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/test_deephistory/Test_DeepHistoryCyleBasedStatemachine.java

@@ -0,0 +1,29 @@
+
+/**
+ * Copyright (c) 2011 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.runtime.java.test_deephistory;
+
+import java.util.HashSet;
+
+import org.yakindu.sct.runtime.java.Event;
+
+public class Test_DeepHistoryCyleBasedStatemachine extends Test_DeepHistoryAbstractBaseStatemachine {
+
+	public Test_DeepHistoryCyleBasedStatemachine() {
+		super(new HashSet<Event<?>>());
+	}
+
+	public void runCycle() {
+		runCycle(getOccuredEvents());
+		// remove all events
+		getOccuredEvents().clear();
+	}
+}

+ 37 - 0
test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/test_deephistory/Test_DeepHistoryEventBasedStatemachine.java

@@ -0,0 +1,37 @@
+/**
+ * Copyright (c) 2011 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.runtime.java.test_deephistory;
+
+import java.util.Collections;
+import java.util.LinkedList;
+import java.util.Queue;
+
+import org.yakindu.sct.runtime.java.Event;
+
+public class Test_DeepHistoryEventBasedStatemachine extends Test_DeepHistoryAbstractBaseStatemachine {
+
+	public Test_DeepHistoryEventBasedStatemachine() {
+		super(new LinkedList<Event<?>>());
+	}
+	
+	@Override
+	protected Queue<Event<?>> getOccuredEvents() {
+		return (Queue<Event<?>>) super.getOccuredEvents();
+	}
+	
+	@Override
+	public void runCycle() {
+		if (eventOccured()) {
+			Event<?> event = getOccuredEvents().poll();
+			runCycle(Collections.singletonList(event));
+		}
+	}
+}

+ 33 - 0
test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/test_expression/InterfaceDefault.java

@@ -0,0 +1,33 @@
+/**
+ * Copyright (c) 2011 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.runtime.java.test_expression;
+
+import org.yakindu.sct.runtime.java.Event;
+import org.yakindu.sct.runtime.java.INotificationSender;
+
+public interface InterfaceDefault extends INotificationSender {
+	
+	public void raiseEvent1();
+	public void raiseEvent1(int value);
+	public boolean isRaisedEvent2();
+		
+	public Event<Double> getEventEvent2();
+	
+	
+	public int getVarVar1();
+	public void setVarVar1(int value);	
+	public int getVarVar2();
+	public void setVarVar2(int value);	
+	public double getVarVar3();
+	public void setVarVar3(double value);	
+	public double getVarVar4();
+	public void setVarVar4(double value);	
+}

+ 98 - 0
test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/test_expression/InterfaceDefaultImpl.java

@@ -0,0 +1,98 @@
+/**
+ * Copyright (c) 2011 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.runtime.java.test_expression;
+
+import org.yakindu.sct.runtime.java.EventNotification;
+import org.yakindu.sct.runtime.java.Event;
+import org.yakindu.sct.runtime.java.NotificationSender;
+
+public class InterfaceDefaultImpl extends NotificationSender implements InterfaceDefault {
+	
+	private final Event<Integer> EventEvent1 = new Event<Integer>("event1", 0); 
+	private final Event<Double> EventEvent2 = new Event<Double>("event2", 0D); 
+	
+	private Test_ExpressionAbstractBaseStatemachine statemachine; 
+	
+	public InterfaceDefaultImpl(Test_ExpressionAbstractBaseStatemachine statemachine) {
+		this.statemachine = statemachine;
+	}
+	
+	public void raiseEvent1() {
+		statemachine.getOccuredEvents().add(EventEvent1);
+	}
+	
+	public void raiseEvent1(int value) {
+		EventEvent1.setValue(value);
+		statemachine.getOccuredEvents().add(EventEvent1);
+	}
+	
+	public Event<Integer> getEventEvent1() {
+		return EventEvent1;
+	}
+	
+	public void raiseEvent2() {
+		statemachine.getOccuredEvents().add(EventEvent2);
+		statemachine.getOutEvents().add(EventEvent2);
+		notifyListeners(new EventNotification(EventEvent2));
+	}
+	
+	public void raiseEvent2(double value) {
+		EventEvent2.setValue(value);
+		statemachine.getOccuredEvents().add(EventEvent2);
+		statemachine.getOutEvents().add(EventEvent2);
+		notifyListeners(new EventNotification(EventEvent2));
+	}
+	
+	public Event<Double> getEventEvent2() {
+		return EventEvent2;
+	}
+	
+	public boolean isRaisedEvent2() {
+		return statemachine.getOutEvents().contains(EventEvent2);
+	}
+	
+	private int varVar1 = 6;
+	
+	public int getVarVar1() {
+		return varVar1;
+	}
+	
+	public void setVarVar1(int value) {
+		varVar1 = value;
+	}	
+	private int varVar2;
+	
+	public int getVarVar2() {
+		return varVar2;
+	}
+	
+	public void setVarVar2(int value) {
+		varVar2 = value;
+	}	
+	private double varVar3 = 19.4;
+	
+	public double getVarVar3() {
+		return varVar3;
+	}
+	
+	public void setVarVar3(double value) {
+		varVar3 = value;
+	}	
+	private double varVar4;
+	
+	public double getVarVar4() {
+		return varVar4;
+	}
+	
+	public void setVarVar4(double value) {
+		varVar4 = value;
+	}	
+}

+ 148 - 0
test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/test_expression/Test_ExpressionAbstractBaseStatemachine.java

@@ -0,0 +1,148 @@
+/**
+ * Copyright (c) 2011 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.runtime.java.test_expression;
+
+import java.util.Collection;
+import java.util.EnumSet;
+import java.util.HashSet;
+import java.util.Set;
+
+import org.yakindu.sct.runtime.java.Event;
+import org.yakindu.sct.runtime.java.ITimedStatemachine;
+import org.yakindu.sct.runtime.java.ITimerHandler;
+import org.yakindu.sct.runtime.java.TimerHandler;
+import org.yakindu.sct.runtime.java.EventNotification;
+import org.yakindu.sct.runtime.java.Notification;
+
+public abstract class Test_ExpressionAbstractBaseStatemachine implements ITimedStatemachine {
+	
+	
+	
+	
+	public enum State {
+	      State1,
+	      State2,
+	};
+	
+	private InterfaceDefaultImpl interfaceDefault;
+	
+	
+
+	private final Set<State> activeStates = EnumSet.noneOf(State.class);
+	
+	private final Collection<Event<?>> occuredEvents;
+	
+	private final Collection<Event<?>> outEvents;
+	
+	private ITimerHandler timerHandler;
+	
+	public Test_ExpressionAbstractBaseStatemachine(Collection<Event<?>> occuredEvents) {
+		this.occuredEvents = occuredEvents;
+		this.outEvents = new HashSet<Event<?>>();
+		interfaceDefault = new InterfaceDefaultImpl(this);
+	}
+	
+	protected Collection<Event<?>> getOccuredEvents() {
+		return occuredEvents;
+	}
+	
+	protected Collection<Event<?>> getOutEvents(){
+		return outEvents;
+	}
+		
+	public void entry() {
+	activeStates.add(State.State1);
+		
+		
+	}
+	
+	protected boolean eventOccured() {
+		return !getOccuredEvents().isEmpty();
+	}
+	
+	@Override
+	public void init() {
+		
+	}
+
+	@Override
+	public void setTimerHandler(ITimerHandler timerHandler) {
+		this.timerHandler = timerHandler;
+	}
+
+	@Override
+	public ITimerHandler getTimerHandler() {
+		if (timerHandler == null) {
+			timerHandler = new TimerHandler(this);
+		}
+		return timerHandler;
+	}
+	
+	@Override
+	public void notify(Notification<?> notification) {
+		if (notification instanceof EventNotification) {
+			EventNotification eventNotification = (EventNotification) notification;
+			getOccuredEvents().add(eventNotification.getElement());
+		}
+	}
+	
+	public Set<State> getActiveStates(){
+		return EnumSet.copyOf(activeStates);
+	}
+	
+	public InterfaceDefault getInterfaceDefault() {
+		return interfaceDefault;
+	}
+	
+
+	private boolean conditionState1Tr0(Collection<?> events) {
+		return getOccuredEvents().contains(interfaceDefault.getEventEvent1());
+	}
+	private boolean conditionState2Tr0(Collection<?> events) {
+		return getOccuredEvents().contains(interfaceDefault.getEventEvent1());
+	}
+	private void actionsState1Tr0() {
+	activeStates.remove(State.State1);
+	activeStates.add(State.State2);
+
+	}
+	private void actionsState2Tr0() {
+	activeStates.remove(State.State2);
+	activeStates.add(State.State1);
+
+	}
+	private void cycleState1(Collection<?> events) {
+if (conditionState1Tr0(events) ) { 
+actionsState1Tr0();
+}
+	}
+	private void cycleState2(Collection<?> events) {
+if (conditionState2Tr0(events) ) { 
+actionsState2Tr0();
+}
+	}
+
+	protected void runCycle(Collection<?> events) {
+		getOutEvents().clear();
+		for (State state : activeStates) {
+			switch (state) {
+    		case State1:
+        		cycleState1(events);
+        		break;
+    		case State2:
+        		cycleState2(events);
+        		break;
+			default:
+				// no state found
+			}
+		}
+	}
+}

+ 29 - 0
test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/test_expression/Test_ExpressionCyleBasedStatemachine.java

@@ -0,0 +1,29 @@
+
+/**
+ * Copyright (c) 2011 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.runtime.java.test_expression;
+
+import java.util.HashSet;
+
+import org.yakindu.sct.runtime.java.Event;
+
+public class Test_ExpressionCyleBasedStatemachine extends Test_ExpressionAbstractBaseStatemachine {
+
+	public Test_ExpressionCyleBasedStatemachine() {
+		super(new HashSet<Event<?>>());
+	}
+
+	public void runCycle() {
+		runCycle(getOccuredEvents());
+		// remove all events
+		getOccuredEvents().clear();
+	}
+}

+ 37 - 0
test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/test_expression/Test_ExpressionEventBasedStatemachine.java

@@ -0,0 +1,37 @@
+/**
+ * Copyright (c) 2011 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.runtime.java.test_expression;
+
+import java.util.Collections;
+import java.util.LinkedList;
+import java.util.Queue;
+
+import org.yakindu.sct.runtime.java.Event;
+
+public class Test_ExpressionEventBasedStatemachine extends Test_ExpressionAbstractBaseStatemachine {
+
+	public Test_ExpressionEventBasedStatemachine() {
+		super(new LinkedList<Event<?>>());
+	}
+	
+	@Override
+	protected Queue<Event<?>> getOccuredEvents() {
+		return (Queue<Event<?>>) super.getOccuredEvents();
+	}
+	
+	@Override
+	public void runCycle() {
+		if (eventOccured()) {
+			Event<?> event = getOccuredEvents().poll();
+			runCycle(Collections.singletonList(event));
+		}
+	}
+}

+ 37 - 0
test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/test_hierarchy/InterfaceDefault.java

@@ -0,0 +1,37 @@
+/**
+ * Copyright (c) 2011 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.runtime.java.test_hierarchy;
+
+
+public interface InterfaceDefault {
+	
+	public void raiseEvent1();
+	public void raiseEvent2();
+	public void raiseEvent3();
+	public void raiseEvent4();
+	public void raiseEvent5();
+	public void raiseEvent6();
+	public void raiseEvent7();
+	public void raiseEvent8();
+	public void raiseEvent9();
+	public void raiseEvent10();
+	public void raiseEvent11();
+	public void raiseEvent12();
+	public void raiseEvent13();
+	public void raiseEvent14();
+	public void raiseEvent15();
+	public void raiseEvent16();
+	
+	public int getVarS1();
+	public void setVarS1(int value);	
+	public int getVarS2();
+	public void setVarS2(int value);	
+}

+ 204 - 0
test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/test_hierarchy/InterfaceDefaultImpl.java

@@ -0,0 +1,204 @@
+/**
+ * Copyright (c) 2011 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.runtime.java.test_hierarchy;
+
+import org.yakindu.sct.runtime.java.EventNotification;
+import org.yakindu.sct.runtime.java.Event;
+
+public class InterfaceDefaultImpl implements InterfaceDefault {
+	
+	private final Event<Void> EventEvent1 = new Event<Void>("event1", null); 
+	private final Event<Void> EventEvent2 = new Event<Void>("event2", null); 
+	private final Event<Void> EventEvent3 = new Event<Void>("event3", null); 
+	private final Event<Void> EventEvent4 = new Event<Void>("event4", null); 
+	private final Event<Void> EventEvent5 = new Event<Void>("event5", null); 
+	private final Event<Void> EventEvent6 = new Event<Void>("event6", null); 
+	private final Event<Void> EventEvent7 = new Event<Void>("event7", null); 
+	private final Event<Void> EventEvent8 = new Event<Void>("event8", null); 
+	private final Event<Void> EventEvent9 = new Event<Void>("event9", null); 
+	private final Event<Void> EventEvent10 = new Event<Void>("event10", null); 
+	private final Event<Void> EventEvent11 = new Event<Void>("event11", null); 
+	private final Event<Void> EventEvent12 = new Event<Void>("event12", null); 
+	private final Event<Void> EventEvent13 = new Event<Void>("event13", null); 
+	private final Event<Void> EventEvent14 = new Event<Void>("event14", null); 
+	private final Event<Void> EventEvent15 = new Event<Void>("event15", null); 
+	private final Event<Void> EventEvent16 = new Event<Void>("event16", null); 
+	
+	private Test_HierarchyAbstractBaseStatemachine statemachine; 
+	
+	public InterfaceDefaultImpl(Test_HierarchyAbstractBaseStatemachine statemachine) {
+		this.statemachine = statemachine;
+	}
+	
+	public void raiseEvent1() {
+		statemachine.getOccuredEvents().add(EventEvent1);
+	}
+	
+	
+	public Event<Void> getEventEvent1() {
+		return EventEvent1;
+	}
+	
+	public void raiseEvent2() {
+		statemachine.getOccuredEvents().add(EventEvent2);
+	}
+	
+	
+	public Event<Void> getEventEvent2() {
+		return EventEvent2;
+	}
+	
+	public void raiseEvent3() {
+		statemachine.getOccuredEvents().add(EventEvent3);
+	}
+	
+	
+	public Event<Void> getEventEvent3() {
+		return EventEvent3;
+	}
+	
+	public void raiseEvent4() {
+		statemachine.getOccuredEvents().add(EventEvent4);
+	}
+	
+	
+	public Event<Void> getEventEvent4() {
+		return EventEvent4;
+	}
+	
+	public void raiseEvent5() {
+		statemachine.getOccuredEvents().add(EventEvent5);
+	}
+	
+	
+	public Event<Void> getEventEvent5() {
+		return EventEvent5;
+	}
+	
+	public void raiseEvent6() {
+		statemachine.getOccuredEvents().add(EventEvent6);
+	}
+	
+	
+	public Event<Void> getEventEvent6() {
+		return EventEvent6;
+	}
+	
+	public void raiseEvent7() {
+		statemachine.getOccuredEvents().add(EventEvent7);
+	}
+	
+	
+	public Event<Void> getEventEvent7() {
+		return EventEvent7;
+	}
+	
+	public void raiseEvent8() {
+		statemachine.getOccuredEvents().add(EventEvent8);
+	}
+	
+	
+	public Event<Void> getEventEvent8() {
+		return EventEvent8;
+	}
+	
+	public void raiseEvent9() {
+		statemachine.getOccuredEvents().add(EventEvent9);
+	}
+	
+	
+	public Event<Void> getEventEvent9() {
+		return EventEvent9;
+	}
+	
+	public void raiseEvent10() {
+		statemachine.getOccuredEvents().add(EventEvent10);
+	}
+	
+	
+	public Event<Void> getEventEvent10() {
+		return EventEvent10;
+	}
+	
+	public void raiseEvent11() {
+		statemachine.getOccuredEvents().add(EventEvent11);
+	}
+	
+	
+	public Event<Void> getEventEvent11() {
+		return EventEvent11;
+	}
+	
+	public void raiseEvent12() {
+		statemachine.getOccuredEvents().add(EventEvent12);
+	}
+	
+	
+	public Event<Void> getEventEvent12() {
+		return EventEvent12;
+	}
+	
+	public void raiseEvent13() {
+		statemachine.getOccuredEvents().add(EventEvent13);
+	}
+	
+	
+	public Event<Void> getEventEvent13() {
+		return EventEvent13;
+	}
+	
+	public void raiseEvent14() {
+		statemachine.getOccuredEvents().add(EventEvent14);
+	}
+	
+	
+	public Event<Void> getEventEvent14() {
+		return EventEvent14;
+	}
+	
+	public void raiseEvent15() {
+		statemachine.getOccuredEvents().add(EventEvent15);
+	}
+	
+	
+	public Event<Void> getEventEvent15() {
+		return EventEvent15;
+	}
+	
+	public void raiseEvent16() {
+		statemachine.getOccuredEvents().add(EventEvent16);
+	}
+	
+	
+	public Event<Void> getEventEvent16() {
+		return EventEvent16;
+	}
+	
+	
+	private int varS1;
+	
+	public int getVarS1() {
+		return varS1;
+	}
+	
+	public void setVarS1(int value) {
+		varS1 = value;
+	}	
+	private int varS2;
+	
+	public int getVarS2() {
+		return varS2;
+	}
+	
+	public void setVarS2(int value) {
+		varS2 = value;
+	}	
+}

+ 483 - 0
test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/test_hierarchy/Test_HierarchyAbstractBaseStatemachine.java

@@ -0,0 +1,483 @@
+/**
+ * Copyright (c) 2011 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.runtime.java.test_hierarchy;
+
+import java.util.Collection;
+import java.util.EnumSet;
+import java.util.HashSet;
+import java.util.Set;
+
+import org.yakindu.sct.runtime.java.Event;
+import org.yakindu.sct.runtime.java.ITimedStatemachine;
+import org.yakindu.sct.runtime.java.ITimerHandler;
+import org.yakindu.sct.runtime.java.TimerHandler;
+import org.yakindu.sct.runtime.java.EventNotification;
+import org.yakindu.sct.runtime.java.Notification;
+
+public abstract class Test_HierarchyAbstractBaseStatemachine implements ITimedStatemachine {
+	
+	
+	
+	
+	public enum State {
+	      State1,
+	      State9,
+	      State10,
+	      State2,
+	      State3,
+	      State4,
+	      State5,
+	      State6,
+	      State7,
+	      State8,
+	};
+	
+	private InterfaceDefaultImpl interfaceDefault;
+	
+	
+
+	private final Set<State> activeStates = EnumSet.noneOf(State.class);
+	
+	private final Collection<Event<?>> occuredEvents;
+	
+	private final Collection<Event<?>> outEvents;
+	
+	private ITimerHandler timerHandler;
+	
+	public Test_HierarchyAbstractBaseStatemachine(Collection<Event<?>> occuredEvents) {
+		this.occuredEvents = occuredEvents;
+		this.outEvents = new HashSet<Event<?>>();
+		interfaceDefault = new InterfaceDefaultImpl(this);
+	}
+	
+	protected Collection<Event<?>> getOccuredEvents() {
+		return occuredEvents;
+	}
+	
+	protected Collection<Event<?>> getOutEvents(){
+		return outEvents;
+	}
+		
+	public void entry() {
+	activeStates.add(State.State1);
+		entryActionsState1();
+		
+		
+	}
+	
+	protected boolean eventOccured() {
+		return !getOccuredEvents().isEmpty();
+	}
+	
+	@Override
+	public void init() {
+		
+	}
+
+	@Override
+	public void setTimerHandler(ITimerHandler timerHandler) {
+		this.timerHandler = timerHandler;
+	}
+
+	@Override
+	public ITimerHandler getTimerHandler() {
+		if (timerHandler == null) {
+			timerHandler = new TimerHandler(this);
+		}
+		return timerHandler;
+	}
+	
+	@Override
+	public void notify(Notification<?> notification) {
+		if (notification instanceof EventNotification) {
+			EventNotification eventNotification = (EventNotification) notification;
+			getOccuredEvents().add(eventNotification.getElement());
+		}
+	}
+	
+	public Set<State> getActiveStates(){
+		return EnumSet.copyOf(activeStates);
+	}
+	
+	public InterfaceDefault getInterfaceDefault() {
+		return interfaceDefault;
+	}
+	
+
+	private boolean conditionState1Tr0(Collection<?> events) {
+		return getOccuredEvents().contains(interfaceDefault.getEventEvent1());
+	}
+	private boolean conditionState9Tr0(Collection<?> events) {
+		return getOccuredEvents().contains(interfaceDefault.getEventEvent9());
+	}
+	private boolean conditionState10Tr0(Collection<?> events) {
+		return getOccuredEvents().contains(interfaceDefault.getEventEvent10());
+	}
+	private boolean conditionState2Tr0(Collection<?> events) {
+		return getOccuredEvents().contains(interfaceDefault.getEventEvent6());
+	}
+	private boolean conditionState3Tr0(Collection<?> events) {
+		return getOccuredEvents().contains(interfaceDefault.getEventEvent2());
+	}
+	private boolean conditionState3Tr1(Collection<?> events) {
+		return getOccuredEvents().contains(interfaceDefault.getEventEvent11());
+	}
+	private boolean conditionState3Tr2(Collection<?> events) {
+		return getOccuredEvents().contains(interfaceDefault.getEventEvent14());
+	}
+	private boolean conditionState4Tr0(Collection<?> events) {
+		return getOccuredEvents().contains(interfaceDefault.getEventEvent7());
+	}
+	private boolean conditionState5Tr0(Collection<?> events) {
+		return getOccuredEvents().contains(interfaceDefault.getEventEvent3());
+	}
+	private boolean conditionState5Tr1(Collection<?> events) {
+		return getOccuredEvents().contains(interfaceDefault.getEventEvent12());
+	}
+	private boolean conditionState5Tr2(Collection<?> events) {
+		return getOccuredEvents().contains(interfaceDefault.getEventEvent15());
+	}
+	private boolean conditionState6Tr0(Collection<?> events) {
+		return getOccuredEvents().contains(interfaceDefault.getEventEvent8());
+	}
+	private boolean conditionState7Tr0(Collection<?> events) {
+		return getOccuredEvents().contains(interfaceDefault.getEventEvent4());
+	}
+	private boolean conditionState8Tr0(Collection<?> events) {
+		return getOccuredEvents().contains(interfaceDefault.getEventEvent5());
+	}
+	private boolean conditionState8Tr1(Collection<?> events) {
+		return getOccuredEvents().contains(interfaceDefault.getEventEvent13());
+	}
+	private boolean conditionState8Tr2(Collection<?> events) {
+		return getOccuredEvents().contains(interfaceDefault.getEventEvent16());
+	}
+	private void actionsState1Tr0() {
+exitActionsState1();
+	activeStates.remove(State.State1);
+	activeStates.add(State.State2);
+entryActionsState2();
+
+	}
+	private void actionsState9Tr0() {
+exitActionsState9();
+	activeStates.remove(State.State9);
+	activeStates.add(State.State10);
+entryActionsState10();
+
+	}
+	private void actionsState10Tr0() {
+exitActionsState10();
+	activeStates.remove(State.State10);
+	activeStates.add(State.State9);
+entryActionsState9();
+
+	}
+	private void actionsState2Tr0() {
+exitActionsState2();
+	activeStates.remove(State.State2);
+	activeStates.add(State.State1);
+entryActionsState1();
+
+	}
+	private void actionsState3Tr0() {
+exitActionsState3();
+	activeStates.remove(State.State3);
+	activeStates.add(State.State4);
+entryActionsState4();
+
+	}
+	private void actionsState3Tr1() {
+exitActionsState3();
+	activeStates.remove(State.State3);
+	activeStates.add(State.State1);
+entryActionsState1();
+
+	}
+	private void actionsState3Tr2() {
+exitActionsState3();
+	activeStates.remove(State.State3);
+	activeStates.add(State.State9);
+entryActionsState9();
+
+	}
+	private void actionsState4Tr0() {
+exitActionsState4();
+	activeStates.remove(State.State4);
+	activeStates.add(State.State3);
+entryActionsState3();
+
+	}
+	private void actionsState5Tr0() {
+exitActionsState5();
+	activeStates.remove(State.State5);
+	activeStates.add(State.State6);
+entryActionsState6();
+
+	}
+	private void actionsState5Tr1() {
+exitActionsState5();
+	activeStates.remove(State.State5);
+	activeStates.add(State.State1);
+entryActionsState1();
+
+	}
+	private void actionsState5Tr2() {
+exitActionsState5();
+	activeStates.remove(State.State5);
+	activeStates.add(State.State10);
+entryActionsState10();
+
+	}
+	private void actionsState6Tr0() {
+exitActionsState6();
+	activeStates.remove(State.State6);
+	activeStates.add(State.State5);
+entryActionsState5();
+
+	}
+	private void actionsState7Tr0() {
+exitActionsState7();
+	activeStates.remove(State.State7);
+	activeStates.add(State.State8);
+entryActionsState8();
+
+	}
+	private void actionsState8Tr0() {
+exitActionsState8();
+	activeStates.remove(State.State8);
+	activeStates.add(State.State7);
+entryActionsState7();
+
+	}
+	private void actionsState8Tr1() {
+exitActionsState8();
+	activeStates.remove(State.State8);
+	activeStates.add(State.State1);
+entryActionsState1();
+
+	}
+	private void actionsState8Tr2() {
+exitActionsState8();
+	activeStates.remove(State.State8);
+	activeStates.add(State.State10);
+entryActionsState10();
+
+	}
+	private void cycleState1(Collection<?> events) {
+	}
+	private void cycleState9(Collection<?> events) {
+if (conditionState9Tr0(events) ) { 
+actionsState9Tr0();
+}
+	}
+	private void cycleState10(Collection<?> events) {
+if (conditionState10Tr0(events) ) { 
+actionsState10Tr0();
+}
+	}
+	private void cycleState2(Collection<?> events) {
+	}
+	private void cycleState3(Collection<?> events) {
+if (conditionState3Tr0(events) ) { 
+actionsState3Tr0();
+}
+else {
+if (conditionState3Tr1(events) ) { 
+actionsState3Tr1();
+}
+else {
+if (conditionState3Tr2(events) ) { 
+actionsState3Tr2();
+}
+}
+}
+	}
+	private void cycleState4(Collection<?> events) {
+	}
+	private void cycleState5(Collection<?> events) {
+if (conditionState5Tr0(events) ) { 
+actionsState5Tr0();
+}
+else {
+if (conditionState5Tr1(events) ) { 
+actionsState5Tr1();
+}
+else {
+if (conditionState5Tr2(events) ) { 
+actionsState5Tr2();
+}
+}
+}
+	}
+	private void cycleState6(Collection<?> events) {
+	}
+	private void cycleState7(Collection<?> events) {
+if (conditionState7Tr0(events) ) { 
+actionsState7Tr0();
+}
+	}
+	private void cycleState8(Collection<?> events) {
+if (conditionState8Tr0(events) ) { 
+actionsState8Tr0();
+}
+else {
+if (conditionState8Tr1(events) ) { 
+actionsState8Tr1();
+}
+else {
+if (conditionState8Tr2(events) ) { 
+actionsState8Tr2();
+}
+}
+}
+	}
+	private void entryActionsState1() {
+	interfaceDefault.setVarS1(1);
+
+
+	}
+	private void entryActionsState9() {
+	interfaceDefault.setVarS1(interfaceDefault.getVarS1() + (1));
+
+
+	}
+	private void entryActionsState10() {
+	interfaceDefault.setVarS1(interfaceDefault.getVarS1() + (1));
+
+
+	}
+	private void entryActionsState2() {
+	interfaceDefault.setVarS2(1);
+
+
+	}
+	private void entryActionsState3() {
+	interfaceDefault.setVarS2(interfaceDefault.getVarS2() + (1));
+
+
+	}
+	private void entryActionsState4() {
+	interfaceDefault.setVarS2(interfaceDefault.getVarS2() + (1));
+
+
+	}
+	private void entryActionsState5() {
+	interfaceDefault.setVarS2(interfaceDefault.getVarS2() + (1));
+
+
+	}
+	private void entryActionsState6() {
+	interfaceDefault.setVarS2(interfaceDefault.getVarS2() + (1));
+
+
+	}
+	private void entryActionsState7() {
+	interfaceDefault.setVarS2(interfaceDefault.getVarS2() + (1));
+
+
+	}
+	private void entryActionsState8() {
+	interfaceDefault.setVarS2(interfaceDefault.getVarS2() + (1));
+
+
+	}
+	private void exitActionsState1() {
+	interfaceDefault.setVarS1(interfaceDefault.getVarS1() - (1));
+
+
+	}
+	private void exitActionsState9() {
+	interfaceDefault.setVarS1(interfaceDefault.getVarS1() - (1));
+
+
+	}
+	private void exitActionsState10() {
+	interfaceDefault.setVarS1(interfaceDefault.getVarS1() - (1));
+
+
+	}
+	private void exitActionsState2() {
+	interfaceDefault.setVarS2(interfaceDefault.getVarS2() - (1));
+
+
+	}
+	private void exitActionsState3() {
+	interfaceDefault.setVarS2(interfaceDefault.getVarS2() - (1));
+
+
+	}
+	private void exitActionsState4() {
+	interfaceDefault.setVarS2(interfaceDefault.getVarS2() - (1));
+
+
+	}
+	private void exitActionsState5() {
+	interfaceDefault.setVarS2(interfaceDefault.getVarS2() - (1));
+
+
+	}
+	private void exitActionsState6() {
+	interfaceDefault.setVarS2(interfaceDefault.getVarS2() - (1));
+
+
+	}
+	private void exitActionsState7() {
+	interfaceDefault.setVarS2(interfaceDefault.getVarS2() - (1));
+
+
+	}
+	private void exitActionsState8() {
+	interfaceDefault.setVarS2(interfaceDefault.getVarS2() - (1));
+
+
+	}
+
+	protected void runCycle(Collection<?> events) {
+		getOutEvents().clear();
+		for (State state : activeStates) {
+			switch (state) {
+    		case State1:
+        		cycleState1(events);
+        		break;
+    		case State9:
+        		cycleState9(events);
+        		break;
+    		case State10:
+        		cycleState10(events);
+        		break;
+    		case State2:
+        		cycleState2(events);
+        		break;
+    		case State3:
+        		cycleState3(events);
+        		break;
+    		case State4:
+        		cycleState4(events);
+        		break;
+    		case State5:
+        		cycleState5(events);
+        		break;
+    		case State6:
+        		cycleState6(events);
+        		break;
+    		case State7:
+        		cycleState7(events);
+        		break;
+    		case State8:
+        		cycleState8(events);
+        		break;
+			default:
+				// no state found
+			}
+		}
+	}
+}

+ 29 - 0
test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/test_hierarchy/Test_HierarchyCyleBasedStatemachine.java

@@ -0,0 +1,29 @@
+
+/**
+ * Copyright (c) 2011 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.runtime.java.test_hierarchy;
+
+import java.util.HashSet;
+
+import org.yakindu.sct.runtime.java.Event;
+
+public class Test_HierarchyCyleBasedStatemachine extends Test_HierarchyAbstractBaseStatemachine {
+
+	public Test_HierarchyCyleBasedStatemachine() {
+		super(new HashSet<Event<?>>());
+	}
+
+	public void runCycle() {
+		runCycle(getOccuredEvents());
+		// remove all events
+		getOccuredEvents().clear();
+	}
+}

+ 37 - 0
test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/test_hierarchy/Test_HierarchyEventBasedStatemachine.java

@@ -0,0 +1,37 @@
+/**
+ * Copyright (c) 2011 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.runtime.java.test_hierarchy;
+
+import java.util.Collections;
+import java.util.LinkedList;
+import java.util.Queue;
+
+import org.yakindu.sct.runtime.java.Event;
+
+public class Test_HierarchyEventBasedStatemachine extends Test_HierarchyAbstractBaseStatemachine {
+
+	public Test_HierarchyEventBasedStatemachine() {
+		super(new LinkedList<Event<?>>());
+	}
+	
+	@Override
+	protected Queue<Event<?>> getOccuredEvents() {
+		return (Queue<Event<?>>) super.getOccuredEvents();
+	}
+	
+	@Override
+	public void runCycle() {
+		if (eventOccured()) {
+			Event<?> event = getOccuredEvents().poll();
+			runCycle(Collections.singletonList(event));
+		}
+	}
+}

+ 27 - 0
test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/test_localactions/InterfaceDefault.java

@@ -0,0 +1,27 @@
+/**
+ * Copyright (c) 2011 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.runtime.java.test_localactions;
+
+
+public interface InterfaceDefault {
+	
+	public void raiseEvent1();
+	public void raiseEvent2();
+	public void raiseEvent3();
+	public void raiseEvent4();
+	
+	public int getVarI();
+	public void setVarI(int value);	
+	public int getVarJ();
+	public void setVarJ(int value);	
+	public int getVarC();
+	public void setVarC(int value);	
+}

+ 93 - 0
test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/test_localactions/InterfaceDefaultImpl.java

@@ -0,0 +1,93 @@
+/**
+ * Copyright (c) 2011 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.runtime.java.test_localactions;
+
+import org.yakindu.sct.runtime.java.EventNotification;
+import org.yakindu.sct.runtime.java.Event;
+
+public class InterfaceDefaultImpl implements InterfaceDefault {
+	
+	private final Event<Void> EventEvent1 = new Event<Void>("Event1", null); 
+	private final Event<Void> EventEvent2 = new Event<Void>("Event2", null); 
+	private final Event<Void> EventEvent3 = new Event<Void>("Event3", null); 
+	private final Event<Void> EventEvent4 = new Event<Void>("Event4", null); 
+	
+	private Test_LocalActionsAbstractBaseStatemachine statemachine; 
+	
+	public InterfaceDefaultImpl(Test_LocalActionsAbstractBaseStatemachine statemachine) {
+		this.statemachine = statemachine;
+	}
+	
+	public void raiseEvent1() {
+		statemachine.getOccuredEvents().add(EventEvent1);
+	}
+	
+	
+	public Event<Void> getEventEvent1() {
+		return EventEvent1;
+	}
+	
+	public void raiseEvent2() {
+		statemachine.getOccuredEvents().add(EventEvent2);
+	}
+	
+	
+	public Event<Void> getEventEvent2() {
+		return EventEvent2;
+	}
+	
+	public void raiseEvent3() {
+		statemachine.getOccuredEvents().add(EventEvent3);
+	}
+	
+	
+	public Event<Void> getEventEvent3() {
+		return EventEvent3;
+	}
+	
+	public void raiseEvent4() {
+		statemachine.getOccuredEvents().add(EventEvent4);
+	}
+	
+	
+	public Event<Void> getEventEvent4() {
+		return EventEvent4;
+	}
+	
+	
+	private int varI;
+	
+	public int getVarI() {
+		return varI;
+	}
+	
+	public void setVarI(int value) {
+		varI = value;
+	}	
+	private int varJ;
+	
+	public int getVarJ() {
+		return varJ;
+	}
+	
+	public void setVarJ(int value) {
+		varJ = value;
+	}	
+	private int varC;
+	
+	public int getVarC() {
+		return varC;
+	}
+	
+	public void setVarC(int value) {
+		varC = value;
+	}	
+}

+ 226 - 0
test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/test_localactions/Test_LocalActionsAbstractBaseStatemachine.java

@@ -0,0 +1,226 @@
+/**
+ * Copyright (c) 2011 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.runtime.java.test_localactions;
+
+import java.util.Collection;
+import java.util.EnumSet;
+import java.util.HashSet;
+import java.util.Set;
+
+import org.yakindu.sct.runtime.java.Event;
+import org.yakindu.sct.runtime.java.TimeEvent;
+import org.yakindu.sct.runtime.java.ITimedStatemachine;
+import org.yakindu.sct.runtime.java.ITimerHandler;
+import org.yakindu.sct.runtime.java.TimerHandler;
+import org.yakindu.sct.runtime.java.EventNotification;
+import org.yakindu.sct.runtime.java.Notification;
+
+public abstract class Test_LocalActionsAbstractBaseStatemachine implements ITimedStatemachine {
+	
+	
+		private static final TimeEvent State1_time_event_0 = new TimeEvent("State1_time_event_0", true); 
+		private static final TimeEvent State2_time_event_0 = new TimeEvent("State2_time_event_0", false); 
+	
+	
+	public enum State {
+	      State1,
+	      State2,
+	};
+	
+	private InterfaceDefaultImpl interfaceDefault;
+	
+	
+
+	private final Set<State> activeStates = EnumSet.noneOf(State.class);
+	
+	private final Collection<Event<?>> occuredEvents;
+	
+	private final Collection<Event<?>> outEvents;
+	
+	private ITimerHandler timerHandler;
+	
+	public Test_LocalActionsAbstractBaseStatemachine(Collection<Event<?>> occuredEvents) {
+		this.occuredEvents = occuredEvents;
+		this.outEvents = new HashSet<Event<?>>();
+		interfaceDefault = new InterfaceDefaultImpl(this);
+	}
+	
+	protected Collection<Event<?>> getOccuredEvents() {
+		return occuredEvents;
+	}
+	
+	protected Collection<Event<?>> getOutEvents(){
+		return outEvents;
+	}
+		
+	public void entry() {
+	activeStates.add(State.State1);
+		entryActionsState1();
+		
+		
+	}
+	
+	protected boolean eventOccured() {
+		return !getOccuredEvents().isEmpty();
+	}
+	
+	@Override
+	public void init() {
+		
+	}
+
+	@Override
+	public void setTimerHandler(ITimerHandler timerHandler) {
+		this.timerHandler = timerHandler;
+	}
+
+	@Override
+	public ITimerHandler getTimerHandler() {
+		if (timerHandler == null) {
+			timerHandler = new TimerHandler(this);
+		}
+		return timerHandler;
+	}
+	
+	@Override
+	public void notify(Notification<?> notification) {
+		if (notification instanceof EventNotification) {
+			EventNotification eventNotification = (EventNotification) notification;
+			getOccuredEvents().add(eventNotification.getElement());
+		}
+	}
+	
+	public Set<State> getActiveStates(){
+		return EnumSet.copyOf(activeStates);
+	}
+	
+	public InterfaceDefault getInterfaceDefault() {
+		return interfaceDefault;
+	}
+	
+
+	private boolean conditionState1Tr0(Collection<?> events) {
+		return getOccuredEvents().contains(interfaceDefault.getEventEvent1());
+	}
+	private boolean conditionState1Lr3(Collection<?> events) {
+		return getOccuredEvents().contains(interfaceDefault.getEventEvent2());
+	}
+	private boolean conditionState1Lr4(Collection<?> events) {
+		return getOccuredEvents().contains(State1_time_event_0);
+	}
+	private boolean conditionState2Tr0(Collection<?> events) {
+		return getOccuredEvents().contains(interfaceDefault.getEventEvent3());
+	}
+	private boolean conditionState2Lr2(Collection<?> events) {
+		return (getOccuredEvents().contains(interfaceDefault.getEventEvent2()) || getOccuredEvents().contains(interfaceDefault.getEventEvent4()));
+	}
+	private boolean conditionState2Lr3(Collection<?> events) {
+		return getOccuredEvents().contains(State2_time_event_0);
+	}
+	private void actionsState1Tr0() {
+exitActionsState1();
+	activeStates.remove(State.State1);
+	activeStates.add(State.State2);
+entryActionsState2();
+
+	}
+	private void actionsState1Lr3() {
+	interfaceDefault.setVarI(3);
+
+	}
+	private void actionsState1Lr4() {
+	interfaceDefault.setVarC(interfaceDefault.getVarC() + (1));
+
+	}
+	private void actionsState2Tr0() {
+exitActionsState2();
+	activeStates.remove(State.State2);
+	activeStates.add(State.State1);
+entryActionsState1();
+
+	}
+	private void actionsState2Lr2() {
+	interfaceDefault.setVarJ(2);
+
+	}
+	private void actionsState2Lr3() {
+	interfaceDefault.setVarJ(3);
+
+	}
+	private void cycleState1(Collection<?> events) {
+if (conditionState1Tr0(events) ) { 
+actionsState1Tr0();
+}
+else {
+if (conditionState1Lr3(events) ) { 
+actionsState1Lr3();
+}
+if (conditionState1Lr4(events) ) { 
+actionsState1Lr4();
+}
+
+}
+	}
+	private void cycleState2(Collection<?> events) {
+if (conditionState2Tr0(events) ) { 
+actionsState2Tr0();
+}
+else {
+if (conditionState2Lr2(events) ) { 
+actionsState2Lr2();
+}
+if (conditionState2Lr3(events) ) { 
+actionsState2Lr3();
+}
+
+}
+	}
+	private void entryActionsState1() {
+getTimerHandler().setTimer(State1_time_event_0, 100);
+	interfaceDefault.setVarI(1);
+
+
+	}
+	private void entryActionsState2() {
+getTimerHandler().setTimer(State2_time_event_0, 200);
+	interfaceDefault.setVarJ(1);
+
+
+	}
+	private void exitActionsState1() {
+getTimerHandler().resetTimer(State1_time_event_0);
+	interfaceDefault.setVarI(0);
+
+
+	}
+	private void exitActionsState2() {
+getTimerHandler().resetTimer(State2_time_event_0);
+	interfaceDefault.setVarJ(0);
+
+
+	}
+
+	protected void runCycle(Collection<?> events) {
+		getOutEvents().clear();
+		for (State state : activeStates) {
+			switch (state) {
+    		case State1:
+        		cycleState1(events);
+        		break;
+    		case State2:
+        		cycleState2(events);
+        		break;
+			default:
+				// no state found
+			}
+		}
+	}
+}

+ 29 - 0
test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/test_localactions/Test_LocalActionsCyleBasedStatemachine.java

@@ -0,0 +1,29 @@
+
+/**
+ * Copyright (c) 2011 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.runtime.java.test_localactions;
+
+import java.util.HashSet;
+
+import org.yakindu.sct.runtime.java.Event;
+
+public class Test_LocalActionsCyleBasedStatemachine extends Test_LocalActionsAbstractBaseStatemachine {
+
+	public Test_LocalActionsCyleBasedStatemachine() {
+		super(new HashSet<Event<?>>());
+	}
+
+	public void runCycle() {
+		runCycle(getOccuredEvents());
+		// remove all events
+		getOccuredEvents().clear();
+	}
+}

+ 37 - 0
test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/test_localactions/Test_LocalActionsEventBasedStatemachine.java

@@ -0,0 +1,37 @@
+/**
+ * Copyright (c) 2011 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.runtime.java.test_localactions;
+
+import java.util.Collections;
+import java.util.LinkedList;
+import java.util.Queue;
+
+import org.yakindu.sct.runtime.java.Event;
+
+public class Test_LocalActionsEventBasedStatemachine extends Test_LocalActionsAbstractBaseStatemachine {
+
+	public Test_LocalActionsEventBasedStatemachine() {
+		super(new LinkedList<Event<?>>());
+	}
+	
+	@Override
+	protected Queue<Event<?>> getOccuredEvents() {
+		return (Queue<Event<?>>) super.getOccuredEvents();
+	}
+	
+	@Override
+	public void runCycle() {
+		if (eventOccured()) {
+			Event<?> event = getOccuredEvents().poll();
+			runCycle(Collections.singletonList(event));
+		}
+	}
+}

+ 23 - 0
test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/test_parallelregions/InterfaceDefault.java

@@ -0,0 +1,23 @@
+/**
+ * Copyright (c) 2011 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.runtime.java.test_parallelregions;
+
+
+public interface InterfaceDefault {
+	
+	public void raiseEvent1();
+	public void raiseEvent2();
+	public void raiseEvent3();
+	public void raiseEvent4();
+	public void raiseEvent5();
+	public void raiseEvent6();
+	
+}

+ 86 - 0
test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/test_parallelregions/InterfaceDefaultImpl.java

@@ -0,0 +1,86 @@
+/**
+ * Copyright (c) 2011 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.runtime.java.test_parallelregions;
+
+import org.yakindu.sct.runtime.java.EventNotification;
+import org.yakindu.sct.runtime.java.Event;
+
+public class InterfaceDefaultImpl implements InterfaceDefault {
+	
+	private final Event<Void> EventEvent1 = new Event<Void>("event1", null); 
+	private final Event<Void> EventEvent2 = new Event<Void>("event2", null); 
+	private final Event<Void> EventEvent3 = new Event<Void>("event3", null); 
+	private final Event<Void> EventEvent4 = new Event<Void>("event4", null); 
+	private final Event<Void> EventEvent5 = new Event<Void>("event5", null); 
+	private final Event<Void> EventEvent6 = new Event<Void>("event6", null); 
+	
+	private Test_ParallelRegionsAbstractBaseStatemachine statemachine; 
+	
+	public InterfaceDefaultImpl(Test_ParallelRegionsAbstractBaseStatemachine statemachine) {
+		this.statemachine = statemachine;
+	}
+	
+	public void raiseEvent1() {
+		statemachine.getOccuredEvents().add(EventEvent1);
+	}
+	
+	
+	public Event<Void> getEventEvent1() {
+		return EventEvent1;
+	}
+	
+	public void raiseEvent2() {
+		statemachine.getOccuredEvents().add(EventEvent2);
+	}
+	
+	
+	public Event<Void> getEventEvent2() {
+		return EventEvent2;
+	}
+	
+	public void raiseEvent3() {
+		statemachine.getOccuredEvents().add(EventEvent3);
+	}
+	
+	
+	public Event<Void> getEventEvent3() {
+		return EventEvent3;
+	}
+	
+	public void raiseEvent4() {
+		statemachine.getOccuredEvents().add(EventEvent4);
+	}
+	
+	
+	public Event<Void> getEventEvent4() {
+		return EventEvent4;
+	}
+	
+	public void raiseEvent5() {
+		statemachine.getOccuredEvents().add(EventEvent5);
+	}
+	
+	
+	public Event<Void> getEventEvent5() {
+		return EventEvent5;
+	}
+	
+	public void raiseEvent6() {
+		statemachine.getOccuredEvents().add(EventEvent6);
+	}
+	
+	
+	public Event<Void> getEventEvent6() {
+		return EventEvent6;
+	}
+	
+	
+}

+ 234 - 0
test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/test_parallelregions/Test_ParallelRegionsAbstractBaseStatemachine.java

@@ -0,0 +1,234 @@
+/**
+ * Copyright (c) 2011 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.runtime.java.test_parallelregions;
+
+import java.util.Collection;
+import java.util.EnumSet;
+import java.util.HashSet;
+import java.util.Set;
+
+import org.yakindu.sct.runtime.java.Event;
+import org.yakindu.sct.runtime.java.ITimedStatemachine;
+import org.yakindu.sct.runtime.java.ITimerHandler;
+import org.yakindu.sct.runtime.java.TimerHandler;
+import org.yakindu.sct.runtime.java.EventNotification;
+import org.yakindu.sct.runtime.java.Notification;
+
+public abstract class Test_ParallelRegionsAbstractBaseStatemachine implements ITimedStatemachine {
+	
+	
+	
+	
+	public enum State {
+	      State1,
+	      State2,
+	      State3,
+	      State4,
+	      State5,
+	      State6,
+	      State9,
+	      State7,
+	      State8,
+	};
+	
+	private InterfaceDefaultImpl interfaceDefault;
+	
+	
+
+	private final Set<State> activeStates = EnumSet.noneOf(State.class);
+	
+	private final Collection<Event<?>> occuredEvents;
+	
+	private final Collection<Event<?>> outEvents;
+	
+	private ITimerHandler timerHandler;
+	
+	public Test_ParallelRegionsAbstractBaseStatemachine(Collection<Event<?>> occuredEvents) {
+		this.occuredEvents = occuredEvents;
+		this.outEvents = new HashSet<Event<?>>();
+		interfaceDefault = new InterfaceDefaultImpl(this);
+	}
+	
+	protected Collection<Event<?>> getOccuredEvents() {
+		return occuredEvents;
+	}
+	
+	protected Collection<Event<?>> getOutEvents(){
+		return outEvents;
+	}
+		
+	public void entry() {
+	activeStates.add(State.State1);
+		
+		
+	}
+	
+	protected boolean eventOccured() {
+		return !getOccuredEvents().isEmpty();
+	}
+	
+	@Override
+	public void init() {
+		
+	}
+
+	@Override
+	public void setTimerHandler(ITimerHandler timerHandler) {
+		this.timerHandler = timerHandler;
+	}
+
+	@Override
+	public ITimerHandler getTimerHandler() {
+		if (timerHandler == null) {
+			timerHandler = new TimerHandler(this);
+		}
+		return timerHandler;
+	}
+	
+	@Override
+	public void notify(Notification<?> notification) {
+		if (notification instanceof EventNotification) {
+			EventNotification eventNotification = (EventNotification) notification;
+			getOccuredEvents().add(eventNotification.getElement());
+		}
+	}
+	
+	public Set<State> getActiveStates(){
+		return EnumSet.copyOf(activeStates);
+	}
+	
+	public InterfaceDefault getInterfaceDefault() {
+		return interfaceDefault;
+	}
+	
+
+	private boolean conditionState1Tr0(Collection<?> events) {
+		return getOccuredEvents().contains(interfaceDefault.getEventEvent1());
+	}
+	private boolean conditionState3Tr0(Collection<?> events) {
+		return getOccuredEvents().contains(interfaceDefault.getEventEvent2());
+	}
+	private boolean conditionState5Tr0(Collection<?> events) {
+		return getOccuredEvents().contains(interfaceDefault.getEventEvent3());
+	}
+	private boolean conditionState6Tr0(Collection<?> events) {
+		return getOccuredEvents().contains(interfaceDefault.getEventEvent4());
+	}
+	private boolean conditionState7Tr0(Collection<?> events) {
+		return (getOccuredEvents().contains(interfaceDefault.getEventEvent5()) || getOccuredEvents().contains(interfaceDefault.getEventEvent3()));
+	}
+	private boolean conditionState8Tr0(Collection<?> events) {
+		return getOccuredEvents().contains(interfaceDefault.getEventEvent6());
+	}
+	private void actionsState1Tr0() {
+	activeStates.remove(State.State1);
+	activeStates.add(State.State2);
+
+	}
+	private void actionsState3Tr0() {
+	activeStates.remove(State.State3);
+	activeStates.add(State.State4);
+
+	}
+	private void actionsState5Tr0() {
+	activeStates.remove(State.State5);
+	activeStates.add(State.State6);
+
+	}
+	private void actionsState6Tr0() {
+	activeStates.remove(State.State6);
+	activeStates.add(State.State5);
+
+	}
+	private void actionsState7Tr0() {
+	activeStates.remove(State.State7);
+	activeStates.add(State.State8);
+
+	}
+	private void actionsState8Tr0() {
+	activeStates.remove(State.State8);
+	activeStates.add(State.State7);
+
+	}
+	private void cycleState1(Collection<?> events) {
+if (conditionState1Tr0(events) ) { 
+actionsState1Tr0();
+}
+	}
+	private void cycleState2(Collection<?> events) {
+	}
+	private void cycleState3(Collection<?> events) {
+if (conditionState3Tr0(events) ) { 
+actionsState3Tr0();
+}
+	}
+	private void cycleState4(Collection<?> events) {
+	}
+	private void cycleState5(Collection<?> events) {
+if (conditionState5Tr0(events) ) { 
+actionsState5Tr0();
+}
+	}
+	private void cycleState6(Collection<?> events) {
+if (conditionState6Tr0(events) ) { 
+actionsState6Tr0();
+}
+	}
+	private void cycleState9(Collection<?> events) {
+	}
+	private void cycleState7(Collection<?> events) {
+if (conditionState7Tr0(events) ) { 
+actionsState7Tr0();
+}
+	}
+	private void cycleState8(Collection<?> events) {
+if (conditionState8Tr0(events) ) { 
+actionsState8Tr0();
+}
+	}
+
+	protected void runCycle(Collection<?> events) {
+		getOutEvents().clear();
+		for (State state : activeStates) {
+			switch (state) {
+    		case State1:
+        		cycleState1(events);
+        		break;
+    		case State2:
+        		cycleState2(events);
+        		break;
+    		case State3:
+        		cycleState3(events);
+        		break;
+    		case State4:
+        		cycleState4(events);
+        		break;
+    		case State5:
+        		cycleState5(events);
+        		break;
+    		case State6:
+        		cycleState6(events);
+        		break;
+    		case State9:
+        		cycleState9(events);
+        		break;
+    		case State7:
+        		cycleState7(events);
+        		break;
+    		case State8:
+        		cycleState8(events);
+        		break;
+			default:
+				// no state found
+			}
+		}
+	}
+}

+ 29 - 0
test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/test_parallelregions/Test_ParallelRegionsCyleBasedStatemachine.java

@@ -0,0 +1,29 @@
+
+/**
+ * Copyright (c) 2011 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.runtime.java.test_parallelregions;
+
+import java.util.HashSet;
+
+import org.yakindu.sct.runtime.java.Event;
+
+public class Test_ParallelRegionsCyleBasedStatemachine extends Test_ParallelRegionsAbstractBaseStatemachine {
+
+	public Test_ParallelRegionsCyleBasedStatemachine() {
+		super(new HashSet<Event<?>>());
+	}
+
+	public void runCycle() {
+		runCycle(getOccuredEvents());
+		// remove all events
+		getOccuredEvents().clear();
+	}
+}

+ 37 - 0
test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/test_parallelregions/Test_ParallelRegionsEventBasedStatemachine.java

@@ -0,0 +1,37 @@
+/**
+ * Copyright (c) 2011 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.runtime.java.test_parallelregions;
+
+import java.util.Collections;
+import java.util.LinkedList;
+import java.util.Queue;
+
+import org.yakindu.sct.runtime.java.Event;
+
+public class Test_ParallelRegionsEventBasedStatemachine extends Test_ParallelRegionsAbstractBaseStatemachine {
+
+	public Test_ParallelRegionsEventBasedStatemachine() {
+		super(new LinkedList<Event<?>>());
+	}
+	
+	@Override
+	protected Queue<Event<?>> getOccuredEvents() {
+		return (Queue<Event<?>>) super.getOccuredEvents();
+	}
+	
+	@Override
+	public void runCycle() {
+		if (eventOccured()) {
+			Event<?> event = getOccuredEvents().poll();
+			runCycle(Collections.singletonList(event));
+		}
+	}
+}

+ 25 - 0
test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/test_shallowhistory/InterfaceDefault.java

@@ -0,0 +1,25 @@
+/**
+ * Copyright (c) 2011 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.runtime.java.test_shallowhistory;
+
+
+public interface InterfaceDefault {
+	
+	public void raiseEvent1();
+	public void raiseEvent2();
+	public void raiseEvent3();
+	public void raiseEvent4();
+	public void raiseEvent5();
+	public void raiseEvent6();
+	public void raiseEvent7();
+	public void raiseEvent8();
+	
+}

+ 106 - 0
test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/test_shallowhistory/InterfaceDefaultImpl.java

@@ -0,0 +1,106 @@
+/**
+ * Copyright (c) 2011 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.runtime.java.test_shallowhistory;
+
+import org.yakindu.sct.runtime.java.EventNotification;
+import org.yakindu.sct.runtime.java.Event;
+
+public class InterfaceDefaultImpl implements InterfaceDefault {
+	
+	private final Event<Void> EventEvent1 = new Event<Void>("event1", null); 
+	private final Event<Void> EventEvent2 = new Event<Void>("event2", null); 
+	private final Event<Void> EventEvent3 = new Event<Void>("event3", null); 
+	private final Event<Void> EventEvent4 = new Event<Void>("event4", null); 
+	private final Event<Void> EventEvent5 = new Event<Void>("event5", null); 
+	private final Event<Void> EventEvent6 = new Event<Void>("event6", null); 
+	private final Event<Void> EventEvent7 = new Event<Void>("event7", null); 
+	private final Event<Void> EventEvent8 = new Event<Void>("event8", null); 
+	
+	private Test_ShallowHistoryAbstractBaseStatemachine statemachine; 
+	
+	public InterfaceDefaultImpl(Test_ShallowHistoryAbstractBaseStatemachine statemachine) {
+		this.statemachine = statemachine;
+	}
+	
+	public void raiseEvent1() {
+		statemachine.getOccuredEvents().add(EventEvent1);
+	}
+	
+	
+	public Event<Void> getEventEvent1() {
+		return EventEvent1;
+	}
+	
+	public void raiseEvent2() {
+		statemachine.getOccuredEvents().add(EventEvent2);
+	}
+	
+	
+	public Event<Void> getEventEvent2() {
+		return EventEvent2;
+	}
+	
+	public void raiseEvent3() {
+		statemachine.getOccuredEvents().add(EventEvent3);
+	}
+	
+	
+	public Event<Void> getEventEvent3() {
+		return EventEvent3;
+	}
+	
+	public void raiseEvent4() {
+		statemachine.getOccuredEvents().add(EventEvent4);
+	}
+	
+	
+	public Event<Void> getEventEvent4() {
+		return EventEvent4;
+	}
+	
+	public void raiseEvent5() {
+		statemachine.getOccuredEvents().add(EventEvent5);
+	}
+	
+	
+	public Event<Void> getEventEvent5() {
+		return EventEvent5;
+	}
+	
+	public void raiseEvent6() {
+		statemachine.getOccuredEvents().add(EventEvent6);
+	}
+	
+	
+	public Event<Void> getEventEvent6() {
+		return EventEvent6;
+	}
+	
+	public void raiseEvent7() {
+		statemachine.getOccuredEvents().add(EventEvent7);
+	}
+	
+	
+	public Event<Void> getEventEvent7() {
+		return EventEvent7;
+	}
+	
+	public void raiseEvent8() {
+		statemachine.getOccuredEvents().add(EventEvent8);
+	}
+	
+	
+	public Event<Void> getEventEvent8() {
+		return EventEvent8;
+	}
+	
+	
+}

+ 247 - 0
test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/test_shallowhistory/Test_ShallowHistoryAbstractBaseStatemachine.java

@@ -0,0 +1,247 @@
+/**
+ * Copyright (c) 2011 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.runtime.java.test_shallowhistory;
+
+import java.util.Collection;
+import java.util.EnumSet;
+import java.util.HashSet;
+import java.util.Set;
+
+import org.yakindu.sct.runtime.java.Event;
+import org.yakindu.sct.runtime.java.ITimedStatemachine;
+import org.yakindu.sct.runtime.java.ITimerHandler;
+import org.yakindu.sct.runtime.java.TimerHandler;
+import org.yakindu.sct.runtime.java.EventNotification;
+import org.yakindu.sct.runtime.java.Notification;
+
+public abstract class Test_ShallowHistoryAbstractBaseStatemachine implements ITimedStatemachine {
+	
+	
+	
+	
+	public enum State {
+	      State1,
+	      State2,
+	      State3,
+	      State4,
+	      State6,
+	      State7,
+	      State8,
+	      State9,
+	      State5,
+	};
+	
+	private InterfaceDefaultImpl interfaceDefault;
+	
+	
+
+	private final Set<State> activeStates = EnumSet.noneOf(State.class);
+	
+	private final Collection<Event<?>> occuredEvents;
+	
+	private final Collection<Event<?>> outEvents;
+	
+	private ITimerHandler timerHandler;
+	
+	public Test_ShallowHistoryAbstractBaseStatemachine(Collection<Event<?>> occuredEvents) {
+		this.occuredEvents = occuredEvents;
+		this.outEvents = new HashSet<Event<?>>();
+		interfaceDefault = new InterfaceDefaultImpl(this);
+	}
+	
+	protected Collection<Event<?>> getOccuredEvents() {
+		return occuredEvents;
+	}
+	
+	protected Collection<Event<?>> getOutEvents(){
+		return outEvents;
+	}
+		
+	public void entry() {
+	activeStates.add(State.State1);
+		
+		
+	}
+	
+	protected boolean eventOccured() {
+		return !getOccuredEvents().isEmpty();
+	}
+	
+	@Override
+	public void init() {
+		
+	}
+
+	@Override
+	public void setTimerHandler(ITimerHandler timerHandler) {
+		this.timerHandler = timerHandler;
+	}
+
+	@Override
+	public ITimerHandler getTimerHandler() {
+		if (timerHandler == null) {
+			timerHandler = new TimerHandler(this);
+		}
+		return timerHandler;
+	}
+	
+	@Override
+	public void notify(Notification<?> notification) {
+		if (notification instanceof EventNotification) {
+			EventNotification eventNotification = (EventNotification) notification;
+			getOccuredEvents().add(eventNotification.getElement());
+		}
+	}
+	
+	public Set<State> getActiveStates(){
+		return EnumSet.copyOf(activeStates);
+	}
+	
+	public InterfaceDefault getInterfaceDefault() {
+		return interfaceDefault;
+	}
+	
+
+	private boolean conditionState1Tr0(Collection<?> events) {
+		return getOccuredEvents().contains(interfaceDefault.getEventEvent1());
+	}
+	private boolean conditionState2Tr0(Collection<?> events) {
+		return getOccuredEvents().contains(interfaceDefault.getEventEvent2());
+	}
+	private boolean conditionState3Tr0(Collection<?> events) {
+		return getOccuredEvents().contains(interfaceDefault.getEventEvent3());
+	}
+	private boolean conditionState4Tr0(Collection<?> events) {
+		return getOccuredEvents().contains(interfaceDefault.getEventEvent4());
+	}
+	private boolean conditionState6Tr0(Collection<?> events) {
+		return getOccuredEvents().contains(interfaceDefault.getEventEvent5());
+	}
+	private boolean conditionState7Tr0(Collection<?> events) {
+		return getOccuredEvents().contains(interfaceDefault.getEventEvent6());
+	}
+	private boolean conditionState8Tr0(Collection<?> events) {
+		return getOccuredEvents().contains(interfaceDefault.getEventEvent7());
+	}
+	private boolean conditionState9Tr0(Collection<?> events) {
+		return getOccuredEvents().contains(interfaceDefault.getEventEvent8());
+	}
+	private void actionsState1Tr0() {
+	activeStates.remove(State.State1);
+	activeStates.add(State.State2);
+
+	}
+	private void actionsState2Tr0() {
+	activeStates.remove(State.State2);
+	activeStates.add(State.State1);
+
+	}
+	private void actionsState3Tr0() {
+	activeStates.remove(State.State3);
+	activeStates.add(State.State4);
+
+	}
+	private void actionsState4Tr0() {
+	activeStates.remove(State.State4);
+	activeStates.add(State.State5);
+
+	}
+	private void actionsState6Tr0() {
+	activeStates.remove(State.State6);
+	activeStates.add(State.State7);
+
+	}
+	private void actionsState7Tr0() {
+	activeStates.remove(State.State7);
+	activeStates.add(State.State6);
+
+	}
+	private void actionsState8Tr0() {
+	activeStates.remove(State.State8);
+	activeStates.add(State.State9);
+
+	}
+	private void actionsState9Tr0() {
+	activeStates.remove(State.State9);
+	activeStates.add(State.State8);
+
+	}
+	private void cycleState1(Collection<?> events) {
+if (conditionState1Tr0(events) ) { 
+actionsState1Tr0();
+}
+	}
+	private void cycleState2(Collection<?> events) {
+	}
+	private void cycleState3(Collection<?> events) {
+if (conditionState3Tr0(events) ) { 
+actionsState3Tr0();
+}
+	}
+	private void cycleState4(Collection<?> events) {
+	}
+	private void cycleState6(Collection<?> events) {
+if (conditionState6Tr0(events) ) { 
+actionsState6Tr0();
+}
+	}
+	private void cycleState7(Collection<?> events) {
+	}
+	private void cycleState8(Collection<?> events) {
+if (conditionState8Tr0(events) ) { 
+actionsState8Tr0();
+}
+	}
+	private void cycleState9(Collection<?> events) {
+if (conditionState9Tr0(events) ) { 
+actionsState9Tr0();
+}
+	}
+	private void cycleState5(Collection<?> events) {
+	}
+
+	protected void runCycle(Collection<?> events) {
+		getOutEvents().clear();
+		for (State state : activeStates) {
+			switch (state) {
+    		case State1:
+        		cycleState1(events);
+        		break;
+    		case State2:
+        		cycleState2(events);
+        		break;
+    		case State3:
+        		cycleState3(events);
+        		break;
+    		case State4:
+        		cycleState4(events);
+        		break;
+    		case State6:
+        		cycleState6(events);
+        		break;
+    		case State7:
+        		cycleState7(events);
+        		break;
+    		case State8:
+        		cycleState8(events);
+        		break;
+    		case State9:
+        		cycleState9(events);
+        		break;
+    		case State5:
+        		cycleState5(events);
+        		break;
+			default:
+				// no state found
+			}
+		}
+	}
+}

+ 29 - 0
test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/test_shallowhistory/Test_ShallowHistoryCyleBasedStatemachine.java

@@ -0,0 +1,29 @@
+
+/**
+ * Copyright (c) 2011 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.runtime.java.test_shallowhistory;
+
+import java.util.HashSet;
+
+import org.yakindu.sct.runtime.java.Event;
+
+public class Test_ShallowHistoryCyleBasedStatemachine extends Test_ShallowHistoryAbstractBaseStatemachine {
+
+	public Test_ShallowHistoryCyleBasedStatemachine() {
+		super(new HashSet<Event<?>>());
+	}
+
+	public void runCycle() {
+		runCycle(getOccuredEvents());
+		// remove all events
+		getOccuredEvents().clear();
+	}
+}

+ 37 - 0
test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/test_shallowhistory/Test_ShallowHistoryEventBasedStatemachine.java

@@ -0,0 +1,37 @@
+/**
+ * Copyright (c) 2011 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.runtime.java.test_shallowhistory;
+
+import java.util.Collections;
+import java.util.LinkedList;
+import java.util.Queue;
+
+import org.yakindu.sct.runtime.java.Event;
+
+public class Test_ShallowHistoryEventBasedStatemachine extends Test_ShallowHistoryAbstractBaseStatemachine {
+
+	public Test_ShallowHistoryEventBasedStatemachine() {
+		super(new LinkedList<Event<?>>());
+	}
+	
+	@Override
+	protected Queue<Event<?>> getOccuredEvents() {
+		return (Queue<Event<?>>) super.getOccuredEvents();
+	}
+	
+	@Override
+	public void runCycle() {
+		if (eventOccured()) {
+			Event<?> event = getOccuredEvents().poll();
+			runCycle(Collections.singletonList(event));
+		}
+	}
+}

+ 27 - 0
test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/test_transition/InterfaceA.java

@@ -0,0 +1,27 @@
+/**
+ * Copyright (c) 2011 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.runtime.java.test_transition;
+
+import org.yakindu.sct.runtime.java.Event;
+import org.yakindu.sct.runtime.java.INotificationSender;
+
+public interface InterfaceA extends INotificationSender {
+	
+	public void raiseEvent1();
+	public void raiseEvent1(int value);
+	public void raiseEvent2();
+	public void raiseEvent3();
+	public boolean isRaisedEvent4();
+		
+	public Event<Void> getEventEvent4();
+	
+	
+}

+ 76 - 0
test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/test_transition/InterfaceAImpl.java

@@ -0,0 +1,76 @@
+/**
+ * Copyright (c) 2011 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.runtime.java.test_transition;
+
+import org.yakindu.sct.runtime.java.EventNotification;
+import org.yakindu.sct.runtime.java.Event;
+import org.yakindu.sct.runtime.java.NotificationSender;
+
+public class InterfaceAImpl extends NotificationSender implements InterfaceA {
+	
+	private final Event<Integer> EventEvent1 = new Event<Integer>("event1", 1); 
+	private final Event<Void> EventEvent2 = new Event<Void>("event2", null); 
+	private final Event<Void> EventEvent3 = new Event<Void>("event3", null); 
+	private final Event<Void> EventEvent4 = new Event<Void>("event4", null); 
+	
+	private Test_TransitionAbstractBaseStatemachine statemachine; 
+	
+	public InterfaceAImpl(Test_TransitionAbstractBaseStatemachine statemachine) {
+		this.statemachine = statemachine;
+	}
+	
+	public void raiseEvent1() {
+		statemachine.getOccuredEvents().add(EventEvent1);
+	}
+	
+	public void raiseEvent1(int value) {
+		EventEvent1.setValue(value);
+		statemachine.getOccuredEvents().add(EventEvent1);
+	}
+	
+	public Event<Integer> getEventEvent1() {
+		return EventEvent1;
+	}
+	
+	public void raiseEvent2() {
+		statemachine.getOccuredEvents().add(EventEvent2);
+	}
+	
+	
+	public Event<Void> getEventEvent2() {
+		return EventEvent2;
+	}
+	
+	public void raiseEvent3() {
+		statemachine.getOccuredEvents().add(EventEvent3);
+	}
+	
+	
+	public Event<Void> getEventEvent3() {
+		return EventEvent3;
+	}
+	
+	public void raiseEvent4() {
+		statemachine.getOccuredEvents().add(EventEvent4);
+		statemachine.getOutEvents().add(EventEvent4);
+		notifyListeners(new EventNotification(EventEvent4));
+	}
+	
+	
+	public Event<Void> getEventEvent4() {
+		return EventEvent4;
+	}
+	
+	public boolean isRaisedEvent4() {
+		return statemachine.getOutEvents().contains(EventEvent4);
+	}
+	
+}

+ 30 - 0
test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/test_transition/InterfaceDefault.java

@@ -0,0 +1,30 @@
+/**
+ * Copyright (c) 2011 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.runtime.java.test_transition;
+
+import org.yakindu.sct.runtime.java.Event;
+import org.yakindu.sct.runtime.java.INotificationSender;
+
+public interface InterfaceDefault extends INotificationSender {
+	
+	public void raiseEvent5();
+	public void raiseEvent5(boolean value);
+	public void raiseEvent6();
+	public boolean isRaisedEvent7();
+		
+	public Event<Void> getEventEvent7();
+	
+	
+	public int getVarI();
+	public void setVarI(int value);	
+	public double getVarJ();
+	public void setVarJ(double value);	
+}

+ 84 - 0
test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/test_transition/InterfaceDefaultImpl.java

@@ -0,0 +1,84 @@
+/**
+ * Copyright (c) 2011 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.runtime.java.test_transition;
+
+import org.yakindu.sct.runtime.java.EventNotification;
+import org.yakindu.sct.runtime.java.Event;
+import org.yakindu.sct.runtime.java.NotificationSender;
+
+public class InterfaceDefaultImpl extends NotificationSender implements InterfaceDefault {
+	
+	private final Event<Boolean> EventEvent5 = new Event<Boolean>("event5", false); 
+	private final Event<Void> EventEvent6 = new Event<Void>("event6", null); 
+	private final Event<Void> EventEvent7 = new Event<Void>("event7", null); 
+	
+	private Test_TransitionAbstractBaseStatemachine statemachine; 
+	
+	public InterfaceDefaultImpl(Test_TransitionAbstractBaseStatemachine statemachine) {
+		this.statemachine = statemachine;
+	}
+	
+	public void raiseEvent5() {
+		statemachine.getOccuredEvents().add(EventEvent5);
+	}
+	
+	public void raiseEvent5(boolean value) {
+		EventEvent5.setValue(value);
+		statemachine.getOccuredEvents().add(EventEvent5);
+	}
+	
+	public Event<Boolean> getEventEvent5() {
+		return EventEvent5;
+	}
+	
+	public void raiseEvent6() {
+		statemachine.getOccuredEvents().add(EventEvent6);
+	}
+	
+	
+	public Event<Void> getEventEvent6() {
+		return EventEvent6;
+	}
+	
+	public void raiseEvent7() {
+		statemachine.getOccuredEvents().add(EventEvent7);
+		statemachine.getOutEvents().add(EventEvent7);
+		notifyListeners(new EventNotification(EventEvent7));
+	}
+	
+	
+	public Event<Void> getEventEvent7() {
+		return EventEvent7;
+	}
+	
+	public boolean isRaisedEvent7() {
+		return statemachine.getOutEvents().contains(EventEvent7);
+	}
+	
+	private int varI;
+	
+	public int getVarI() {
+		return varI;
+	}
+	
+	public void setVarI(int value) {
+		varI = value;
+	}	
+	private double varJ;
+	
+	public double getVarJ() {
+		return varJ;
+	}
+	
+	public void setVarJ(double value) {
+		varJ = value;
+	}	
+}

+ 287 - 0
test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/test_transition/Test_TransitionAbstractBaseStatemachine.java

@@ -0,0 +1,287 @@
+/**
+ * Copyright (c) 2011 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.runtime.java.test_transition;
+
+import java.util.Collection;
+import java.util.EnumSet;
+import java.util.HashSet;
+import java.util.Set;
+
+import org.yakindu.sct.runtime.java.Event;
+import org.yakindu.sct.runtime.java.TimeEvent;
+import org.yakindu.sct.runtime.java.ITimedStatemachine;
+import org.yakindu.sct.runtime.java.ITimerHandler;
+import org.yakindu.sct.runtime.java.TimerHandler;
+import org.yakindu.sct.runtime.java.EventNotification;
+import org.yakindu.sct.runtime.java.Notification;
+
+public abstract class Test_TransitionAbstractBaseStatemachine implements ITimedStatemachine {
+	
+	private static final Event<Integer> EventEvent10 = new Event<Integer>("event10", 0); 
+	
+		private static final TimeEvent State1_time_event_0 = new TimeEvent("State1_time_event_0", false); 
+		private static final TimeEvent State1_time_event_1 = new TimeEvent("State1_time_event_1", false); 
+	
+	
+	public enum State {
+	      State1,
+	      State2,
+	};
+	
+	private InterfaceAImpl interfaceA;
+	private InterfaceDefaultImpl interfaceDefault;
+	
+	
+
+	private final Set<State> activeStates = EnumSet.noneOf(State.class);
+	
+	private final Collection<Event<?>> occuredEvents;
+	
+	private final Collection<Event<?>> outEvents;
+	
+	private ITimerHandler timerHandler;
+	
+	public Test_TransitionAbstractBaseStatemachine(Collection<Event<?>> occuredEvents) {
+		this.occuredEvents = occuredEvents;
+		this.outEvents = new HashSet<Event<?>>();
+		interfaceA = new InterfaceAImpl(this);
+		interfaceDefault = new InterfaceDefaultImpl(this);
+	}
+	
+	protected Collection<Event<?>> getOccuredEvents() {
+		return occuredEvents;
+	}
+	
+	protected Collection<Event<?>> getOutEvents(){
+		return outEvents;
+	}
+		
+	public void entry() {
+	activeStates.add(State.State1);
+		entryActionsState1();
+		
+		
+	}
+	
+	protected boolean eventOccured() {
+		return !getOccuredEvents().isEmpty();
+	}
+	
+	@Override
+	public void init() {
+		
+	}
+
+	@Override
+	public void setTimerHandler(ITimerHandler timerHandler) {
+		this.timerHandler = timerHandler;
+	}
+
+	@Override
+	public ITimerHandler getTimerHandler() {
+		if (timerHandler == null) {
+			timerHandler = new TimerHandler(this);
+		}
+		return timerHandler;
+	}
+	
+	@Override
+	public void notify(Notification<?> notification) {
+		if (notification instanceof EventNotification) {
+			EventNotification eventNotification = (EventNotification) notification;
+			getOccuredEvents().add(eventNotification.getElement());
+		}
+	}
+	
+	public Set<State> getActiveStates(){
+		return EnumSet.copyOf(activeStates);
+	}
+	
+	public InterfaceA getInterfaceA() {
+		return interfaceA;
+	}
+	
+	public InterfaceDefault getInterfaceDefault() {
+		return interfaceDefault;
+	}
+	
+	private void raiseEvent10() {
+		getOccuredEvents().add(EventEvent10);
+	}
+	
+	private void raiseEvent10(int value) {
+		EventEvent10.setValue(value);
+		getOccuredEvents().add(EventEvent10);
+	}
+	
+	private int getEventValueEvent10() {
+		return EventEvent10.getValue();
+	}
+
+	private boolean conditionState1Tr0(Collection<?> events) {
+		return (getOccuredEvents().contains(interfaceA.getEventEvent1()) || getOccuredEvents().contains(interfaceA.getEventEvent2()));
+	}
+	private boolean conditionState1Tr1(Collection<?> events) {
+		return (interfaceDefault.getVarI() == 5);
+	}
+	private boolean conditionState1Tr2(Collection<?> events) {
+		return (getOccuredEvents().contains(interfaceA.getEventEvent3()) && (interfaceDefault.getVarJ() < 20));
+	}
+	private boolean conditionState1Tr3(Collection<?> events) {
+		return ((getOccuredEvents().contains(interfaceA.getEventEvent3()) || getOccuredEvents().contains(interfaceA.getEventEvent4())) && (interfaceDefault.getVarJ() > 30));
+	}
+	private boolean conditionState1Tr4(Collection<?> events) {
+		return getOccuredEvents().contains(interfaceDefault.getEventEvent6());
+	}
+	private boolean conditionState1Tr5(Collection<?> events) {
+		return getOccuredEvents().contains(interfaceDefault.getEventEvent7());
+	}
+	private boolean conditionState1Tr6(Collection<?> events) {
+		return getOccuredEvents().contains(State1_time_event_0);
+	}
+	private boolean conditionState1Tr7(Collection<?> events) {
+		return getOccuredEvents().contains(State1_time_event_1);
+	}
+	private boolean conditionState1Tr8(Collection<?> events) {
+		return getOccuredEvents().contains(interfaceA.getEventEvent1());
+	}
+	private void actionsState1Tr0() {
+exitActionsState1();
+	activeStates.remove(State.State1);
+	activeStates.add(State.State2);
+
+	}
+	private void actionsState1Tr1() {
+exitActionsState1();
+	activeStates.remove(State.State1);
+	activeStates.add(State.State2);
+
+	}
+	private void actionsState1Tr2() {
+exitActionsState1();
+	activeStates.remove(State.State1);
+	activeStates.add(State.State2);
+
+	}
+	private void actionsState1Tr3() {
+exitActionsState1();
+	activeStates.remove(State.State1);
+	activeStates.add(State.State2);
+
+	}
+	private void actionsState1Tr4() {
+exitActionsState1();
+	activeStates.remove(State.State1);
+	interfaceDefault.setVarI(15);
+
+	activeStates.add(State.State2);
+
+	}
+	private void actionsState1Tr5() {
+exitActionsState1();
+	activeStates.remove(State.State1);
+	interfaceDefault.setVarJ((interfaceDefault.getVarI() * 9));
+
+	activeStates.add(State.State2);
+
+	}
+	private void actionsState1Tr6() {
+exitActionsState1();
+	activeStates.remove(State.State1);
+	activeStates.add(State.State2);
+
+	}
+	private void actionsState1Tr7() {
+exitActionsState1();
+	activeStates.remove(State.State1);
+	activeStates.add(State.State2);
+
+	}
+	private void actionsState1Tr8() {
+exitActionsState1();
+	activeStates.remove(State.State1);
+	activeStates.add(State.State2);
+
+	}
+	private void cycleState1(Collection<?> events) {
+if (conditionState1Tr0(events) ) { 
+actionsState1Tr0();
+}
+else {
+if (conditionState1Tr1(events) ) { 
+actionsState1Tr1();
+}
+else {
+if (conditionState1Tr2(events) ) { 
+actionsState1Tr2();
+}
+else {
+if (conditionState1Tr3(events) ) { 
+actionsState1Tr3();
+}
+else {
+if (conditionState1Tr4(events) ) { 
+actionsState1Tr4();
+}
+else {
+if (conditionState1Tr5(events) ) { 
+actionsState1Tr5();
+}
+else {
+if (conditionState1Tr6(events) ) { 
+actionsState1Tr6();
+}
+else {
+if (conditionState1Tr7(events) ) { 
+actionsState1Tr7();
+}
+else {
+if (conditionState1Tr8(events) ) { 
+actionsState1Tr8();
+}
+}
+}
+}
+}
+}
+}
+}
+}
+	}
+	private void cycleState2(Collection<?> events) {
+	}
+	private void entryActionsState1() {
+getTimerHandler().setTimer(State1_time_event_0, (10 * 1000));
+getTimerHandler().setTimer(State1_time_event_1, 100);
+
+	}
+	private void exitActionsState1() {
+getTimerHandler().resetTimer(State1_time_event_0);
+getTimerHandler().resetTimer(State1_time_event_1);
+
+	}
+
+	protected void runCycle(Collection<?> events) {
+		getOutEvents().clear();
+		for (State state : activeStates) {
+			switch (state) {
+    		case State1:
+        		cycleState1(events);
+        		break;
+    		case State2:
+        		cycleState2(events);
+        		break;
+			default:
+				// no state found
+			}
+		}
+	}
+}

+ 29 - 0
test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/test_transition/Test_TransitionCyleBasedStatemachine.java

@@ -0,0 +1,29 @@
+
+/**
+ * Copyright (c) 2011 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.runtime.java.test_transition;
+
+import java.util.HashSet;
+
+import org.yakindu.sct.runtime.java.Event;
+
+public class Test_TransitionCyleBasedStatemachine extends Test_TransitionAbstractBaseStatemachine {
+
+	public Test_TransitionCyleBasedStatemachine() {
+		super(new HashSet<Event<?>>());
+	}
+
+	public void runCycle() {
+		runCycle(getOccuredEvents());
+		// remove all events
+		getOccuredEvents().clear();
+	}
+}

+ 37 - 0
test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/test_transition/Test_TransitionEventBasedStatemachine.java

@@ -0,0 +1,37 @@
+/**
+ * Copyright (c) 2011 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.runtime.java.test_transition;
+
+import java.util.Collections;
+import java.util.LinkedList;
+import java.util.Queue;
+
+import org.yakindu.sct.runtime.java.Event;
+
+public class Test_TransitionEventBasedStatemachine extends Test_TransitionAbstractBaseStatemachine {
+
+	public Test_TransitionEventBasedStatemachine() {
+		super(new LinkedList<Event<?>>());
+	}
+	
+	@Override
+	protected Queue<Event<?>> getOccuredEvents() {
+		return (Queue<Event<?>>) super.getOccuredEvents();
+	}
+	
+	@Override
+	public void runCycle() {
+		if (eventOccured()) {
+			Event<?> event = getOccuredEvents().poll();
+			runCycle(Collections.singletonList(event));
+		}
+	}
+}

+ 9 - 0
test-plugins/org.yakindu.sct.generator.java.runtime.test/src/org/yakindu/sct/generator/java/runtime/test/AllCycleBasedStatemachineTests.java

@@ -0,0 +1,9 @@
+package org.yakindu.sct.generator.java.runtime.test;
+
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+
+@RunWith(Suite.class)
+@Suite.SuiteClasses({ TestInterfaceTestCycleBasedStatemachine.class })
+public class AllCycleBasedStatemachineTests {
+}

+ 205 - 0
test-plugins/org.yakindu.sct.generator.java.runtime.test/src/org/yakindu/sct/generator/java/runtime/test/TestInterfaceTestCycleBasedStatemachine.java

@@ -0,0 +1,205 @@
+package org.yakindu.sct.generator.java.runtime.test;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.yakindu.sct.runtime.java.interfacetest.InterfaceTestAbstractBaseStatemachine.State;
+import org.yakindu.sct.runtime.java.interfacetest.InterfaceTestCyleBasedStatemachine;
+
+public class TestInterfaceTestCycleBasedStatemachine {
+
+	private InterfaceTestCyleBasedStatemachine statemachine;
+
+	@Before
+	public void setUp() {
+		statemachine = new InterfaceTestCyleBasedStatemachine();
+		statemachine.entry();
+	}
+
+	@After
+	public void tearDown() {
+		statemachine = null;
+	}
+
+	@Test
+	public void testStatemachineInitialisation() {
+		setUp();
+		assertEquals("InterfaceDefault.Var2 is not correct initialized:", 2.3,
+				statemachine.getInterfaceDefault().getVarVar2(),
+				Math.pow(10, -8));
+		assertEquals("InterfaceDefault.Var3 is not correct initialized:", 1,
+				statemachine.getInterfaceDefault().getVarVar3());
+		assertTrue("Statemachine isn't in State: " + State.State1.name() + ".",
+				statemachine.getActiveStates().contains(State.State1));
+		assertEquals("More than one state is active.", 1, statemachine
+				.getActiveStates().size());
+		tearDown();
+	}
+
+	@Test
+	public void testStatemachineRunCycle_1() {
+		setUp();
+		statemachine.getInterfaceDefault().raiseEvent1();
+		statemachine.runCycle();
+		// Test if state is changed to State2
+		assertTrue("Statemachine isn't in State: " + State.State2.name() + ".",
+				statemachine.getActiveStates().contains(State.State2));
+		// Test if only one state is active
+		assertEquals("More than one state is active.", 1, statemachine
+				.getActiveStates().size());
+		// Test if event2 is raised (happens in entry of State2
+		assertTrue("Event not raised: ", statemachine.getInterfaceDefault()
+				.isRaisedEvent2());
+		// Test if event2 value is set to 22 (happens in entry of State2
+		assertEquals("Event 2 value not set correct: ", 22, statemachine
+				.getInterfaceDefault().getEventEvent2().getValue().intValue());
+
+		statemachine.getInterfaceDefault().raiseEvent1();
+		statemachine.runCycle();
+		// Test if statemachine is back in State 1
+		assertTrue("Statemachine isn't in State: " + State.State1.name() + ".",
+				statemachine.getActiveStates().contains(State.State1));
+		// Test if only one state is active
+		assertEquals("More than one state is active.", 1, statemachine
+				.getActiveStates().size());
+		// Event 2 shouldn't be raised anymore
+		assertFalse("Event is still raised: ", statemachine
+				.getInterfaceDefault().isRaisedEvent2());
+		tearDown();
+	}
+
+	@Test
+	public void testStatemachineRunCycle_2() {
+		setUp();
+		statemachine.getInterfaceDefault().setVarVar2(-12.6);
+		statemachine.getInterfaceDefault().raiseEvent1();
+		statemachine.runCycle();
+		// Test if statemachine is still in State 1
+		assertTrue("Statemachine isn't in State: " + State.State1.name() + ".",
+				statemachine.getActiveStates().contains(State.State1));
+		// Test if only one state is active
+		assertEquals("More than one state is active.", 1, statemachine
+				.getActiveStates().size());
+		// Event 2 shouldn't be raised
+		assertFalse("Event is still raised: ", statemachine
+				.getInterfaceDefault().isRaisedEvent2());
+		// Event 2 value should not be set to 22
+		assertTrue("Event value is set to 22: ", statemachine
+				.getInterfaceDefault().getEventEvent2().getValue() != 22);
+
+		statemachine.getInterfaceDefault().raiseEvent1();
+		statemachine.getInterfaceDefault().setVarVar2(213.55);
+		statemachine.runCycle();
+		// Test if state is changed to State2
+		assertTrue("Statemachine isn't in State: " + State.State2.name() + ".",
+				statemachine.getActiveStates().contains(State.State2));
+		// Test if only one state is active
+		assertEquals("More than one state is active.", 1, statemachine
+				.getActiveStates().size());
+		// Test if event2 is raised (happens in entry of State2
+		assertTrue("Event not raised: ", statemachine.getInterfaceDefault()
+				.isRaisedEvent2());
+		// Test if event2 value is set to 22 (happens in entry of State2
+		assertEquals("Event 2 value not set correct: ", 22, statemachine
+				.getInterfaceDefault().getEventEvent2().getValue().intValue());
+
+		tearDown();
+	}
+
+	@Test
+	public void testStatemachineRunCycle_3() {
+		setUp();
+		statemachine.getInterfaceOther().raiseEvent3();
+		statemachine.runCycle();
+		// Test if state is changed to State3
+		assertTrue("Statemachine isn't in State: " + State.State3.name() + ".",
+				statemachine.getActiveStates().contains(State.State3));
+		// Test if only one state is active
+		assertEquals("More than one state is active.", 1, statemachine
+				.getActiveStates().size());
+		// Test if event4 is raised (happens in entry of State3
+		assertTrue("Event not raised: ", statemachine.getInterfaceOther()
+				.isRaisedEvent4());
+
+		statemachine.getInterfaceOther().raiseEvent3();
+		statemachine.runCycle();
+		// Test if statemachine is back in State 1
+		assertTrue("Statemachine isn't in State: " + State.State1.name() + ".",
+				statemachine.getActiveStates().contains(State.State1));
+		// Test if only one state is active
+		assertEquals("More than one state is active.", 1, statemachine
+				.getActiveStates().size());
+		// Event 4 shouldn't be raised anymore
+		assertFalse("Event is still raised: ", statemachine.getInterfaceOther()
+				.isRaisedEvent4());
+		tearDown();
+	}
+
+	@Test
+	public void testStatemachineRunCycle_4() {
+		setUp();
+		statemachine.getInterfaceDefault().setVarVar3(2);
+		statemachine.getInterfaceOther().raiseEvent3();
+		statemachine.runCycle();
+		// Test if state is changed to State1
+		assertTrue("Statemachine isn't in State: " + State.State1.name() + ".",
+				statemachine.getActiveStates().contains(State.State1));
+		// Test if only one state is active
+		assertEquals("More than one state is active.", 1, statemachine
+				.getActiveStates().size());
+		// Test if event4 is not raised
+		assertFalse("Event not raised: ", statemachine.getInterfaceOther()
+				.isRaisedEvent4());
+
+		statemachine.getInterfaceOther().raiseEvent3();
+		statemachine.getInterfaceDefault().setVarVar3(1);
+		statemachine.runCycle();
+		// Test if state is changed to State3
+		assertTrue("Statemachine isn't in State: " + State.State3.name() + ".",
+				statemachine.getActiveStates().contains(State.State3));
+		// Test if only one state is active
+		assertEquals("More than one state is active.", 1, statemachine
+				.getActiveStates().size());
+		// Test if event4 is raised (happens in entry of State3
+		assertTrue("Event not raised: ", statemachine.getInterfaceOther()
+				.isRaisedEvent4());
+		tearDown();
+	}
+
+	@Test
+	public void testStatemachineRunCycle_5() {
+		setUp();
+		statemachine.getInterfaceDefault().setVarVar1(true);
+		statemachine.getInterfaceThird().raiseEvent5();
+		statemachine.runCycle();
+		// Test if state is changed to State4
+		assertTrue("Statemachine isn't in State: " + State.State4.name() + ".",
+				statemachine.getActiveStates().contains(State.State4));
+		// Test if only one state is active
+		assertEquals("More than one state is active.", 1, statemachine
+				.getActiveStates().size());
+		// Test if event6 is raised
+		assertTrue("Event not raised: ", statemachine.getInterfaceThird()
+				.isRaisedEvent6());
+		// Test if event6 is set to true;
+		assertTrue("Event 6 not set: ",statemachine.getInterfaceThird()
+				.getEventEvent6().getValue());
+
+		statemachine.getInterfaceThird().raiseEvent5();
+		statemachine.runCycle();
+		// Test if state is changed to State1
+		assertTrue("Statemachine isn't in State: " + State.State1.name() + ".",
+				statemachine.getActiveStates().contains(State.State1));
+		// Test if only one state is active
+		assertEquals("More than one state is active.", 1, statemachine
+				.getActiveStates().size());
+		// Test if event6 is not raised
+		assertFalse("Event raised: ", statemachine.getInterfaceThird()
+				.isRaisedEvent6());
+		tearDown();
+	}
+}