protected void deleteVertex(AtlasVertex instanceVertex, boolean force) throws AtlasException { // Update external references(incoming edges) to this vertex LOG.debug( "Setting the external references to {} to null(removing edges)", string(instanceVertex)); Iterator<AtlasEdge> edges = instanceVertex.getEdges(AtlasEdgeDirection.IN).iterator(); while (edges.hasNext()) { AtlasEdge edge = edges.next(); Id.EntityState edgeState = GraphHelper.getState(edge); if (edgeState == Id.EntityState.ACTIVE) { // Delete only the active edge references AttributeInfo attribute = getAttributeForEdge(edge.getLabel()); // TODO use delete edge instead?? deleteEdgeBetweenVertices(edge.getOutVertex(), edge.getInVertex(), attribute.name); } } _deleteVertex(instanceVertex, force); }