if (!(route instanceof RouteSupport)) {
// lets remove the current connection between the parent and node so that
// createFeature.canCreate() returns true
route.removeConnection(node);
CreateFlowFeature createFeature = new CreateFlowFeature(featureProvider);
CreateConnectionContext connectContext = new CreateConnectionContext();
PictogramElement srcState = featureProvider.getPictogramElementForBusinessObject(route);
//PictogramElement destState = featureProvider.getPictogramElementForBusinessObject(node);
if (srcState == destState) {
Activator.getLogger().debug("Should not be the same element for different nodes: " + route + " and " + node);
}
connectContext.setSourcePictogramElement(srcState);
connectContext.setTargetPictogramElement(destState);
Anchor srcAnchor = DiagramUtils.getAnchor(srcState);
Anchor destAnchor = DiagramUtils.getAnchor(destState);
if (srcAnchor != null && destAnchor != null) {
connectContext.setSourceAnchor(srcAnchor);
connectContext.setTargetAnchor(destAnchor);
if (createFeature.canCreate(connectContext)) {
createFeature.execute(connectContext);
}
}
}
List<AbstractNode> children = node.getOutputs();