summaryrefslogtreecommitdiffstats
path: root/bpmn/so-bpmn-tasks
diff options
context:
space:
mode:
authorSteve Smokowski <ss835w@att.com>2020-10-19 11:56:18 +0000
committerGerrit Code Review <gerrit@onap.org>2020-10-19 11:56:18 +0000
commit56ba4c107a4f26a312a7abe9dc984aac8b7bd18f (patch)
treec3db9b741a55826b39aa1db9e6faa4d14f1748a0 /bpmn/so-bpmn-tasks
parentbb3126b06f81d9251e0d684590a3301b06c2802d (diff)
parentb6e786662a95e03a93cf3cfe2c9e0e43be1accb9 (diff)
Merge "use correct vnf and vf cust for replace in"
Diffstat (limited to 'bpmn/so-bpmn-tasks')
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowAction.java29
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasks.java5
2 files changed, 31 insertions, 3 deletions
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowAction.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowAction.java
index 0f955e2851..d9ad245e76 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowAction.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowAction.java
@@ -88,6 +88,7 @@ import org.onap.so.serviceinstancebeans.ModelType;
import org.onap.so.serviceinstancebeans.Networks;
import org.onap.so.serviceinstancebeans.Pnfs;
import org.onap.so.serviceinstancebeans.RelatedInstance;
+import org.onap.so.serviceinstancebeans.RelatedInstanceList;
import org.onap.so.serviceinstancebeans.RequestDetails;
import org.onap.so.serviceinstancebeans.Service;
import org.onap.so.serviceinstancebeans.ServiceInstancesRequest;
@@ -566,6 +567,20 @@ public class WorkflowAction {
} else {
vfModuleCustomizationUUID = aaiVfModule.getModelCustomizationId();
}
+ String replaceVfModuleCustomizationUUID = "";
+ String replaceVnfModuleCustomizationUUID = "";
+ boolean isReplace = false;
+ if (dataObj.getRequestAction().equalsIgnoreCase("replaceInstance")
+ || dataObj.getRequestAction().equalsIgnoreCase("replaceInstanceRetainAssignments")) {
+ for (RelatedInstanceList relatedInstList : dataObj.getRequestDetails().getRelatedInstanceList()) {
+ RelatedInstance relatedInstance = relatedInstList.getRelatedInstance();
+ if (relatedInstance.getModelInfo().getModelType().equals(ModelType.vnf)) {
+ replaceVnfModuleCustomizationUUID = relatedInstance.getModelInfo().getModelCustomizationId();
+ }
+ }
+ replaceVfModuleCustomizationUUID = dataObj.getRequestDetails().getModelInfo().getModelCustomizationId();
+ isReplace = true;
+ }
List<org.onap.aai.domain.yang.Vnfc> vnfcs =
getRelatedResourcesInVfModule(vnfId, vfModuleId, org.onap.aai.domain.yang.Vnfc.class, Types.VNFC);
@@ -579,9 +594,19 @@ public class WorkflowAction {
}
workflowIdsCopy.setConfigurationId(configuration.getConfigurationId());
for (OrchestrationFlow orchFlow : result) {
- dataObj.getResourceKey().setVfModuleCustomizationId(vfModuleCustomizationUUID);
+ if (!isReplace) {
+ dataObj.getResourceKey().setVfModuleCustomizationId(vfModuleCustomizationUUID);
+ dataObj.getResourceKey().setVnfCustomizationId(vnfCustomizationUUID);
+ } else {
+ if (orchFlow.getFlowName().contains("Delete")) {
+ dataObj.getResourceKey().setVfModuleCustomizationId(vfModuleCustomizationUUID);
+ dataObj.getResourceKey().setVnfCustomizationId(vnfCustomizationUUID);
+ } else {
+ dataObj.getResourceKey().setVfModuleCustomizationId(replaceVfModuleCustomizationUUID);
+ dataObj.getResourceKey().setVnfCustomizationId(replaceVnfModuleCustomizationUUID);
+ }
+ }
dataObj.getResourceKey().setCvnfModuleCustomizationId(vnfc.getModelCustomizationId());
- dataObj.getResourceKey().setVnfCustomizationId(vnfCustomizationUUID);
String vnfcName = vnfc.getVnfcName();
if (vnfcName == null || vnfcName.isEmpty()) {
buildAndThrowException(dataObj.getExecution(), "Exception in create execution list "
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasks.java
index f0898ace81..43a85051be 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasks.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasks.java
@@ -414,9 +414,12 @@ public class WorkflowActionBBTasks {
String handlingCode = (String) execution.getVariable(HANDLINGCODE);
final boolean aLaCarte = (boolean) execution.getVariable(G_ALACARTE);
int currentSequence = (int) execution.getVariable(G_CURRENT_SEQUENCE);
+ String requestAction = (String) execution.getVariable(G_ACTION);
ExecuteBuildingBlock ebb = flowsToExecute.get(currentSequence - 1);
String bbFlowName = ebb.getBuildingBlock().getBpmnFlowName();
- if ("ActivateVfModuleBB".equalsIgnoreCase(bbFlowName) && aLaCarte && "Success".equalsIgnoreCase(handlingCode)) {
+ if ("ActivateVfModuleBB".equalsIgnoreCase(bbFlowName) && aLaCarte && "Success".equalsIgnoreCase(handlingCode)
+ && !(requestAction.equalsIgnoreCase("replaceInstance")
+ || requestAction.equalsIgnoreCase("replaceInstanceRetainAssignments"))) {
postProcessingExecuteBBActivateVfModule(execution, ebb, flowsToExecute);
}
}