You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by is...@apache.org on 2021/07/24 18:05:57 UTC

[airavata-data-lake] branch master updated: ResourceServiceHandler/createResource remove properties from serilizedPropertyMap

This is an automated email from the ASF dual-hosted git repository.

isjarana pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/airavata-data-lake.git


The following commit(s) were added to refs/heads/master by this push:
     new d4c5ea2  ResourceServiceHandler/createResource remove properties from serilizedPropertyMap
     new 745ad7b  Merge pull request #31 from isururanawaka/workflow_merge_23_jul_2021
d4c5ea2 is described below

commit d4c5ea2c3ba90d13705b9ef8bf242ce951f53020
Author: Isuru Ranawaka <ir...@gmail.com>
AuthorDate: Sat Jul 24 14:05:05 2021 -0400

    ResourceServiceHandler/createResource remove properties from serilizedPropertyMap
---
 .../airavata/drms/api/handlers/ResourceServiceHandler.java     | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/data-resource-management-service/drms-api/src/main/java/org/apache/airavata/drms/api/handlers/ResourceServiceHandler.java b/data-resource-management-service/drms-api/src/main/java/org/apache/airavata/drms/api/handlers/ResourceServiceHandler.java
index 6f3dda2..ed6328f 100644
--- a/data-resource-management-service/drms-api/src/main/java/org/apache/airavata/drms/api/handlers/ResourceServiceHandler.java
+++ b/data-resource-management-service/drms-api/src/main/java/org/apache/airavata/drms/api/handlers/ResourceServiceHandler.java
@@ -18,6 +18,7 @@ package org.apache.airavata.drms.api.handlers;
 
 import com.google.protobuf.Empty;
 import com.google.protobuf.InvalidProtocolBufferException;
+import com.google.protobuf.MapEntry;
 import com.google.protobuf.Struct;
 import com.google.protobuf.util.JsonFormat;
 import io.grpc.Status;
@@ -150,9 +151,16 @@ public class ResourceServiceHandler extends ResourceServiceGrpc.ResourceServiceI
                 serializedMap.put("lastModifiedTime", exEntity.get().getCreatedAt());
                 serializedMap.put("owner", exEntity.get().getOwnerId());
 
+                if (serializedMap.containsKey("properties") && serializedMap.get("properties") instanceof List) {
+                   List propertiesList = (List) serializedMap.get("properties");
+                   propertiesList.forEach(property-> {
+                       MapEntry entry = (MapEntry) property;
+                       serializedMap.put(entry.getKey().toString(),entry.getValue());
+                   });
+                }
+                serializedMap.remove("properties");
                 if (!parentId.isEmpty()) {
                     String parentLabel = request.getResource().getPropertiesMap().get("PARENT_TYPE");
-                    serializedMap.remove("properties");
                     this.neo4JConnector.mergeNodesWithParentChildRelationShip(serializedMap, new HashMap<>(),
                             request.getResource().getType(), parentLabel, callUser.getUsername(), entityId,
                             parentId, callUser.getTenantId());