package org.eclipse.bpmn2.modeler.core.layout.nnew;

import org.eclipse.bpmn2.modeler.core.layout.Docking;
import org.eclipse.bpmn2.modeler.core.layout.util.LayoutUtil.Sector;
import org.eclipse.bpmn2.modeler.core.utils.Tuple;
import org.eclipse.graphiti.mm.pictograms.FreeFormConnection;

/**
 * Special layouting context for boundary events.
 * 
 * @author nico.rehwaldt
 */
public class BoundaryEventLayoutContext extends DefaultLayoutContext {

	public BoundaryEventLayoutContext(FreeFormConnection connection) {
		super(connection, true);
	}
	
	@Override
	protected boolean needsLayoutByDockings(Tuple<Docking, Docking> dockings, Sector afterRepairStartSector, Sector afterRepairEndSector) {
		return afterRepairStartSector != dockings.getFirst().getSector() || 
			   afterRepairEndSector != dockings.getSecond().getSector();
	}
}

@@ -690,16 +690,87 @@
 ctor) %7B%0A
+%09%09if (connection.getBendpoints().size() %3E 1) %7B%0A%09%09%09return false;%0A%09%09%7D%0A%09%09%0A
 %09%09return

check for bendboint count in BoundaryEventLayoutContext