Support node template artifact properties
[sdc.git] / catalog-be / src / main / java / org / openecomp / sdc / be / components / impl / ResourceBusinessLogic.java
index f7beca6..8c97a04 100644 (file)
@@ -3409,6 +3409,14 @@ public class ResourceBusinessLogic extends ComponentBusinessLogic {
                 ToscaArtifactDataDefinition to = new ToscaArtifactDataDefinition();
                 to.setFile(entry.getValue().getFile());
                 to.setType(entry.getValue().getType());
+                if(isNotEmpty(entry.getValue().getProperties())) {
+                    Map<String, Object> newPropertiesMap = new HashMap<>();
+                    List<UploadPropInfo> artifactPropsInfo = entry.getValue().getProperties();
+                    for(UploadPropInfo propInfo: artifactPropsInfo) {
+                        newPropertiesMap.put(propInfo.getName(), propInfo.getValue());
+                    }
+                    to.setProperties(newPropertiesMap);
+                }
                 toscaArtifacts.put(entry.getKey(), to);
             }
             componentInstance.setToscaArtifacts(toscaArtifacts);
@@ -3640,9 +3648,6 @@ public class ResourceBusinessLogic extends ComponentBusinessLogic {
             if (oldResource.getCsarUUID() != null) {
                 newResource.setCsarUUID(oldResource.getCsarUUID());
             }
-            if (oldResource.getCsarVersionId() != null) {
-                newResource.setCsarVersionId(oldResource.getCsarVersionId());
-            }
             if (oldResource.getImportedToscaChecksum() != null) {
                 newResource.setImportedToscaChecksum(oldResource.getImportedToscaChecksum());
             }