diff options
author | 2017-07-03 20:16:55 +0300 | |
---|---|---|
committer | 2017-07-03 20:16:55 +0300 | |
commit | 153a35821f0d25ce23cca467b76c5a7c5092c744 (patch) | |
tree | 0c66c4d1310019479e446ea3a4c26faffb0aa33f /openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org | |
parent | ffdda7d685029d6a88ac82ac637e43bba96423cb (diff) |
[sdc] - last merges before moving to LF
Change-Id: I0df3ec795f0de84229ea4bb4806ec8f959243557
Signed-off-by: Tal Gitelman <tg851x@intl.att.com>
Diffstat (limited to 'openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org')
-rw-r--r-- | openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/UnifiedCompositionService.java | 29 |
1 files changed, 25 insertions, 4 deletions
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/UnifiedCompositionService.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/UnifiedCompositionService.java index 50576086c8..d5a87ad668 100644 --- a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/UnifiedCompositionService.java +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/UnifiedCompositionService.java @@ -1706,7 +1706,7 @@ public class UnifiedCompositionService { //todo - define list of type which will match the node property type (instead of string) addPropertyInputParameter(propertyType, substitutionServiceTemplate, propertyDefinition .getEntry_schema(), - parameterId, unifiedCompositionEntity); + parameterId, unifiedCompositionEntity, context); } } } @@ -1782,7 +1782,7 @@ public class UnifiedCompositionService { addPropertyInputParameter(propertyType, substitutionServiceTemplate, enrichNodeType .getProperties().get(enrichPropertyName).getEntry_schema(), - Optional.of(inputParamId), compositionEntity); + Optional.of(inputParamId), compositionEntity, context); } } @@ -1814,8 +1814,16 @@ public class UnifiedCompositionService { private void addPropertyInputParameter(String propertyType, ServiceTemplate substitutionServiceTemplate, EntrySchema entrySchema, Optional<String> parameterId, - UnifiedCompositionEntity unifiedCompositionEntity) { - if (isPropertySimpleType(propertyType)) { + UnifiedCompositionEntity unifiedCompositionEntity, + TranslationContext context) { + if(parameterId.isPresent() && + isParameterBelongsToEnrichedPortProperties(parameterId.get(), context)){ + addInputParameter(parameterId.get(), + propertyType, + propertyType.equals(PropertyType.LIST.getDisplayName()) ? entrySchema : null , + substitutionServiceTemplate); + } + else if (isPropertySimpleType(propertyType)) { parameterId .ifPresent(parameterIdValue -> addInputParameter(parameterIdValue, PropertyType.LIST.getDisplayName(), @@ -1842,6 +1850,19 @@ public class UnifiedCompositionService { } } + private boolean isParameterBelongsToEnrichedPortProperties(String parameterId, + TranslationContext context){ + List enrichPortResourceProperties = context.getEnrichPortResourceProperties(); + + for(int i = 0; i < enrichPortResourceProperties.size(); i++){ + if(parameterId.contains((CharSequence) enrichPortResourceProperties.get(i))){ + return true; + } + } + + return false; + } + private boolean isPropertySimpleType(String propertyType) { return !Objects.isNull(propertyType) && (propertyType.equalsIgnoreCase(PropertyType.STRING.getDisplayName()) |