|
@@ -13,6 +13,7 @@ package org.yakindu.sct.simulation.core.sruntime.impl;
|
|
|
import java.util.ArrayList;
|
|
import java.util.ArrayList;
|
|
|
import java.util.Collection;
|
|
import java.util.Collection;
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
|
+
|
|
|
import org.eclipse.core.runtime.Assert;
|
|
import org.eclipse.core.runtime.Assert;
|
|
|
import org.eclipse.emf.common.notify.Notification;
|
|
import org.eclipse.emf.common.notify.Notification;
|
|
|
import org.eclipse.emf.common.notify.NotificationChain;
|
|
import org.eclipse.emf.common.notify.NotificationChain;
|
|
@@ -26,14 +27,16 @@ import org.eclipse.emf.ecore.util.EObjectContainmentEList;
|
|
|
import org.eclipse.emf.ecore.util.EObjectResolvingEList;
|
|
import org.eclipse.emf.ecore.util.EObjectResolvingEList;
|
|
|
import org.eclipse.emf.ecore.util.InternalEList;
|
|
import org.eclipse.emf.ecore.util.InternalEList;
|
|
|
import org.yakindu.base.base.impl.NamedElementImpl;
|
|
import org.yakindu.base.base.impl.NamedElementImpl;
|
|
|
|
|
+import org.yakindu.base.types.ITypeSystem.InferredType;
|
|
|
import org.yakindu.sct.model.sgraph.RegularState;
|
|
import org.yakindu.sct.model.sgraph.RegularState;
|
|
|
import org.yakindu.sct.model.sgraph.State;
|
|
import org.yakindu.sct.model.sgraph.State;
|
|
|
-import org.yakindu.sct.model.sgraph.util.DerivedSubsetEObjectEList;
|
|
|
|
|
|
|
+import org.yakindu.sct.simulation.core.sruntime.CompositeSlot;
|
|
|
import org.yakindu.sct.simulation.core.sruntime.ExecutionContext;
|
|
import org.yakindu.sct.simulation.core.sruntime.ExecutionContext;
|
|
|
import org.yakindu.sct.simulation.core.sruntime.ExecutionEvent;
|
|
import org.yakindu.sct.simulation.core.sruntime.ExecutionEvent;
|
|
|
import org.yakindu.sct.simulation.core.sruntime.ExecutionSlot;
|
|
import org.yakindu.sct.simulation.core.sruntime.ExecutionSlot;
|
|
|
import org.yakindu.sct.simulation.core.sruntime.ExecutionVariable;
|
|
import org.yakindu.sct.simulation.core.sruntime.ExecutionVariable;
|
|
|
import org.yakindu.sct.simulation.core.sruntime.SRuntimePackage;
|
|
import org.yakindu.sct.simulation.core.sruntime.SRuntimePackage;
|
|
|
|
|
+
|
|
|
import com.google.common.base.Predicate;
|
|
import com.google.common.base.Predicate;
|
|
|
import com.google.common.collect.Iterables;
|
|
import com.google.common.collect.Iterables;
|
|
|
import com.google.common.collect.Lists;
|
|
import com.google.common.collect.Lists;
|
|
@@ -44,11 +47,12 @@ import com.google.common.collect.Lists;
|
|
|
* <p>
|
|
* <p>
|
|
|
* The following features are implemented:
|
|
* The following features are implemented:
|
|
|
* <ul>
|
|
* <ul>
|
|
|
|
|
+ * <li>{@link org.yakindu.sct.simulation.core.sruntime.impl.ExecutionContextImpl#getType <em>Type</em>}</li>
|
|
|
|
|
+ * <li>{@link org.yakindu.sct.simulation.core.sruntime.impl.ExecutionContextImpl#getValue <em>Value</em>}</li>
|
|
|
|
|
+ * <li>{@link org.yakindu.sct.simulation.core.sruntime.impl.ExecutionContextImpl#getFqName <em>Fq Name</em>}</li>
|
|
|
|
|
+ * <li>{@link org.yakindu.sct.simulation.core.sruntime.impl.ExecutionContextImpl#getSlots <em>Slots</em>}</li>
|
|
|
* <li>{@link org.yakindu.sct.simulation.core.sruntime.impl.ExecutionContextImpl#getActiveStates <em>Active States</em>}</li>
|
|
* <li>{@link org.yakindu.sct.simulation.core.sruntime.impl.ExecutionContextImpl#getActiveStates <em>Active States</em>}</li>
|
|
|
- * <li>{@link org.yakindu.sct.simulation.core.sruntime.impl.ExecutionContextImpl#getEvents <em>Events</em>}</li>
|
|
|
|
|
- * <li>{@link org.yakindu.sct.simulation.core.sruntime.impl.ExecutionContextImpl#getVariables <em>Variables</em>}</li>
|
|
|
|
|
* <li>{@link org.yakindu.sct.simulation.core.sruntime.impl.ExecutionContextImpl#getExecutedElements <em>Executed Elements</em>}</li>
|
|
* <li>{@link org.yakindu.sct.simulation.core.sruntime.impl.ExecutionContextImpl#getExecutedElements <em>Executed Elements</em>}</li>
|
|
|
- * <li>{@link org.yakindu.sct.simulation.core.sruntime.impl.ExecutionContextImpl#getSlots <em>Slots</em>}</li>
|
|
|
|
|
* <li>{@link org.yakindu.sct.simulation.core.sruntime.impl.ExecutionContextImpl#getSuspendedElements <em>Suspended Elements</em>}</li>
|
|
* <li>{@link org.yakindu.sct.simulation.core.sruntime.impl.ExecutionContextImpl#getSuspendedElements <em>Suspended Elements</em>}</li>
|
|
|
* <li>{@link org.yakindu.sct.simulation.core.sruntime.impl.ExecutionContextImpl#isSnapshot <em>Snapshot</em>}</li>
|
|
* <li>{@link org.yakindu.sct.simulation.core.sruntime.impl.ExecutionContextImpl#isSnapshot <em>Snapshot</em>}</li>
|
|
|
* </ul>
|
|
* </ul>
|
|
@@ -58,35 +62,90 @@ import com.google.common.collect.Lists;
|
|
|
*/
|
|
*/
|
|
|
public class ExecutionContextImpl extends NamedElementImpl implements ExecutionContext {
|
|
public class ExecutionContextImpl extends NamedElementImpl implements ExecutionContext {
|
|
|
/**
|
|
/**
|
|
|
- * The cached value of the '{@link #getActiveStates() <em>Active States</em>}' reference list.
|
|
|
|
|
- * <!-- begin-user-doc --> <!--
|
|
|
|
|
- * end-user-doc -->
|
|
|
|
|
- * @see #getActiveStates()
|
|
|
|
|
|
|
+ * The default value of the '{@link #getType() <em>Type</em>}' attribute.
|
|
|
|
|
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
|
|
|
|
|
+ * @see #getType()
|
|
|
* @generated
|
|
* @generated
|
|
|
* @ordered
|
|
* @ordered
|
|
|
*/
|
|
*/
|
|
|
- protected EList<RegularState> activeStates;
|
|
|
|
|
|
|
+ protected static final InferredType TYPE_EDEFAULT = null;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * The cached value of the '{@link #getExecutedElements() <em>Executed Elements</em>}' reference list.
|
|
|
|
|
|
|
+ * The cached value of the '{@link #getType() <em>Type</em>}' attribute.
|
|
|
|
|
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
|
|
|
|
|
+ * @see #getType()
|
|
|
|
|
+ * @generated
|
|
|
|
|
+ * @ordered
|
|
|
|
|
+ */
|
|
|
|
|
+ protected InferredType type = TYPE_EDEFAULT;
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * The default value of the '{@link #getValue() <em>Value</em>}' attribute.
|
|
|
|
|
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
|
|
|
|
|
+ * @see #getValue()
|
|
|
|
|
+ * @generated
|
|
|
|
|
+ * @ordered
|
|
|
|
|
+ */
|
|
|
|
|
+ protected static final Object VALUE_EDEFAULT = null;
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * The cached value of the '{@link #getValue() <em>Value</em>}' attribute.
|
|
|
|
|
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
|
|
|
|
|
+ * @see #getValue()
|
|
|
|
|
+ * @generated
|
|
|
|
|
+ * @ordered
|
|
|
|
|
+ */
|
|
|
|
|
+ protected Object value = VALUE_EDEFAULT;
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * The default value of the '{@link #getFqName() <em>Fq Name</em>}' attribute.
|
|
|
* <!-- begin-user-doc -->
|
|
* <!-- begin-user-doc -->
|
|
|
* <!-- end-user-doc -->
|
|
* <!-- end-user-doc -->
|
|
|
- * @see #getExecutedElements()
|
|
|
|
|
|
|
+ * @see #getFqName()
|
|
|
* @generated
|
|
* @generated
|
|
|
* @ordered
|
|
* @ordered
|
|
|
*/
|
|
*/
|
|
|
- protected EList<EObject> executedElements;
|
|
|
|
|
|
|
+ protected static final String FQ_NAME_EDEFAULT = null;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * The cached value of the '{@link #getSlots() <em>Slots</em>}' containment reference list.
|
|
|
|
|
|
|
+ * The cached value of the '{@link #getFqName() <em>Fq Name</em>}' attribute.
|
|
|
* <!-- begin-user-doc -->
|
|
* <!-- begin-user-doc -->
|
|
|
* <!-- end-user-doc -->
|
|
* <!-- end-user-doc -->
|
|
|
|
|
+ * @see #getFqName()
|
|
|
|
|
+ * @generated
|
|
|
|
|
+ * @ordered
|
|
|
|
|
+ */
|
|
|
|
|
+ protected String fqName = FQ_NAME_EDEFAULT;
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * The cached value of the '{@link #getSlots() <em>Slots</em>}' containment reference list.
|
|
|
|
|
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
|
|
|
* @see #getSlots()
|
|
* @see #getSlots()
|
|
|
* @generated
|
|
* @generated
|
|
|
* @ordered
|
|
* @ordered
|
|
|
*/
|
|
*/
|
|
|
protected EList<ExecutionSlot> slots;
|
|
protected EList<ExecutionSlot> slots;
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * The cached value of the '{@link #getActiveStates() <em>Active States</em>}' reference list.
|
|
|
|
|
+ * <!-- begin-user-doc --> <!--
|
|
|
|
|
+ * end-user-doc -->
|
|
|
|
|
+ * @see #getActiveStates()
|
|
|
|
|
+ * @generated
|
|
|
|
|
+ * @ordered
|
|
|
|
|
+ */
|
|
|
|
|
+ protected EList<RegularState> activeStates;
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * The cached value of the '{@link #getExecutedElements() <em>Executed Elements</em>}' reference list.
|
|
|
|
|
+ * <!-- begin-user-doc --> <!--
|
|
|
|
|
+ * end-user-doc -->
|
|
|
|
|
+ * @see #getExecutedElements()
|
|
|
|
|
+ * @generated
|
|
|
|
|
+ * @ordered
|
|
|
|
|
+ */
|
|
|
|
|
+ protected EList<EObject> executedElements;
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* The cached value of the '{@link #getSuspendedElements() <em>Suspended Elements</em>}' reference list.
|
|
* The cached value of the '{@link #getSuspendedElements() <em>Suspended Elements</em>}' reference list.
|
|
|
* <!-- begin-user-doc -->
|
|
* <!-- begin-user-doc -->
|
|
@@ -99,8 +158,7 @@ public class ExecutionContextImpl extends NamedElementImpl implements ExecutionC
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* The default value of the '{@link #isSnapshot() <em>Snapshot</em>}' attribute.
|
|
* The default value of the '{@link #isSnapshot() <em>Snapshot</em>}' attribute.
|
|
|
- * <!-- begin-user-doc -->
|
|
|
|
|
- * <!-- end-user-doc -->
|
|
|
|
|
|
|
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
|
|
|
* @see #isSnapshot()
|
|
* @see #isSnapshot()
|
|
|
* @generated
|
|
* @generated
|
|
|
* @ordered
|
|
* @ordered
|
|
@@ -109,8 +167,7 @@ public class ExecutionContextImpl extends NamedElementImpl implements ExecutionC
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* The cached value of the '{@link #isSnapshot() <em>Snapshot</em>}' attribute.
|
|
* The cached value of the '{@link #isSnapshot() <em>Snapshot</em>}' attribute.
|
|
|
- * <!-- begin-user-doc -->
|
|
|
|
|
- * <!-- end-user-doc -->
|
|
|
|
|
|
|
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
|
|
|
* @see #isSnapshot()
|
|
* @see #isSnapshot()
|
|
|
* @generated
|
|
* @generated
|
|
|
* @ordered
|
|
* @ordered
|
|
@@ -138,31 +195,70 @@ public class ExecutionContextImpl extends NamedElementImpl implements ExecutionC
|
|
|
* <!-- begin-user-doc --> <!-- end-user-doc -->
|
|
* <!-- begin-user-doc --> <!-- end-user-doc -->
|
|
|
* @generated
|
|
* @generated
|
|
|
*/
|
|
*/
|
|
|
- public List<RegularState> getActiveStates() {
|
|
|
|
|
- if (activeStates == null) {
|
|
|
|
|
- activeStates = new EObjectResolvingEList<RegularState>(RegularState.class, this, SRuntimePackage.EXECUTION_CONTEXT__ACTIVE_STATES);
|
|
|
|
|
- }
|
|
|
|
|
- return activeStates;
|
|
|
|
|
|
|
+ public InferredType getType() {
|
|
|
|
|
+ return type;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* <!-- begin-user-doc --> <!-- end-user-doc -->
|
|
* <!-- begin-user-doc --> <!-- end-user-doc -->
|
|
|
- *
|
|
|
|
|
- * @generated NOT
|
|
|
|
|
|
|
+ * @generated
|
|
|
*/
|
|
*/
|
|
|
- public List<ExecutionEvent> getEvents() {
|
|
|
|
|
- return new DerivedSubsetEObjectEList<ExecutionEvent>(ExecutionEvent.class, this,
|
|
|
|
|
- SRuntimePackage.EXECUTION_CONTEXT__EVENTS, SRuntimePackage.EXECUTION_CONTEXT__SLOTS);
|
|
|
|
|
|
|
+ public void setType(InferredType newType) {
|
|
|
|
|
+ InferredType oldType = type;
|
|
|
|
|
+ type = newType;
|
|
|
|
|
+ if (eNotificationRequired())
|
|
|
|
|
+ eNotify(new ENotificationImpl(this, Notification.SET, SRuntimePackage.EXECUTION_CONTEXT__TYPE, oldType, type));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* <!-- begin-user-doc --> <!-- end-user-doc -->
|
|
* <!-- begin-user-doc --> <!-- end-user-doc -->
|
|
|
- *
|
|
|
|
|
- * @generated NOT
|
|
|
|
|
|
|
+ * @generated
|
|
|
*/
|
|
*/
|
|
|
- public List<ExecutionVariable> getVariables() {
|
|
|
|
|
- return new DerivedSubsetEObjectEList<ExecutionVariable>(ExecutionVariable.class, this,
|
|
|
|
|
- SRuntimePackage.EXECUTION_CONTEXT__VARIABLES, SRuntimePackage.EXECUTION_CONTEXT__SLOTS);
|
|
|
|
|
|
|
+ public Object getValue() {
|
|
|
|
|
+ return value;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
|
|
|
|
|
+ * @generated
|
|
|
|
|
+ */
|
|
|
|
|
+ public void setValue(Object newValue) {
|
|
|
|
|
+ Object oldValue = value;
|
|
|
|
|
+ value = newValue;
|
|
|
|
|
+ if (eNotificationRequired())
|
|
|
|
|
+ eNotify(new ENotificationImpl(this, Notification.SET, SRuntimePackage.EXECUTION_CONTEXT__VALUE, oldValue, value));
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * <!-- begin-user-doc -->
|
|
|
|
|
+ * <!-- end-user-doc -->
|
|
|
|
|
+ * @generated
|
|
|
|
|
+ */
|
|
|
|
|
+ public String getFqName() {
|
|
|
|
|
+ return fqName;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * <!-- begin-user-doc -->
|
|
|
|
|
+ * <!-- end-user-doc -->
|
|
|
|
|
+ * @generated
|
|
|
|
|
+ */
|
|
|
|
|
+ public void setFqName(String newFqName) {
|
|
|
|
|
+ String oldFqName = fqName;
|
|
|
|
|
+ fqName = newFqName;
|
|
|
|
|
+ if (eNotificationRequired())
|
|
|
|
|
+ eNotify(new ENotificationImpl(this, Notification.SET, SRuntimePackage.EXECUTION_CONTEXT__FQ_NAME, oldFqName, fqName));
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
|
|
|
|
|
+ * @generated
|
|
|
|
|
+ */
|
|
|
|
|
+ public List<RegularState> getActiveStates() {
|
|
|
|
|
+ if (activeStates == null) {
|
|
|
|
|
+ activeStates = new EObjectResolvingEList<RegularState>(RegularState.class, this, SRuntimePackage.EXECUTION_CONTEXT__ACTIVE_STATES);
|
|
|
|
|
+ }
|
|
|
|
|
+ return activeStates;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -177,8 +273,7 @@ public class ExecutionContextImpl extends NamedElementImpl implements ExecutionC
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * <!-- begin-user-doc -->
|
|
|
|
|
- * <!-- end-user-doc -->
|
|
|
|
|
|
|
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
|
|
|
* @generated
|
|
* @generated
|
|
|
*/
|
|
*/
|
|
|
public List<ExecutionSlot> getSlots() {
|
|
public List<ExecutionSlot> getSlots() {
|
|
@@ -189,8 +284,7 @@ public class ExecutionContextImpl extends NamedElementImpl implements ExecutionC
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * <!-- begin-user-doc -->
|
|
|
|
|
- * <!-- end-user-doc -->
|
|
|
|
|
|
|
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
|
|
|
* @generated
|
|
* @generated
|
|
|
*/
|
|
*/
|
|
|
public List<EObject> getSuspendedElements() {
|
|
public List<EObject> getSuspendedElements() {
|
|
@@ -201,8 +295,7 @@ public class ExecutionContextImpl extends NamedElementImpl implements ExecutionC
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * <!-- begin-user-doc -->
|
|
|
|
|
- * <!-- end-user-doc -->
|
|
|
|
|
|
|
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
|
|
|
* @generated
|
|
* @generated
|
|
|
*/
|
|
*/
|
|
|
public boolean isSnapshot() {
|
|
public boolean isSnapshot() {
|
|
@@ -210,8 +303,7 @@ public class ExecutionContextImpl extends NamedElementImpl implements ExecutionC
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * <!-- begin-user-doc -->
|
|
|
|
|
- * <!-- end-user-doc -->
|
|
|
|
|
|
|
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
|
|
|
* @generated
|
|
* @generated
|
|
|
*/
|
|
*/
|
|
|
public void setSnapshot(boolean newSnapshot) {
|
|
public void setSnapshot(boolean newSnapshot) {
|
|
@@ -227,7 +319,7 @@ public class ExecutionContextImpl extends NamedElementImpl implements ExecutionC
|
|
|
* @generated NOT
|
|
* @generated NOT
|
|
|
*/
|
|
*/
|
|
|
public List<ExecutionEvent> getRaisedEvents() {
|
|
public List<ExecutionEvent> getRaisedEvents() {
|
|
|
- Iterable<ExecutionEvent> raisedEvents = Iterables.filter(getEvents(), new Predicate<ExecutionEvent>() {
|
|
|
|
|
|
|
+ Iterable<ExecutionEvent> raisedEvents = Iterables.filter(getAllEvents(), new Predicate<ExecutionEvent>() {
|
|
|
public boolean apply(ExecutionEvent input) {
|
|
public boolean apply(ExecutionEvent input) {
|
|
|
return input.isRaised();
|
|
return input.isRaised();
|
|
|
}
|
|
}
|
|
@@ -243,7 +335,7 @@ public class ExecutionContextImpl extends NamedElementImpl implements ExecutionC
|
|
|
* @generated NOT
|
|
* @generated NOT
|
|
|
*/
|
|
*/
|
|
|
public List<ExecutionEvent> getScheduledEvents() {
|
|
public List<ExecutionEvent> getScheduledEvents() {
|
|
|
- Iterable<ExecutionEvent> raisedEvents = Iterables.filter(getEvents(), new Predicate<ExecutionEvent>() {
|
|
|
|
|
|
|
+ Iterable<ExecutionEvent> raisedEvents = Iterables.filter(getAllEvents(), new Predicate<ExecutionEvent>() {
|
|
|
public boolean apply(ExecutionEvent input) {
|
|
public boolean apply(ExecutionEvent input) {
|
|
|
return input.isScheduled();
|
|
return input.isScheduled();
|
|
|
}
|
|
}
|
|
@@ -258,30 +350,31 @@ public class ExecutionContextImpl extends NamedElementImpl implements ExecutionC
|
|
|
*
|
|
*
|
|
|
* @generated NOT
|
|
* @generated NOT
|
|
|
*/
|
|
*/
|
|
|
- public ExecutionVariable getVariable(final String name) {
|
|
|
|
|
- Assert.isNotNull(name);
|
|
|
|
|
- for (ExecutionVariable var : getVariables()) {
|
|
|
|
|
- if (name.equals(var.getName()))
|
|
|
|
|
|
|
+ public ExecutionVariable getVariable(final String fqName) {
|
|
|
|
|
+ Assert.isNotNull(fqName);
|
|
|
|
|
+ for (ExecutionVariable var : getAllVariables()) {
|
|
|
|
|
+ if (fqName.equals(var.getFqName()))
|
|
|
return var;
|
|
return var;
|
|
|
}
|
|
}
|
|
|
|
|
+ System.out.println("No variable found: " + fqName + " " + getAllVariables());
|
|
|
return null;
|
|
return null;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- *Returns the event by its qualified name
|
|
|
|
|
|
|
+ * Returns the event by its qualified name
|
|
|
*
|
|
*
|
|
|
* @generated NOT
|
|
* @generated NOT
|
|
|
*/
|
|
*/
|
|
|
- public ExecutionEvent getEvent(final String name) {
|
|
|
|
|
- Assert.isNotNull(name);
|
|
|
|
|
-
|
|
|
|
|
- for (ExecutionEvent event : getEvents()) {
|
|
|
|
|
- if (name.equals(event.getName()))
|
|
|
|
|
|
|
+ public ExecutionEvent getEvent(final String fqName) {
|
|
|
|
|
+ Assert.isNotNull(fqName);
|
|
|
|
|
+ for (ExecutionEvent event : getAllEvents()) {
|
|
|
|
|
+ if (fqName.equals(event.getFqName()))
|
|
|
return event;
|
|
return event;
|
|
|
}
|
|
}
|
|
|
|
|
+ System.out.println("No event found: " + fqName + " " + getAllEvents());
|
|
|
return null;
|
|
return null;
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* <!-- begin-user-doc --> <!-- end-user-doc -->
|
|
* <!-- begin-user-doc --> <!-- end-user-doc -->
|
|
|
*
|
|
*
|
|
@@ -296,10 +389,49 @@ public class ExecutionContextImpl extends NamedElementImpl implements ExecutionC
|
|
|
return result;
|
|
return result;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
|
|
|
|
|
+ * @generated NOT
|
|
|
|
|
+ */
|
|
|
|
|
+ public List<ExecutionEvent> getAllEvents() {
|
|
|
|
|
+ List<ExecutionEvent> result = new BasicEList<ExecutionEvent>();
|
|
|
|
|
+ addEvents(result, slots);
|
|
|
|
|
+ return result;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ protected void addEvents(List<ExecutionEvent> event, List<ExecutionSlot> slots) {
|
|
|
|
|
+ for (ExecutionSlot slot : slots) {
|
|
|
|
|
+ if (slot instanceof ExecutionEvent) {
|
|
|
|
|
+ event.add((ExecutionEvent) slot);
|
|
|
|
|
+ } else if (slot instanceof CompositeSlot) {
|
|
|
|
|
+ addEvents(event, ((CompositeSlot) slot).getSlots());
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * <!-- begin-user-doc -->
|
|
|
|
|
- * <!-- end-user-doc -->
|
|
|
|
|
|
|
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
|
|
|
|
|
+ *
|
|
|
|
|
+ * @generated NOT
|
|
|
|
|
+ */
|
|
|
|
|
+ public List<ExecutionVariable> getAllVariables() {
|
|
|
|
|
+ List<ExecutionVariable> result = new BasicEList<ExecutionVariable>();
|
|
|
|
|
+ addVariables(result, slots);
|
|
|
|
|
+ return result;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ protected void addVariables(List<ExecutionVariable> variables, List<ExecutionSlot> slots) {
|
|
|
|
|
+ for (ExecutionSlot slot : slots) {
|
|
|
|
|
+ if (slot instanceof ExecutionVariable) {
|
|
|
|
|
+ variables.add((ExecutionVariable) slot);
|
|
|
|
|
+ } else if (slot instanceof CompositeSlot) {
|
|
|
|
|
+ addVariables(variables, ((CompositeSlot) slot).getSlots());
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
|
|
|
* @generated
|
|
* @generated
|
|
|
*/
|
|
*/
|
|
|
@Override
|
|
@Override
|
|
@@ -331,16 +463,18 @@ public class ExecutionContextImpl extends NamedElementImpl implements ExecutionC
|
|
|
@Override
|
|
@Override
|
|
|
public Object eGet(int featureID, boolean resolve, boolean coreType) {
|
|
public Object eGet(int featureID, boolean resolve, boolean coreType) {
|
|
|
switch (featureID) {
|
|
switch (featureID) {
|
|
|
|
|
+ case SRuntimePackage.EXECUTION_CONTEXT__TYPE:
|
|
|
|
|
+ return getType();
|
|
|
|
|
+ case SRuntimePackage.EXECUTION_CONTEXT__VALUE:
|
|
|
|
|
+ return getValue();
|
|
|
|
|
+ case SRuntimePackage.EXECUTION_CONTEXT__FQ_NAME:
|
|
|
|
|
+ return getFqName();
|
|
|
|
|
+ case SRuntimePackage.EXECUTION_CONTEXT__SLOTS:
|
|
|
|
|
+ return getSlots();
|
|
|
case SRuntimePackage.EXECUTION_CONTEXT__ACTIVE_STATES:
|
|
case SRuntimePackage.EXECUTION_CONTEXT__ACTIVE_STATES:
|
|
|
return getActiveStates();
|
|
return getActiveStates();
|
|
|
- case SRuntimePackage.EXECUTION_CONTEXT__EVENTS:
|
|
|
|
|
- return getEvents();
|
|
|
|
|
- case SRuntimePackage.EXECUTION_CONTEXT__VARIABLES:
|
|
|
|
|
- return getVariables();
|
|
|
|
|
case SRuntimePackage.EXECUTION_CONTEXT__EXECUTED_ELEMENTS:
|
|
case SRuntimePackage.EXECUTION_CONTEXT__EXECUTED_ELEMENTS:
|
|
|
return getExecutedElements();
|
|
return getExecutedElements();
|
|
|
- case SRuntimePackage.EXECUTION_CONTEXT__SLOTS:
|
|
|
|
|
- return getSlots();
|
|
|
|
|
case SRuntimePackage.EXECUTION_CONTEXT__SUSPENDED_ELEMENTS:
|
|
case SRuntimePackage.EXECUTION_CONTEXT__SUSPENDED_ELEMENTS:
|
|
|
return getSuspendedElements();
|
|
return getSuspendedElements();
|
|
|
case SRuntimePackage.EXECUTION_CONTEXT__SNAPSHOT:
|
|
case SRuntimePackage.EXECUTION_CONTEXT__SNAPSHOT:
|
|
@@ -357,26 +491,27 @@ public class ExecutionContextImpl extends NamedElementImpl implements ExecutionC
|
|
|
@Override
|
|
@Override
|
|
|
public void eSet(int featureID, Object newValue) {
|
|
public void eSet(int featureID, Object newValue) {
|
|
|
switch (featureID) {
|
|
switch (featureID) {
|
|
|
|
|
+ case SRuntimePackage.EXECUTION_CONTEXT__TYPE:
|
|
|
|
|
+ setType((InferredType)newValue);
|
|
|
|
|
+ return;
|
|
|
|
|
+ case SRuntimePackage.EXECUTION_CONTEXT__VALUE:
|
|
|
|
|
+ setValue(newValue);
|
|
|
|
|
+ return;
|
|
|
|
|
+ case SRuntimePackage.EXECUTION_CONTEXT__FQ_NAME:
|
|
|
|
|
+ setFqName((String)newValue);
|
|
|
|
|
+ return;
|
|
|
|
|
+ case SRuntimePackage.EXECUTION_CONTEXT__SLOTS:
|
|
|
|
|
+ getSlots().clear();
|
|
|
|
|
+ getSlots().addAll((Collection<? extends ExecutionSlot>)newValue);
|
|
|
|
|
+ return;
|
|
|
case SRuntimePackage.EXECUTION_CONTEXT__ACTIVE_STATES:
|
|
case SRuntimePackage.EXECUTION_CONTEXT__ACTIVE_STATES:
|
|
|
getActiveStates().clear();
|
|
getActiveStates().clear();
|
|
|
getActiveStates().addAll((Collection<? extends RegularState>)newValue);
|
|
getActiveStates().addAll((Collection<? extends RegularState>)newValue);
|
|
|
return;
|
|
return;
|
|
|
- case SRuntimePackage.EXECUTION_CONTEXT__EVENTS:
|
|
|
|
|
- getEvents().clear();
|
|
|
|
|
- getEvents().addAll((Collection<? extends ExecutionEvent>)newValue);
|
|
|
|
|
- return;
|
|
|
|
|
- case SRuntimePackage.EXECUTION_CONTEXT__VARIABLES:
|
|
|
|
|
- getVariables().clear();
|
|
|
|
|
- getVariables().addAll((Collection<? extends ExecutionVariable>)newValue);
|
|
|
|
|
- return;
|
|
|
|
|
case SRuntimePackage.EXECUTION_CONTEXT__EXECUTED_ELEMENTS:
|
|
case SRuntimePackage.EXECUTION_CONTEXT__EXECUTED_ELEMENTS:
|
|
|
getExecutedElements().clear();
|
|
getExecutedElements().clear();
|
|
|
getExecutedElements().addAll((Collection<? extends EObject>)newValue);
|
|
getExecutedElements().addAll((Collection<? extends EObject>)newValue);
|
|
|
return;
|
|
return;
|
|
|
- case SRuntimePackage.EXECUTION_CONTEXT__SLOTS:
|
|
|
|
|
- getSlots().clear();
|
|
|
|
|
- getSlots().addAll((Collection<? extends ExecutionSlot>)newValue);
|
|
|
|
|
- return;
|
|
|
|
|
case SRuntimePackage.EXECUTION_CONTEXT__SUSPENDED_ELEMENTS:
|
|
case SRuntimePackage.EXECUTION_CONTEXT__SUSPENDED_ELEMENTS:
|
|
|
getSuspendedElements().clear();
|
|
getSuspendedElements().clear();
|
|
|
getSuspendedElements().addAll((Collection<? extends EObject>)newValue);
|
|
getSuspendedElements().addAll((Collection<? extends EObject>)newValue);
|
|
@@ -395,21 +530,24 @@ public class ExecutionContextImpl extends NamedElementImpl implements ExecutionC
|
|
|
@Override
|
|
@Override
|
|
|
public void eUnset(int featureID) {
|
|
public void eUnset(int featureID) {
|
|
|
switch (featureID) {
|
|
switch (featureID) {
|
|
|
- case SRuntimePackage.EXECUTION_CONTEXT__ACTIVE_STATES:
|
|
|
|
|
- getActiveStates().clear();
|
|
|
|
|
|
|
+ case SRuntimePackage.EXECUTION_CONTEXT__TYPE:
|
|
|
|
|
+ setType(TYPE_EDEFAULT);
|
|
|
return;
|
|
return;
|
|
|
- case SRuntimePackage.EXECUTION_CONTEXT__EVENTS:
|
|
|
|
|
- getEvents().clear();
|
|
|
|
|
|
|
+ case SRuntimePackage.EXECUTION_CONTEXT__VALUE:
|
|
|
|
|
+ setValue(VALUE_EDEFAULT);
|
|
|
return;
|
|
return;
|
|
|
- case SRuntimePackage.EXECUTION_CONTEXT__VARIABLES:
|
|
|
|
|
- getVariables().clear();
|
|
|
|
|
- return;
|
|
|
|
|
- case SRuntimePackage.EXECUTION_CONTEXT__EXECUTED_ELEMENTS:
|
|
|
|
|
- getExecutedElements().clear();
|
|
|
|
|
|
|
+ case SRuntimePackage.EXECUTION_CONTEXT__FQ_NAME:
|
|
|
|
|
+ setFqName(FQ_NAME_EDEFAULT);
|
|
|
return;
|
|
return;
|
|
|
case SRuntimePackage.EXECUTION_CONTEXT__SLOTS:
|
|
case SRuntimePackage.EXECUTION_CONTEXT__SLOTS:
|
|
|
getSlots().clear();
|
|
getSlots().clear();
|
|
|
return;
|
|
return;
|
|
|
|
|
+ case SRuntimePackage.EXECUTION_CONTEXT__ACTIVE_STATES:
|
|
|
|
|
+ getActiveStates().clear();
|
|
|
|
|
+ return;
|
|
|
|
|
+ case SRuntimePackage.EXECUTION_CONTEXT__EXECUTED_ELEMENTS:
|
|
|
|
|
+ getExecutedElements().clear();
|
|
|
|
|
+ return;
|
|
|
case SRuntimePackage.EXECUTION_CONTEXT__SUSPENDED_ELEMENTS:
|
|
case SRuntimePackage.EXECUTION_CONTEXT__SUSPENDED_ELEMENTS:
|
|
|
getSuspendedElements().clear();
|
|
getSuspendedElements().clear();
|
|
|
return;
|
|
return;
|
|
@@ -427,16 +565,18 @@ public class ExecutionContextImpl extends NamedElementImpl implements ExecutionC
|
|
|
@Override
|
|
@Override
|
|
|
public boolean eIsSet(int featureID) {
|
|
public boolean eIsSet(int featureID) {
|
|
|
switch (featureID) {
|
|
switch (featureID) {
|
|
|
|
|
+ case SRuntimePackage.EXECUTION_CONTEXT__TYPE:
|
|
|
|
|
+ return TYPE_EDEFAULT == null ? type != null : !TYPE_EDEFAULT.equals(type);
|
|
|
|
|
+ case SRuntimePackage.EXECUTION_CONTEXT__VALUE:
|
|
|
|
|
+ return VALUE_EDEFAULT == null ? value != null : !VALUE_EDEFAULT.equals(value);
|
|
|
|
|
+ case SRuntimePackage.EXECUTION_CONTEXT__FQ_NAME:
|
|
|
|
|
+ return FQ_NAME_EDEFAULT == null ? fqName != null : !FQ_NAME_EDEFAULT.equals(fqName);
|
|
|
|
|
+ case SRuntimePackage.EXECUTION_CONTEXT__SLOTS:
|
|
|
|
|
+ return slots != null && !slots.isEmpty();
|
|
|
case SRuntimePackage.EXECUTION_CONTEXT__ACTIVE_STATES:
|
|
case SRuntimePackage.EXECUTION_CONTEXT__ACTIVE_STATES:
|
|
|
return activeStates != null && !activeStates.isEmpty();
|
|
return activeStates != null && !activeStates.isEmpty();
|
|
|
- case SRuntimePackage.EXECUTION_CONTEXT__EVENTS:
|
|
|
|
|
- return !getEvents().isEmpty();
|
|
|
|
|
- case SRuntimePackage.EXECUTION_CONTEXT__VARIABLES:
|
|
|
|
|
- return !getVariables().isEmpty();
|
|
|
|
|
case SRuntimePackage.EXECUTION_CONTEXT__EXECUTED_ELEMENTS:
|
|
case SRuntimePackage.EXECUTION_CONTEXT__EXECUTED_ELEMENTS:
|
|
|
return executedElements != null && !executedElements.isEmpty();
|
|
return executedElements != null && !executedElements.isEmpty();
|
|
|
- case SRuntimePackage.EXECUTION_CONTEXT__SLOTS:
|
|
|
|
|
- return slots != null && !slots.isEmpty();
|
|
|
|
|
case SRuntimePackage.EXECUTION_CONTEXT__SUSPENDED_ELEMENTS:
|
|
case SRuntimePackage.EXECUTION_CONTEXT__SUSPENDED_ELEMENTS:
|
|
|
return suspendedElements != null && !suspendedElements.isEmpty();
|
|
return suspendedElements != null && !suspendedElements.isEmpty();
|
|
|
case SRuntimePackage.EXECUTION_CONTEXT__SNAPSHOT:
|
|
case SRuntimePackage.EXECUTION_CONTEXT__SNAPSHOT:
|
|
@@ -446,8 +586,53 @@ public class ExecutionContextImpl extends NamedElementImpl implements ExecutionC
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * <!-- begin-user-doc -->
|
|
|
|
|
- * <!-- end-user-doc -->
|
|
|
|
|
|
|
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
|
|
|
|
|
+ * @generated
|
|
|
|
|
+ */
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass) {
|
|
|
|
|
+ if (baseClass == ExecutionSlot.class) {
|
|
|
|
|
+ switch (derivedFeatureID) {
|
|
|
|
|
+ case SRuntimePackage.EXECUTION_CONTEXT__TYPE: return SRuntimePackage.EXECUTION_SLOT__TYPE;
|
|
|
|
|
+ case SRuntimePackage.EXECUTION_CONTEXT__VALUE: return SRuntimePackage.EXECUTION_SLOT__VALUE;
|
|
|
|
|
+ case SRuntimePackage.EXECUTION_CONTEXT__FQ_NAME: return SRuntimePackage.EXECUTION_SLOT__FQ_NAME;
|
|
|
|
|
+ default: return -1;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ if (baseClass == CompositeSlot.class) {
|
|
|
|
|
+ switch (derivedFeatureID) {
|
|
|
|
|
+ case SRuntimePackage.EXECUTION_CONTEXT__SLOTS: return SRuntimePackage.COMPOSITE_SLOT__SLOTS;
|
|
|
|
|
+ default: return -1;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
|
|
|
|
|
+ * @generated
|
|
|
|
|
+ */
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public int eDerivedStructuralFeatureID(int baseFeatureID, Class<?> baseClass) {
|
|
|
|
|
+ if (baseClass == ExecutionSlot.class) {
|
|
|
|
|
+ switch (baseFeatureID) {
|
|
|
|
|
+ case SRuntimePackage.EXECUTION_SLOT__TYPE: return SRuntimePackage.EXECUTION_CONTEXT__TYPE;
|
|
|
|
|
+ case SRuntimePackage.EXECUTION_SLOT__VALUE: return SRuntimePackage.EXECUTION_CONTEXT__VALUE;
|
|
|
|
|
+ case SRuntimePackage.EXECUTION_SLOT__FQ_NAME: return SRuntimePackage.EXECUTION_CONTEXT__FQ_NAME;
|
|
|
|
|
+ default: return -1;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ if (baseClass == CompositeSlot.class) {
|
|
|
|
|
+ switch (baseFeatureID) {
|
|
|
|
|
+ case SRuntimePackage.COMPOSITE_SLOT__SLOTS: return SRuntimePackage.EXECUTION_CONTEXT__SLOTS;
|
|
|
|
|
+ default: return -1;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
|
|
|
* @generated
|
|
* @generated
|
|
|
*/
|
|
*/
|
|
|
@Override
|
|
@Override
|
|
@@ -455,7 +640,13 @@ public class ExecutionContextImpl extends NamedElementImpl implements ExecutionC
|
|
|
if (eIsProxy()) return super.toString();
|
|
if (eIsProxy()) return super.toString();
|
|
|
|
|
|
|
|
StringBuffer result = new StringBuffer(super.toString());
|
|
StringBuffer result = new StringBuffer(super.toString());
|
|
|
- result.append(" (snapshot: ");
|
|
|
|
|
|
|
+ result.append(" (type: ");
|
|
|
|
|
+ result.append(type);
|
|
|
|
|
+ result.append(", value: ");
|
|
|
|
|
+ result.append(value);
|
|
|
|
|
+ result.append(", fqName: ");
|
|
|
|
|
+ result.append(fqName);
|
|
|
|
|
+ result.append(", snapshot: ");
|
|
|
result.append(snapshot);
|
|
result.append(snapshot);
|
|
|
result.append(')');
|
|
result.append(')');
|
|
|
return result.toString();
|
|
return result.toString();
|