use of org.yakindu.sct.model.sexec.ExecutionScope in project statecharts by Yakindu.
the class ExecutionFlowImpl method basicSetSuperScope.
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetSuperScope(ExecutionScope newSuperScope, NotificationChain msgs) {
ExecutionScope oldSuperScope = superScope;
superScope = newSuperScope;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, SexecPackage.EXECUTION_FLOW__SUPER_SCOPE, oldSuperScope, newSuperScope);
if (msgs == null)
msgs = notification;
else
msgs.add(notification);
}
return msgs;
}
use of org.yakindu.sct.model.sexec.ExecutionScope in project statecharts by Yakindu.
the class ExecutionStateImpl method basicSetSuperScope.
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetSuperScope(ExecutionScope newSuperScope, NotificationChain msgs) {
ExecutionScope oldSuperScope = superScope;
superScope = newSuperScope;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, SexecPackage.EXECUTION_STATE__SUPER_SCOPE, oldSuperScope, newSuperScope);
if (msgs == null)
msgs = notification;
else
msgs.add(notification);
}
return msgs;
}
use of org.yakindu.sct.model.sexec.ExecutionScope in project statecharts by Yakindu.
the class ExecutionScopeImpl method basicSetSuperScope.
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetSuperScope(ExecutionScope newSuperScope, NotificationChain msgs) {
ExecutionScope oldSuperScope = superScope;
superScope = newSuperScope;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, SexecPackage.EXECUTION_SCOPE__SUPER_SCOPE, oldSuperScope, newSuperScope);
if (msgs == null)
msgs = notification;
else
msgs.add(notification);
}
return msgs;
}
use of org.yakindu.sct.model.sexec.ExecutionScope in project statecharts by Yakindu.
the class ModelSequencerStateTest method testCompositeStateExitSequence_Deep.
/**
* A composite state must have a exit sequence. This exit sequence consists
* of an exit action call and a state switch for all leaf states.
*/
@SuppressWarnings("unused")
@Test
public void testCompositeStateExitSequence_Deep() {
Statechart sc = _createStatechart("sc");
{
InterfaceScope s_scope = _createInterfaceScope("Interface", sc);
VariableDefinition v1 = _createVariableDefinition("v1", TYPE_INTEGER, s_scope);
EventDefinition e1 = _createEventDefinition("e1", s_scope);
Region r = _createRegion("r", sc);
{
State s1 = _createState("s1", r);
{
_createExitAssignment(v1, s1, 1);
Region r_s1 = _createRegion("r", s1);
{
State s3 = _createState("s3", r_s1);
{
_createExitAssignment(v1, s3, 2);
Region r_s3 = _createRegion("r", s3);
{
State s4 = _createState("s4", r_s3);
_createExitAssignment(v1, s4, 3);
FinalState fs = _createFinalState(r_s3);
}
}
}
}
State s2 = _createState("s2", r);
{
Region r_s1 = _createRegion("r", s2);
{
_createState("s6", r_s1);
}
}
}
}
ExecutionFlow flow = sequencer.transform(sc);
ExecutionState _s1 = flow.getStates().get(0);
assertEquals("sc.r.s1", _s1.getName());
ExecutionState _s3 = flow.getStates().get(1);
assertEquals("sc.r.s1.r.s3", _s3.getName());
ExecutionState _s4 = flow.getStates().get(2);
assertEquals("sc.r.s1.r.s3.r.s4", _s4.getName());
ExecutionState _fs = flow.getStates().get(3);
assertEquals("sc.r.s1.r.s3.r._final_", _fs.getName());
ExecutionState _s6 = flow.getStates().get(5);
assertEquals("sc.r.s2.r.s6", _s6.getName());
assertNull(_fs.getEntryAction());
assertNull(_fs.getExitAction());
assertNotNull(_fs.getExitSequence());
assertEquals(2, _s1.getExitSequence().getSteps().size());
ExecutionScope _r_s1 = _s1.getSubScopes().get(0);
assertCall(_s1.getExitSequence(), 0, _r_s1.getExitSequence());
Step _switch = _r_s1.getExitSequence().getSteps().get(0);
assertStateSwitch(_switch, _s4, _fs);
assertCall(assertedSequence(assertedStateCase(_switch, _s4).getStep()), 0, _s4.getExitSequence());
assertCall(assertedSequence(assertedStateCase(_switch, _s4).getStep()), 1, _s3.getExitAction());
assertCall(assertedSequence(assertedStateCase(_switch, _fs).getStep()), 0, _fs.getExitSequence());
assertCall(assertedSequence(assertedStateCase(_switch, _fs).getStep()), 1, _s3.getExitAction());
assertCall(_s1.getExitSequence(), 1, _s1.getExitAction());
}
Aggregations