use of org.yakindu.sct.model.sgraph.Synchronization in project statecharts by Yakindu.
the class SGraphNameProvider method qualifiedName.
public QualifiedName qualifiedName(Synchronization ele) {
QualifiedName qualifiedNameFromConverter = null;
if (!Strings.isEmpty(ele.getName())) {
qualifiedNameFromConverter = QualifiedName.create(ele.getName());
} else {
LinkedList<Synchronization> list = new LinkedList<Synchronization>();
Iterables.addAll(list, Iterables.filter(((Region) ele.eContainer()).getVertices(), Synchronization.class));
qualifiedNameFromConverter = QualifiedName.create(_SYNC_NAME + list.indexOf(ele));
}
return getParentQualifiedName(ele, qualifiedNameFromConverter);
}
use of org.yakindu.sct.model.sgraph.Synchronization in project statecharts by Yakindu.
the class SGraphJavaValidator method orthogonalTransition.
@Check
public void orthogonalTransition(Transition transition) {
Vertex source = transition.getSource();
Vertex target = transition.getTarget();
if ((source instanceof Synchronization) || (target instanceof Synchronization))
// ... the check does not apply.
return;
EObject commonAncestor = commonAncestor(source, target);
if (commonAncestor instanceof CompositeElement) {
error(ISSUE_TRANSITION_ORTHOGONAL, transition, null, -1);
}
}
use of org.yakindu.sct.model.sgraph.Synchronization in project statecharts by Yakindu.
the class TransitionsWithNoTriggerTest method noTriggerOnSyncOutgoing.
/**
* The outgoing transitions of a sync (fork / join) node must not have any
* trigger part. Thus empty transitions must not have any warning. This test
* case addresses a bug #75 (
* https://code.google.com/a/eclipselabs.org/p/yakindu/issues/detail?id=75 )
* .
*/
@Test
public void noTriggerOnSyncOutgoing() {
statechart = loadStatechart("ValidEmptyTransitionFromSync.sct");
Region validRegion = firstNamed(eAllOfType(statechart, Region.class), "valid");
Synchronization sync = eAllOfType(validRegion, Synchronization.class).get(0);
for (Transition t : sync.getOutgoingTransitions()) {
assertTrue(validate(t));
assertIssueCount(diagnostics, 0);
}
}
use of org.yakindu.sct.model.sgraph.Synchronization in project statecharts by Yakindu.
the class SGraphJavaValidationTest method synchronizationOutgoingTransitionCount.
@Test
public void synchronizationOutgoingTransitionCount() {
statechart = loadStatechart("SyncOutgoingTransition.sct");
State state = firstNamed(EcoreUtil2.eAllOfType(statechart, State.class), "StateB");
Synchronization sync = (Synchronization) state.getOutgoingTransitions().get(0).getTarget();
assertFalse(validator.validate(sync, diagnostics, new HashMap<Object, Object>()));
assertIssueCount(diagnostics, 1);
assertError(diagnostics, ISSUE_SYNCHRONIZATION_TRANSITION_OUTGOING);
}
use of org.yakindu.sct.model.sgraph.Synchronization in project statecharts by Yakindu.
the class SGraphJavaValidationTest method orthogonalSynchronizedTransition_Source.
@Test
public void orthogonalSynchronizedTransition_Source() {
statechart = loadStatechart("NotOrthogonalRegion03.sct");
State stateC = firstNamed(EcoreUtil2.eAllOfType(statechart, State.class), "C");
Synchronization sync = (Synchronization) stateC.getOutgoingTransitions().get(0).getTarget();
assertFalse(validator.validate(sync, diagnostics, new HashMap<Object, Object>()));
assertIssueCount(diagnostics, 2);
assertError(diagnostics, ISSUE_SYNCHRONIZATION_SOURCE_TARGET_STATES_PARENT_REGION);
}
Aggregations