aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKrupaNagabhushan <krupa.nagabhushan@est.tech>2021-03-02 16:37:43 +0000
committerVasyl Razinkov <vasyl.razinkov@est.tech>2021-03-17 22:51:57 +0000
commita54b7c89ae8441e749cc08489672c50cfbe5786f (patch)
treedf10dcb8bb2bce791b667c826197feef3a62225e
parent737340d942fcfd431f21b5463bcde57b95e4d69c (diff)
Fix Substitution Mapping for inputs created independently
Issue-ID: SDC-3515 Signed-off-by: KrupaNagabhushan <krupa.nagabhushan@est.tech> Change-Id: I90e489ac7f7a244d1338d0d6f6c3c2413a131fcc
-rw-r--r--catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/InputsBusinessLogic.java1
-rw-r--r--catalog-be/src/main/java/org/openecomp/sdc/be/tosca/ToscaExportHandler.java2
-rw-r--r--common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/PropertyDataDefinition.java4
3 files changed, 6 insertions, 1 deletions
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/InputsBusinessLogic.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/InputsBusinessLogic.java
index 5b197de183..2f43a5b736 100644
--- a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/InputsBusinessLogic.java
+++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/InputsBusinessLogic.java
@@ -955,6 +955,7 @@ public class InputsBusinessLogic extends BaseBusinessLogic {
}
}
+ newInputDefinition.setMappedToComponentProperty(false);
Either<InputDefinition, StorageOperationStatus> addInputEither =
toscaOperationFacade.addInputToComponent(inputName, newInputDefinition, component);
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 ab87b5e739..9664ccd510 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
@@ -1866,7 +1866,7 @@ public class ToscaExportHandler {
if (component == null || CollectionUtils.isEmpty(component.getInputs())) {
return Collections.emptyMap();
}
- return component.getInputs().stream()
+ return component.getInputs().stream().filter(input -> input.isMappedToComponentProperty())
.map(PropertyDataDefinition::getName)
.collect(
Collectors.toMap(
diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/PropertyDataDefinition.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/PropertyDataDefinition.java
index 3f68a3cc76..3a0d08c2c8 100644
--- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/PropertyDataDefinition.java
+++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/PropertyDataDefinition.java
@@ -53,6 +53,7 @@ public class PropertyDataDefinition extends ToscaDataDefinition {
private String value;
private String label;
private Boolean immutable = Boolean.FALSE;
+ private Boolean mappedToComponentProperty = Boolean.TRUE;
private String inputPath;
private String status;
@@ -102,6 +103,7 @@ public class PropertyDataDefinition extends ToscaDataDefinition {
this.setHidden(propertyDataDefinition.isHidden());
this.setLabel(propertyDataDefinition.getLabel());
this.setImmutable(propertyDataDefinition.isImmutable());
+ this.setMappedToComponentProperty(propertyDataDefinition.isMappedToComponentProperty());
this.setParentUniqueId(propertyDataDefinition.getParentUniqueId());
this.setOwnerId(propertyDataDefinition.getOwnerId());
this.setGetInputValues(propertyDataDefinition.getGetInputValues());
@@ -167,6 +169,8 @@ public class PropertyDataDefinition extends ToscaDataDefinition {
return immutable;
}
+ public Boolean isMappedToComponentProperty() { return mappedToComponentProperty; }
+
public String getParentUniqueId() {
return getOwnerId();
}