Browse Source

added support for exit and entry actions ...

terfloth@itemis.de 14 years ago
parent
commit
879e8da4f1
29 changed files with 898 additions and 48 deletions
  1. BIN
      plugins/org.yakindu.sct.model.sexec.edit/icons/full/ctool16/CreateExecutionState_entryAction_Call.gif
  2. BIN
      plugins/org.yakindu.sct.model.sexec.edit/icons/full/ctool16/CreateExecutionState_entryAction_Check.gif
  3. BIN
      plugins/org.yakindu.sct.model.sexec.edit/icons/full/ctool16/CreateExecutionState_entryAction_CheckRef.gif
  4. BIN
      plugins/org.yakindu.sct.model.sexec.edit/icons/full/ctool16/CreateExecutionState_entryAction_Cycle.gif
  5. BIN
      plugins/org.yakindu.sct.model.sexec.edit/icons/full/ctool16/CreateExecutionState_entryAction_EnterState.gif
  6. BIN
      plugins/org.yakindu.sct.model.sexec.edit/icons/full/ctool16/CreateExecutionState_entryAction_Execution.gif
  7. BIN
      plugins/org.yakindu.sct.model.sexec.edit/icons/full/ctool16/CreateExecutionState_entryAction_ExitState.gif
  8. BIN
      plugins/org.yakindu.sct.model.sexec.edit/icons/full/ctool16/CreateExecutionState_entryAction_If.gif
  9. BIN
      plugins/org.yakindu.sct.model.sexec.edit/icons/full/ctool16/CreateExecutionState_entryAction_Sequence.gif
  10. BIN
      plugins/org.yakindu.sct.model.sexec.edit/icons/full/ctool16/CreateExecutionState_exitAction_Call.gif
  11. BIN
      plugins/org.yakindu.sct.model.sexec.edit/icons/full/ctool16/CreateExecutionState_exitAction_Check.gif
  12. BIN
      plugins/org.yakindu.sct.model.sexec.edit/icons/full/ctool16/CreateExecutionState_exitAction_CheckRef.gif
  13. BIN
      plugins/org.yakindu.sct.model.sexec.edit/icons/full/ctool16/CreateExecutionState_exitAction_Cycle.gif
  14. BIN
      plugins/org.yakindu.sct.model.sexec.edit/icons/full/ctool16/CreateExecutionState_exitAction_EnterState.gif
  15. BIN
      plugins/org.yakindu.sct.model.sexec.edit/icons/full/ctool16/CreateExecutionState_exitAction_Execution.gif
  16. BIN
      plugins/org.yakindu.sct.model.sexec.edit/icons/full/ctool16/CreateExecutionState_exitAction_ExitState.gif
  17. BIN
      plugins/org.yakindu.sct.model.sexec.edit/icons/full/ctool16/CreateExecutionState_exitAction_If.gif
  18. BIN
      plugins/org.yakindu.sct.model.sexec.edit/icons/full/ctool16/CreateExecutionState_exitAction_Sequence.gif
  19. 2 0
      plugins/org.yakindu.sct.model.sexec.edit/plugin.properties
  20. 118 0
      plugins/org.yakindu.sct.model.sexec.edit/src/org/yakindu/sct/model/sexec/provider/ExecutionStateItemProvider.java
  21. 6 2
      plugins/org.yakindu.sct.model.sexec/model/sexec.ecore
  22. 55 1
      plugins/org.yakindu.sct.model.sexec/src/org/yakindu/sct/model/sexec/ExecutionState.java
  23. 61 5
      plugins/org.yakindu.sct.model.sexec/src/org/yakindu/sct/model/sexec/SexecPackage.java
  24. 148 15
      plugins/org.yakindu.sct.model.sexec/src/org/yakindu/sct/model/sexec/impl/ExecutionStateImpl.java
  25. 27 5
      plugins/org.yakindu.sct.model.sexec/src/org/yakindu/sct/model/sexec/impl/SexecPackageImpl.java
  26. 65 2
      plugins/org.yakindu.sct.model.sexec/src/org/yakindu/sct/model/sexec/transformation/ModelSequencer.xtend
  27. 244 17
      plugins/org.yakindu.sct.model.sexec/xtend-gen/org/yakindu/sct/model/sexec/transformation/ModelSequencer.java
  28. 133 1
      test-plugins/org.yakindu.sct.model.sexec.test/src/org/yakindu/sct/model/sexec/transformation/test/ModelSequencerTest.java
  29. 39 0
      test-plugins/org.yakindu.sct.model.sexec.test/src/org/yakindu/sct/model/sexec/transformation/test/SCTTestUtil.java

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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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

@@ -66,3 +66,5 @@ _UI_CheckRef_type = Check Ref
 _UI_CheckRef_check_feature = Check
 _UI_Call_type = Call
 _UI_Call_step_feature = Step
+_UI_ExecutionState_entryAction_feature = Entry Action
+_UI_ExecutionState_exitAction_feature = Exit Action

+ 118 - 0
plugins/org.yakindu.sct.model.sexec.edit/src/org/yakindu/sct/model/sexec/provider/ExecutionStateItemProvider.java

@@ -129,6 +129,8 @@ public class ExecutionStateItemProvider
 			super.getChildrenFeatures(object);
 			childrenFeatures.add(SexecPackage.Literals.EXECUTION_STATE__CYCLE);
 			childrenFeatures.add(SexecPackage.Literals.EXECUTION_STATE__REACTIONS);
+			childrenFeatures.add(SexecPackage.Literals.EXECUTION_STATE__ENTRY_ACTION);
+			childrenFeatures.add(SexecPackage.Literals.EXECUTION_STATE__EXIT_ACTION);
 		}
 		return childrenFeatures;
 	}
@@ -189,6 +191,8 @@ public class ExecutionStateItemProvider
 				return;
 			case SexecPackage.EXECUTION_STATE__CYCLE:
 			case SexecPackage.EXECUTION_STATE__REACTIONS:
+			case SexecPackage.EXECUTION_STATE__ENTRY_ACTION:
+			case SexecPackage.EXECUTION_STATE__EXIT_ACTION:
 				fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false));
 				return;
 		}
@@ -215,6 +219,120 @@ public class ExecutionStateItemProvider
 			(createChildParameter
 				(SexecPackage.Literals.EXECUTION_STATE__REACTIONS,
 				 SexecFactory.eINSTANCE.createReaction()));
