use of org.yakindu.sct.model.sexec.ExecutionRegion in project statecharts by Yakindu.
the class StatechartEnterExistActionTest method testSCLocalReaction.
/**
* The transition sequence must contain all exit actions for parent states
* that will be left by a transition.
*/
@SuppressWarnings("unused")
@Test
public void testSCLocalReaction() {
Statechart sc = _createStatechart("sc");
{
VariableDefinition v = _createVariableDefinition("v", TYPE_INTEGER, getOrCreateInternalScope(sc));
LocalReaction entryAction = _createEntryAction(sc);
ReactionEffect effect = _createReactionEffect(entryAction);
_createVariableAssignment(v, AssignmentOperator.ADD_ASSIGN, _createValue(1), effect);
LocalReaction exitAction = _createExitAction(sc);
effect = _createReactionEffect(exitAction);
_createVariableAssignment(v, AssignmentOperator.ADD_ASSIGN, _createValue(1), effect);
Region r = _createRegion("r", sc);
{
Entry e = _createEntry(EntryKind.INITIAL, null, r);
State s1 = _createState("s1", r);
Transition t = _createTransition(e, s1);
}
}
ExecutionFlow flow = sequencer.transform(sc);
ExecutionRegion region = flow.getRegions().get(0);
assertEquals(0, flow.getReactions().size());
assertedOrder(flow.getEnterSequences().get(0), null, Lists.newArrayList(new StepLeaf(flow.getEntryAction()), new StepLeaf(region.getEnterSequences().get(0))));
assertedOrder(flow.getExitSequence(), null, Lists.newArrayList(new StepLeaf(region.getExitSequence()), new StepLeaf(flow.getExitAction())));
}
use of org.yakindu.sct.model.sexec.ExecutionRegion in project statecharts by Yakindu.
the class HistoryEntryImpl method setRegion.
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setRegion(ExecutionRegion newRegion) {
ExecutionRegion oldRegion = region;
region = newRegion;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, SexecPackage.HISTORY_ENTRY__REGION, oldRegion, region));
}
Aggregations