aboutsummaryrefslogtreecommitdiffstats
path: root/catalog-be/src/main/java
diff options
context:
space:
mode:
Diffstat (limited to 'catalog-be/src/main/java')
-rw-r--r--catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ComponentNodeFilterBusinessLogic.java11
1 files changed, 9 insertions, 2 deletions
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ComponentNodeFilterBusinessLogic.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ComponentNodeFilterBusinessLogic.java
index e60ced5cc7..65b5794687 100644
--- a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ComponentNodeFilterBusinessLogic.java
+++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ComponentNodeFilterBusinessLogic.java
@@ -358,9 +358,17 @@ public class ComponentNodeFilterBusinessLogic extends BaseBusinessLogic {
List<RequirementNodeFilterPropertyDataDefinition> properties = ciNodeFilterDataDefinition.getProperties()
.getListToscaDataDefinition();
if (!properties.isEmpty()) {
+ final Component component;
+ try {
+ component = getComponent(componentId);
+ } catch (BusinessLogicException e) {
+ throw new ComponentException(e.getResponseFormat());
+ }
properties.forEach(property -> {
+ String propertyType = getComponentInstancePropertyType(component, componentInstanceId, property.getName());
RequirementNodeFilterPropertyDataDefinition requirementNodeFilterPropertyDataDefinition =
getRequirementNodeFilterPropertyDataDefinition(property);
+ requirementNodeFilterPropertyDataDefinition.setType(propertyType);
Either<CINodeFilterDataDefinition, StorageOperationStatus> nodeFilterProperty = nodeFilterOperation
.addNewProperty(componentId, componentInstanceId, nodeFilter.left().value(), requirementNodeFilterPropertyDataDefinition);
if (nodeFilterProperty.isRight()) {
@@ -396,8 +404,7 @@ public class ComponentNodeFilterBusinessLogic extends BaseBusinessLogic {
private List<String> getNodeFilterConstraints(String name, List<String> value) {
List<String> constraints = new ArrayList<>();
- String values = value.get(0).split("\n")[0];
- constraints.add(name + ": {" + values + "}");
+ constraints.add(name + ":\n " + value.get(0));
return constraints;
}