Fix VSP updating issue 00/112600/2
authorxuegao <xg353y@intl.att.com>
Mon, 14 Sep 2020 06:57:26 +0000 (08:57 +0200)
committerXue Gao <xg353y@intl.att.com>
Mon, 14 Sep 2020 08:45:58 +0000 (08:45 +0000)
Fix the issue during the VSP updating.

Issue-ID: SDC-3104
Signed-off-by: xuegao <xg353y@intl.att.com>
Change-Id: If58aa1a7f1846b0269a7f759b47c7f00f834ae1f

catalog-model/src/main/java/org/openecomp/sdc/be/model/jsonjanusgraph/operations/ToscaElementLifecycleOperation.java

index bf89963..b7cc2c8 100644 (file)
@@ -442,6 +442,8 @@ public class ToscaElementLifecycleOperation extends BaseOperation {
                 lastCertifiedV.setVertex((JanusGraphVertex) lastCertifiedVertex);
                 lastCertifiedV.setUniqueId((String) janusGraphDao
                     .getProperty((JanusGraphVertex) lastCertifiedVertex, GraphPropertyEnum.UNIQUE_ID.getProperty()));
+                lastCertifiedV.addMetadataProperty(GraphPropertyEnum.IS_ABSTRACT,
+                    (Boolean) janusGraphDao.getProperty((JanusGraphVertex) lastCertifiedVertex, GraphPropertyEnum.IS_ABSTRACT.getProperty()));
                 StorageOperationStatus res = updateEdgeToCatalogRoot(null, lastCertifiedV);
                 if (res != StorageOperationStatus.OK) {
                     return res;
@@ -1264,7 +1266,7 @@ public class ToscaElementLifecycleOperation extends BaseOperation {
             Boolean isAbstract = (Boolean) newVersionV.getMetadataProperty(GraphPropertyEnum.IS_ABSTRACT);
                        
                        if ( isAbstract == null || !isAbstract ) {
-                // no new vertex, only delete previous
+                // create new vertex
                 JanusGraphOperationStatus
                     result = janusGraphDao
                     .createEdge(catalogV, newVersionV, EdgeLabelEnum.CATALOG_ELEMENT, null);