Update to not audit automation status changes

This commit is contained in:
2023-02-21 22:19:20 -06:00
parent f3cf327384
commit 63be3f01a7
3 changed files with 47 additions and 1 deletions

View File

@ -155,6 +155,7 @@ public class RecordAutomationStatusUpdater
.withValue(table.getPrimaryKeyField(), r.getValue(table.getPrimaryKeyField()))
.withValue(automationDetails.getStatusTracking().getFieldName(), r.getValue(automationDetails.getStatusTracking().getFieldName()))).toList());
updateInput.setAreAllValuesBeingUpdatedTheSame(true);
updateInput.setOmitDmlAudit(true);
new UpdateAction().execute(updateInput);
}

View File

@ -75,7 +75,14 @@ public class UpdateAction
UpdateOutput updateResult = qModule.getUpdateInterface().execute(updateInput);
// todo post-customization - can do whatever w/ the result if you want
new DMLAuditAction().execute(new DMLAuditInput().withTableActionInput(updateInput).withRecordList(updateResult.getRecords()).withOldRecordList(oldRecordList));
if(updateInput.getOmitDmlAudit())
{
LOG.debug("Requested to omit DML audit");
}
else
{
new DMLAuditAction().execute(new DMLAuditInput().withTableActionInput(updateInput).withRecordList(updateResult.getRecords()).withOldRecordList(oldRecordList));
}
return updateResult;
}
@ -87,6 +94,11 @@ public class UpdateAction
*******************************************************************************/
private static List<QRecord> getOldRecordListForAuditIfNeeded(UpdateInput updateInput)
{
if(updateInput.getOmitDmlAudit())
{
return (null);
}
try
{
AuditLevel auditLevel = DMLAuditAction.getAuditLevel(updateInput);

View File

@ -45,6 +45,8 @@ public class UpdateInput extends AbstractTableActionInput
////////////////////////////////////////////////////////////////////////////////////////////
private Boolean areAllValuesBeingUpdatedTheSame = null;
private boolean omitDmlAudit = false;
/*******************************************************************************
@ -132,4 +134,35 @@ public class UpdateInput extends AbstractTableActionInput
this.areAllValuesBeingUpdatedTheSame = areAllValuesBeingUpdatedTheSame;
}
/*******************************************************************************
** Getter for omitDmlAudit
*******************************************************************************/
public boolean getOmitDmlAudit()
{
return (this.omitDmlAudit);
}
/*******************************************************************************
** Setter for omitDmlAudit
*******************************************************************************/
public void setOmitDmlAudit(boolean omitDmlAudit)
{
this.omitDmlAudit = omitDmlAudit;
}
/*******************************************************************************
** Fluent setter for omitDmlAudit
*******************************************************************************/
public UpdateInput withOmitDmlAudit(boolean omitDmlAudit)
{
this.omitDmlAudit = omitDmlAudit;
return (this);
}
}