Browse Source

Transform local reaction of statechart to execution flow.reactions

benjamin.schwertfeger@gmail.com 13 years ago
parent
commit
54cedbde6a

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


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

@@ -131,3 +131,4 @@ _UI_ExecutionFlow_historyVector_feature = History Vector
 _UI_ExecutionRegion_historyVector_feature = History Vector
 _UI_TraceBeginRunCycle_type = Trace Begin Run Cycle
 _UI_TraceEndRunCycle_type = Trace End Run Cycle
+_UI_ExecutionFlow_reactions_feature = Reactions

+ 7 - 0
plugins/org.yakindu.sct.model.sexec.edit/src/org/yakindu/sct/model/sexec/provider/ExecutionFlowItemProvider.java

@@ -179,6 +179,7 @@ public class ExecutionFlowItemProvider
 			childrenFeatures.add(SexecPackage.Literals.EXECUTION_FLOW__NODES);
 			childrenFeatures.add(SexecPackage.Literals.EXECUTION_FLOW__REGIONS);
 			childrenFeatures.add(SexecPackage.Literals.EXECUTION_FLOW__HISTORY_VECTOR);
+			childrenFeatures.add(SexecPackage.Literals.EXECUTION_FLOW__REACTIONS);
 		}
 		return childrenFeatures;
 	}
@@ -243,6 +244,7 @@ public class ExecutionFlowItemProvider
 			case SexecPackage.EXECUTION_FLOW__NODES:
 			case SexecPackage.EXECUTION_FLOW__REGIONS:
 			case SexecPackage.EXECUTION_FLOW__HISTORY_VECTOR:
+			case SexecPackage.EXECUTION_FLOW__REACTIONS:
 				fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false));
 				return;
 		}
@@ -309,6 +311,11 @@ public class ExecutionFlowItemProvider
 			(createChildParameter
 				(SexecPackage.Literals.EXECUTION_FLOW__HISTORY_VECTOR,
 				 SexecFactory.eINSTANCE.createStateVector()));
+
+		newChildDescriptors.add
+			(createChildParameter
+				(SexecPackage.Literals.EXECUTION_FLOW__REACTIONS,
+				 SexecFactory.eINSTANCE.createReaction()));
 	}
 
 	/**

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

@@ -15,6 +15,8 @@
         eType="#//ExecutionRegion" containment="true"/>
     <eStructuralFeatures xsi:type="ecore:EReference" name="historyVector" eType="#//StateVector"
         containment="true"/>
+    <eStructuralFeatures xsi:type="ecore:EReference" name="reactions" upperBound="-1"
+        eType="#//Reaction" containment="true"/>
   </eClassifiers>
   <eClassifiers xsi:type="ecore:EClass" name="ExecutionNode" eSuperTypes="#//MappedElement ../../org.yakindu.base.types/model/base.ecore#//NamedElement">
     <eStructuralFeatures xsi:type="ecore:EReference" name="reactions" upperBound="-1"

+ 1 - 0
plugins/org.yakindu.sct.model.sexec/model/sexec.genmodel

@@ -15,6 +15,7 @@
       <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference sexec.ecore#//ExecutionFlow/nodes"/>
       <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference sexec.ecore#//ExecutionFlow/regions"/>
       <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference sexec.ecore#//ExecutionFlow/historyVector"/>
+      <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference sexec.ecore#//ExecutionFlow/reactions"/>
     </genClasses>
     <genClasses ecoreClass="sexec.ecore#//ExecutionNode">
       <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference sexec.ecore#//ExecutionNode/reactions"/>

+ 17 - 0
plugins/org.yakindu.sct.model.sexec/src/org/yakindu/sct/model/sexec/ExecutionFlow.java

@@ -21,6 +21,7 @@ import org.yakindu.sct.model.sgraph.ScopedElement;
  *   <li>{@link org.yakindu.sct.model.sexec.ExecutionFlow#getNodes <em>Nodes</em>}</li>
  *   <li>{@link org.yakindu.sct.model.sexec.ExecutionFlow#getRegions <em>Regions</em>}</li>
  *   <li>{@link org.yakindu.sct.model.sexec.ExecutionFlow#getHistoryVector <em>History Vector</em>}</li>
+ *   <li>{@link org.yakindu.sct.model.sexec.ExecutionFlow#getReactions <em>Reactions</em>}</li>
  * </ul>
  * </p>
  *
@@ -103,4 +104,20 @@ public interface ExecutionFlow extends ScopedElement, ExecutionScope {
 	 */
 	void setHistoryVector(StateVector value);
 
