Fix - Blockstorage and Compute in VF linking 09/12209/1
authorTal Gitelman <tg851x@intl.att.com>
Wed, 13 Sep 2017 14:33:39 +0000 (17:33 +0300)
committerTal Gitelman <tg851x@intl.att.com>
Wed, 13 Sep 2017 14:33:39 +0000 (17:33 +0300)
Change-Id: I5b79be033ad547b4d3f4d5443bd2b3a74dff6242
Issue-ID:SDC-267
Signed-off-by: Tal Gitelman <tg851x@intl.att.com>
catalog-model/src/main/java/org/openecomp/sdc/be/model/jsontitan/operations/NodeTypeOperation.java

index d52aa03..71e2010 100644 (file)
@@ -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<String> 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<GraphVertex, StorageOperationStatus> assosiateElementToData = assosiateElementToData(nodeTypeVertex, VertexTypeEnum.CAPABILTIES, EdgeLabelEnum.CAPABILITIES, capabiltiesAll);
                        if (assosiateElementToData.isRight()) {