+
+		newChildDescriptors.add
+			(createChildParameter
+				(SexecPackage.Literals.EXECUTION_STATE__ENTRY_ACTION,
+				 SexecFactory.eINSTANCE.createSequence()));
+
+		newChildDescriptors.add
+			(createChildParameter
+				(SexecPackage.Literals.EXECUTION_STATE__ENTRY_ACTION,
+				 SexecFactory.eINSTANCE.createCycle()));
+
+		newChildDescriptors.add
+			(createChildParameter
+				(SexecPackage.Literals.EXECUTION_STATE__ENTRY_ACTION,
+				 SexecFactory.eINSTANCE.createCheck()));
+
+		newChildDescriptors.add
+			(createChildParameter
+				(SexecPackage.Literals.EXECUTION_STATE__ENTRY_ACTION,
+				 SexecFactory.eINSTANCE.createIf()));
+
+		newChildDescriptors.add
+			(createChildParameter
+				(SexecPackage.Literals.EXECUTION_STATE__ENTRY_ACTION,
+				 SexecFactory.eINSTANCE.createExecution()));
+
+		newChildDescriptors.add
+			(createChildParameter
+				(SexecPackage.Literals.EXECUTION_STATE__ENTRY_ACTION,
+				 SexecFactory.eINSTANCE.createEnterState()));
+
+		newChildDescriptors.add
+			(createChildParameter
+				(SexecPackage.Literals.EXECUTION_STATE__ENTRY_ACTION,
+				 SexecFactory.eINSTANCE.createExitState()));
+
+		newChildDescriptors.add
+			(createChildParameter
+				(SexecPackage.Literals.EXECUTION_STATE__ENTRY_ACTION,
+				 SexecFactory.eINSTANCE.createCall()));
+
+		newChildDescriptors.add
+			(createChildParameter
+				(SexecPackage.Literals.EXECUTION_STATE__ENTRY_ACTION,
+				 SexecFactory.eINSTANCE.createCheckRef()));
+
+		newChildDescriptors.add
+			(createChildParameter
+				(SexecPackage.Literals.EXECUTION_STATE__EXIT_ACTION,
+				 SexecFactory.eINSTANCE.createSequence()));
+
+		newChildDescriptors.add
+			(createChildParameter
+				(SexecPackage.Literals.EXECUTION_STATE__EXIT_ACTION,
+				 SexecFactory.eINSTANCE.createCycle()));
+
+		newChildDescriptors.add
+			(createChildParameter
+				(SexecPackage.Literals.EXECUTION_STATE__EXIT_ACTION,
+				 SexecFactory.eINSTANCE.createCheck()));
+
+		newChildDescriptors.add
+			(createChildParameter
+				(SexecPackage.Literals.EXECUTION_STATE__EXIT_ACTION,
+				 SexecFactory.eINSTANCE.createIf()));
+
+		newChildDescriptors.add
+			(createChildParameter
+				(SexecPackage.Literals.EXECUTION_STATE__EXIT_ACTION,
+				 SexecFactory.eINSTANCE.createExecution()));
+
+		newChildDescriptors.add
+			(createChildParameter
+				(SexecPackage.Literals.EXECUTION_STATE__EXIT_ACTION,
+				 SexecFactory.eINSTANCE.createEnterState()));
+
+		newChildDescriptors.add
+			(createChildParameter
+				(SexecPackage.Literals.EXECUTION_STATE__EXIT_ACTION,
+				 SexecFactory.eINSTANCE.createExitState()));
+
+		newChildDescriptors.add
+			(createChildParameter
+				(SexecPackage.Literals.EXECUTION_STATE__EXIT_ACTION,
+				 SexecFactory.eINSTANCE.createCall()));
+
+		newChildDescriptors.add
+			(createChildParameter
+				(SexecPackage.Literals.EXECUTION_STATE__EXIT_ACTION,
+				 SexecFactory.eINSTANCE.createCheckRef()));
+	}
+
+	/**
+	 * This returns the label text for {@link org.eclipse.emf.edit.command.CreateChildCommand}.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	@Override
+	public String getCreateChildText(Object owner, Object feature, Object child, Collection<?> selection) {
+		Object childFeature = feature;
+		Object childObject = child;
+
+		boolean qualify =
+			childFeature == SexecPackage.Literals.EXECUTION_STATE__CYCLE ||
+			childFeature == SexecPackage.Literals.EXECUTION_STATE__ENTRY_ACTION ||
+			childFeature == SexecPackage.Literals.EXECUTION_STATE__EXIT_ACTION;
+
+		if (qualify) {
+			return getString
+				("_UI_CreateChild_text2",
+				 new Object[] { getTypeText(childObject), getFeatureText(childFeature), getTypeText(owner) });
+		}
+		return super.getCreateChildText(owner, feature, child, selection);
 	}
 
 }

+ 6 - 2
plugins/org.yakindu.sct.model.sexec/model/sexec.ecore

@@ -15,12 +15,16 @@
   </eClassifiers>
   <eClassifiers xsi:type="ecore:EClass" name="ExecutionState" eSuperTypes="#//NamedElement">
     <eStructuralFeatures xsi:type="ecore:EAttribute" name="simpleName" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+    <eStructuralFeatures xsi:type="ecore:EAttribute" name="leaf" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"
+        defaultValueLiteral="false"/>
     <eStructuralFeatures xsi:type="ecore:EReference" name="cycle" eType="#//Cycle"
         containment="true"/>
     <eStructuralFeatures xsi:type="ecore:EReference" name="reactions" upperBound="-1"
         eType="#//Reaction" containment="true"/>
-    <eStructuralFeatures xsi:type="ecore:EAttribute" name="leaf" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"
-        defaultValueLiteral="false"/>
+    <eStructuralFeatures xsi:type="ecore:EReference" name="entryAction" eType="#//Step"
+        containment="true"/>
+    <eStructuralFeatures xsi:type="ecore:EReference" name="exitAction" eType="#//Step"
+        containment="true"/>
   </eClassifiers>
   <eClassifiers xsi:type="ecore:EClass" name="Reaction" eSuperTypes="#//NamedElement">
     <eStructuralFeatures xsi:type="ecore:EReference" name="check" eType="#//Check"

+ 55 - 1
plugins/org.yakindu.sct.model.sexec/src/org/yakindu/sct/model/sexec/ExecutionState.java

@@ -17,9 +17,11 @@ import org.eclipse.emf.common.util.EList;
  * The following features are supported:
  * <ul>
  *   <li>{@link org.yakindu.sct.model.sexec.ExecutionState#getSimpleName <em>Simple Name</em>}</li>
+ *   <li>{@link org.yakindu.sct.model.sexec.ExecutionState#isLeaf <em>Leaf</em>}</li>
  *   <li>{@link org.yakindu.sct.model.sexec.ExecutionState#getCycle <em>Cycle</em>}</li>
  *   <li>{@link org.yakindu.sct.model.sexec.ExecutionState#getReactions <em>Reactions</em>}</li>
- *   <li>{@link org.yakindu.sct.model.sexec.ExecutionState#isLeaf <em>Leaf</em>}</li>
+ *   <li>{@link org.yakindu.sct.model.sexec.ExecutionState#getEntryAction <em>Entry Action</em>}</li>
+ *   <li>{@link org.yakindu.sct.model.sexec.ExecutionState#getExitAction <em>Exit Action</em>}</li>
  * </ul>
  * </p>
  *
@@ -96,6 +98,58 @@ public interface ExecutionState extends NamedElement {
 	 */
 	EList<Reaction> getReactions();
 
+	/**
+	 * Returns the value of the '<em><b>Entry Action</b></em>' containment reference.
+	 * <!-- begin-user-doc -->
+	 * <p>
+	 * If the meaning of the '<em>Entry Action</em>' containment reference isn't clear,
+	 * there really should be more of a description here...
+	 * </p>
+	 * <!-- end-user-doc -->
+	 * @return the value of the '<em>Entry Action</em>' containment reference.
+	 * @see #setEntryAction(Step)
+	 * @see org.yakindu.sct.model.sexec.SexecPackage#getExecutionState_EntryAction()
+	 * @model containment="true"
+	 * @generated
+	 */
+	Step getEntryAction();
+
+	/**
+	 * Sets the value of the '{@link org.yakindu.sct.model.sexec.ExecutionState#getEntryAction <em>Entry Action</em>}' containment reference.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @param value the new value of the '<em>Entry Action</em>' containment reference.
+	 * @see #getEntryAction()
+	 * @generated
+	 */
+	void setEntryAction(Step value);
+
+	/**
+	 * Returns the value of the '<em><b>Exit Action</b></em>' containment reference.
+	 * <!-- begin-user-doc -->
+	 * <p>
+	 * If the meaning of the '<em>Exit Action</em>' containment reference isn't clear,
+	 * there really should be more of a description here...
+	 * </p>
+	 * <!-- end-user-doc -->
+	 * @return the value of the '<em>Exit Action</em>' containment reference.
+	 * @see #setExitAction(Step)
+	 * @see org.yakindu.sct.model.sexec.SexecPackage#getExecutionState_ExitAction()
+	 * @model containment="true"
+	 * @generated
+	 */
+	Step getExitAction();
+
+	/**
+	 * Sets the value of the '{@link org.yakindu.sct.model.sexec.ExecutionState#getExitAction <em>Exit Action</em>}' containment reference.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @param value the new value of the '<em>Exit Action</em>' containment reference.
+	 * @see #getExitAction()
+	 * @generated
+	 */
+	void setExitAction(Step value);
+
 	/**
 	 * Returns the value of the '<em><b>Leaf</b></em>' attribute.
 	 * The default value is <code>"false"</code>.

+ 61 - 5
plugins/org.yakindu.sct.model.sexec/src/org/yakindu/sct/model/sexec/SexecPackage.java

@@ -189,6 +189,15 @@ public interface SexecPackage extends EPackage {
 	 */
 	int EXECUTION_STATE__SIMPLE_NAME = NAMED_ELEMENT_FEATURE_COUNT + 0;
 
+	/**
+	 * The feature id for the '<em><b>Leaf</b></em>' attribute.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 * @ordered
+	 */
+	int EXECUTION_STATE__LEAF = NAMED_ELEMENT_FEATURE_COUNT + 1;
+
 	/**
 	 * The feature id for the '<em><b>Cycle</b></em>' containment reference.
 	 * <!-- begin-user-doc -->
@@ -196,7 +205,7 @@ public interface SexecPackage extends EPackage {
 	 * @generated
 	 * @ordered
 	 */
-	int EXECUTION_STATE__CYCLE = NAMED_ELEMENT_FEATURE_COUNT + 1;
+	int EXECUTION_STATE__CYCLE = NAMED_ELEMENT_FEATURE_COUNT + 2;
 
 	/**
 	 * The feature id for the '<em><b>Reactions</b></em>' containment reference list.
@@ -205,16 +214,25 @@ public interface SexecPackage extends EPackage {
 	 * @generated
 	 * @ordered
 	 */
