Skip to content

Commit

Permalink
modify instead of delete delta for auditing task actions such as (sus…
Browse files Browse the repository at this point in the history
…pend, runNow, resume) - MID-3743
  • Loading branch information
katkav committed Apr 1, 2020
1 parent 61ac267 commit b94757b
Showing 1 changed file with 7 additions and 2 deletions.
Expand Up @@ -1941,12 +1941,17 @@ private void auditTaskOperation(PrismReferenceValue taskRef, AuditEventType even
String requestIdentifier = ModelImplUtils.generateRequestIdentifier();
auditRecord.setRequestIdentifier(requestIdentifier);
auditRecord.setTarget(taskRef);
ObjectDelta<TaskType> delta = prismContext.deltaFactory().object().createDeleteDelta(TaskType.class, taskRef.getOid());
ObjectDelta<TaskType> delta;
if (AuditEventType.DELETE_OBJECT == event) {
delta = prismContext.deltaFactory().object().createDeleteDelta(TaskType.class, taskRef.getOid());
} else {
//TODO should we somehow indicate deltas which are executed in taskManager?
delta = prismContext.deltaFactory().object().createEmptyModifyDelta(TaskType.class, taskRef.getOid());
}
ObjectDeltaOperation<TaskType> odo = new ObjectDeltaOperation<>(delta, parentResult);
auditRecord.getDeltas().add(odo);
if (AuditEventStage.EXECUTION == stage) {
auditRecord.setOutcome(parentResult.getStatus());

}
auditHelper.audit(auditRecord, null, operationTask, parentResult);
}
Expand Down

0 comments on commit b94757b

Please sign in to comment.