diff options
Diffstat (limited to 'catalog-be/src/main')
-rw-r--r-- | catalog-be/src/main/java/org/openecomp/sdc/be/tosca/ToscaExportHandler.java | 6 | ||||
-rw-r--r-- | catalog-be/src/main/java/org/openecomp/sdc/be/tosca/model/NodeFilter.java | 7 |
2 files changed, 11 insertions, 2 deletions
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/ToscaExportHandler.java b/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/ToscaExportHandler.java index a8aa6b33a9..9591e6b1a7 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/ToscaExportHandler.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/ToscaExportHandler.java @@ -937,8 +937,10 @@ public class ToscaExportHandler { } nodeTemplate.setType(componentInstance.getToscaComponentName()); nodeTemplate.setDirectives(componentInstance.getDirectives()); - nodeTemplate.setNode_filter(convertToNodeTemplateNodeFilterComponent(componentInstance.getNodeFilter())); - + NodeFilter nodeFilter = convertToNodeTemplateNodeFilterComponent(componentInstance.getNodeFilter()); + if(nodeFilter != null && nodeFilter.hasData()){ + nodeTemplate.setNode_filter(nodeFilter); + } final Either<Component, Boolean> originComponentRes = capabilityRequirementConverter .getOriginComponent(componentCache, componentInstance); if (originComponentRes.isRight()) { diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/model/NodeFilter.java b/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/model/NodeFilter.java index 6cad788a1e..ba93e09c13 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/model/NodeFilter.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/model/NodeFilter.java @@ -17,6 +17,9 @@ package org.openecomp.sdc.be.tosca.model; import java.util.List; import java.util.Map; + +import org.apache.commons.collections.CollectionUtils; + import lombok.Getter; import lombok.Setter; @@ -27,4 +30,8 @@ public class NodeFilter { private Object tosca_id; private List<Map<String, List<Object>>> properties; private List<Map<String, CapabilityFilter>> capabilities; + + public boolean hasData() { + return CollectionUtils.isNotEmpty(properties) || CollectionUtils.isNotEmpty(capabilities); + } } |