Skip to content

Commit

Permalink
move data-set status CodeSystem into common library
Browse files Browse the repository at this point in the history
  • Loading branch information
wetret committed Sep 8, 2023
1 parent 40c024e commit a73de65
Show file tree
Hide file tree
Showing 22 changed files with 222 additions and 433 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
<dependency>
<groupId>de.medizininformatik-initiative</groupId>
<artifactId>mii-processes-common</artifactId>
<version>1.0.0.0-RC1</version>
<version>1.0.0.0-SNAPSHOT</version>
</dependency>

<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ public interface ConstantsDataTransfer
String PROFILE_TASK_DATA_SEND_PROCESS_URI = ConstantsBase.PROCESS_MII_URI_BASE + PROCESS_NAME_DATA_RECEIVE;
String PROFILE_TASK_DATA_SEND_MESSAGE_NAME = "dataSend";

String PROFILE_TASK_DATA_RECEIVE = "http://medizininformatik-initiative.de/fhir/StructureDefinition/task-data-receive";
String PROFILE_TASK_DATA_RECEIVE_PROCESS_URI = ConstantsBase.PROCESS_MII_URI_BASE + PROCESS_NAME_DATA_SEND;
String PROFILE_TASK_DATA_RECEIVE_MESSAGE_NAME = "dataReceive";
String PROFILE_TASK_DATA_STATUS = "http://medizininformatik-initiative.de/fhir/StructureDefinition/task-data-status";
String PROFILE_TASK_DATA_STATUS_PROCESS_URI = ConstantsBase.PROCESS_MII_URI_BASE + PROCESS_NAME_DATA_SEND;
String PROFILE_TASK_DATA_STATUS_MESSAGE_NAME = "dataStatus";

String BPMN_EXECUTION_VARIABLE_PROJECT_IDENTIFIER = "projectIdentifier";
String BPMN_EXECUTION_VARIABLE_DMS_IDENTIFIER = "dms-identifier";
Expand All @@ -40,15 +40,4 @@ public interface ConstantsDataTransfer
String CODESYSTEM_DATA_TRANSFER_VALUE_DATA_SET_REFERENCE = "data-set-reference";
String CODESYSTEM_DATA_TRANSFER_VALUE_DOCUMENT_REFERENCE_LOCATION = "document-reference-location";
String CODESYSTEM_DATA_TRANSFER_VALUE_DATA_SET_STATUS = "data-set-status";

String CODESYSTEM_DATA_SET_STATUS = "http://medizininformatik-initiative.de/fhir/CodeSystem/data-set-status";
String CODESYSTEM_DATA_SET_STATUS_VALUE_NOT_ALLOWED = "not-allowed";
String CODESYSTEM_DATA_SET_STATUS_VALUE_NOT_REACHABLE = "not-reachable";
String CODESYSTEM_DATA_SET_STATUS_VALUE_RECEIPT_MISSING = "receipt-missing";
String CODESYSTEM_DATA_SET_STATUS_VALUE_RECEIPT_OK = "receipt-ok";
String CODESYSTEM_DATA_SET_STATUS_VALUE_RECEIPT_ERROR = "receipt-error";
String CODESYSTEM_DATA_SET_STATUS_VALUE_RECEIVE_OK = "receive-ok";
String CODESYSTEM_DATA_SET_STATUS_VALUE_RECEIVE_ERROR = "receive-error";

String EXTENSION_DATA_SET_STATUS_ERROR_URL = "http://medizininformatik-initiative.de/fhir/StructureDefinition/extension-data-set-status-error";
}
Original file line number Diff line number Diff line change
Expand Up @@ -52,29 +52,29 @@ public Map<String, List<String>> getFhirResourcesByProcessId()
var aSend = "fhir/ActivityDefinition/data-transfer-send.xml";

var cCrypto = "fhir/CodeSystem/mii-cryptography.xml";
var cDaSeSt = "fhir/CodeSystem/data-set-status.xml";
var cDaSeSt = "fhir/CodeSystem/mii-data-set-status.xml";
var cDaTr = "fhir/CodeSystem/data-transfer.xml";

var eDaSeStEr = "fhir/StructureDefinition/extension-data-set-status-error.xml";

var nPrId = "fhir/NamingSystem/mii-project-identifier.xml";