-	int EXECUTION_STATE__REACTIONS = NAMED_ELEMENT_FEATURE_COUNT + 2;
+	int EXECUTION_STATE__REACTIONS = NAMED_ELEMENT_FEATURE_COUNT + 3;
 
 	/**
-	 * The feature id for the '<em><b>Leaf</b></em>' attribute.
+	 * The feature id for the '<em><b>Entry Action</b></em>' containment reference.
 	 * <!-- begin-user-doc -->
 	 * <!-- end-user-doc -->
 	 * @generated
 	 * @ordered
 	 */
-	int EXECUTION_STATE__LEAF = NAMED_ELEMENT_FEATURE_COUNT + 3;
+	int EXECUTION_STATE__ENTRY_ACTION = NAMED_ELEMENT_FEATURE_COUNT + 4;
+
+	/**
+	 * The feature id for the '<em><b>Exit Action</b></em>' containment reference.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 * @ordered
+	 */
+	int EXECUTION_STATE__EXIT_ACTION = NAMED_ELEMENT_FEATURE_COUNT + 5;
 
 	/**
 	 * The number of structural features of the '<em>Execution State</em>' class.
@@ -223,7 +241,7 @@ public interface SexecPackage extends EPackage {
 	 * @generated
 	 * @ordered
 	 */
-	int EXECUTION_STATE_FEATURE_COUNT = NAMED_ELEMENT_FEATURE_COUNT + 4;
+	int EXECUTION_STATE_FEATURE_COUNT = NAMED_ELEMENT_FEATURE_COUNT + 6;
 
 	/**
 	 * The meta object id for the '{@link org.yakindu.sct.model.sexec.impl.ReactionImpl <em>Reaction</em>}' class.
@@ -884,6 +902,28 @@ public interface SexecPackage extends EPackage {
 	 */
 	EReference getExecutionState_Reactions();
 
+	/**
+	 * Returns the meta object for the containment reference '{@link org.yakindu.sct.model.sexec.ExecutionState#getEntryAction <em>Entry Action</em>}'.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @return the meta object for the containment reference '<em>Entry Action</em>'.
+	 * @see org.yakindu.sct.model.sexec.ExecutionState#getEntryAction()
+	 * @see #getExecutionState()
+	 * @generated
+	 */
+	EReference getExecutionState_EntryAction();
+
+	/**
+	 * Returns the meta object for the containment reference '{@link org.yakindu.sct.model.sexec.ExecutionState#getExitAction <em>Exit Action</em>}'.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @return the meta object for the containment reference '<em>Exit Action</em>'.
+	 * @see org.yakindu.sct.model.sexec.ExecutionState#getExitAction()
+	 * @see #getExecutionState()
+	 * @generated
+	 */
+	EReference getExecutionState_ExitAction();
+
 	/**
 	 * Returns the meta object for the attribute '{@link org.yakindu.sct.model.sexec.ExecutionState#isLeaf <em>Leaf</em>}'.
 	 * <!-- begin-user-doc -->
@@ -1299,6 +1339,22 @@ public interface SexecPackage extends EPackage {
 		 */
 		EReference EXECUTION_STATE__REACTIONS = eINSTANCE.getExecutionState_Reactions();
 
+		/**
+		 * The meta object literal for the '<em><b>Entry Action</b></em>' containment reference feature.
+		 * <!-- begin-user-doc -->
+		 * <!-- end-user-doc -->
+		 * @generated
+		 */
+		EReference EXECUTION_STATE__ENTRY_ACTION = eINSTANCE.getExecutionState_EntryAction();
+
+		/**
+		 * The meta object literal for the '<em><b>Exit Action</b></em>' containment reference feature.
+		 * <!-- begin-user-doc -->
+		 * <!-- end-user-doc -->
+		 * @generated
+		 */
+		EReference EXECUTION_STATE__EXIT_ACTION = eINSTANCE.getExecutionState_ExitAction();
+
 		/**
 		 * The meta object literal for the '<em><b>Leaf</b></em>' attribute feature.
 		 * <!-- begin-user-doc -->

+ 148 - 15
plugins/org.yakindu.sct.model.sexec/src/org/yakindu/sct/model/sexec/impl/ExecutionStateImpl.java

@@ -22,6 +22,7 @@ import org.yakindu.sct.model.sexec.Cycle;
 import org.yakindu.sct.model.sexec.ExecutionState;
 import org.yakindu.sct.model.sexec.Reaction;
 import org.yakindu.sct.model.sexec.SexecPackage;
+import org.yakindu.sct.model.sexec.Step;
 
 /**
  * <!-- begin-user-doc -->
@@ -31,9 +32,11 @@ import org.yakindu.sct.model.sexec.SexecPackage;
  * The following features are implemented:
  * <ul>
  *   <li>{@link org.yakindu.sct.model.sexec.impl.ExecutionStateImpl#getSimpleName <em>Simple Name</em>}</li>
+ *   <li>{@link org.yakindu.sct.model.sexec.impl.ExecutionStateImpl#isLeaf <em>Leaf</em>}</li>
  *   <li>{@link org.yakindu.sct.model.sexec.impl.ExecutionStateImpl#getCycle <em>Cycle</em>}</li>
  *   <li>{@link org.yakindu.sct.model.sexec.impl.ExecutionStateImpl#getReactions <em>Reactions</em>}</li>
- *   <li>{@link org.yakindu.sct.model.sexec.impl.ExecutionStateImpl#isLeaf <em>Leaf</em>}</li>
+ *   <li>{@link org.yakindu.sct.model.sexec.impl.ExecutionStateImpl#getEntryAction <em>Entry Action</em>}</li>
+ *   <li>{@link org.yakindu.sct.model.sexec.impl.ExecutionStateImpl#getExitAction <em>Exit Action</em>}</li>
  * </ul>
  * </p>
  *
@@ -60,6 +63,26 @@ public class ExecutionStateImpl extends NamedElementImpl implements ExecutionSta
 	 */
 	protected String simpleName = SIMPLE_NAME_EDEFAULT;
 
+	/**
+	 * The default value of the '{@link #isLeaf() <em>Leaf</em>}' attribute.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @see #isLeaf()
+	 * @generated
+	 * @ordered
+	 */
+	protected static final boolean LEAF_EDEFAULT = false;
+
+	/**
+	 * The cached value of the '{@link #isLeaf() <em>Leaf</em>}' attribute.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @see #isLeaf()
+	 * @generated
+	 * @ordered
+	 */
+	protected boolean leaf = LEAF_EDEFAULT;
+
 	/**
 	 * The cached value of the '{@link #getCycle() <em>Cycle</em>}' containment reference.
 	 * <!-- begin-user-doc -->
@@ -81,24 +104,24 @@ public class ExecutionStateImpl extends NamedElementImpl implements ExecutionSta
 	protected EList<Reaction> reactions;
 
 	/**
-	 * The default value of the '{@link #isLeaf() <em>Leaf</em>}' attribute.
+	 * The cached value of the '{@link #getEntryAction() <em>Entry Action</em>}' containment reference.
 	 * <!-- begin-user-doc -->
 	 * <!-- end-user-doc -->
-	 * @see #isLeaf()
+	 * @see #getEntryAction()
 	 * @generated
 	 * @ordered
 	 */
-	protected static final boolean LEAF_EDEFAULT = false;
+	protected Step entryAction;
 
 	/**
-	 * The cached value of the '{@link #isLeaf() <em>Leaf</em>}' attribute.
+	 * The cached value of the '{@link #getExitAction() <em>Exit Action</em>}' containment reference.
 	 * <!-- begin-user-doc -->
 	 * <!-- end-user-doc -->
-	 * @see #isLeaf()
+	 * @see #getExitAction()
 	 * @generated
 	 * @ordered
 	 */
