RED-3437: Fixed several bugs in workflow

This commit is contained in:
deiflaender 2022-02-17 09:46:02 +01:00
parent 825566e81a
commit 1b27dae3d8
4 changed files with 15 additions and 6 deletions

View File

@ -37,8 +37,8 @@ public class FileStatusProcessingUpdateService {
if (settings.isNerServiceEnabled() && !fileManagementStorageService.nerEntitiesExists(dossierId, fileId)) {
fileStatusService.addToNerQueue(dossierId, fileId);
} else {
analyzeResult.setMessageType(MessageType.ANALYSE);
analysisSuccessful(dossierId, fileId, analyzeResult);
fileStatusService.setStatusAnalyse(dossierId, fileId, 1);
fileStatusService.addToAnalysisQueue(dossierId, fileId, 2, null);
}
break;

View File

@ -95,6 +95,7 @@ public class FileStatusService {
}
public void setStatusProcessing(String fileId) {
fileStatusPersistenceService.updateProcessingStatus(fileId, ProcessingStatus.PROCESSING);

View File

@ -614,10 +614,18 @@ public class ManualRedactionService {
public void updateProcessedDate(String fileId, ManualRedactions manualRedactions) {
// These are marked as processed once analysis completes, not when they are set as approved
manualRedactions.getIdsToRemove().forEach(removeRedactionPersistenceService::markAsProcessed);
manualRedactions.getForceRedactions().forEach(forceRedactionPersistenceService::markAsProcessed);
manualRedactions.getImageRecategorization().forEach(recategorizationPersistenceService::markAsProcessed);
if(manualRedactions != null) {
if(manualRedactions.getIdsToRemove() != null) {
manualRedactions.getIdsToRemove().forEach(removeRedactionPersistenceService::markAsProcessed);
}
if(manualRedactions.getForceRedactions() != null) {
manualRedactions.getForceRedactions().forEach(forceRedactionPersistenceService::markAsProcessed);
}
if(manualRedactions.getImageRecategorization() != null) {
manualRedactions.getImageRecategorization().forEach(recategorizationPersistenceService::markAsProcessed);
}
}
}

View File

@ -36,7 +36,7 @@ public class NerMessageReceiver {
String fileId = (String) entityResponse.get("fileId");
log.info("Received NER Message from {} {}", dossierId, fileId);
fileStatusService.addToAnalysisQueue(dossierId, fileId, 2, null);
fileStatusService.setStatusAnalyse(dossierId, fileId, 1);
}