From 8d530f3f8918274ad220d2ab66a5ff493de22096 Mon Sep 17 00:00:00 2001 From: Tal Gitelman Date: Wed, 13 Sep 2017 17:33:39 +0300 Subject: Fix - Blockstorage and Compute in VF linking Change-Id: I5b79be033ad547b4d3f4d5443bd2b3a74dff6242 Issue-ID:SDC-267 Signed-off-by: Tal Gitelman --- .../be/model/jsontitan/operations/NodeTypeOperation.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'catalog-model/src/main') diff --git a/catalog-model/src/main/java/org/openecomp/sdc/be/model/jsontitan/operations/NodeTypeOperation.java b/catalog-model/src/main/java/org/openecomp/sdc/be/model/jsontitan/operations/NodeTypeOperation.java index d52aa038a3..71e2010ccd 100644 --- a/catalog-model/src/main/java/org/openecomp/sdc/be/model/jsontitan/operations/NodeTypeOperation.java +++ b/catalog-model/src/main/java/org/openecomp/sdc/be/model/jsontitan/operations/NodeTypeOperation.java @@ -36,6 +36,7 @@ import org.openecomp.sdc.be.datatypes.elements.ListRequirementDataDefinition; import org.openecomp.sdc.be.datatypes.elements.MapPropertiesDataDefinition; import org.openecomp.sdc.be.datatypes.elements.PropertyDataDefinition; import org.openecomp.sdc.be.datatypes.enums.GraphPropertyEnum; +import org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields; import org.openecomp.sdc.be.datatypes.tosca.ToscaDataDefinition; import org.openecomp.sdc.be.model.ComponentParametersView; import org.openecomp.sdc.be.model.DerivedNodeTypeResolver; @@ -468,6 +469,19 @@ public class NodeTypeOperation extends ToscaElementOperation { ToscaDataDefinition.mergeDataMaps(capabiltiesAll, capabilties); } + + capabiltiesAll.values().forEach(l -> { + l.getListToscaDataDefinition().forEach(c -> { + List capabilitySources = c.getCapabilitySources(); + if ( capabilitySources == null ){ + capabilitySources = new ArrayList<>(); + } + capabilitySources.add((String) nodeType.getMetadataValue(JsonPresentationFields.TOSCA_RESOURCE_NAME)); + c.setCapabilitySources(capabilitySources); + }); + }); + + if (!capabiltiesAll.isEmpty()) { Either assosiateElementToData = assosiateElementToData(nodeTypeVertex, VertexTypeEnum.CAPABILTIES, EdgeLabelEnum.CAPABILITIES, capabiltiesAll); if (assosiateElementToData.isRight()) { -- cgit 1.2.3-korg