diff options
Diffstat (limited to 'catalog-be/src/main/java/org/openecomp/sdc/be/tosca/ToscaExportHandler.java')
-rw-r--r-- | catalog-be/src/main/java/org/openecomp/sdc/be/tosca/ToscaExportHandler.java | 19 |
1 files changed, 19 insertions, 0 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 d0c14f77c5..08c3d18157 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 @@ -373,6 +373,11 @@ public class ToscaExportHandler { substitutionMapping.setProperties(propertyMappingMap); } + final Map<String, String[]> attributesMappingMap = buildSubstitutionMappingAttributesMapping(component); + if (!attributesMappingMap.isEmpty()) { + substitutionMapping.setAttributes(attributesMappingMap); + } + topologyTemplate.setSubstitution_mappings(substitutionMapping); toscaNode.setTopology_template(topologyTemplate); @@ -1751,6 +1756,20 @@ public class ToscaExportHandler { ); } + private Map<String, String[]> buildSubstitutionMappingAttributesMapping(final Component component) { + if (component == null || CollectionUtils.isEmpty(component.getOutputs())) { + return Collections.emptyMap(); + } + return component.getOutputs().stream() + .map(PropertyDataDefinition::getName) + .collect( + Collectors.toMap( + outputName -> outputName, + outputName -> new String[]{outputName}, + (outputName1, outputName2) -> outputName1) + ); + } + Optional<Map<String, ToscaProperty>> getProxyNodeTypeProperties(Component proxyComponent, Map<String, DataTypeDefinition> dataTypes) { |