addContext.setY(y);
y += 100;
IAddFeature addFeature = featureProvider.getAddFeature(addContext);
if (addFeature.canAdd(addContext)) {
PictogramElement destState = null;
if (processedNodes.contains(node) == false) {
destState = addFeature.add(addContext);
} else {
destState = featureProvider.getPictogramElementForBusinessObject(node);
}
// remember the node
processedNodes.add(node);
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);