[MSO-8] Update the maven dependency
[so.git] / bpmn / MSOCommonBPMN / src / main / groovy / org / openecomp / mso / bpmn / common / scripts / SDNCAdapterUtils.groovy
  * ============LICENSE_END=========================================================
  */
 
-package com.att.bpm.scripts;
-
-import org.openecomp.mso.bpmn.core.WorkflowException
+package org.openecomp.mso.bpmn.common.scripts;
 
+import org.apache.commons.lang3.*
 import org.camunda.bpm.engine.delegate.BpmnError
 import org.camunda.bpm.engine.runtime.Execution
-import org.apache.commons.lang3.*
+import org.openecomp.mso.bpmn.core.WorkflowException
+import org.springframework.web.util.UriUtils
 
 
 /**
@@ -53,10 +53,10 @@ class SDNCAdapterUtils {
 
                def requestId = execution.getVariable('testReqId') // for junits
                if(requestId==null){
-                       requestId = execution.getVariable("att-mso-request-id") + "-" +         System.currentTimeMillis()
+                       requestId = execution.getVariable("openecomp-mso-request-id") + "-" +   System.currentTimeMillis()
                }
 
-               def svcInstanceId = execution.getVariable("att-mso-service-instance-id")
+               def svcInstanceId = execution.getVariable("openecomp-mso-service-instance-id")
 
                def nnsRequestInformation = utils.removeXmlNamespaces(requestInformation)
                def nnsServiceInformation = utils.removeXmlNamespaces(serviceInformation)
@@ -64,8 +64,8 @@ class SDNCAdapterUtils {
                def nnsFeatureParameters = utils.removeXmlNamespaces(featureParameters)
 
                String sdncAdapterFeatureRequest = """
-                               <sdncadapterworkflow:SDNCAdapterWorkflowRequest xmlns:sdncadapterworkflow="http://ecomp.att.com/mso/workflow/schema/v1"
-                                               xmlns:sdncadapter="http://domain2.att.com/workflow/sdnc/adapter/schema/v1">
+                               <sdncadapterworkflow:SDNCAdapterWorkflowRequest xmlns:sdncadapterworkflow="http://openecomp.com/mso/workflow/schema/v1"
+                                               xmlns:sdncadapter="http://domain2.openecomp.com/workflow/sdnc/adapter/schema/v1">
                                        <sdncadapter:RequestHeader>
                                                <sdncadapter:RequestId>${requestId}</sdncadapter:RequestId>
                                                <sdncadapter:SvcInstanceId>${svcInstanceId}</sdncadapter:SvcInstanceId>
@@ -97,18 +97,18 @@ class SDNCAdapterUtils {
 
                def requestId = execution.getVariable('testReqId') // for junits
                if(requestId==null){
-                       requestId = execution.getVariable("att-mso-request-id") + "-" +         System.currentTimeMillis()
+                       requestId = execution.getVariable("openecomp-mso-request-id") + "-" +   System.currentTimeMillis()
                }
 
-               def svcInstanceId = execution.getVariable("att-mso-service-instance-id")
+               def svcInstanceId = execution.getVariable("openecomp-mso-service-instance-id")
 
                def nnsRequestInformation = utils.removeXmlNamespaces(requestInformation)
                def nnsServiceInformation = utils.removeXmlNamespaces(serviceInformation)
                def nnsVnfInformationList = utils.removeXmlNamespaces(vnfInformationList)
 
                String sdncAdapterActivateVnfRequest = """
-                               <sdncadapterworkflow:SDNCAdapterWorkflowRequest xmlns:sdncadapterworkflow="http://ecomp.att.com/mso/workflow/schema/v1"
-                                               xmlns:sdncadapter="http://domain2.att.com/workflow/sdnc/adapter/schema/v1">
+                               <sdncadapterworkflow:SDNCAdapterWorkflowRequest xmlns:sdncadapterworkflow="http://openecomp.com/mso/workflow/schema/v1"
+                                               xmlns:sdncadapter="http://domain2.openecomp.com/workflow/sdnc/adapter/schema/v1">
                                        <sdncadapter:RequestHeader>
                                                <sdncadapter:RequestId>${requestId}</sdncadapter:RequestId>
                                                <sdncadapter:SvcInstanceId>${svcInstanceId}</sdncadapter:SvcInstanceId>
@@ -136,7 +136,7 @@ class SDNCAdapterUtils {
                def request = taskProcessor.getVariable(execution, prefix+'Request')
 
                def requestInformation = """<request-information>
-                                                                               <request-id>${execution.getVariable("att-mso-request-id")}</request-id>
+                                                                               <request-id>${execution.getVariable("openecomp-mso-request-id")}</request-id>
                                                                                <request-action>torepl</request-action>
                                                                                <source>${execution.getVariable(prefix+"source")}</source>
                                                                                <notification-url>${execution.getVariable(prefix+"notificationUrl")}</notification-url>
@@ -156,10 +156,10 @@ class SDNCAdapterUtils {
 
                def requestId = execution.getVariable('testReqId') // for junits
                if(requestId==null){
-                       requestId = execution.getVariable("att-mso-request-id") + "-" +         System.currentTimeMillis()
+                       requestId = execution.getVariable("openecomp-mso-request-id") + "-" +   System.currentTimeMillis()
                }
 
-               def svcInstanceId = execution.getVariable("att-mso-service-instance-id")
+               def svcInstanceId = execution.getVariable("openecomp-mso-service-instance-id")
 
                //Build Service Information
                // Send serviceName from CANOPI to sdnc for service-type
@@ -199,8 +199,8 @@ class SDNCAdapterUtils {
 
                //Build SDNC Adapter Request
                String sdncAdapterL3ToHLRequest = """
-                               <sdncadapterworkflow:SDNCAdapterWorkflowRequest xmlns:sdncadapterworkflow="http://ecomp.att.com/mso/workflow/schema/v1"
-                                               xmlns:sdncadapter="http://domain2.att.com/workflow/sdnc/adapter/schema/v1">
+                               <sdncadapterworkflow:SDNCAdapterWorkflowRequest xmlns:sdncadapterworkflow="http://openecomp.com/mso/workflow/schema/v1"
+                                               xmlns:sdncadapter="http://domain2.openecomp.com/workflow/sdnc/adapter/schema/v1">
                                        <sdncadapter:RequestHeader>
                                                <sdncadapter:RequestId>${requestId}</sdncadapter:RequestId>
                                                <sdncadapter:SvcInstanceId>${svcInstanceId}</sdncadapter:SvcInstanceId>
@@ -240,10 +240,10 @@ class SDNCAdapterUtils {
 
                        def requestId = execution.getVariable('testReqId') // for junits
                        if(requestId==null){
-                               requestId = execution.getVariable("att-mso-request-id") + "-" +  System.currentTimeMillis()
+                               requestId = execution.getVariable("openecomp-mso-request-id") + "-" +  System.currentTimeMillis()
                        }
 
-                       def svcInstanceId = execution.getVariable("att-mso-service-instance-id")
+                       def svcInstanceId = execution.getVariable("openecomp-mso-service-instance-id")
                        def msoAction = 'gammainternet'
 
                        def timeoutInMinutes = execution.getVariable('URN_mso_sdnc_timeout_firewall_minutes')
@@ -254,21 +254,26 @@ class SDNCAdapterUtils {
                                workflowException(execution, 'Internal Error', 9999) // TODO: what message and error code?
                        }
 
+                       def l2HomingInformation = utils.getNodeXml(serviceParameters, 'l2-homing-information', false)
                        def internetEvcAccessInformation = utils.getNodeXml(serviceParameters, 'internet-evc-access-information', false)
                        def vrLan = utils.getNodeXml(serviceParameters, 'vr-lan', false)
+                       def upceVmsServiceInformation = utils.getNodeXml(serviceParameters, 'ucpe-vms-service-information', false)
+
 
                        def nnsRequestInformation = utils.removeXmlNamespaces(requestInformation)
                        def nnsServiceInformation = utils.removeXmlNamespaces(serviceInformation)
+                       def nnsl2HomingInformation = utils.removeXmlNamespaces(l2HomingInformation)
                        def nnsInternetEvcAccessInformation = utils.removeXmlNamespaces(internetEvcAccessInformation)
                        def nnsVrLan = utils.removeXmlNamespaces(vrLan)
+                       def nnsUpceVmsServiceInformation = utils.removeXmlNamespaces(upceVmsServiceInformation)
 
                        if (additionalData == null) {
                                additionalData = ""
                        }
 
                        String content = """
-                               <sdncadapterworkflow:SDNCAdapterWorkflowRequest xmlns:sdncadapterworkflow="http://ecomp.att.com/mso/workflow/schema/v1"
-                                               xmlns:sdncadapter="http://domain2.att.com/workflow/sdnc/adapter/schema/v1">
+                               <sdncadapterworkflow:SDNCAdapterWorkflowRequest xmlns:sdncadapterworkflow="http://openecomp.com/mso/workflow/schema/v1"
+                                               xmlns:sdncadapter="http://domain2.openecomp.com/workflow/sdnc/adapter/schema/v1">
                                        <sdncadapter:RequestHeader>
                                                <sdncadapter:RequestId>${requestId}</sdncadapter:RequestId>
                                                <sdncadapter:SvcInstanceId>${svcInstanceId}</sdncadapter:SvcInstanceId>
@@ -281,8 +286,10 @@ class SDNCAdapterUtils {
                                                ${additionalData}
                                                ${nnsRequestInformation}
                                                ${nnsServiceInformation}
+                                               ${nnsl2HomingInformation}
                                                ${nnsInternetEvcAccessInformation}
                                                ${nnsVrLan}
+                                               ${nnsUpceVmsServiceInformation}
                                        </sdncadapterworkflow:SDNCRequestData>
                                                <sdncadapterworkflow:SDNCTimeOutValueInMinutes>${timeoutInMinutes}</sdncadapterworkflow:SDNCTimeOutValueInMinutes>
                                </sdncadapterworkflow:SDNCAdapterWorkflowRequest>
@@ -336,10 +343,10 @@ class SDNCAdapterUtils {
 
                        def requestId = execution.getVariable('testReqId') // for junits
                        if(requestId==null){
-                               requestId = execution.getVariable("att-mso-request-id") + "-" +         System.currentTimeMillis()
+                               requestId = execution.getVariable("openecomp-mso-request-id") + "-" +   System.currentTimeMillis()
                        }
 
-                       def svcInstanceId = execution.getVariable("att-mso-service-instance-id")
+                       def svcInstanceId = execution.getVariable("openecomp-mso-service-instance-id")
                        def msoAction = 'gammainternet'
 
                        def callbackUrl = (String) execution.getVariable('URN_mso_workflow_sdncadapter_callback')
@@ -348,14 +355,18 @@ class SDNCAdapterUtils {
                                taskProcessor.workflowException(execution, 'Internal Error', 9999) // TODO: what message and error code?
                        }
 
+                       def l2HomingInformation = utils.getNodeXml(request, 'l2-homing-information', false)
                        def internetEvcAccessInformation = utils.getNodeXml(request, 'internet-evc-access-information', false)
                        def vrLan = utils.getNodeXml(request, 'vr-lan', false)
+                       def upceVmsServiceInfo = utils.getNodeXml(request, 'ucpe-vms-service-information', false)
                        def vnfInformationList = utils.getNodeXml(request, 'vnf-information-list', false)
 
                        def nnsRequestInformation = utils.removeXmlNamespaces(requestInformation)
                        def nnsServiceInformation = utils.removeXmlNamespaces(serviceInformation)
+                       def nnsl2HomingInformation = utils.removeXmlNamespaces(l2HomingInformation)
                        def nnsInternetEvcAccessInformation = utils.removeXmlNamespaces(internetEvcAccessInformation)
                        def nnsVrLan = utils.removeXmlNamespaces(vrLan)
+                       def nnsUpceVmsServiceInfo = utils.removeXmlNamespaces(upceVmsServiceInfo)
                        def nnsVnfInformationList = utils.removeXmlNamespaces(vrLan)
                        def nnsinternetSvcChangeDetails = ""
 
@@ -371,8 +382,8 @@ class SDNCAdapterUtils {
                        }
 
                        String content = """
-                               <sdncadapterworkflow:SDNCAdapterWorkflowRequest xmlns:sdncadapterworkflow="http://ecomp.att.com/mso/workflow/schema/v1"
-                                               xmlns:sdncadapter="http://domain2.att.com/workflow/sdnc/adapter/schema/v1">
+                               <sdncadapterworkflow:SDNCAdapterWorkflowRequest xmlns:sdncadapterworkflow="http://openecomp.com/mso/workflow/schema/v1"
+                                               xmlns:sdncadapter="http://domain2.openecomp.com/workflow/sdnc/adapter/schema/v1">
                                        <sdncadapter:RequestHeader>
                                                <sdncadapter:RequestId>${requestId}</sdncadapter:RequestId>
                                                <sdncadapter:SvcInstanceId>${svcInstanceId}</sdncadapter:SvcInstanceId>
@@ -385,8 +396,10 @@ class SDNCAdapterUtils {
                                                ${additionalData}
                                                ${nnsRequestInformation}
                                                ${nnsServiceInformation}
+                                               ${nnsl2HomingInformation}
                                                ${nnsInternetEvcAccessInformation}
                                                ${nnsVrLan}
+                                               ${nnsUpceVmsServiceInfo}
                                                ${nnsVnfInformationList}
                                                ${nnsinternetSvcChangeDetails}
                                        </sdncadapterworkflow:SDNCRequestData>
@@ -406,8 +419,6 @@ class SDNCAdapterUtils {
                }
        }
 
-
-
        /**
         * Builds a topology SDNC request and return String request.
         * As V2 will use 1607-style request, region instead of aic clli code
@@ -418,15 +429,16 @@ class SDNCAdapterUtils {
         * @param action, the action element value
         * @param requestAction the svcOperation element value
         * @param cloudRegionId the aai's cloud-region-id
+        * @param networkId the aai's network-id
         * @param additionalData additional XML content to be inserted into the
-        *        RequestData element (may be null)
+        *   RequestData element (may be null)
         */
