summaryrefslogtreecommitdiffstats
path: root/catalog-be
diff options
context:
space:
mode:
Diffstat (limited to 'catalog-be')
-rw-r--r--catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ComponentInstanceBusinessLogic.java17
1 files changed, 17 insertions, 0 deletions
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ComponentInstanceBusinessLogic.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ComponentInstanceBusinessLogic.java
index dcccfd961d..76db103525 100644
--- a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ComponentInstanceBusinessLogic.java
+++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ComponentInstanceBusinessLogic.java
@@ -2990,6 +2990,7 @@ public class ComponentInstanceBusinessLogic extends BaseBusinessLogic {
newComponentInstance.setInstanceCount(resResourceInfo.getInstanceCount());
newComponentInstance.setMaxOccurrences(resResourceInfo.getMaxOccurrences());
newComponentInstance.setMinOccurrences(resResourceInfo.getMinOccurrences());
+ newComponentInstance.setDirectives(resResourceInfo.getDirectives());
checkForExternalReqAndCapabilities(origComponent, resResourceInfo);
ComponentInstance updatedComponentInstance =
@@ -3014,6 +3015,9 @@ public class ComponentInstanceBusinessLogic extends BaseBusinessLogic {
log.debug("Component with id {} was not found", containerComponentId);
throw new ByActionStatusComponentException(actionStatus, Constants.EMPTY_STRING);
}
+
+ maintainNodeFilters(currentResourceInstance, newComponentInstance, containerComponentId);
+
resourceInstanceStatus = getResourceInstanceById(updatedComponentRes.left().value(),
updatedComponentInstance.getUniqueId());
if (resourceInstanceStatus.isRight()) {
@@ -3030,6 +3034,19 @@ public class ComponentInstanceBusinessLogic extends BaseBusinessLogic {
}
}
+ private void maintainNodeFilters(
+ ComponentInstance currentResourceInstance,
+ ComponentInstance newComponentInstance,
+ String containerComponentId) {
+ CINodeFilterDataDefinition filterToMaintain = currentResourceInstance.getNodeFilter();
+ if (null != filterToMaintain) {
+ nodeFilterOperation.addNodeFilterData(
+ containerComponentId.toLowerCase(),
+ newComponentInstance.getUniqueId(),
+ filterToMaintain);
+ }
+ }
+
private void checkForExternalReqAndCapabilities(Component component, ComponentInstance resResourceInfo) {
Map<String, List<RequirementDefinition>> requirementsMap = resResourceInfo.getRequirements();
Map<String, List<RequirementDefinition>> externalRequirementsMap = new HashMap<>();