aboutsummaryrefslogtreecommitdiffstats
path: root/bpmn/so-bpmn-tasks/src/main
diff options
context:
space:
mode:
authorBonkur, Venkat <venkat.bonkur@att.com>2020-03-25 17:02:20 -0400
committerBenjamin, Max (mb388a) <mb388a@att.com>2020-03-25 17:02:20 -0400
commita5c5b045553342376e240a506a05d0f7b947d191 (patch)
tree9084496bed0680757858dbf1853ad0eaecd5611d /bpmn/so-bpmn-tasks/src/main
parentf5420060c758308df18a0e316d6ae214ef9eb5c6 (diff)
mso vnf configuration update composite flow
Existing Change Management VNF Configuration Update flow migrated to the generic building blocks Introduced Activity BB VNFConfigModifyActivity.bpmn Updates to AppcOrcherationPreProcessor, ApplicationControllerTaskImpl to handle the ConfigModify Activity block. Updates to the catalog migration scripts to include VNF-Config-Update Macro flow. Issue-ID: SO-2768 Signed-off-by: Benjamin, Max (mb388a) <mb388a@att.com> Change-Id: I06be7a83fb2738b91b0257e1ec84298a7dafc1a1
Diffstat (limited to 'bpmn/so-bpmn-tasks/src/main')
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/appc/tasks/AppcOrchestratorPreProcessor.java21
1 files changed, 19 insertions, 2 deletions
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/appc/tasks/AppcOrchestratorPreProcessor.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/appc/tasks/AppcOrchestratorPreProcessor.java
index 9697246b03..9c55d0a922 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/appc/tasks/AppcOrchestratorPreProcessor.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/appc/tasks/AppcOrchestratorPreProcessor.java
@@ -1,7 +1,9 @@
package org.onap.so.bpmn.infrastructure.appc.tasks;
import java.util.ArrayList;
+import java.util.HashMap;
import java.util.List;
+import java.util.Map;
import java.util.Optional;
import org.onap.aai.domain.yang.Vserver;
import org.onap.appc.client.lcm.model.Action;
@@ -29,6 +31,8 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
+import com.fasterxml.jackson.core.type.TypeReference;
+import com.fasterxml.jackson.databind.ObjectMapper;
@Component
public class AppcOrchestratorPreProcessor {
@@ -84,8 +88,16 @@ public class AppcOrchestratorPreProcessor {
appcTaskRequest.setNewSoftwareVersion(newSoftwareVersion);
String operationsTimeout = JsonUtils.getJsonValue(payload, "operations_timeout");
appcTaskRequest.setOperationsTimeout(operationsTimeout);
- }
+ Map<String, String> configMap = new HashMap<>();
+ ObjectMapper objectMapper = new ObjectMapper();
+ String configParamsStr = JsonUtils.getJsonValue(payload, "configuration_parameters");
+ if (configParamsStr != null) {
+ configMap =
+ objectMapper.readValue(configParamsStr, new TypeReference<HashMap<String, String>>() {});
+ }
+ appcTaskRequest.setConfigParams(configMap);
+ }
ControllerSelectionReference controllerSelectionReference = catalogDbClient
.getControllerSelectionReferenceByVnfTypeAndActionCategory(vnfType, action.toString());
String controllerType = null;
@@ -229,8 +241,13 @@ public class AppcOrchestratorPreProcessor {
.isEmpty()) {
errorMessage = "APPC action Snapshot is missing vserverId parameter. ";
}
- break;
}
+ break;
+ case ConfigModify:
+ if (appcTaskRequest.getConfigParams().isEmpty() || appcTaskRequest.getConfigParams() == null) {
+ errorMessage = "APPC action ConfigModify is missing Configuration parameters. ";
+ }
+ break;
default:
break;
}