From 654db79e01a20632cf1d7c3c6a786160aaa82eed Mon Sep 17 00:00:00 2001 From: "Kuleshov, Elena" Date: Tue, 7 Apr 2020 15:50:32 -0400 Subject: Add workflowName and operationName to v8 of Add workflowName and operationName to v8 of orchestrationRequests response. Fix typo in the schema for infra_active_requests. Change version matching for the new interface fields. Issue-ID: SO-2799 Signed-off-by: Benjamin, Max (mb388a) Change-Id: Icc7f3c6271023a578df2c1d969c807a578cc9577 --- .../org/onap/so/apihandlerinfra/InstanceManagement.java | 12 ++++++++++++ .../org/onap/so/apihandlerinfra/OrchestrationRequests.java | 13 +++++++++++++ 2 files changed, 25 insertions(+) (limited to 'mso-api-handlers/mso-api-handler-infra/src/main') diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/InstanceManagement.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/InstanceManagement.java index 3007ddd7c9..f39a95e92c 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/InstanceManagement.java +++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/InstanceManagement.java @@ -197,6 +197,7 @@ public class InstanceManagement { vnfId = sir.getVnfInstanceId(); } + currentActiveReq = setWorkflowNameAndOperationName(currentActiveReq, workflowUuid); saveCurrentActiveRequest(currentActiveReq); RequestClientParameter requestClientParameter; @@ -293,6 +294,7 @@ public class InstanceManagement { RecipeLookupResult recipeLookupResult = getInstanceManagementWorkflowRecipe(currentActiveReq, workflowUuid); + currentActiveReq = setWorkflowNameAndOperationName(currentActiveReq, workflowUuid); saveCurrentActiveRequest(currentActiveReq); RequestClientParameter requestClientParameter; @@ -357,4 +359,14 @@ public class InstanceManagement { } return null; } + + protected InfraActiveRequests setWorkflowNameAndOperationName(InfraActiveRequests currentActiveReq, + String workflowUuid) { + Workflow workflow = catalogDbClient.findWorkflowByArtifactUUID(workflowUuid); + if (workflow != null) { + currentActiveReq.setWorkflowName(workflow.getName()); + currentActiveReq.setOperationName(workflow.getOperationName()); + } + return currentActiveReq; + } } diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/OrchestrationRequests.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/OrchestrationRequests.java index c43a050500..3993c65008 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/OrchestrationRequests.java +++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/OrchestrationRequests.java @@ -311,6 +311,19 @@ public class OrchestrationRequests { request.setOriginalRequestId(originalRequestId); } + if (!version.matches("v[1-7]")) { + String workflowName = iar.getWorkflowName(); + if (workflowName == null) { + workflowName = iar.getRequestAction(); + } + request.setWorkflowName(workflowName); + + String operationName = iar.getOperationName(); + if (operationName != null) { + request.setOperationName(operationName); + } + } + InstanceReferences ir = new InstanceReferences(); if (iar.getNetworkId() != null) ir.setNetworkInstanceId(iar.getNetworkId()); -- cgit 1.2.3-korg