-	protected boolean leaf = LEAF_EDEFAULT;
+	protected Step exitAction;
 
 	/**
 	 * <!-- begin-user-doc -->
@@ -195,6 +218,92 @@ public class ExecutionStateImpl extends NamedElementImpl implements ExecutionSta
 		return reactions;
 	}
 
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public Step getEntryAction() {
+		return entryAction;
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public NotificationChain basicSetEntryAction(Step newEntryAction, NotificationChain msgs) {
+		Step oldEntryAction = entryAction;
+		entryAction = newEntryAction;
+		if (eNotificationRequired()) {
+			ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, SexecPackage.EXECUTION_STATE__ENTRY_ACTION, oldEntryAction, newEntryAction);
+			if (msgs == null) msgs = notification; else msgs.add(notification);
+		}
+		return msgs;
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public void setEntryAction(Step newEntryAction) {
+		if (newEntryAction != entryAction) {
+			NotificationChain msgs = null;
+			if (entryAction != null)
+				msgs = ((InternalEObject)entryAction).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - SexecPackage.EXECUTION_STATE__ENTRY_ACTION, null, msgs);
+			if (newEntryAction != null)
+				msgs = ((InternalEObject)newEntryAction).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - SexecPackage.EXECUTION_STATE__ENTRY_ACTION, null, msgs);
+			msgs = basicSetEntryAction(newEntryAction, msgs);
+			if (msgs != null) msgs.dispatch();
+		}
+		else if (eNotificationRequired())
+			eNotify(new ENotificationImpl(this, Notification.SET, SexecPackage.EXECUTION_STATE__ENTRY_ACTION, newEntryAction, newEntryAction));
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public Step getExitAction() {
+		return exitAction;
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public NotificationChain basicSetExitAction(Step newExitAction, NotificationChain msgs) {
+		Step oldExitAction = exitAction;
+		exitAction = newExitAction;
+		if (eNotificationRequired()) {
+			ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, SexecPackage.EXECUTION_STATE__EXIT_ACTION, oldExitAction, newExitAction);
+			if (msgs == null) msgs = notification; else msgs.add(notification);
+		}
+		return msgs;
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public void setExitAction(Step newExitAction) {
+		if (newExitAction != exitAction) {
+			NotificationChain msgs = null;
+			if (exitAction != null)
+				msgs = ((InternalEObject)exitAction).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - SexecPackage.EXECUTION_STATE__EXIT_ACTION, null, msgs);
+			if (newExitAction != null)
+				msgs = ((InternalEObject)newExitAction).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - SexecPackage.EXECUTION_STATE__EXIT_ACTION, null, msgs);
+			msgs = basicSetExitAction(newExitAction, msgs);
+			if (msgs != null) msgs.dispatch();
+		}
+		else if (eNotificationRequired())
+			eNotify(new ENotificationImpl(this, Notification.SET, SexecPackage.EXECUTION_STATE__EXIT_ACTION, newExitAction, newExitAction));
+	}
+
 	/**
 	 * <!-- begin-user-doc -->
 	 * <!-- end-user-doc -->
@@ -228,6 +337,10 @@ public class ExecutionStateImpl extends NamedElementImpl implements ExecutionSta
 				return basicSetCycle(null, msgs);
 			case SexecPackage.EXECUTION_STATE__REACTIONS:
 				return ((InternalEList<?>)getReactions()).basicRemove(otherEnd, msgs);
+			case SexecPackage.EXECUTION_STATE__ENTRY_ACTION:
+				return basicSetEntryAction(null, msgs);
+			case SexecPackage.EXECUTION_STATE__EXIT_ACTION:
+				return basicSetExitAction(null, msgs);
 		}
 		return super.eInverseRemove(otherEnd, featureID, msgs);
 	}
@@ -242,12 +355,16 @@ public class ExecutionStateImpl extends NamedElementImpl implements ExecutionSta
 		switch (featureID) {
 			case SexecPackage.EXECUTION_STATE__SIMPLE_NAME:
 				return getSimpleName();
+			case SexecPackage.EXECUTION_STATE__LEAF:
+				return isLeaf();
 			case SexecPackage.EXECUTION_STATE__CYCLE:
 				return getCycle();
 			case SexecPackage.EXECUTION_STATE__REACTIONS:
 				return getReactions();
-			case SexecPackage.EXECUTION_STATE__LEAF:
-				return isLeaf();
+			case SexecPackage.EXECUTION_STATE__ENTRY_ACTION:
+				return getEntryAction();
+			case SexecPackage.EXECUTION_STATE__EXIT_ACTION:
+				return getExitAction();
 		}
 		return super.eGet(featureID, resolve, coreType);
 	}
@@ -264,6 +381,9 @@ public class ExecutionStateImpl extends NamedElementImpl implements ExecutionSta
 			case SexecPackage.EXECUTION_STATE__SIMPLE_NAME:
 				setSimpleName((String)newValue);
 				return;
+			case SexecPackage.EXECUTION_STATE__LEAF:
+				setLeaf((Boolean)newValue);
+				return;
 			case SexecPackage.EXECUTION_STATE__CYCLE:
 				setCycle((Cycle)newValue);
 				return;
@@ -271,8 +391,11 @@ public class ExecutionStateImpl extends NamedElementImpl implements ExecutionSta
 				getReactions().clear();
 				getReactions().addAll((Collection<? extends Reaction>)newValue);
 				return;
-			case SexecPackage.EXECUTION_STATE__LEAF:
-				setLeaf((Boolean)newValue);
+			case SexecPackage.EXECUTION_STATE__ENTRY_ACTION:
+				setEntryAction((Step)newValue);
+				return;
+			case SexecPackage.EXECUTION_STATE__EXIT_ACTION:
+				setExitAction((Step)newValue);
 				return;
 		}
 		super.eSet(featureID, newValue);
@@ -289,14 +412,20 @@ public class ExecutionStateImpl extends NamedElementImpl implements ExecutionSta
 			case SexecPackage.EXECUTION_STATE__SIMPLE_NAME:
 				setSimpleName(SIMPLE_NAME_EDEFAULT);
 				return;
+			case SexecPackage.EXECUTION_STATE__LEAF:
+				setLeaf(LEAF_EDEFAULT);
+				return;
 			case SexecPackage.EXECUTION_STATE__CYCLE:
 				setCycle((Cycle)null);
 				return;
 			case SexecPackage.EXECUTION_STATE__REACTIONS:
 				getReactions().clear();
 				return;
-			case SexecPackage.EXECUTION_STATE__LEAF:
-				setLeaf(LEAF_EDEFAULT);
+			case SexecPackage.EXECUTION_STATE__ENTRY_ACTION:
+				setEntryAction((Step)null);
+				return;
+			case SexecPackage.EXECUTION_STATE__EXIT_ACTION:
+				setExitAction((Step)null);
 				return;
 		}
 		super.eUnset(featureID);
@@ -312,12 +441,16 @@ public class ExecutionStateImpl extends NamedElementImpl implements ExecutionSta
 		switch (featureID) {
 			case SexecPackage.EXECUTION_STATE__SIMPLE_NAME:
 				return SIMPLE_NAME_EDEFAULT == null ? simpleName != null : !SIMPLE_NAME_EDEFAULT.equals(simpleName);
+			case SexecPackage.EXECUTION_STATE__LEAF:
+				return leaf != LEAF_EDEFAULT;
 			case SexecPackage.EXECUTION_STATE__CYCLE:
 				return cycle != null;
 			case SexecPackage.EXECUTION_STATE__REACTIONS:
 				return reactions != null && !reactions.isEmpty();
-			case SexecPackage.EXECUTION_STATE__LEAF:
-				return leaf != LEAF_EDEFAULT;
+			case SexecPackage.EXECUTION_STATE__ENTRY_ACTION:
+				return entryAction != null;
+			case SexecPackage.EXECUTION_STATE__EXIT_ACTION:
+				return exitAction != null;
 		}
 		return super.eIsSet(featureID);
 	}

+ 27 - 5
plugins/org.yakindu.sct.model.sexec/src/org/yakindu/sct/model/sexec/impl/SexecPackageImpl.java

@@ -275,7 +275,7 @@ public class SexecPackageImpl extends EPackageImpl implements SexecPackage {
 	 * @generated
 	 */
 	public EReference getExecutionState_Cycle() {
-		return (EReference)executionStateEClass.getEStructuralFeatures().get(1);
+		return (EReference)executionStateEClass.getEStructuralFeatures().get(2);
 	}
 
 	/**
@@ -284,7 +284,25 @@ public class SexecPackageImpl extends EPackageImpl implements SexecPackage {
 	 * @generated
 	 */
 	public EReference getExecutionState_Reactions() {
-		return (EReference)executionStateEClass.getEStructuralFeatures().get(2);
+		return (EReference)executionStateEClass.getEStructuralFeatures().get(3);
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public EReference getExecutionState_EntryAction() {
+		return (EReference)executionStateEClass.getEStructuralFeatures().get(4);
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public EReference getExecutionState_ExitAction() {
+		return (EReference)executionStateEClass.getEStructuralFeatures().get(5);
 	}
 
 	/**
@@ -293,7 +311,7 @@ public class SexecPackageImpl extends EPackageImpl implements SexecPackage {
 	 * @generated
 	 */
 	public EAttribute getExecutionState_Leaf() {
-		return (EAttribute)executionStateEClass.getEStructuralFeatures().get(3);
+		return (EAttribute)executionStateEClass.getEStructuralFeatures().get(1);
 	}
 
 	/**
@@ -593,9 +611,11 @@ public class SexecPackageImpl extends EPackageImpl implements SexecPackage {
 
 		executionStateEClass = createEClass(EXECUTION_STATE);
 		createEAttribute(executionStateEClass, EXECUTION_STATE__SIMPLE_NAME);
+		createEAttribute(executionStateEClass, EXECUTION_STATE__LEAF);
 		createEReference(executionStateEClass, EXECUTION_STATE__CYCLE);
 		createEReference(executionStateEClass, EXECUTION_STATE__REACTIONS);
-		createEAttribute(executionStateEClass, EXECUTION_STATE__LEAF);
+		createEReference(executionStateEClass, EXECUTION_STATE__ENTRY_ACTION);
+		createEReference(executionStateEClass, EXECUTION_STATE__EXIT_ACTION);
 
 		reactionEClass = createEClass(REACTION);
 		createEReference(reactionEClass, REACTION__CHECK);
@@ -695,9 +715,11 @@ public class SexecPackageImpl extends EPackageImpl implements SexecPackage {
 
 		initEClass(executionStateEClass, ExecutionState.class, "ExecutionState", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
 		initEAttribute(getExecutionState_SimpleName(), ecorePackage.getEString(), "simpleName", null, 0, 1, ExecutionState.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+		initEAttribute(getExecutionState_Leaf(), ecorePackage.getEBoolean(), "leaf", "false", 0, 1, ExecutionState.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
 		initEReference(getExecutionState_Cycle(), this.getCycle(), null, "cycle", null, 0, 1, ExecutionState.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
 		initEReference(getExecutionState_Reactions(), this.getReaction(), null, "reactions", null, 0, -1, ExecutionState.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-		initEAttribute(getExecutionState_Leaf(), ecorePackage.getEBoolean(), "leaf", "false", 0, 1, ExecutionState.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+		initEReference(getExecutionState_EntryAction(), this.getStep(), null, "entryAction", null, 0, 1, ExecutionState.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+		initEReference(getExecutionState_ExitAction(), this.getStep(), null, "exitAction", null, 0, 1, ExecutionState.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
 
 		initEClass(reactionEClass, Reaction.class, "Reaction", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
 		initEReference(getReaction_Check(), this.getCheck(), null, "check", null, 0, 1, Reaction.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);

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

@@ -46,6 +46,9 @@ import java.util.List
 import org.eclipse.emf.ecore.EObject
 import org.yakindu.sct.model.stext.stext.Assignment
 import org.yakindu.sct.model.sgraph.Variable
+import org.yakindu.sct.model.stext.stext.LocalReaction
+import org.yakindu.sct.model.stext.stext.EntryEvent
+import org.yakindu.sct.model.stext.stext.ExitEvent
 
 class ModelSequencer {
 	
@@ -64,6 +67,7 @@ class ModelSequencer {
 		// during mapping the basic structural elements will be mapped from the source statechart to the execution flow
 		sc.mapScopes(ef)
 		sc.mapStates(ef)
+		sc.mapTransitions(ef)
 		
 		// derive all additional information that is necessary for the execution
 		ef.defineStateVector(sc)
@@ -129,10 +133,26 @@ class ModelSequencer {
 
 	
 	def ExecutionState mapState(State state) {
+		val _state = state.create
+		_state.leaf = state.simple
+		_state.entryAction = state.mapEntryAction
+		_state.exitAction = state.mapExitAction
+		return _state
+	}
+	 
+
+	def ExecutionFlow mapTransitions(Statechart statechart, ExecutionFlow r){
+		var content = EcoreUtil2::eAllContentsAsList(statechart)
+		val allStates = content.filter(e | e instanceof State)
+		allStates.forEach( s | (s as State).mapStateTransition);
+		return r
+	}
+
+
+	def ExecutionState mapStateTransition(State state) {
 		val _state = state.create
 		_state.reactions.addAll( state.outgoingTransitions.map(t | t.mapTransition))
-		_state.leaf = state.simple 
-		_state
+		return _state
 	}
 	 
 	 
@@ -146,9 +166,16 @@ class ModelSequencer {
 
 	def Sequence mapToEffect(Transition t) {
 		val sequence = sexecFactory.createSequence 
+
+		if (t.source instanceof State && (t.source as State).create.exitAction != null) 
+			sequence.steps.add( (t.source as State).create.exitAction.newCall)
+
 		if (t.source != null) sequence.steps.add(newExitStateStep(t.source as State))
 		if (t.effect != null) sequence.steps.add(t.effect.mapEffect)		
 		if (t.target != null) sequence.steps.add(newEnterStateStep(t.target as State))
+	
+		if (t.target instanceof State && (t.target as State).create.entryAction != null) 
+			sequence.steps.add( (t.target as State).create.entryAction.newCall)
 		
 		return sequence
 	}	
@@ -170,6 +197,27 @@ class ModelSequencer {
 		exec	
 	}
 	
+	
+	def Step mapEntryAction(State state) {
+		val seq = sexecFactory.createSequence
+		seq.name = "entryAction"
+		state.entryReactions
+			.map([lr | if (lr.effect != null) { (lr.effect as ReactionEffect).mapEffect } else null])
+			.forEach(e | if (e != null) { seq.steps.add(e) })
+		
+		if (seq.steps.size > 0) seq else null
+	}
+	
+	def Step mapExitAction(State state) {
+		val seq = sexecFactory.createSequence
+		seq.name = "exitAction"
+		state.exitReactions
+			.map([lr | if (lr.effect != null) { (lr.effect as ReactionEffect).mapEffect } else null])
+			.forEach(e | if (e != null) { seq.steps.add(e) })
+		
+		if (seq.steps.size > 0) seq else null
+	}
+	
 	/* ==========================================================================
 	 * SEQUENCING
 	 */
@@ -350,4 +398,19 @@ class ModelSequencer {
 	def target(Entry entry) {
 		entry?.outgoingTransitions?.get(0)?.target as State
 	}
+	
+	def List<LocalReaction> entryReactions(State state) {
+		state.localReactions
+			.filter(r | (r.trigger as ReactionTrigger).triggers.exists( t | t instanceof EntryEvent))
+			.map(lr | lr as LocalReaction)
+			.toList	
+	} 
+	
+	def List<LocalReaction> exitReactions(State state) {
+		state.localReactions
+			.filter(r | (r.trigger as ReactionTrigger).triggers.exists( t | t instanceof ExitEvent))
+			.map(lr | lr as LocalReaction)
+			.toList	
+	} 
+	
 }

+ 244 - 17
plugins/org.yakindu.sct.model.sexec/xtend-gen/org/yakindu/sct/model/sexec/transformation/ModelSequencer.java

@@ -9,6 +9,7 @@ import org.eclipse.xtext.EcoreUtil2;
 import org.eclipse.xtext.naming.IQualifiedNameProvider;
 import org.eclipse.xtext.xbase.lib.BooleanExtensions;
 import org.eclipse.xtext.xbase.lib.CollectionExtensions;
+import org.eclipse.xtext.xbase.lib.ComparableExtensions;
 import org.eclipse.xtext.xbase.lib.Functions.Function1;
 import org.eclipse.xtext.xbase.lib.Functions.Function2;
 import org.eclipse.xtext.xbase.lib.IterableExtensions;
@@ -49,6 +50,7 @@ import org.yakindu.sct.model.stext.stext.ElementReferenceExpression;
 import org.yakindu.sct.model.stext.stext.EventDefinition;
 import org.yakindu.sct.model.stext.stext.EventSpec;
 import org.yakindu.sct.model.stext.stext.Expression;
+import org.yakindu.sct.model.stext.stext.LocalReaction;
 import org.yakindu.sct.model.stext.stext.LogicalOrExpression;
 import org.yakindu.sct.model.stext.stext.ReactionEffect;
 import org.yakindu.sct.model.stext.stext.ReactionTrigger;
@@ -74,6 +76,7 @@ public class ModelSequencer {
       final ExecutionFlow ef = _create;
       this.mapScopes(sc, ef);
       this.mapStates(sc, ef);
+      this.mapTransitions(sc, ef);
       this.defineStateVector(ef, sc);
       this.defineEnterSequence(ef, sc);
       this.defineStateCycles(ef, sc);
@@ -170,7 +173,42 @@ public class ModelSequencer {
   }
   
   public ExecutionState mapState(final State state) {
-    ExecutionState _xblockexpression = null;
+    {
+      ExecutionState _create = this.factory.create(state);
+      final ExecutionState _state = _create;
+      boolean _isSimple = state.isSimple();
+      _state.setLeaf(_isSimple);
+      Step _mapEntryAction = this.mapEntryAction(state);
+      _state.setEntryAction(_mapEntryAction);
+      Step _mapExitAction = this.mapExitAction(state);
+      _state.setExitAction(_mapExitAction);
+      return _state;
+    }
+  }
+  
+  public ExecutionFlow mapTransitions(final Statechart statechart, final ExecutionFlow r) {
+    {
+      List<EObject> _eAllContentsAsList = EcoreUtil2.eAllContentsAsList(statechart);
+      List<EObject> content = _eAllContentsAsList;
+      final Function1<EObject,Boolean> _function = new Function1<EObject,Boolean>() {
+          public Boolean apply(final EObject e) {
+            return (e instanceof org.yakindu.sct.model.sgraph.State);
+          }
+        };
+      Iterable<EObject> _filter = IterableExtensions.<EObject>filter(content, _function);
+      final Iterable<EObject> allStates = _filter;
+      final Function1<EObject,ExecutionState> _function_1 = new Function1<EObject,ExecutionState>() {
+          public ExecutionState apply(final EObject s) {
+            ExecutionState _mapStateTransition = ModelSequencer.this.mapStateTransition(((State) s));
+            return _mapStateTransition;
+          }
+        };
+      IterableExtensions.<EObject>forEach(allStates, _function_1);
+      return r;
+    }
+  }
+  
+  public ExecutionState mapStateTransition(final State state) {
     {
       ExecutionState _create = this.factory.create(state);
       final ExecutionState _state = _create;
@@ -184,11 +222,8 @@ public class ModelSequencer {
         };
       List<Reaction> _map = ListExtensions.<Transition, Reaction>map(_outgoingTransitions, _function);
       _reactions.addAll(_map);
-      boolean _isSimple = state.isSimple();
-      _state.setLeaf(_isSimple);
-      _xblockexpression = (_state);
+      return _state;
     }
-    return _xblockexpression;
   }
   
   public Reaction mapTransition(final Transition t) {
@@ -213,29 +248,67 @@ public class ModelSequencer {
       SexecFactory _sexecFactory = this.sexecFactory();
       Sequence _createSequence = _sexecFactory.createSequence();
       final Sequence sequence = _createSequence;
+      boolean _operator_and = false;
       Vertex _source = t.getSource();
-      boolean _operator_notEquals = ObjectExtensions.operator_notEquals(_source, null);
-      if (_operator_notEquals) {
-        EList<Step> _steps = sequence.getSteps();
+      if (!(_source instanceof org.yakindu.sct.model.sgraph.State)) {
+        _operator_and = false;
+      } else {
         Vertex _source_1 = t.getSource();
-        ExitState _newExitStateStep = this.newExitStateStep(((State) _source_1));
-        _steps.add(_newExitStateStep);
+        ExecutionState _create = this.factory.create(((State) _source_1));
+        Step _exitAction = _create.getExitAction();
+        boolean _operator_notEquals = ObjectExtensions.operator_notEquals(_exitAction, null);
+        _operator_and = BooleanExtensions.operator_and((_source instanceof org.yakindu.sct.model.sgraph.State), _operator_notEquals);
       }
-      Effect _effect = t.getEffect();
-      boolean _operator_notEquals_1 = ObjectExtensions.operator_notEquals(_effect, null);
+      if (_operator_and) {
+        EList<Step> _steps = sequence.getSteps();
+        Vertex _source_2 = t.getSource();
+        ExecutionState _create_1 = this.factory.create(((State) _source_2));
+        Step _exitAction_1 = _create_1.getExitAction();
+        Call _newCall = this.factory.newCall(_exitAction_1);
+        _steps.add(_newCall);
+      }
+      Vertex _source_3 = t.getSource();
+      boolean _operator_notEquals_1 = ObjectExtensions.operator_notEquals(_source_3, null);
       if (_operator_notEquals_1) {
         EList<Step> _steps_1 = sequence.getSteps();
+        Vertex _source_4 = t.getSource();
+        ExitState _newExitStateStep = this.newExitStateStep(((State) _source_4));
+        _steps_1.add(_newExitStateStep);
+      }
+      Effect _effect = t.getEffect();
+      boolean _operator_notEquals_2 = ObjectExtensions.operator_notEquals(_effect, null);
+      if (_operator_notEquals_2) {
+        EList<Step> _steps_2 = sequence.getSteps();
         Effect _effect_1 = t.getEffect();
         Sequence _mapEffect = this.mapEffect(_effect_1);
-        _steps_1.add(_mapEffect);
+        _steps_2.add(_mapEffect);
       }
       Vertex _target = t.getTarget();
-      boolean _operator_notEquals_2 = ObjectExtensions.operator_notEquals(_target, null);
-      if (_operator_notEquals_2) {
-        EList<Step> _steps_2 = sequence.getSteps();
+      boolean _operator_notEquals_3 = ObjectExtensions.operator_notEquals(_target, null);
+      if (_operator_notEquals_3) {
+        EList<Step> _steps_3 = sequence.getSteps();
         Vertex _target_1 = t.getTarget();
         EnterState _newEnterStateStep = this.newEnterStateStep(((State) _target_1));
-        _steps_2.add(_newEnterStateStep);
+        _steps_3.add(_newEnterStateStep);
+      }
+      boolean _operator_and_1 = false;
+      Vertex _target_2 = t.getTarget();
+      if (!(_target_2 instanceof org.yakindu.sct.model.sgraph.State)) {
+        _operator_and_1 = false;
+      } else {
+        Vertex _target_3 = t.getTarget();
+        ExecutionState _create_2 = this.factory.create(((State) _target_3));
+        Step _entryAction = _create_2.getEntryAction();
+        boolean _operator_notEquals_4 = ObjectExtensions.operator_notEquals(_entryAction, null);
+        _operator_and_1 = BooleanExtensions.operator_and((_target_2 instanceof org.yakindu.sct.model.sgraph.State), _operator_notEquals_4);
+      }
+      if (_operator_and_1) {
+        EList<Step> _steps_4 = sequence.getSteps();
+        Vertex _target_4 = t.getTarget();
+        ExecutionState _create_3 = this.factory.create(((State) _target_4));
+        Step _entryAction_1 = _create_3.getEntryAction();
+        Call _newCall_1 = this.factory.newCall(_entryAction_1);
+        _steps_4.add(_newCall_1);
       }
       return sequence;
     }
@@ -285,6 +358,108 @@ public class ModelSequencer {
     return _xblockexpression;
   }
   
+  public Step mapEntryAction(final State state) {
+    Sequence _xblockexpression = null;
+    {
+      SexecFactory _sexecFactory = this.sexecFactory();
+      Sequence _createSequence = _sexecFactory.createSequence();
+      final Sequence seq = _createSequence;
+      seq.setName("entryAction");
+      List<LocalReaction> _entryReactions = this.entryReactions(state);
+      final Function1<LocalReaction,Sequence> _function = new Function1<LocalReaction,Sequence>() {
+          public Sequence apply(final LocalReaction lr) {
+            Sequence _xifexpression = null;
+            Effect _effect = lr.getEffect();
+            boolean _operator_notEquals = ObjectExtensions.operator_notEquals(_effect, null);
+            if (_operator_notEquals) {
+              Effect _effect_1 = lr.getEffect();
+              Sequence _mapEffect = ModelSequencer.this.mapEffect(((ReactionEffect) _effect_1));
+              _xifexpression = _mapEffect;
+            } else {
+              _xifexpression = null;
+            }
+            return _xifexpression;
+          }
+        };
+      List<Sequence> _map = ListExtensions.<LocalReaction, Sequence>map(_entryReactions, _function);
+      final Function1<Sequence,Boolean> _function_1 = new Function1<Sequence,Boolean>() {
+          public Boolean apply(final Sequence e) {
+            Boolean _xifexpression_1 = null;
+            boolean _operator_notEquals_1 = ObjectExtensions.operator_notEquals(e, null);
+            if (_operator_notEquals_1) {
+              EList<Step> _steps = seq.getSteps();
+              boolean _add = _steps.add(e);
+              _xifexpression_1 = _add;
+            }
+            return _xifexpression_1;
+          }
+        };
+      IterableExtensions.<Sequence>forEach(_map, _function_1);
+      Sequence _xifexpression_2 = null;
+      EList<Step> _steps_1 = seq.getSteps();
+      int _size = _steps_1.size();
+      boolean _operator_greaterThan = ComparableExtensions.<Integer>operator_greaterThan(((Integer)_size), ((Integer)0));
+      if (_operator_greaterThan) {
+        _xifexpression_2 = seq;
+      } else {
+        _xifexpression_2 = null;
+      }
+      _xblockexpression = (_xifexpression_2);
+    }
+    return _xblockexpression;
+  }
+  
+  public Step mapExitAction(final State state) {
+    Sequence _xblockexpression = null;
+    {
+      SexecFactory _sexecFactory = this.sexecFactory();
+      Sequence _createSequence = _sexecFactory.createSequence();
+      final Sequence seq = _createSequence;
+      seq.setName("exitAction");
+      List<LocalReaction> _exitReactions = this.exitReactions(state);
+      final Function1<LocalReaction,Sequence> _function = new Function1<LocalReaction,Sequence>() {
+          public Sequence apply(final LocalReaction lr) {
+            Sequence _xifexpression = null;
+            Effect _effect = lr.getEffect();
+            boolean _operator_notEquals = ObjectExtensions.operator_notEquals(_effect, null);
+            if (_operator_notEquals) {
+              Effect _effect_1 = lr.getEffect();
+              Sequence _mapEffect = ModelSequencer.this.mapEffect(((ReactionEffect) _effect_1));
+              _xifexpression = _mapEffect;
+            } else {
+              _xifexpression = null;
+            }
+            return _xifexpression;
+          }
+        };
+      List<Sequence> _map = ListExtensions.<LocalReaction, Sequence>map(_exitReactions, _function);
+      final Function1<Sequence,Boolean> _function_1 = new Function1<Sequence,Boolean>() {
+          public Boolean apply(final Sequence e) {
+            Boolean _xifexpression_1 = null;
+            boolean _operator_notEquals_1 = ObjectExtensions.operator_notEquals(e, null);
+            if (_operator_notEquals_1) {
+              EList<Step> _steps = seq.getSteps();
+              boolean _add = _steps.add(e);
+              _xifexpression_1 = _add;
+            }
+            return _xifexpression_1;
+          }
+        };
+      IterableExtensions.<Sequence>forEach(_map, _function_1);
+      Sequence _xifexpression_2 = null;
+      EList<Step> _steps_1 = seq.getSteps();
+      int _size = _steps_1.size();
+      boolean _operator_greaterThan = ComparableExtensions.<Integer>operator_greaterThan(((Integer)_size), ((Integer)0));
+      if (_operator_greaterThan) {
+        _xifexpression_2 = seq;
+      } else {
+        _xifexpression_2 = null;
+      }
+      _xblockexpression = (_xifexpression_2);
+    }
+    return _xblockexpression;
+  }
+  
   public ExecutionFlow defineStateCycles(final ExecutionFlow flow, final Statechart sc) {
     {
       EList<ExecutionState> _states = flow.getStates();
@@ -649,6 +824,58 @@ public class ModelSequencer {
     return ((State) _target);
   }
   
+  public List<LocalReaction> entryReactions(final State state) {
+    EList<org.yakindu.sct.model.sgraph.Reaction> _localReactions = state.getLocalReactions();
+    final Function1<org.yakindu.sct.model.sgraph.Reaction,Boolean> _function = new Function1<org.yakindu.sct.model.sgraph.Reaction,Boolean>() {
+        public Boolean apply(final org.yakindu.sct.model.sgraph.Reaction r) {
+          Trigger _trigger = r.getTrigger();
+          EList<EventSpec> _triggers = ((ReactionTrigger) _trigger).getTriggers();
+          final Function1<EventSpec,Boolean> _function_1 = new Function1<EventSpec,Boolean>() {
+              public Boolean apply(final EventSpec t) {
+                return (t instanceof org.yakindu.sct.model.stext.stext.EntryEvent);
+              }
+            };
+          boolean _exists = IterableExtensions.<EventSpec>exists(_triggers, _function_1);
+          return ((Boolean)_exists);
+        }
+      };
+    Iterable<org.yakindu.sct.model.sgraph.Reaction> _filter = IterableExtensions.<org.yakindu.sct.model.sgraph.Reaction>filter(_localReactions, _function);
+    final Function1<org.yakindu.sct.model.sgraph.Reaction,LocalReaction> _function_2 = new Function1<org.yakindu.sct.model.sgraph.Reaction,LocalReaction>() {
+        public LocalReaction apply(final org.yakindu.sct.model.sgraph.Reaction lr) {
+          return ((LocalReaction) lr);
+        }
+      };
+    Iterable<LocalReaction> _map = IterableExtensions.<org.yakindu.sct.model.sgraph.Reaction, LocalReaction>map(_filter, _function_2);
+    List<LocalReaction> _list = IterableExtensions.<LocalReaction>toList(_map);
+    return _list;
+  }
+  
+  public List<LocalReaction> exitReactions(final State state) {
+    EList<org.yakindu.sct.model.sgraph.Reaction> _localReactions = state.getLocalReactions();
+    final Function1<org.yakindu.sct.model.sgraph.Reaction,Boolean> _function = new Function1<org.yakindu.sct.model.sgraph.Reaction,Boolean>() {
+        public Boolean apply(final org.yakindu.sct.model.sgraph.Reaction r) {
+          Trigger _trigger = r.getTrigger();
+          EList<EventSpec> _triggers = ((ReactionTrigger) _trigger).getTriggers();
+          final Function1<EventSpec,Boolean> _function_1 = new Function1<EventSpec,Boolean>() {
+              public Boolean apply(final EventSpec t) {
+                return (t instanceof org.yakindu.sct.model.stext.stext.ExitEvent);
+              }
+            };
+          boolean _exists = IterableExtensions.<EventSpec>exists(_triggers, _function_1);
+          return ((Boolean)_exists);
+        }
+      };
+    Iterable<org.yakindu.sct.model.sgraph.Reaction> _filter = IterableExtensions.<org.yakindu.sct.model.sgraph.Reaction>filter(_localReactions, _function);
+    final Function1<org.yakindu.sct.model.sgraph.Reaction,LocalReaction> _function_2 = new Function1<org.yakindu.sct.model.sgraph.Reaction,LocalReaction>() {
+        public LocalReaction apply(final org.yakindu.sct.model.sgraph.Reaction lr) {
+          return ((LocalReaction) lr);
+        }
+      };
+    Iterable<LocalReaction> _map = IterableExtensions.<org.yakindu.sct.model.sgraph.Reaction, LocalReaction>map(_filter, _function_2);
+    List<LocalReaction> _list = IterableExtensions.<LocalReaction>toList(_map);
+    return _list;
+  }
+  
   public Declaration map(final Declaration e) {
     if ((e instanceof EventDefinition)) {
       return _map((EventDefinition)e);

+ 133 - 1
test-plugins/org.yakindu.sct.model.sexec.test/src/org/yakindu/sct/model/sexec/transformation/test/ModelSequencerTest.java

@@ -31,8 +31,10 @@ import org.yakindu.sct.model.stext.stext.Assignment;
 import org.yakindu.sct.model.stext.stext.AssignmentOperator;
 import org.yakindu.sct.model.stext.stext.ElementReferenceExpression;
 import org.yakindu.sct.model.stext.stext.EventDefinition;
+import org.yakindu.sct.model.stext.stext.Expression;
 import org.yakindu.sct.model.stext.stext.InterfaceScope;
 import org.yakindu.sct.model.stext.stext.InternalScope;
+import org.yakindu.sct.model.stext.stext.LocalReaction;
 import org.yakindu.sct.model.stext.stext.LogicalOrExpression;
 import org.yakindu.sct.model.stext.stext.ReactionEffect;
 import org.yakindu.sct.model.stext.stext.ReactionTrigger;
@@ -160,6 +162,7 @@ public class ModelSequencerTest {
 	}
 	
 	
+	
 	/**
 	 * For each top level region a EnterState step must be performed.
 	 */
@@ -180,6 +183,62 @@ public class ModelSequencerTest {
 	}
 	
 	
+	/**
+	 * if a state defines a entry action then the execution state must have a entryAction.
+	 */
+	@Test public void testStateEntryAction() {
+		Statechart sc = _createStatechart("test");
+		Scope scope = _createInterfaceScope("interface", sc);
+		VariableDefinition v1 = _createVariableDefinition("v1", Type.INTEGER, scope);
+		Region r = _createRegion("main", sc);
+		Entry e = _createEntry(EntryKind.INITIAL, null, r);
+		State s1 = _createState("s1", r);
+		State s2 = _createState("s2", r);
+		Transition e_t = _createTransition(e, s1);
+		Transition s1_t = _createTransition(s1, s2);
+		LocalReaction entryAction = _createEntryAction(s2);
+		Assignment assign = _createVariableAssignment(v1, AssignmentOperator.ASSIGN, _createValue("42"), (ReactionEffect) entryAction.getEffect());
+		
+		ExecutionFlow flow = sequencer.transform(sc);
+		
+		ExecutionState _s1 = flow.getStates().get(0);
+		ExecutionState _s2 = flow.getStates().get(1);
+		assertEquals(s1.getName(), _s1.getSimpleName());
+		assertEquals(s2.getName(), _s2.getSimpleName());
+		
+		assertNotNull(_s2.getEntryAction());
+		assertNull(_s1.getEntryAction());
+	}
+	
+	
+	/**
+	 * if a state defines a exit action then the execution state must have a exitAction.
+	 */
+	@Test public void testStateExitAction() {
+		Statechart sc = _createStatechart("test");
+		Scope scope = _createInterfaceScope("interface", sc);
+		VariableDefinition v1 = _createVariableDefinition("v1", Type.INTEGER, scope);
+		Region r = _createRegion("main", sc);
+		Entry e = _createEntry(EntryKind.INITIAL, null, r);
+		State s1 = _createState("s1", r);
+		State s2 = _createState("s2", r);
+		Transition e_t = _createTransition(e, s1);
+		Transition s1_t = _createTransition(s1, s2);
+		LocalReaction exitAction = _createExitAction(s1);
+		Assignment assign = _createVariableAssignment(v1, AssignmentOperator.ASSIGN, _createValue("21"), (ReactionEffect) exitAction.getEffect());
+		
+		ExecutionFlow flow = sequencer.transform(sc);
+		
+		ExecutionState _s1 = flow.getStates().get(0);
+		ExecutionState _s2 = flow.getStates().get(1);
+		assertEquals(s1.getName(), _s1.getSimpleName());
+		assertEquals(s2.getName(), _s2.getSimpleName());
+		
+		assertNotNull(_s1.getExitAction());
+		assertNull(_s2.getExitAction());
+	}
+	
+	
 	@Test public void testStateReaction_SimpleFlatTSC() {
 		SimpleFlatTSC tsc = new SimpleFlatTSC();
 		
@@ -205,7 +264,6 @@ public class ModelSequencerTest {
 		
 	}
 	
-	
 	/**
 	 * The transition action must be part of the reaction effect sequence
 	 */
@@ -245,6 +303,80 @@ public class ModelSequencerTest {
 	}
 
 	
+	/**
+	 * The exit action must be part of the reaction effect sequence
+	 */
+	@Test public void testStateReaction_WithExitAction() {
+		SimpleFlatTSC tsc = new SimpleFlatTSC();
+
+		VariableDefinition v1 = _createVariableDefinition("v1", Type.INTEGER, tsc.s_scope);
+		LocalReaction exitAction = _createExitAction(tsc.s1);
+		Assignment assign = _createVariableAssignment(v1, AssignmentOperator.ASSIGN, _createValue("21"), (ReactionEffect) exitAction.getEffect());
+
+		ExecutionFlow flow = sequencer.transform(tsc.sc);
+		
+		
+		// test state with one outgoing transition
+		ExecutionState _s1 = flow.getStates().get(0);
+		ExecutionState _s2 = flow.getStates().get(1);
+		assertEquals(tsc.s1.getName(), _s1.getSimpleName());
+		assertEquals(tsc.s2.getName(), _s2.getSimpleName());
+
+		assertEquals(1, _s1.getReactions().size());
+		Reaction reaction = _s1.getReactions().get(0);
+
+		assertNotNull(reaction.getCheck());
+		
+		assertNotNull(reaction.getEffect());
+		Sequence seq = (Sequence) reaction.getEffect();
+
+		Call _exitActionCall = (Call) seq.getSteps().get(0);
+		assertSame( _s1.getExitAction(), _exitActionCall.getStep());	
+
+		assertTrue(seq.getSteps().get(1) instanceof ExitState);
+		assertEquals(_s1, ((ExitState)seq.getSteps().get(1)).getState());
+		
+	}
+	
+	/**
+	 * The exit action must be part of the reaction effect sequence
+	 */
+	@Test public void testStateReaction_WithEntryAction() {
+		SimpleFlatTSC tsc = new SimpleFlatTSC();
+
+		VariableDefinition v1 = _createVariableDefinition("v1", Type.INTEGER, tsc.s_scope);
+		LocalReaction entryAction = _createEntryAction(tsc.s2);
+		Assignment assign = _createVariableAssignment(v1, AssignmentOperator.ASSIGN, _createValue("21"), (ReactionEffect) entryAction.getEffect());
+
+		
+		ExecutionFlow flow = sequencer.transform(tsc.sc);
+		
+		
+		// test state with one outgoing transition
+		ExecutionState _s1 = flow.getStates().get(0);
+		ExecutionState _s2 = flow.getStates().get(1);
+		assertEquals(tsc.s1.getName(), _s1.getSimpleName());
+		assertEquals(tsc.s2.getName(), _s2.getSimpleName());
+
+		assertEquals(1, _s1.getReactions().size());
+		Reaction reaction = _s1.getReactions().get(0);
+
+		assertNotNull(reaction.getCheck());
+		
+		assertNotNull(reaction.getEffect());
+		Sequence seq = (Sequence) reaction.getEffect();
+
+		assertTrue(seq.getSteps().get(0) instanceof ExitState);
+		assertEquals(_s1, ((ExitState)seq.getSteps().get(0)).getState());
+
+		assertTrue(seq.getSteps().get(1) instanceof EnterState);
+		assertEquals(_s2, ((EnterState)seq.getSteps().get(1)).getState());
+
+		Call _entryActionCall = (Call) seq.getSteps().get(2);
+		assertSame( _s2.getEntryAction(), _entryActionCall.getStep());	
+	}
+	
+
 	@Test public void testStateCycle_SimpleFlatTSC() {
 		OrthogonalFlatTSC tsc = new OrthogonalFlatTSC();
 		

+ 39 - 0
test-plugins/org.yakindu.sct.model.sexec.test/src/org/yakindu/sct/model/sexec/transformation/test/SCTTestUtil.java

@@ -1,8 +1,10 @@
 package org.yakindu.sct.model.sexec.transformation.test;
 
+import org.apache.log4j.spi.TriggeringEventEvaluator;
 import org.yakindu.sct.model.sgraph.Entry;
 import org.yakindu.sct.model.sgraph.EntryKind;
 import org.yakindu.sct.model.sgraph.Reaction;
+import org.yakindu.sct.model.sgraph.ReactiveElement;
 import org.yakindu.sct.model.sgraph.Region;
 import org.yakindu.sct.model.sgraph.SGraphFactory;
 import org.yakindu.sct.model.sgraph.Scope;
@@ -13,10 +15,13 @@ import org.yakindu.sct.model.sgraph.Transition;
 import org.yakindu.sct.model.sgraph.Vertex;
 import org.yakindu.sct.model.stext.stext.Assignment;
 import org.yakindu.sct.model.stext.stext.AssignmentOperator;
+import org.yakindu.sct.model.stext.stext.EntryEvent;
 import org.yakindu.sct.model.stext.stext.EventDefinition;
+import org.yakindu.sct.model.stext.stext.EventSpec;
 import org.yakindu.sct.model.stext.stext.Expression;
 import org.yakindu.sct.model.stext.stext.InterfaceScope;
 import org.yakindu.sct.model.stext.stext.InternalScope;
+import org.yakindu.sct.model.stext.stext.LocalReaction;
 import org.yakindu.sct.model.stext.stext.PrimitiveValueExpression;
 import org.yakindu.sct.model.stext.stext.ReactionEffect;
 import org.yakindu.sct.model.stext.stext.ReactionTrigger;
@@ -121,6 +126,40 @@ public class SCTTestUtil {
 		return effect;
 	}
 	
+	
+	public static LocalReaction _createEntryAction(ReactiveElement parent) {
+		LocalReaction reaction = StextFactory.eINSTANCE.createLocalReaction();
+		ReactionTrigger trigger = StextFactory.eINSTANCE.createReactionTrigger();
+		EntryEvent entryEvent = StextFactory.eINSTANCE.createEntryEvent();
+		_createReactionEffect(reaction);
+		
+		trigger.getTriggers().add(entryEvent);
+		reaction.setTrigger(trigger);
+		if (parent != null) parent.getLocalReactions().add(reaction);
+		
+		return reaction;
+	}
+	
+	
+	public static LocalReaction _createExitAction(ReactiveElement parent) {
+		return _createLocalRection(parent, StextFactory.eINSTANCE.createExitEvent() );
+	}
+	
+	public static LocalReaction _createLocalRection(ReactiveElement parent, EventSpec triggerEvent) {
+		LocalReaction reaction = StextFactory.eINSTANCE.createLocalReaction();
+		ReactionTrigger trigger = StextFactory.eINSTANCE.createReactionTrigger();
+		_createReactionEffect(reaction);
+		
+		trigger.getTriggers().add(triggerEvent);
+		reaction.setTrigger(trigger);
+		if (parent != null) parent.getLocalReactions().add(reaction);
+		
+		return reaction;
+	}
+	
+	
+
+	
 	public static Assignment _createVariableAssignment(VariableDefinition v, AssignmentOperator op, Expression expression, ReactionEffect e) {
 		Assignment assignment = StextFactory.eINSTANCE.createAssignment();
 		assignment.setVarRef(v);