diff --git a/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/EntityGraphMapper.java b/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/EntityGraphMapper.java index 560835cb16..3486ddcd42 100644 --- a/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/EntityGraphMapper.java +++ b/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/EntityGraphMapper.java @@ -3185,13 +3185,18 @@ public void updateClassifications(EntityMutationContext context, String guid, Li AtlasGraphUtilsV2.setEncodedProperty(classificationVertex, CLASSIFICATION_VERTEX_REMOVE_PROPAGATIONS_KEY, updatedRemovePropagations); // If value set true from false and source entity is deleted, remove propagated classification from propagated entities - if (updatedRemovePropagations && !currentRemovePropagations) { - boolean isEntityDeleted = entityVertex.getProperty(STATE_PROPERTY_KEY, String.class).equals(DELETED.toString()); - if(isEntityDeleted && taskManagement != null && DEFERRED_ACTION_ENABLED) { - createAndQueueTask(CLASSIFICATION_PROPAGATION_DELETE, entityVertex, classificationVertex.getIdForDisplay()); - } + boolean isEntityDeleted = entityVertex.getProperty(STATE_PROPERTY_KEY, String.class).equals(DELETED.toString()); + boolean isUpdatedRemovePropagationsDifferentFromCurrent = updatedRemovePropagations != currentRemovePropagations; + + if (isEntityDeleted && taskManagement != null && DEFERRED_ACTION_ENABLED && isUpdatedRemovePropagationsDifferentFromCurrent) { + createAndQueueTask( + updatedRemovePropagations ? CLASSIFICATION_PROPAGATION_DELETE : CLASSIFICATION_PROPAGATION_ADD, + entityVertex, + classificationVertex.getIdForDisplay() + ); } + isClassificationUpdated = true; }