}
if (a instanceof ITransitionableFrom) {
sourceConnections.addAll(((ITransitionableFrom) a)
.getOutputTransitions());
for (int i = 0; i < sourceConnections.size(); i++) {
ITransition t = (ITransition) sourceConnections.get(i);
((ITransitionableFrom) a).removeOutputTransition(t);
t.getToState().removeInputTransition(t);
}
}
if (a instanceof ITransitionableTo)
targetConnections.addAll(((ITransitionableTo) a)
.getInputTransitions());
for (int i = 0; i < targetConnections.size(); i++) {
if (targetConnections.get(i) instanceof IStateTransition) {
IStateTransition t = (IStateTransition) targetConnections
.get(i);
t.getFromState().removeOutputTransition(t);
((ITransitionableTo) a).removeInputTransition(t);
}
else if (targetConnections.get(i) instanceof IfTransition) {
IfTransition t = (IfTransition) targetConnections.get(i);
if (t.isThen()) {
t.getFromIf().removeThenTransition();
}
else {
t.getFromIf().removeElseTransition();
}
((ITransitionableTo) a).removeInputTransition(t);
}
}
}