-        public String sdncTopologyRequestV2 (Execution execution, String requestXML, String serviceInstanceId, String callbackUrl, String action, String requestAction, String cloudRegionId, networkId, String additionalData) {
+        public String sdncTopologyRequestV2 (Execution execution, String requestXML, String serviceInstanceId, String callbackUrl, String action, String requestAction, String cloudRegionId, networkId, String queryAAIResponse, String additionalData) {
                 def utils=new MsoUtils()
 
                 String requestId = ""
                 try {
-                        requestId = execution.getVariable("att-mso-request-id")
+                        requestId = execution.getVariable("openecomp-mso-request-id")
                 } catch (Exception ex) {
                         requestId = utils.getNodeText1(requestXML, "request-id")
                 }
@@ -439,7 +451,13 @@ class SDNCAdapterUtils {
                 String networkType = ""
                 if (utils.nodeExists(requestXML, "network-type")) {
                         networkType = utils.getNodeText1(requestXML, "network-type")
-                }       
+                }
+                
+                // Replace/Use the value of network-type from aai query (vs input) during Delete Network flows.
+                if (queryAAIResponse != null) {
+                    networkType = utils.getNodeText1(queryAAIResponse, "network-type")
+                }
+                        
                 String serviceId = ""
                 if (utils.nodeExists(requestXML, "service-id")) {
                         serviceId = utils.getNodeText1(requestXML, "service-id")
@@ -462,17 +480,19 @@ class SDNCAdapterUtils {
                         int serviceStart = siRelatedLink.indexOf("service-subscription/")
                         int serviceEnd = siRelatedLink.indexOf("/service-instances/")
                         serviceType = siRelatedLink.substring(serviceStart + 21, serviceEnd)
+                        serviceType = UriUtils.decode(serviceType,"UTF-8")
                         // get subscriber name
                         int subscriberNameStart = siRelatedLink.indexOf("customers/customer/")
                         int subscriberNameEnd = siRelatedLink.indexOf("/service-subscriptions/")
                     subscriberName = siRelatedLink.substring(subscriberNameStart + 19, subscriberNameEnd)
+                        subscriberName = UriUtils.decode(subscriberName,"UTF-8")
                 }
                 
                 String content =
-                       """<aetgt:SDNCAdapterWorkflowRequest xmlns:aetgt="http://ecomp.att.com/mso/workflow/schema/v1"
-                                                 xmlns:sdncadapterworkflow="http://ecomp.att.com/mso/workflow/schema/v1"
-                                                 xmlns:sdncadapter="http://domain2.att.com/workflow/sdnc/adapter/schema/v1"
-                                                 xmlns:ns5="http://ecomp.att.com/mso/request/types/v1">
+                       """<aetgt:SDNCAdapterWorkflowRequest xmlns:aetgt="http://openecomp.com/mso/workflow/schema/v1"
+                                                 xmlns:sdncadapterworkflow="http://openecomp.com/mso/workflow/schema/v1"
+                                                 xmlns:sdncadapter="http://domain2.openecomp.com/workflow/sdnc/adapter/schema/v1"
+                                                 xmlns:ns5="http://openecomp.com/mso/request/types/v1">
                                           <sdncadapter:RequestHeader>
                                                  <sdncadapter:RequestId>${requestId}</sdncadapter:RequestId>
                                                  <sdncadapter:SvcInstanceId>${serviceInstanceId}</sdncadapter:SvcInstanceId>
@@ -508,97 +528,165 @@ class SDNCAdapterUtils {
                        return content
         }
 
-       /**
-        * Validates a workflow response.
-        * @param execution the execution
-        * @param responseVar the execution variable in which the response is stored
-        * @param responseCodeVar the execution variable in which the response code is stored
-        * @param errorResponseVar the execution variable in which the error response is stored
-        */
-
-       public void validateSDNCResponseOld(Execution execution, String responseVar,
-                       String responseCodeVar, String errorResponseVar) {
-               def method = getClass().getSimpleName() + '.validateWorkflowResponse(' +
-                       'execution=' + execution.getId() +
-                       ', responseVar=' + responseVar +
-                       ', responseCodeVar=' + responseCodeVar +
-                       ', errorResponseVar=' + errorResponseVar +
-                       ')'
-               def isDebugLogEnabled = execution.getVariable('isDebugLogEnabled')
-               taskProcessor.logDebug('Entered ' + method, isDebugLogEnabled)
-
-               try {
-                       def prefix = execution.getVariable('prefix')
-                       execution.setVariable(prefix+'sdncResponseSuccess', false)
-                       def response = execution.getVariable(responseVar)
-                       taskProcessor.logDebug(responseVar + ' = ' +
-                               (response == null ? "" : System.lineSeparator()) +
-                               response, isDebugLogEnabled)
-
-                       def responseCode = execution.getVariable(responseCodeVar)
-                       taskProcessor.logDebug(responseCodeVar + ' = ' + responseCode, isDebugLogEnabled)
-
-                       def errorResponse = execution.getVariable(errorResponseVar)
-
-                       errorResponse = taskProcessor.utils.getNodeText1(errorResponse,"ErrorMessage")
-                       if (errorResponse == null) errorResponse = errorResponse
-
-                       taskProcessor.logDebug(errorResponseVar + ' = ' +
-                               (errorResponse == null ? "" : System.lineSeparator()) +
-                               errorResponse, isDebugLogEnabled)
-
-                       if ("200".equals(String.valueOf(responseCode)) || "201".equals(String.valueOf(responseCode))) {
-
-                               // we need to peer into the request data for error
-                               def String callbackRequestData = taskProcessor.utils.getNodeXml(response, 'RequestData', false)
-                               def String decodedXml = decodeXML(callbackRequestData)
-                               taskProcessor.utils.log("DEBUG","decodedXml:\n" + decodedXml, isDebugLogEnabled)
-
-                               def int requestDataResponseCode = 200
-                               def String requestDataResponseMessage = ''
-
-                               if (taskProcessor.utils.nodeExists(decodedXml, "response-code")) {
-                                       try{
-                                       requestDataResponseCode  = ((String) taskProcessor.utils.getNodeText(decodedXml, "response-code")).toInteger()
-                                       }catch(Exception e){
-                                       //TODO proper handling of new, non numerical response codes in 1607 and new error handling for common API
-                                               requestDataResponseCode = 500
-                                       }
-                                       if (taskProcessor.utils.nodeExists(decodedXml, "response-message")) {
-                                               requestDataResponseMessage  = taskProcessor.utils.getNodeText(decodedXml, "response-message")
-                                       }
-                               }
-
-                               taskProcessor.utils.log("DEBUG", "SDNC callback response-code: " + requestDataResponseCode, isDebugLogEnabled)
-                               taskProcessor.utils.log("DEBUG", "SDNC callback response-message: " + requestDataResponseMessage, isDebugLogEnabled)
-
-                               // if response-code is not Success (200, 201, etc) we need to throw an exception
-                               if (requestDataResponseCode < 200 || requestDataResponseCode > 299) {
-                                       ExceptionUtil exceptionUtil = new ExceptionUtil()
-                                       def convertedCode = exceptionUtil.MapSDNCResponseCodeToErrorCode(requestDataResponseCode.toString())
-                                       taskProcessor.workflowException(execution, "Received error from SDN-C: " + requestDataResponseMessage, convertedCode)
-
-                               }
-                       }
-                       else {
-                               taskProcessor.logWarn('Expected response code 200 or 201 in ' + responseCodeVar + ', got \'' + responseCode + '\'')
-                               taskProcessor.workflowException(execution, errorResponse, responseCode)
-                       }
-
-                       if (response == null || response.trim().equals("")) {
-                               taskProcessor.logWarn(responseVar + ' is empty');
-                               taskProcessor.workflowException(execution, errorResponse, responseCode)
-                       }
-
-                       execution.setVariable(prefix+'sdncResponseSuccess', true)
-                       taskProcessor.logDebug('Exited ' + method, isDebugLogEnabled)
-               } catch (BpmnError e) {
-                       throw e;
-               } catch (Exception e) {
-                       taskProcessor.logError('Caught exception in ' + method, e)
-                       taskProcessor.workflowException(execution, 'Internal Error- Unable to validate SDNC Response ' + e.getMessage(), 500)
-               }
-       }
+        /**
+         * Builds a topology SDNC request and return String request.
+         * As V2 will use 1607-style request, region instead of aic clli code
+         * @param execution, the execution
+         * @param requestXML, the incoming request for the flow
+         * @param serviceInstanceId, the serviceIntance (if available)
+         * @param callbackUrl, the call back url
+         * @param action, the action element value
+         * @param requestAction the svcOperation element value
+         * @param cloudRegionId the aai's cloud-region-id
+         * @param networkId the aai's network-id
+         * @param additionalData additional XML content to be inserted into the
+         *   RequestData element (may be null)
+         */
+         public String sdncTopologyRequestRsrc (Execution execution, String requestXML, String serviceInstanceId, String callbackUrl, String action, String requestAction, String cloudRegionId, networkId, String additionalData) {
+                 def utils=new MsoUtils()
+
+                 // SNDC is expecting requestId as unique each call.
+                 String requestId = ""
+                 String testRequestId = execution.getVariable("testMessageId")  // for test purposes.
+                 if (testRequestId == null) {
+                     requestId = UUID.randomUUID()  // generate unique
+                 } else {
+                     requestId = testRequestId 
+                 }     
+                   
+                 String aicCloudRegion = cloudRegionId
+                 String tenantId = ""
+                 if (utils.nodeExists(requestXML, "tenant-id")) {
+                         tenantId = utils.getNodeText1(requestXML, "tenant-id")
+                 }
+                 String networkType = ""
+                 if (utils.nodeExists(requestXML, "network-type")) {
+                         networkType = utils.getNodeText1(requestXML, "network-type")
+                 }
+                 
+                 String subscriptionServiceType = ""
+                 if (utils.nodeExists(requestXML, "subscription-service-type")) {
+                         subscriptionServiceType = utils.getNodeText1(requestXML, "subscription-service-type")
+                 }
+                 
+                 String globalCustomerId = ""
+                 if (utils.nodeExists(requestXML, "global-customer-id")) {
+                         globalCustomerId = utils.getNodeText1(requestXML, "global-customer-id")
+                 }
+
+                 String serviceId = ""
+                 if (utils.nodeExists(requestXML, "service-id")) {
+                         serviceId = utils.getNodeText1(requestXML, "service-id")
+                 }
+                 String networkName = ""
+                 if (utils.nodeExists(requestXML, "network-name")) {
+                         networkName = utils.getNodeText1(requestXML, "network-name")
+                 }
+                 String source = ""
+                 if (utils.nodeExists(requestXML, "source")) {
+                         source = utils.getNodeText1(requestXML, "source")
+                 }
+                 // get resourceLink from subflow execution variable
+                 String serviceType = ""
+                 String subscriberName = ""
+                 String siRelatedLink = execution.getVariable("GENGSI_siResourceLink")
+                 if (siRelatedLink != null) {
+                         // get service type
+                         int serviceStart = siRelatedLink.indexOf("service-subscription/")
+                         int serviceEnd = siRelatedLink.indexOf("/service-instances/")
+                         serviceType = siRelatedLink.substring(serviceStart + 21, serviceEnd)
+                         serviceType = UriUtils.decode(serviceType,"UTF-8")
+                         // get subscriber name
+                         int subscriberNameStart = siRelatedLink.indexOf("customers/customer/")
+                         int subscriberNameEnd = siRelatedLink.indexOf("/service-subscriptions/")
+                         subscriberName = siRelatedLink.substring(subscriberNameStart + 19, subscriberNameEnd)
+                         subscriberName = UriUtils.decode(subscriberName,"UTF-8")
+                 }
+                 
+                 // network-information from 'networkModelInfo' // verify the DB Catalog response
+                 String networkModelInfo = utils.getNodeXml(requestXML, "networkModelInfo", false).replace("tag0:","").replace(":tag0","")
+                 String modelInvariantUuid = utils.getNodeText1(networkModelInfo, "modelInvariantUuid") !=null ? 
+                                             utils.getNodeText1(networkModelInfo, "modelInvariantUuid") : ""
+                 String modelCustomizationUuid = utils.getNodeText1(networkModelInfo, "modelCustomizationUuid")  !=null ?
+                                                 utils.getNodeText1(networkModelInfo, "modelCustomizationUuid")  : ""
+                 String modelUuid = utils.getNodeText1(networkModelInfo, "modelUuid") !=null ? 
+                                    utils.getNodeText1(networkModelInfo, "modelUuid") : "" 
+                 String modelVersion = utils.getNodeText1(networkModelInfo, "modelVersion") !=null ?
+                                           utils.getNodeText1(networkModelInfo, "modelVersion") : ""
+                 String modelName = utils.getNodeText1(networkModelInfo, "modelName") !=null ?
+                                    utils.getNodeText1(networkModelInfo, "modelName") : ""
+                                                        
+                // service-information from 'networkModelInfo' // verify the DB Catalog response
+                String serviceModelInfo = utils.getNodeXml(requestXML, "serviceModelInfo", false).replace("tag0:","").replace(":tag0","")
+                String serviceModelInvariantUuid = utils.getNodeText1(serviceModelInfo, "modelInvariantUuid")  !=null ?
+                                                                                   utils.getNodeText1(serviceModelInfo, "modelInvariantUuid")  : ""
+                String serviceModelUuid = utils.getNodeText1(serviceModelInfo, "modelUuid") !=null ?
+                                                              utils.getNodeText1(serviceModelInfo, "modelUuid") : ""
+                String serviceModelVersion = utils.getNodeText1(serviceModelInfo, "modelVersion") !=null ?
+                                                                 utils.getNodeText1(serviceModelInfo, "modelVersion") : ""
+                String serviceModelName = utils.getNodeText1(serviceModelInfo, "modelName") !=null ?
+                                                          utils.getNodeText1(serviceModelInfo, "modelName") : ""
+                                                        
+                                                        
+                 String content =
+                 """<aetgt:SDNCAdapterWorkflowRequest xmlns:aetgt="http://openecomp.com/mso/workflow/schema/v1"
+                                                                   xmlns:sdncadapter="http://domain2.openecomp.com/workflow/sdnc/adapter/schema/v1" 
+                                                    xmlns:sdncadapterworkflow="http://openecomp.com/mso/workflow/schema/v1">
+                                          <sdncadapter:RequestHeader>
+                                                 <sdncadapter:RequestId>${requestId}</sdncadapter:RequestId>
+                                                 <sdncadapter:SvcInstanceId>${serviceInstanceId}</sdncadapter:SvcInstanceId>
+                                                 <sdncadapter:SvcAction>${action}</sdncadapter:SvcAction>
+                                                 <sdncadapter:SvcOperation>network-topology-operation</sdncadapter:SvcOperation>
+                                                 <sdncadapter:CallbackUrl>sdncCallback</sdncadapter:CallbackUrl>
+                          <sdncadapter:MsoAction>generic-resource</sdncadapter:MsoAction>
+                                          </sdncadapter:RequestHeader>                            
+                                          <sdncadapterworkflow:SDNCRequestData>
+                                                  <request-information>
+                                                     <request-id>${requestId}</request-id>
+                                                     <request-action>${requestAction}</request-action>
+                                                     <source>${source}</source> 
+                                                     <notification-url></notification-url> 
+                                                     <order-number></order-number>
+                                                     <order-version></order-version>
+                                                  </request-information>
+                                                  <service-information>
+                                                     <service-id>${serviceId}</service-id>
+                                                     <subscription-service-type>${subscriptionServiceType}</subscription-service-type>
+                                                         <ecomp-model-information>
+                                                                  <model-invariant-uuid>${serviceModelInvariantUuid}</model-invariant-uuid>
+                                                                  <model-uuid>${serviceModelUuid}</model-uuid>
+                                                                  <model-version>${serviceModelVersion}</model-version>
+                                                                  <model-name>${serviceModelName}</model-name>
+                              </ecomp-model-information>
+                                                     <service-instance-id>${serviceInstanceId}</service-instance-id>
+                                                     <global-customer-id>${globalCustomerId}</global-customer-id>
+                                                     <subscriber-name>${subscriberName}</subscriber-name>
+                                                  </service-information>
+                                                  <network-information>
+                                                     <network-id>${networkId}</network-id>
+                                                     <network-type>${networkType}</network-type>
+                                                         <ecomp-model-information>
+                                                                  <model-invariant-uuid>${modelInvariantUuid}</model-invariant-uuid>
+                                                                  <model-customization-uuid>${modelCustomizationUuid}</model-customization-uuid>
+                                                                  <model-uuid>${modelUuid}</model-uuid>
+                                                                  <model-version>${modelVersion}</model-version>
+                                                                  <model-name>${modelName}</model-name>
+                                                         </ecomp-model-information>
+                                                  </network-information>
+                                                  <network-request-input>
+                                                    <network-name>${networkName}</network-name> 
+                                                <tenant>${tenantId}</tenant>
+                                                    <aic-cloud-region>${aicCloudRegion}</aic-cloud-region>  
+                                                    <aic-clli></aic-clli> 
+                                                    <network-input-parameters/>
+                                                  </network-request-input>
+                                     </sdncadapterworkflow:SDNCRequestData>
+                   </aetgt:SDNCAdapterWorkflowRequest>""".trim()       
+                                  
+                        return content
+         }
+        
                        /**
                         * Validates a workflow response.
                         * @param execution the execution