var sReceive = "fhir/StructureDefinition/task-data-receive.xml";
var sSend = "fhir/StructureDefinition/task-data-send.xml";
var sSendStart = "fhir/StructureDefinition/task-data-send-start.xml";
var sStatus = "fhir/StructureDefinition/task-data-status.xml";

var tSendStart = "fhir/Task/task-data-send-start.xml";

var vCrypto = "fhir/ValueSet/mii-cryptography.xml";
var vDaSeStRe = "fhir/ValueSet/data-set-status-receive.xml";
var vDaSeStSe = "fhir/ValueSet/data-set-status-send.xml";
var vDaSeStRe = "fhir/ValueSet/mii-data-set-status-receive.xml";
var vDaSeStSe = "fhir/ValueSet/mii-data-set-status-send.xml";
var vDaTr = "fhir/ValueSet/data-transfer.xml";

return Map.of( //
ConstantsDataTransfer.PROCESS_NAME_FULL_DATA_RECEIVE, //
Arrays.asList(aReceive, cCrypto, cDaSeSt, cDaTr, eDaSeStEr, nPrId, sSend, vCrypto, vDaSeStRe, vDaTr), //
ConstantsDataTransfer.PROCESS_NAME_FULL_DATA_SEND, //
Arrays.asList(aSend, cDaSeSt, cDaTr, eDaSeStEr, nPrId, sSendStart, sReceive, tSendStart, vDaSeStSe,
Arrays.asList(aSend, cDaSeSt, cDaTr, eDaSeStEr, nPrId, sStatus, sSendStart, tSendStart, vDaSeStSe,
vDaTr));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
import org.springframework.beans.factory.InitializingBean;

import de.medizininformatik_initiative.process.data_transfer.ConstantsDataTransfer;
import de.medizininformatik_initiative.process.data_transfer.util.DataSetStatusGenerator;
import de.medizininformatik_initiative.processes.common.util.ConstantsBase;
import de.medizininformatik_initiative.processes.common.util.DataSetStatusGenerator;
import dev.dsf.bpe.v1.ProcessPluginApi;
import dev.dsf.bpe.v1.activity.AbstractTaskMessageSend;
import dev.dsf.bpe.v1.variables.Variables;
Expand Down Expand Up @@ -92,18 +92,20 @@ private void handleError(Variables variables, Exception exception)
{
Task task = variables.getStartTask();

String statusCode = ConstantsDataTransfer.CODESYSTEM_DATA_SET_STATUS_VALUE_NOT_REACHABLE;
String statusCode = ConstantsBase.CODESYSTEM_DATA_SET_STATUS_VALUE_NOT_REACHABLE;
if (exception instanceof WebApplicationException webApplicationException)
{
if (webApplicationException.getResponse() != null
&& webApplicationException.getResponse().getStatus() == Response.Status.FORBIDDEN.getStatusCode())
{
statusCode = ConstantsDataTransfer.CODESYSTEM_DATA_SET_STATUS_VALUE_NOT_ALLOWED;
statusCode = ConstantsBase.CODESYSTEM_DATA_SET_STATUS_VALUE_NOT_ALLOWED;
}
}

task.setStatus(Task.TaskStatus.FAILED);
task.addOutput(statusGenerator.createDataSetStatusOutput(statusCode, "Send data-set failed"));
task.addOutput(
statusGenerator.createDataSetStatusOutput(statusCode, ConstantsDataTransfer.CODESYSTEM_DATA_TRANSFER,
ConstantsDataTransfer.CODESYSTEM_DATA_TRANSFER_VALUE_DATA_SET_STATUS, "Send data-set failed"));
variables.updateTask(task);

variables.setString(ConstantsDataTransfer.BPMN_EXECUTION_VARIABLE_DATA_SEND_ERROR_MESSAGE,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,18 @@

import org.camunda.bpm.engine.delegate.DelegateExecution;
import org.hl7.fhir.r4.model.Coding;
import org.hl7.fhir.r4.model.IdType;
import org.hl7.fhir.r4.model.Task;
import org.hl7.fhir.r4.model.Type;
import org.springframework.beans.factory.InitializingBean;

import de.medizininformatik_initiative.process.data_transfer.ConstantsDataTransfer;
import de.medizininformatik_initiative.process.data_transfer.util.DataSetStatusGenerator;
import de.medizininformatik_initiative.processes.common.util.ConstantsBase;
import de.medizininformatik_initiative.processes.common.util.DataSetStatusGenerator;
import dev.dsf.bpe.v1.ProcessPluginApi;
import dev.dsf.bpe.v1.activity.AbstractTaskMessageSend;
import dev.dsf.bpe.v1.variables.Variables;
import dev.dsf.fhir.client.FhirWebserviceClient;

public class SendReceipt extends AbstractTaskMessageSend implements InitializingBean
{
Expand Down Expand Up @@ -42,9 +45,20 @@ protected Stream<Task.ParameterComponent> getAdditionalInputParameters(DelegateE
return createReceiptOk();
}

@Override
protected IdType doSend(FhirWebserviceClient client, Task task)
{
return client.withMinimalReturn()
.withRetry(ConstantsBase.DSF_CLIENT_RETRY_6_TIMES, ConstantsBase.DSF_CLIENT_RETRY_INTERVAL_5MIN)
.create(task);
}

private Stream<Task.ParameterComponent> createReceiptError(Variables variables)
{
return statusGenerator.transformOutputToInputComponent(variables.getStartTask())
return statusGenerator
.transformOutputToInputComponent(variables.getStartTask(),
ConstantsDataTransfer.CODESYSTEM_DATA_TRANSFER,
ConstantsDataTransfer.CODESYSTEM_DATA_TRANSFER_VALUE_DATA_SET_STATUS)
.map(this::receiveToReceiptStatus);
}

Expand All @@ -53,9 +67,9 @@ private Task.ParameterComponent receiveToReceiptStatus(Task.ParameterComponent p
Type value = parameterComponent.getValue();
if (value instanceof Coding coding)
{
if (ConstantsDataTransfer.CODESYSTEM_DATA_SET_STATUS_VALUE_RECEIVE_ERROR.equals(coding.getCode()))
if (ConstantsBase.CODESYSTEM_DATA_SET_STATUS_VALUE_RECEIVE_ERROR.equals(coding.getCode()))
{
coding.setCode(ConstantsDataTransfer.CODESYSTEM_DATA_SET_STATUS_VALUE_RECEIPT_ERROR);
coding.setCode(ConstantsBase.CODESYSTEM_DATA_SET_STATUS_VALUE_RECEIPT_ERROR);
}
}

Expand All @@ -67,8 +81,8 @@ private Stream<Task.ParameterComponent> createReceiptOk()
Task.ParameterComponent parameterComponent = new Task.ParameterComponent();
parameterComponent.getType().addCoding().setSystem(ConstantsDataTransfer.CODESYSTEM_DATA_TRANSFER)
.setCode(ConstantsDataTransfer.CODESYSTEM_DATA_TRANSFER_VALUE_DATA_SET_STATUS);
parameterComponent.setValue(new Coding().setSystem(ConstantsDataTransfer.CODESYSTEM_DATA_SET_STATUS)
.setCode(ConstantsDataTransfer.CODESYSTEM_DATA_SET_STATUS_VALUE_RECEIPT_OK));
parameterComponent.setValue(new Coding().setSystem(ConstantsBase.CODESYSTEM_DATA_SET_STATUS)
.setCode(ConstantsBase.CODESYSTEM_DATA_SET_STATUS_VALUE_RECEIPT_OK));

return Stream.of(parameterComponent);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@

import ca.uhn.fhir.context.FhirContext;
import de.medizininformatik_initiative.process.data_transfer.ConstantsDataTransfer;
import de.medizininformatik_initiative.process.data_transfer.util.DataSetStatusGenerator;
import de.medizininformatik_initiative.processes.common.crypto.KeyProvider;
import de.medizininformatik_initiative.processes.common.crypto.RsaAesGcmUtil;
import de.medizininformatik_initiative.processes.common.fhir.client.logging.DataLogger;
import de.medizininformatik_initiative.processes.common.util.ConstantsBase;
import de.medizininformatik_initiative.processes.common.util.DataSetStatusGenerator;
import dev.dsf.bpe.v1.ProcessPluginApi;
import dev.dsf.bpe.v1.activity.AbstractServiceDelegate;
import dev.dsf.bpe.v1.variables.Variables;
Expand Down Expand Up @@ -78,7 +79,9 @@ protected void doExecute(DelegateExecution execution, Variables variables)
{
task.setStatus(Task.TaskStatus.FAILED);
task.addOutput(statusGenerator.createDataSetStatusOutput(
ConstantsDataTransfer.CODESYSTEM_DATA_SET_STATUS_VALUE_RECEIVE_ERROR, "Decrypt data-set failed"));
ConstantsBase.CODESYSTEM_DATA_SET_STATUS_VALUE_RECEIVE_ERROR,
ConstantsDataTransfer.CODESYSTEM_DATA_TRANSFER,
ConstantsDataTransfer.CODESYSTEM_DATA_TRANSFER_VALUE_DATA_SET_STATUS, "Decrypt data-set failed"));
variables.updateTask(task);

variables.setString(ConstantsDataTransfer.BPMN_EXECUTION_VARIABLE_DATA_RECEIVE_ERROR_MESSAGE,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
import org.springframework.beans.factory.InitializingBean;

import de.medizininformatik_initiative.process.data_transfer.ConstantsDataTransfer;
import de.medizininformatik_initiative.process.data_transfer.util.DataSetStatusGenerator;
import de.medizininformatik_initiative.processes.common.util.ConstantsBase;
import de.medizininformatik_initiative.processes.common.util.DataSetStatusGenerator;
import dev.dsf.bpe.v1.ProcessPluginApi;
import dev.dsf.bpe.v1.activity.AbstractServiceDelegate;
import dev.dsf.bpe.v1.variables.Variables;
Expand Down Expand Up @@ -70,7 +70,9 @@ protected void doExecute(DelegateExecution execution, Variables variables)
{
task.setStatus(Task.TaskStatus.FAILED);
task.addOutput(statusGenerator.createDataSetStatusOutput(
ConstantsDataTransfer.CODESYSTEM_DATA_SET_STATUS_VALUE_RECEIVE_ERROR, "Download data-set failed"));
ConstantsBase.CODESYSTEM_DATA_SET_STATUS_VALUE_RECEIVE_ERROR,
ConstantsDataTransfer.CODESYSTEM_DATA_TRANSFER,
ConstantsDataTransfer.CODESYSTEM_DATA_TRANSFER_VALUE_DATA_SET_STATUS, "Download data-set failed"));
variables.updateTask(task);

variables.setString(ConstantsDataTransfer.BPMN_EXECUTION_VARIABLE_DATA_RECEIVE_ERROR_MESSAGE,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ private void sendMail(Task task, Variables variables)
String message = "Could not download and insert new data-set in process '"
+ ConstantsDataTransfer.PROCESS_NAME_FULL_DATA_RECEIVE + "' from organization '"
+ task.getRequester().getIdentifier().getValue() + "' in Task with id '" + task.getId() + "':\n"
+ "- status code: " + ConstantsDataTransfer.CODESYSTEM_DATA_SET_STATUS_VALUE_RECEIVE_ERROR + "\n"
+ "- error: " + (error == null ? "none" : error);
+ "- status code: " + ConstantsBase.CODESYSTEM_DATA_SET_STATUS_VALUE_RECEIVE_ERROR + "\n" + "- error: "
+ (error == null ? "none" : error);

api.getMailService().send(subject, message);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import org.hl7.fhir.r4.model.Task;

import de.medizininformatik_initiative.process.data_transfer.ConstantsDataTransfer;
import de.medizininformatik_initiative.processes.common.util.ConstantsBase;
import dev.dsf.bpe.v1.ProcessPluginApi;
import dev.dsf.bpe.v1.activity.AbstractServiceDelegate;
import dev.dsf.bpe.v1.variables.Variables;
Expand Down Expand Up @@ -36,8 +37,8 @@ private void sendMail(Task task, Variables variables)

String statusCode = task.getOutput().stream().filter(o -> o.getValue() instanceof Coding)
.map(o -> (Coding) o.getValue())
.filter(c -> ConstantsDataTransfer.CODESYSTEM_DATA_SET_STATUS.equals(c.getSystem()))
.map(c -> c.getCode()).findFirst().orElse("unknown");
.filter(c -> ConstantsBase.CODESYSTEM_DATA_SET_STATUS.equals(c.getSystem())).map(c -> c.getCode())
.findFirst().orElse("unknown");

String subject = "Error in process '" + ConstantsDataTransfer.BPMN_EXECUTION_VARIABLE_DATA_SEND_ERROR + "'";
String message = "Could not send data-set in process '" + ConstantsDataTransfer.PROCESS_NAME_FULL_DATA_SEND
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@
import org.springframework.beans.factory.InitializingBean;

import de.medizininformatik_initiative.process.data_transfer.ConstantsDataTransfer;
import de.medizininformatik_initiative.process.data_transfer.util.DataSetStatusGenerator;
import de.medizininformatik_initiative.processes.common.fhir.client.FhirClient;
import de.medizininformatik_initiative.processes.common.fhir.client.FhirClientFactory;
import de.medizininformatik_initiative.processes.common.util.ConstantsBase;
import de.medizininformatik_initiative.processes.common.util.DataSetStatusGenerator;
import dev.dsf.bpe.v1.ProcessPluginApi;
import dev.dsf.bpe.v1.activity.AbstractServiceDelegate;
import dev.dsf.bpe.v1.variables.Variables;
Expand Down Expand Up @@ -67,8 +68,10 @@ protected void doExecute(DelegateExecution execution, Variables variables)
{
List<IdType> createdIds = storeData(variables, fhirClient, bundle, sendingOrganization, projectIdentifier);

task.addOutput(statusGenerator
.createDataSetStatusOutput(ConstantsDataTransfer.CODESYSTEM_DATA_SET_STATUS_VALUE_RECEIVE_OK));
task.addOutput(
statusGenerator.createDataSetStatusOutput(ConstantsBase.CODESYSTEM_DATA_SET_STATUS_VALUE_RECEIVE_OK,
ConstantsDataTransfer.CODESYSTEM_DATA_TRANSFER,
ConstantsDataTransfer.CODESYSTEM_DATA_TRANSFER_VALUE_DATA_SET_STATUS));
variables.updateTask(task);

sendMail(createdIds, sendingOrganization, projectIdentifier);
Expand All @@ -77,7 +80,9 @@ protected void doExecute(DelegateExecution execution, Variables variables)
{
task.setStatus(Task.TaskStatus.FAILED);
task.addOutput(statusGenerator.createDataSetStatusOutput(
ConstantsDataTransfer.CODESYSTEM_DATA_SET_STATUS_VALUE_RECEIVE_ERROR, "Insert data-set failed"));
ConstantsBase.CODESYSTEM_DATA_SET_STATUS_VALUE_RECEIVE_ERROR,
ConstantsDataTransfer.CODESYSTEM_DATA_TRANSFER,
ConstantsDataTransfer.CODESYSTEM_DATA_TRANSFER_VALUE_DATA_SET_STATUS, "Insert data-set failed"));
variables.updateTask(task);

variables.setString(ConstantsDataTransfer.BPMN_EXECUTION_VARIABLE_DATA_RECEIVE_ERROR_MESSAGE,
Expand All @@ -104,7 +109,7 @@ private List<IdType> storeData(Variables variables, FhirClient fhirClient, Bundl
.map(IdType::new).map(id -> setIdBase(id, fhirClient)).collect(toList());

idsOfCreatedResources.stream().filter(i -> ResourceType.DocumentReference.name().equals(i.getResourceType()))
.forEach(i -> addOutputToLeadingTask(variables, i));
.forEach(i -> addOutputToStartTask(variables, i));

idsOfCreatedResources.forEach(id -> toLogMessage(id, sendingOrganization, projectIdentifier));

Expand Down Expand Up @@ -140,7 +145,7 @@ private void toLogMessage(IdType idType, String sendingOrganization, String proj
projectIdentifier);
}

private void addOutputToLeadingTask(Variables variables, IdType id)
private void addOutputToStartTask(Variables variables, IdType id)
{
Task startTask = variables.getStartTask();
startTask.addOutput().setValue(new Reference(id.getValue()).setType(id.getResourceType())).getType().addCoding()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
import org.springframework.beans.factory.InitializingBean;

import de.medizininformatik_initiative.process.data_transfer.ConstantsDataTransfer;
import de.medizininformatik_initiative.process.data_transfer.util.DataSetStatusGenerator;
import de.medizininformatik_initiative.processes.common.util.ConstantsBase;
import de.medizininformatik_initiative.processes.common.util.DataSetStatusGenerator;
import dev.dsf.bpe.v1.ProcessPluginApi;
import dev.dsf.bpe.v1.activity.AbstractServiceDelegate;
import dev.dsf.bpe.v1.variables.Variables;
Expand Down Expand Up @@ -64,25 +64,28 @@ else if (Task.TaskStatus.INPROGRESS.equals(startTask.getStatus()))

private void handleReceivedResponse(Task startTask, Task currentTask)
{
statusGenerator.transformInputToOutput(currentTask, startTask);
statusGenerator.transformInputToOutput(currentTask, startTask, ConstantsDataTransfer.CODESYSTEM_DATA_TRANSFER,
ConstantsDataTransfer.CODESYSTEM_DATA_TRANSFER_VALUE_DATA_SET_STATUS);

if (startTask.getOutput().stream().filter(Task.TaskOutputComponent::hasExtension)
.flatMap(o -> o.getExtension().stream())
.anyMatch(e -> ConstantsDataTransfer.EXTENSION_DATA_SET_STATUS_ERROR_URL.equals(e.getUrl())))
.anyMatch(e -> ConstantsBase.EXTENSION_DATA_SET_STATUS_ERROR_URL.equals(e.getUrl())))
startTask.setStatus(Task.TaskStatus.FAILED);
}

private void handleMissingResponse(Task startTask)
{
startTask.setStatus(Task.TaskStatus.FAILED);
startTask.addOutput(statusGenerator
.createDataSetStatusOutput(ConstantsDataTransfer.CODESYSTEM_DATA_SET_STATUS_VALUE_RECEIPT_MISSING));
startTask.addOutput(statusGenerator.createDataSetStatusOutput(
ConstantsBase.CODESYSTEM_DATA_SET_STATUS_VALUE_RECEIPT_MISSING,
ConstantsDataTransfer.CODESYSTEM_DATA_TRANSFER,
ConstantsDataTransfer.CODESYSTEM_DATA_TRANSFER_VALUE_DATA_SET_STATUS));
}

private void writeStatusLogAndSendMail(Task startTask, String projectIdentifier, String dmsIdentifier)
{
startTask.getOutput().stream().filter(o -> o.getValue() instanceof Coding).filter(
o -> ConstantsDataTransfer.CODESYSTEM_DATA_SET_STATUS.equals(((Coding) o.getValue()).getSystem()))
startTask.getOutput().stream().filter(o -> o.getValue() instanceof Coding)
.filter(o -> ConstantsBase.CODESYSTEM_DATA_SET_STATUS.equals(((Coding) o.getValue()).getSystem()))
.forEach(o -> doWriteStatusLogAndSendMail(o, startTask.getId(), projectIdentifier, dmsIdentifier));
}

Expand All @@ -94,19 +97,21 @@ private void doWriteStatusLogAndSendMail(Task.TaskOutputComponent output, String
String error = output.hasExtension() ? output.getExtensionFirstRep().getValueAsPrimitive().getValueAsString()
: "none";

String errorLog = error.isBlank() ? "" : " - " + error;
if (ConstantsDataTransfer.CODESYSTEM_DATA_SET_STATUS_VALUE_RECEIPT_OK.equals(code))
if (ConstantsBase.CODESYSTEM_DATA_SET_STATUS_VALUE_RECEIPT_OK.equals(code))
{
logger.info(
"Task with id '{}' for project-identifier '{}' and DMS with identifier '{}' has data-set status code '{}'",
startTaskId, projectIdentifier, dmsIdentifier, code);

sendSuccessfulMail(projectIdentifier, dmsIdentifier, code);
}
else
{
String errorLog = error.isBlank() ? "" : " - " + error;
logger.warn(
"Task with id '{}' for project-identifier '{}' and DMS with identifier '{}' has data-set status code '{}'{}",
startTaskId, projectIdentifier, dmsIdentifier, code, errorLog);

sendErrorMail(startTaskId, projectIdentifier, dmsIdentifier, code, error);
}
}
Expand Down
Loading

0 comments on commit a73de65

Please sign in to comment.