Fix intgration issue for E2E service 86/73486/2
authorsubhash kumar singh <subhash.kumar.singh@huawei.com>
Sun, 25 Nov 2018 17:19:32 +0000 (22:49 +0530)
committersubhash kumar singh <subhash.kumar.singh@huawei.com>
Sun, 25 Nov 2018 17:21:26 +0000 (22:51 +0530)
Fix intgration issue for E2E service.

Change-Id: I1b701f137ebc79addfb6914c7c68ac8c73f673d4
Issue-ID: SO-1252
Signed-off-by: subhash kumar singh <subhash.kumar.singh@huawei.com>
adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/impl/SDNCRestClient.java
bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/ActivateSDNCNetworkResource.groovy
bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateSDNCNetworkResource.groovy

index f842e78..3276931 100644 (file)
@@ -87,7 +87,7 @@ public class SDNCRestClient{
                // Added delay to allow completion of create request to SDNC
                // before executing activate of create request.
                try {
-                       Thread.sleep(1000);
+                       Thread.sleep(5000);
                } catch (InterruptedException e) {
                        e.printStackTrace();
                }
index b912b64..580416e 100644 (file)
@@ -53,7 +53,6 @@ public class ActivateSDNCNetworkResource extends AbstractServiceTaskProcessor {
     MsoUtils msoUtils = new MsoUtils()
 
     public void preProcessRequest(DelegateExecution execution) {
-        def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
         msoLogger.info(" ***** Started preProcessRequest *****")
 
         try {
@@ -64,7 +63,7 @@ public class ActivateSDNCNetworkResource extends AbstractServiceTaskProcessor {
             String resourceInput = execution.getVariable("resourceInput")
             //Get ResourceInput Object
             ResourceInput resourceInputObj = ResourceRequestBuilder.getJsonObject(resourceInput, ResourceInput.class)
-            execution.setVariable(Prefix + "resourceInput", resourceInputObj)
+            execution.setVariable(Prefix + "resourceInput", resourceInputObj.toString())
 
             //Deal with recipeParams
             String recipeParamsFromWf = execution.getVariable("recipeParamXsd")
@@ -125,8 +124,8 @@ public class ActivateSDNCNetworkResource extends AbstractServiceTaskProcessor {
         } catch (BpmnError e) {
             throw e;
         } catch (Exception ex){
-            msg = "Exception in preProcessRequest " + ex.getMessage()
-            msoLogger.debug( msg)
+            String msg = "Exception in preProcessRequest " + ex.getMessage()
+            msoLogger.debug(msg)
             exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
         }
     }
@@ -398,7 +397,7 @@ public class ActivateSDNCNetworkResource extends AbstractServiceTaskProcessor {
 
         } catch (Exception ex) {
             String exceptionMessage = " Bpmn error encountered in CreateSDNCCNetworkResource flow. prepareSDNCRequest() - " + ex.getMessage()
-            msoLogger.debug( exceptionMessage)
+            msoLogger.debug(exceptionMessage)
             exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage)
 
         }
@@ -415,7 +414,7 @@ public class ActivateSDNCNetworkResource extends AbstractServiceTaskProcessor {
     }
 
     public void sendSyncResponse(DelegateExecution execution) {
-        msoLogger.dubug(" *** sendSyncResponse *** ")
+        msoLogger.info("started sendsyncResp")
 
         try {
             String operationStatus = "finished"
@@ -427,9 +426,9 @@ public class ActivateSDNCNetworkResource extends AbstractServiceTaskProcessor {
 
         } catch (Exception ex) {
             String msg = "Exception in sendSyncResponse:" + ex.getMessage()
-            msoLogger.debug( msg)
+            msoLogger.debug(msg)
             exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
         }
-        msoLogger.dubug(" ***** Exit sendSyncResponse *****")
+        msoLogger.info("exited sendsyncResp")
     }
 }
\ No newline at end of file
index a505f3f..8e168a3 100644 (file)
@@ -203,7 +203,7 @@ public class CreateSDNCNetworkResource extends AbstractServiceTaskProcessor {
                     uResourceInput = jsonUtil.addJsonValue(uResourceInput, "requestInputs.access-ltp-id", inputParameters.get("local-access-ltp-id"))
                     uResourceInput = jsonUtil.addJsonValue(uResourceInput, "requestInputs.access-node-id", inputParameters.get("local-access-node-id"))
                     resourceInputObj.setResourceParameters(uResourceInput)
-                    execution.setVariable(Prefix + "resourceInput", resourceInputObj)
+                    execution.setVariable(Prefix + "resourceInput", resourceInputObj.toString())
                 }
 
                 break
@@ -539,10 +539,7 @@ public class CreateSDNCNetworkResource extends AbstractServiceTaskProcessor {
 
     private def getInstnaceId(DelegateExecution execution) {
         def responce  = new XmlSlurper().parseText(execution.getVariable("CRENWKI_createSDNCResponse"))
-        def data = responce.toString()
-        data = data.substring(data.indexOf("<"))
 
-        def resp = new XmlSlurper().parseText(data)
         ResourceInput resourceInputObj = ResourceRequestBuilder.getJsonObject(execution.getVariable(Prefix + "resourceInput"), ResourceInput.class)
         String modelName = resourceInputObj.getResourceModelInfo().getModelName()
         def val = ""
@@ -550,18 +547,18 @@ public class CreateSDNCNetworkResource extends AbstractServiceTaskProcessor {
         switch (modelName) {
             case  ~/[\w\s\W]*SOTNConnectivity[\w\s\W]*/ :
             case ~/[\w\s\W]*SDWANConnectivity[\w\s\W]*/ :
-                val = resp."network-response-information"."instance-id"
+                val = responce."response-data"."RequestData"."output"."network-response-information"."instance-id"
                 break
 
             case ~/[\w\s\W]*deviceVF[\w\s\W]*/ :
             case ~/[\w\s\W]*SiteWANVF[\w\s\W]*/ :
             case ~/[\w\s\W]*Site[\w\s\W]*/:
-                val = resp."vnf-response-information"."instance-id"
+                val = responce."response-data"."RequestData"."output"."vnf-response-information"."instance-id"
                 break
 
             case ~/[\w\s\W]*sdwanvpnattachment[\w\s\W]*/ :
             case ~/[\w\s\W]*sotnvpnattachment[\w\s\W]*/:
-                val = resp."connection-attachment-response-information"."instance-id"
+                val = responce."response-data"."RequestData"."output"."connection-attachment-response-information"."instance-id"
                 break
         }