* ================================================================================
* Copyright (C) 2019 Bell Canada
* ================================================================================
+ * Modifications Copyright (c) 2020 Tech Mahindra
+ * ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
package org.onap.so.client.cds;
import com.google.gson.JsonObject;
+import org.apache.commons.lang3.StringUtils;
import org.onap.so.bpmn.common.BuildingBlockExecution;
import org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf;
import org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance;
final String modelCustomizationUuid = genericVnf.getModelInfoGenericVnf().getModelCustomizationUuid();
resolutionKey = genericVnf.getVnfName();
- blueprintName = genericVnf.getBlueprintName();
- blueprintVersion = genericVnf.getBlueprintVersion();
+ blueprintName = genericVnf.getModelInfoGenericVnf().getBlueprintName();
+ blueprintVersion = genericVnf.getModelInfoGenericVnf().getBlueprintVersion();
vnfObject.addProperty("service-instance-id", serviceInstance.getServiceInstanceId());
vnfObject.addProperty("service-model-uuid", serviceInstance.getModelInfoServiceInstance().getModelUuid());
final GeneralBuildingBlock buildingBlock = execution.getGeneralBuildingBlock();
List<Map<String, Object>> userParamsFromRequest =
buildingBlock.getRequestContext().getRequestParameters().getUserParams();
-
- configureInstanceParamsForVnf.populateInstanceParams(vnfObject, userParamsFromRequest,
- modelCustomizationUuid);
+ String vnfInstanceName = execution.getLookupMap().getOrDefault(ResourceKey.VNF_INSTANCE_NAME, "");
+ if (userParamsFromRequest != null && userParamsFromRequest.size() != 0) {
+ configureInstanceParamsForVnf.populateInstanceParams(vnfObject, userParamsFromRequest,
+ modelCustomizationUuid, vnfInstanceName);
+ }
} catch (Exception e) {
throw new PayloadGenerationException("Failed to buildPropertyObjectForVnf", e);
}