Skip to content

Commit

Permalink
Merge pull request #3351 from atlanhq/dg-1476
Browse files Browse the repository at this point in the history
DG-1476 Handle QN check and Archive Stakeholders in domain delete flow
  • Loading branch information
PRATHAM2002-DS authored Jul 22, 2024
2 parents 75bc7e0 + fea7d5d commit 20fe47c
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -467,9 +467,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 20fe47c

Please sign in to comment.