Search in sources :

Example 1 with ExecutionScope

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;
}
Also used : ENotificationImpl(org.eclipse.emf.ecore.impl.ENotificationImpl) ExecutionScope(org.yakindu.sct.model.sexec.ExecutionScope)

Example 2 with ExecutionScope

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;
}
Also used : ENotificationImpl(org.eclipse.emf.ecore.impl.ENotificationImpl) ExecutionScope(org.yakindu.sct.model.sexec.ExecutionScope)

Example 3 with ExecutionScope

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;
}
Also used : ENotificationImpl(org.eclipse.emf.ecore.impl.ENotificationImpl) ExecutionScope(org.yakindu.sct.model.sexec.ExecutionScope)

Example 4 with ExecutionScope

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());
}
Also used : ExecutionState(org.yakindu.sct.model.sexec.ExecutionState) StextTestFactory._createVariableDefinition(org.yakindu.sct.model.stext.test.util.StextTestFactory._createVariableDefinition) VariableDefinition(org.yakindu.sct.model.stext.stext.VariableDefinition) FinalState(org.yakindu.sct.model.sgraph.FinalState) SGraphTestFactory._createFinalState(org.yakindu.sct.model.sgraph.test.util.SGraphTestFactory._createFinalState) ExitState(org.yakindu.sct.model.sexec.ExitState) SCTTestUtil.findState(org.yakindu.sct.model.sexec.transformation.test.SCTTestUtil.findState) SGraphTestFactory._createState(org.yakindu.sct.model.sgraph.test.util.SGraphTestFactory._createState) ExecutionState(org.yakindu.sct.model.sexec.ExecutionState) EnterState(org.yakindu.sct.model.sexec.EnterState) State(org.yakindu.sct.model.sgraph.State) ExecutionFlow(org.yakindu.sct.model.sexec.ExecutionFlow) Statechart(org.yakindu.sct.model.sgraph.Statechart) SGraphTestFactory._createStatechart(org.yakindu.sct.model.sgraph.test.util.SGraphTestFactory._createStatechart) InterfaceScope(org.yakindu.sct.model.stext.stext.InterfaceScope) StextTestFactory._createInterfaceScope(org.yakindu.sct.model.stext.test.util.StextTestFactory._createInterfaceScope) Region(org.yakindu.sct.model.sgraph.Region) SGraphTestFactory._createRegion(org.yakindu.sct.model.sgraph.test.util.SGraphTestFactory._createRegion) Step(org.yakindu.sct.model.sexec.Step) StextTestFactory._createEventDefinition(org.yakindu.sct.model.stext.test.util.StextTestFactory._createEventDefinition) EventDefinition(org.yakindu.sct.model.stext.stext.EventDefinition) FinalState(org.yakindu.sct.model.sgraph.FinalState) SGraphTestFactory._createFinalState(org.yakindu.sct.model.sgraph.test.util.SGraphTestFactory._createFinalState) ExecutionScope(org.yakindu.sct.model.sexec.ExecutionScope) Test(org.junit.Test)

Aggregations

ExecutionScope (org.yakindu.sct.model.sexec.ExecutionScope)4 ENotificationImpl (org.eclipse.emf.ecore.impl.ENotificationImpl)3 Test (org.junit.Test)1 EnterState (org.yakindu.sct.model.sexec.EnterState)1 ExecutionFlow (org.yakindu.sct.model.sexec.ExecutionFlow)1 ExecutionState (org.yakindu.sct.model.sexec.ExecutionState)1 ExitState (org.yakindu.sct.model.sexec.ExitState)1 Step (org.yakindu.sct.model.sexec.Step)1 SCTTestUtil.findState (org.yakindu.sct.model.sexec.transformation.test.SCTTestUtil.findState)1 FinalState (org.yakindu.sct.model.sgraph.FinalState)1 Region (org.yakindu.sct.model.sgraph.Region)1 State (org.yakindu.sct.model.sgraph.State)1 Statechart (org.yakindu.sct.model.sgraph.Statechart)1 SGraphTestFactory._createFinalState (org.yakindu.sct.model.sgraph.test.util.SGraphTestFactory._createFinalState)1 SGraphTestFactory._createRegion (org.yakindu.sct.model.sgraph.test.util.SGraphTestFactory._createRegion)1 SGraphTestFactory._createState (org.yakindu.sct.model.sgraph.test.util.SGraphTestFactory._createState)1 SGraphTestFactory._createStatechart (org.yakindu.sct.model.sgraph.test.util.SGraphTestFactory._createStatechart)1 EventDefinition (org.yakindu.sct.model.stext.stext.EventDefinition)1 InterfaceScope (org.yakindu.sct.model.stext.stext.InterfaceScope)1 VariableDefinition (org.yakindu.sct.model.stext.stext.VariableDefinition)1