+	/**
+	 * Returns the value of the '<em><b>Reactions</b></em>' containment reference list.
+	 * The list contents are of type {@link org.yakindu.sct.model.sexec.Reaction}.
+	 * <!-- begin-user-doc -->
+	 * <p>
+	 * If the meaning of the '<em>Reactions</em>' containment reference list isn't clear,
+	 * there really should be more of a description here...
+	 * </p>
+	 * <!-- end-user-doc -->
+	 * @return the value of the '<em>Reactions</em>' containment reference list.
+	 * @see org.yakindu.sct.model.sexec.SexecPackage#getExecutionFlow_Reactions()
+	 * @model containment="true"
+	 * @generated
+	 */
+	EList<Reaction> getReactions();
+
 } // ExecutionFlow

+ 29 - 1
plugins/org.yakindu.sct.model.sexec/src/org/yakindu/sct/model/sexec/SexecPackage.java

@@ -217,6 +217,15 @@ public interface SexecPackage extends EPackage {
 	 */
 	int EXECUTION_FLOW__HISTORY_VECTOR = SGraphPackage.SCOPED_ELEMENT_FEATURE_COUNT + 10;
 
+	/**
+	 * The feature id for the '<em><b>Reactions</b></em>' containment reference list.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 * @ordered
+	 */
+	int EXECUTION_FLOW__REACTIONS = SGraphPackage.SCOPED_ELEMENT_FEATURE_COUNT + 11;
+
 	/**
 	 * The number of structural features of the '<em>Execution Flow</em>' class.
 	 * <!-- begin-user-doc -->
@@ -224,7 +233,7 @@ public interface SexecPackage extends EPackage {
 	 * @generated
 	 * @ordered
 	 */
-	int EXECUTION_FLOW_FEATURE_COUNT = SGraphPackage.SCOPED_ELEMENT_FEATURE_COUNT + 11;
+	int EXECUTION_FLOW_FEATURE_COUNT = SGraphPackage.SCOPED_ELEMENT_FEATURE_COUNT + 12;
 
 	/**
 	 * The meta object id for the '{@link org.yakindu.sct.model.sexec.impl.ExecutionNodeImpl <em>Execution Node</em>}' class.
@@ -2207,6 +2216,17 @@ public interface SexecPackage extends EPackage {
 	 */
 	EReference getExecutionFlow_HistoryVector();
 
+	/**
+	 * Returns the meta object for the containment reference list '{@link org.yakindu.sct.model.sexec.ExecutionFlow#getReactions <em>Reactions</em>}'.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @return the meta object for the containment reference list '<em>Reactions</em>'.
+	 * @see org.yakindu.sct.model.sexec.ExecutionFlow#getReactions()
+	 * @see #getExecutionFlow()
+	 * @generated
+	 */
+	EReference getExecutionFlow_Reactions();
+
 	/**
 	 * Returns the meta object for class '{@link org.yakindu.sct.model.sexec.ExecutionNode <em>Execution Node</em>}'.
 	 * <!-- begin-user-doc -->
@@ -3163,6 +3183,14 @@ public interface SexecPackage extends EPackage {
 		 */
 		EReference EXECUTION_FLOW__HISTORY_VECTOR = eINSTANCE.getExecutionFlow_HistoryVector();
 
+		/**
+		 * The meta object literal for the '<em><b>Reactions</b></em>' containment reference list feature.
+		 * <!-- begin-user-doc -->
+		 * <!-- end-user-doc -->
+		 * @generated
+		 */
+		EReference EXECUTION_FLOW__REACTIONS = eINSTANCE.getExecutionFlow_Reactions();
+
 		/**
 		 * The meta object literal for the '{@link org.yakindu.sct.model.sexec.impl.ExecutionNodeImpl <em>Execution Node</em>}' class.
 		 * <!-- begin-user-doc -->

+ 37 - 0
plugins/org.yakindu.sct.model.sexec/src/org/yakindu/sct/model/sexec/impl/ExecutionFlowImpl.java

@@ -26,6 +26,7 @@ import org.yakindu.sct.model.sexec.ExecutionRegion;
 import org.yakindu.sct.model.sexec.ExecutionScope;
 import org.yakindu.sct.model.sexec.ExecutionState;
 import org.yakindu.sct.model.sexec.MappedElement;
+import org.yakindu.sct.model.sexec.Reaction;
 import org.yakindu.sct.model.sexec.Sequence;
 import org.yakindu.sct.model.sexec.SexecPackage;
 import org.yakindu.sct.model.sexec.StateVector;
@@ -49,6 +50,7 @@ import org.yakindu.sct.model.sgraph.impl.ScopedElementImpl;
  *   <li>{@link org.yakindu.sct.model.sexec.impl.ExecutionFlowImpl#getNodes <em>Nodes</em>}</li>
  *   <li>{@link org.yakindu.sct.model.sexec.impl.ExecutionFlowImpl#getRegions <em>Regions</em>}</li>
  *   <li>{@link org.yakindu.sct.model.sexec.impl.ExecutionFlowImpl#getHistoryVector <em>History Vector</em>}</li>
+ *   <li>{@link org.yakindu.sct.model.sexec.impl.ExecutionFlowImpl#getReactions <em>Reactions</em>}</li>
  * </ul>
  * </p>
  *
@@ -175,6 +177,16 @@ public class ExecutionFlowImpl extends ScopedElementImpl implements ExecutionFlo
 	 */
 	protected StateVector historyVector;
 
+	/**
+	 * The cached value of the '{@link #getReactions() <em>Reactions</em>}' containment reference list.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @see #getReactions()
+	 * @generated
+	 * @ordered
+	 */
+	protected EList<Reaction> reactions;
+
 	/**
 	 * <!-- begin-user-doc -->
 	 * <!-- end-user-doc -->
@@ -533,6 +545,18 @@ public class ExecutionFlowImpl extends ScopedElementImpl implements ExecutionFlo
 			eNotify(new ENotificationImpl(this, Notification.SET, SexecPackage.EXECUTION_FLOW__HISTORY_VECTOR, newHistoryVector, newHistoryVector));
 	}
 
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public EList<Reaction> getReactions() {
+		if (reactions == null) {
+			reactions = new EObjectContainmentEList<Reaction>(Reaction.class, this, SexecPackage.EXECUTION_FLOW__REACTIONS);
+		}
+		return reactions;
+	}
+
 	/**
 	 * <!-- begin-user-doc -->
 	 * <!-- end-user-doc -->
@@ -578,6 +602,8 @@ public class ExecutionFlowImpl extends ScopedElementImpl implements ExecutionFlo
 				return ((InternalEList<?>)getRegions()).basicRemove(otherEnd, msgs);
 			case SexecPackage.EXECUTION_FLOW__HISTORY_VECTOR:
 				return basicSetHistoryVector(null, msgs);
+			case SexecPackage.EXECUTION_FLOW__REACTIONS:
+				return ((InternalEList<?>)getReactions()).basicRemove(otherEnd, msgs);
 		}
 		return super.eInverseRemove(otherEnd, featureID, msgs);
 	}
@@ -614,6 +640,8 @@ public class ExecutionFlowImpl extends ScopedElementImpl implements ExecutionFlo
 				return getRegions();
 			case SexecPackage.EXECUTION_FLOW__HISTORY_VECTOR:
 				return getHistoryVector();
+			case SexecPackage.EXECUTION_FLOW__REACTIONS:
+				return getReactions();
 		}
 		return super.eGet(featureID, resolve, coreType);
 	}
@@ -664,6 +692,10 @@ public class ExecutionFlowImpl extends ScopedElementImpl implements ExecutionFlo
 			case SexecPackage.EXECUTION_FLOW__HISTORY_VECTOR:
 				setHistoryVector((StateVector)newValue);
 				return;
+			case SexecPackage.EXECUTION_FLOW__REACTIONS:
+				getReactions().clear();
+				getReactions().addAll((Collection<? extends Reaction>)newValue);
+				return;
 		}
 		super.eSet(featureID, newValue);
 	}
@@ -709,6 +741,9 @@ public class ExecutionFlowImpl extends ScopedElementImpl implements ExecutionFlo
 			case SexecPackage.EXECUTION_FLOW__HISTORY_VECTOR:
 				setHistoryVector((StateVector)null);
 				return;
+			case SexecPackage.EXECUTION_FLOW__REACTIONS:
+				getReactions().clear();
+				return;
 		}
 		super.eUnset(featureID);
 	}
@@ -743,6 +778,8 @@ public class ExecutionFlowImpl extends ScopedElementImpl implements ExecutionFlo
 				return regions != null && !regions.isEmpty();
 			case SexecPackage.EXECUTION_FLOW__HISTORY_VECTOR:
 				return historyVector != null;
+			case SexecPackage.EXECUTION_FLOW__REACTIONS:
+				return reactions != null && !reactions.isEmpty();
 		}
 		return super.eIsSet(featureID);
 	}

+ 1 - 0
plugins/org.yakindu.sct.model.sexec/src/org/yakindu/sct/model/sexec/impl/SexecFactoryImpl.java

@@ -11,6 +11,7 @@ import org.eclipse.emf.ecore.EObject;
 import org.eclipse.emf.ecore.EPackage;
 import org.eclipse.emf.ecore.impl.EFactoryImpl;
 import org.eclipse.emf.ecore.plugin.EcorePlugin;
+import org.yakindu.sct.model.sexec.*;
 import org.yakindu.sct.model.sexec.Call;
 import org.yakindu.sct.model.sexec.Check;
 import org.yakindu.sct.model.sexec.CheckRef;

+ 11 - 0
plugins/org.yakindu.sct.model.sexec/src/org/yakindu/sct/model/sexec/impl/SexecPackageImpl.java

@@ -396,6 +396,15 @@ public class SexecPackageImpl extends EPackageImpl implements SexecPackage {
 		return (EReference)executionFlowEClass.getEStructuralFeatures().get(3);
 	}
 
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public EReference getExecutionFlow_Reactions() {
+		return (EReference)executionFlowEClass.getEStructuralFeatures().get(4);
+	}
+
 	/**
 	 * <!-- begin-user-doc -->
 	 * <!-- end-user-doc -->
@@ -1188,6 +1197,7 @@ public class SexecPackageImpl extends EPackageImpl implements SexecPackage {
 		createEReference(executionFlowEClass, EXECUTION_FLOW__NODES);
 		createEReference(executionFlowEClass, EXECUTION_FLOW__REGIONS);
 		createEReference(executionFlowEClass, EXECUTION_FLOW__HISTORY_VECTOR);
+		createEReference(executionFlowEClass, EXECUTION_FLOW__REACTIONS);
 
 		executionNodeEClass = createEClass(EXECUTION_NODE);
 		createEReference(executionNodeEClass, EXECUTION_NODE__REACTIONS);
@@ -1380,6 +1390,7 @@ public class SexecPackageImpl extends EPackageImpl implements SexecPackage {
 		initEReference(getExecutionFlow_Nodes(), this.getExecutionNode(), null, "nodes", null, 0, -1, ExecutionFlow.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
 		initEReference(getExecutionFlow_Regions(), this.getExecutionRegion(), null, "regions", null, 0, -1, ExecutionFlow.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
 		initEReference(getExecutionFlow_HistoryVector(), this.getStateVector(), null, "historyVector", null, 0, 1, ExecutionFlow.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+		initEReference(getExecutionFlow_Reactions(), this.getReaction(), null, "reactions", null, 0, -1, ExecutionFlow.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
 
 		initEClass(executionNodeEClass, ExecutionNode.class, "ExecutionNode", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
 		initEReference(getExecutionNode_Reactions(), this.getReaction(), null, "reactions", null, 0, -1, ExecutionNode.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);

+ 15 - 0
plugins/org.yakindu.sct.model.sexec/src/org/yakindu/sct/model/sexec/transformation/BehaviorMapping.xtend

@@ -215,6 +215,21 @@ class BehaviorMapping {
 	}
 	
 	def ExecutionFlow mapLocalReactions(Statechart statechart, ExecutionFlow r){
+		r.reactions.addAll(statechart.localReactions
+				.filter( typeof( LocalReaction ))
+				// ignore all reaction that are just entry or exit actions
+				.filter(lr | 
+					(lr.trigger as ReactionTrigger).triggers.empty 
+					|| ! (lr.trigger as ReactionTrigger).triggers.filter( t | 
+						t instanceof RegularEventSpec 
+						|| t instanceof TimeEventSpec 
+						|| t instanceof OnCycleEvent 
+						|| t instanceof AlwaysEvent
+					).toList.empty
+				)
+				.map(t | t.mapReaction)
+		)
+		
 		var content = statechart.allContentsIterable
 		val allStates = content.filter(typeof(State))
 		allStates.forEach( s | (s as State).mapStateLocalReactions);

+ 1 - 0
plugins/org.yakindu.sct.model.sexec/src/org/yakindu/sct/model/sexec/util/SexecAdapterFactory.java

@@ -11,6 +11,7 @@ import org.eclipse.emf.common.notify.Notifier;
 import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl;
 import org.eclipse.emf.ecore.EObject;
 import org.yakindu.base.base.NamedElement;
+import org.yakindu.sct.model.sexec.*;
 import org.yakindu.sct.model.sexec.Call;
 import org.yakindu.sct.model.sexec.Check;
 import org.yakindu.sct.model.sexec.CheckRef;

+ 1 - 0
plugins/org.yakindu.sct.model.sexec/src/org/yakindu/sct/model/sexec/util/SexecSwitch.java

@@ -10,6 +10,7 @@ import org.eclipse.emf.ecore.EObject;
 import org.eclipse.emf.ecore.EPackage;
 import org.eclipse.emf.ecore.util.Switch;
 import org.yakindu.base.base.NamedElement;
+import org.yakindu.sct.model.sexec.*;
 import org.yakindu.sct.model.sexec.Call;
 import org.yakindu.sct.model.sexec.Check;
 import org.yakindu.sct.model.sexec.CheckRef;

+ 59 - 4
plugins/org.yakindu.sct.model.sexec/xtend-gen/org/yakindu/sct/model/sexec/transformation/BehaviorMapping.java

@@ -514,17 +514,72 @@ public class BehaviorMapping {
   
   public ExecutionFlow mapLocalReactions(final Statechart statechart, final ExecutionFlow r) {
     {
+      EList<Reaction> _reactions = r.getReactions();
+      EList<org.yakindu.sct.model.sgraph.Reaction> _localReactions = statechart.getLocalReactions();
+      Iterable<LocalReaction> _filter = IterableExtensions.<LocalReaction>filter(_localReactions, org.yakindu.sct.model.stext.stext.LocalReaction.class);
+      final Function1<LocalReaction,Boolean> _function = new Function1<LocalReaction,Boolean>() {
+          public Boolean apply(final LocalReaction lr) {
+            boolean _operator_or = false;
+            Trigger _trigger = lr.getTrigger();
+            EList<EventSpec> _triggers = ((ReactionTrigger) _trigger).getTriggers();
+            boolean _isEmpty = _triggers.isEmpty();
+            if (_isEmpty) {
+              _operator_or = true;
+            } else {
+              Trigger _trigger_1 = lr.getTrigger();
+              EList<EventSpec> _triggers_1 = ((ReactionTrigger) _trigger_1).getTriggers();
+              final Function1<EventSpec,Boolean> _function_1 = new Function1<EventSpec,Boolean>() {
+                  public Boolean apply(final EventSpec t) {
+                    boolean _operator_or_1 = false;
+                    boolean _operator_or_2 = false;
+                    boolean _operator_or_3 = false;
+                    if ((t instanceof org.yakindu.sct.model.stext.stext.RegularEventSpec)) {
+                      _operator_or_3 = true;
+                    } else {
+                      _operator_or_3 = BooleanExtensions.operator_or((t instanceof org.yakindu.sct.model.stext.stext.RegularEventSpec), (t instanceof org.yakindu.sct.model.stext.stext.TimeEventSpec));
+                    }
+                    if (_operator_or_3) {
+                      _operator_or_2 = true;
+                    } else {
+                      _operator_or_2 = BooleanExtensions.operator_or(_operator_or_3, (t instanceof org.yakindu.sct.model.stext.stext.OnCycleEvent));
+                    }
+                    if (_operator_or_2) {
+                      _operator_or_1 = true;
+                    } else {
+                      _operator_or_1 = BooleanExtensions.operator_or(_operator_or_2, (t instanceof org.yakindu.sct.model.stext.stext.AlwaysEvent));
+                    }
+                    return ((Boolean)_operator_or_1);
+                  }
+                };
+              Iterable<EventSpec> _filter_1 = IterableExtensions.<EventSpec>filter(_triggers_1, _function_1);
+              List<EventSpec> _list = IterableExtensions.<EventSpec>toList(_filter_1);
+              boolean _isEmpty_1 = _list.isEmpty();
+              boolean _operator_not = BooleanExtensions.operator_not(_isEmpty_1);
+              _operator_or = BooleanExtensions.operator_or(_isEmpty, _operator_not);
+            }
+            return ((Boolean)_operator_or);
+          }
+        };
+      Iterable<LocalReaction> _filter_2 = IterableExtensions.<LocalReaction>filter(_filter, _function);
+      final Function1<LocalReaction,Reaction> _function_2 = new Function1<LocalReaction,Reaction>() {
+          public Reaction apply(final LocalReaction t_1) {
+            Reaction _mapReaction = BehaviorMapping.this.mapReaction(t_1);
+            return _mapReaction;
+          }
+        };
+      Iterable<Reaction> _map = IterableExtensions.<LocalReaction, Reaction>map(_filter_2, _function_2);
+      CollectionExtensions.<Reaction>addAll(_reactions, _map);
       Iterable<EObject> _allContentsIterable = EObjectExtensions.allContentsIterable(statechart);
       Iterable<EObject> content = _allContentsIterable;
-      Iterable<State> _filter = IterableExtensions.<State>filter(content, org.yakindu.sct.model.sgraph.State.class);
-      final Iterable<State> allStates = _filter;
-      final Function1<State,ExecutionState> _function = new Function1<State,ExecutionState>() {
+      Iterable<State> _filter_3 = IterableExtensions.<State>filter(content, org.yakindu.sct.model.sgraph.State.class);
+      final Iterable<State> allStates = _filter_3;
+      final Function1<State,ExecutionState> _function_3 = new Function1<State,ExecutionState>() {
           public ExecutionState apply(final State s) {
             ExecutionState _mapStateLocalReactions = BehaviorMapping.this.mapStateLocalReactions(((State) s));
             return _mapStateLocalReactions;
           }
         };
-      IterableExtensions.<State>forEach(allStates, _function);
+      IterableExtensions.<State>forEach(allStates, _function_3);
       return r;
     }
   }