Skip to content

Commit

Permalink
skip deleting Titles with active stakeholders
Browse files Browse the repository at this point in the history
  • Loading branch information
PRATHAM2002-DS committed Jul 22, 2024
1 parent 3827bed commit fea7d5d
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -460,9 +460,13 @@ public void processDelete(AtlasVertex vertex) throws AtlasBaseException {
AtlasVertex stakeholderTitleVertex = entityRetriever.getEntityVertex(stakeholderTitle.getGuid());
AtlasGraphUtilsV2.removeItemFromListPropertyValue(stakeholderTitleVertex, ATTR_DOMAIN_QUALIFIED_NAMES, vertex.getProperty(QUALIFIED_NAME, String.class));
List<String> domainQualifiedNames = stakeholderTitleVertex.getMultiValuedProperty(ATTR_DOMAIN_QUALIFIED_NAMES, String.class);

if (CollectionUtils.isEmpty(domainQualifiedNames)) {
entityStore.deleteById(stakeholderTitle.getGuid());
LOG.info("Deleted Stakeholder Title: {}", stakeholderTitle.getGuid());
Iterator<AtlasVertex> stakeholders = getActiveChildrenVertices(stakeholderTitleVertex, STAKEHOLDER_TITLE_EDGE_LABEL);
if (!stakeholders.hasNext()) {
entityStore.deleteById(stakeholderTitle.getGuid());
LOG.info("Deleted Stakeholder Title: {}", stakeholderTitle.getGuid());
}
}
}
}
Expand Down

0 comments on commit fea7d5d

Please sign in to comment.