Fix Substitution Mapping for inputs created independently 90/119390/3
authorKrupaNagabhushan <krupa.nagabhushan@est.tech>
Tue, 2 Mar 2021 16:37:43 +0000 (16:37 +0000)
committerVasyl Razinkov <vasyl.razinkov@est.tech>
Wed, 17 Mar 2021 22:51:57 +0000 (22:51 +0000)
Issue-ID: SDC-3515
Signed-off-by: KrupaNagabhushan <krupa.nagabhushan@est.tech>
Change-Id: I90e489ac7f7a244d1338d0d6f6c3c2413a131fcc

catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/InputsBusinessLogic.java
catalog-be/src/main/java/org/openecomp/sdc/be/tosca/ToscaExportHandler.java
common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/PropertyDataDefinition.java

index 5b197de..2f43a5b 100644 (file)
@@ -955,6 +955,7 @@ public class InputsBusinessLogic extends BaseBusinessLogic {
                 }
             }
 
+            newInputDefinition.setMappedToComponentProperty(false);
             Either<InputDefinition, StorageOperationStatus> addInputEither =
                 toscaOperationFacade.addInputToComponent(inputName, newInputDefinition, component);
 
index ab87b5e..9664ccd 100644 (file)
@@ -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(
index 3f68a3c..3a0d08c 100644 (file)
@@ -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();
     }