Skip to content

Commit

Permalink
Merge pull request #2330 from atlanhq/tag/gov-1311
Browse files Browse the repository at this point in the history
fix: add way to add propagation if set to false again
  • Loading branch information
sumandas0 authored Aug 31, 2023
2 parents ef511c9 + 1fd0358 commit 8687468
Showing 1 changed file with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 8687468

Please sign in to comment.