Changes made to Inbound/Design-Services 33/40433/3
authorDilip kumar Pampana <dp583p@att.com>
Fri, 30 Mar 2018 20:34:33 +0000 (16:34 -0400)
committerTakamune Cho <tc012c@att.com>
Tue, 3 Apr 2018 15:42:19 +0000 (15:42 +0000)
Error Displayed in CDT  while saving the artifacts to APPC DB using SAVE ALL TO APPC  though the artifacts are saved in DB

Issue-ID: APPC-817
Change-Id: I748dd099b3df2ace95b9930aec2fcf1de3f6d148
Signed-off-by: Dilip kumar Pampana <dp583p@att.com>
appc-inbound/appc-design-services/provider/src/main/java/org/onap/appc/design/dbervices/DesignDBService.java

index 02de360..83ef0f9 100644 (file)
@@ -2,23 +2,21 @@
  * ============LICENSE_START=======================================================
  * ONAP : APPC
  * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Copyright (C) 2017 Amdocs
  * =============================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
- * 
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  * ============LICENSE_END=========================================================
  */
 
@@ -197,7 +195,8 @@ public class DesignDBService {
             createArtifactTrackingRecord(payload, requestID, sdcArtifactId, sdcReferenceId);
             String status = getDataFromActionStatus(payload, STATUS);
             if (status == null || status.isEmpty()) {
-                setActionStatus(payload, "Not Tested");
+              log.info("Action Status is: "+ status);
+              setActionStatus(payload, "Not Tested");
             }
             linkstatusRelationShip(sdcArtifactId, sdcReferenceId, payload);
 
@@ -227,9 +226,9 @@ public class DesignDBService {
 
         if (payloadObject.get(DesignServiceConstants.VNFC_TYPE) != null && !payloadObject
             .get(DesignServiceConstants.VNFC_TYPE).textValue().isEmpty()) {
-            queryString = queryString + " AND  VNFC_TYPE =  ? ) )";
+            queryString = queryString + " AND  VNFC_TYPE =  ? GROUP BY VNF_TYPE HAVING COUNT(VNF_TYPE)>=1 ) )";
         } else {
-            queryString = queryString + " ) ) ";
+            queryString = queryString + " GROUP BY VNF_TYPE HAVING COUNT(VNF_TYPE)>=1 ) ) ";
         }
         log.info(QUERY_STR + queryString);
         boolean data = dbservice.updateDBData(queryString, argList);
@@ -310,6 +309,7 @@ public class DesignDBService {
         if (payloadObject.get(DesignServiceConstants.VNFC_TYPE) != null && !payloadObject
             .get(DesignServiceConstants.VNFC_TYPE).textValue().isEmpty()) {
             argList.add(payloadObject.get(DesignServiceConstants.VNFC_TYPE).textValue());
+            log.info("Vnfc-Type: " + payloadObject.get(DesignServiceConstants.VNFC_TYPE).textValue());
         } else {
             argList.add(null);
         }
@@ -322,6 +322,8 @@ public class DesignDBService {
         }
         argList.add(status);
 
+        log.info("QueryString: " + insertQuery);
+        log.info("Arguments List: " + argList);
         boolean updateStatus = dbservice.updateDBData(insertQuery, argList);
         if (!updateStatus)
             throw new DBException("Error while updating Action Status");