Commit c0492645 authored by Anastasiia Gelmut's avatar Anastasiia Gelmut
Browse files

GONRG-2056 Changed WorkflowRunServiceImpl

parent e1a18efb
Pipeline #34791 passed with stages
in 43 minutes and 23 seconds
...@@ -5,6 +5,7 @@ import java.util.Collections; ...@@ -5,6 +5,7 @@ import java.util.Collections;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Objects;
import java.util.UUID; import java.util.UUID;
import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.ObjectMapper;
...@@ -56,7 +57,14 @@ public class WorkflowRunServiceImpl implements IWorkflowRunService { ...@@ -56,7 +57,14 @@ public class WorkflowRunServiceImpl implements IWorkflowRunService {
final WorkflowMetadata workflowMetadata = workflowMetadataRepository.getWorkflow(workflowName); final WorkflowMetadata workflowMetadata = workflowMetadataRepository.getWorkflow(workflowName);
final String workflowId = workflowMetadata.getWorkflowId(); final String workflowId = workflowMetadata.getWorkflowId();
final String runId = request.getRunId() != null ? request.getRunId() : UUID.randomUUID().toString(); final String runId = request.getRunId() != null ? request.getRunId() : UUID.randomUUID().toString();
String dagName = (String) workflowMetadata.getRegistrationInstructions().get(KEY_DAG_NAME); String dagName = null;
Map<String, Object> instructions = workflowMetadata.getRegistrationInstructions();
if (Objects.nonNull(instructions)) {
dagName = (String) instructions.get(KEY_DAG_NAME);
}
if (Objects.isNull(dagName)) {
dagName = workflowMetadata.getWorkflowName();
}
final WorkflowEngineRequest rq = new WorkflowEngineRequest(runId, workflowId, workflowName, dagName); final WorkflowEngineRequest rq = new WorkflowEngineRequest(runId, workflowId, workflowName, dagName);
final Map<String, Object> context = createWorkflowPayload(workflowName, runId, dpsHeaders.getCorrelationId(), request); final Map<String, Object> context = createWorkflowPayload(workflowName, runId, dpsHeaders.getCorrelationId(), request);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment