From b67c463f19532e7c4db10c62a1205861dfd2583d Mon Sep 17 00:00:00 2001
From: 黄卓垚10112215 <huang.zhuoyao@zte.com.cn>
Date: Wed, 12 Dec 2018 16:14:37 +0800
Subject: Bug fix for getInstnaceId

CreateSDNCNetworkResource.afterCreateSDNCCall can't get instance id from getInstnaceId in afterCreateSDNCCall for modelName default case is missing

Issue-ID: SO-1331

Change-Id: Ic9dab916cc17f0175c42f915d5acf4f817a4321c
Signed-off-by: Zhuoyao Huang <10112215@zte.com.cn>
---
 .../scripts/CreateSDNCNetworkResource.groovy             | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

(limited to 'bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap')

diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateSDNCNetworkResource.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateSDNCNetworkResource.groovy
index 8e168a3cf1..9301f3d508 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateSDNCNetworkResource.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateSDNCNetworkResource.groovy
@@ -538,27 +538,27 @@ public class CreateSDNCNetworkResource extends AbstractServiceTaskProcessor {
     }
 
     private def getInstnaceId(DelegateExecution execution) {
-        def responce  = new XmlSlurper().parseText(execution.getVariable("CRENWKI_createSDNCResponse"))
+        def response  = new XmlSlurper().parseText(execution.getVariable("CRENWKI_createSDNCResponse"))
 
         ResourceInput resourceInputObj = ResourceRequestBuilder.getJsonObject(execution.getVariable(Prefix + "resourceInput"), ResourceInput.class)
         String modelName = resourceInputObj.getResourceModelInfo().getModelName()
         def val = ""
 
         switch (modelName) {
-            case  ~/[\w\s\W]*SOTNConnectivity[\w\s\W]*/ :
-            case ~/[\w\s\W]*SDWANConnectivity[\w\s\W]*/ :
-                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 = responce."response-data"."RequestData"."output"."vnf-response-information"."instance-id"
+                val = response."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 = responce."response-data"."RequestData"."output"."connection-attachment-response-information"."instance-id"
+                val = response."response-data"."RequestData"."output"."connection-attachment-response-information"."instance-id"
+                break
+
+            // for SDWANConnectivity and SOTNConnectivity and default:
+            default:
+                val = response."response-data"."RequestData"."output"."network-response-information"."instance-id"
                 break
         }
 
-- 
cgit 1.2.3-korg