@Override public void execute() { module = model.getModuleElement(); module.getSite().addCommitListener(this); cmds = new ArrayList<ConnectionDeleteCommand>(); for (Connection connection : model.getSourceConnections()) { cmds.add(new ConnectionDeleteCommand(connection)); } for (Connection connection : model.getTargetConnections()) { cmds.add(new ConnectionDeleteCommand(connection)); } module.removeModel(model); for (ConnectionDeleteCommand cmd : cmds) { cmd.execute(); } }