3f7ffbf28cd3da7985f4da4fc84b45ed0a342921
[so.git] / bpmn / MSOInfrastructureBPMN / src / main / groovy / org / openecomp / mso / bpmn / infrastructure / scripts / DoDeleteVnfAndModules.groovy
1 /*-
2  * ============LICENSE_START=======================================================
3  * ONAP - SO
4  * ================================================================================
5  * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6  * ================================================================================
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  * 
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  * 
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  * ============LICENSE_END=========================================================
19  */
20 package org.openecomp.mso.bpmn.infrastructure.scripts
21
22 import java.util.UUID;
23
24 import org.json.JSONObject;
25 import org.json.JSONArray;
26 import org.camunda.bpm.engine.delegate.BpmnError
27 import org.camunda.bpm.engine.runtime.Execution;
28
29 import static org.apache.commons.lang3.StringUtils.*;
30
31 import org.openecomp.mso.bpmn.core.json.JsonUtils
32 import org.openecomp.mso.rest.APIResponse
33 import org.openecomp.mso.rest.RESTClient
34 import org.openecomp.mso.rest.RESTConfig
35 import org.openecomp.mso.bpmn.common.scripts.AaiUtil
36 import org.openecomp.mso.bpmn.common.scripts.AbstractServiceTaskProcessor
37 import org.openecomp.mso.bpmn.common.scripts.ExceptionUtil
38 import org.openecomp.mso.bpmn.common.scripts.SDNCAdapterUtils
39 import org.openecomp.mso.bpmn.common.scripts.VidUtils
40 import org.openecomp.mso.bpmn.core.RollbackData
41 import org.openecomp.mso.bpmn.core.WorkflowException
42 import org.springframework.web.util.UriUtils;
43
44 /**
45  * This class supports the macro VID Flow
46  * with the deletion of a generic vnf and related VF modules.
47  */
48 class DoDeleteVnfAndModules extends AbstractServiceTaskProcessor {
49
50         String Prefix="DDVAM_"
51         ExceptionUtil exceptionUtil = new ExceptionUtil()
52         JsonUtils jsonUtil = new JsonUtils()
53         VidUtils vidUtils = new VidUtils(this)
54         SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils(this)
55
56         /**
57          * This method gets and validates the incoming
58          * request.
59          *
60          * @param - execution
61          *      
62          */
63         public void preProcessRequest(Execution execution) {
64                 def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
65                 execution.setVariable("prefix",Prefix)
66                 utils.log("DEBUG", " *** STARTED DoDeleteVnfAndModules PreProcessRequest Process*** ", isDebugEnabled)
67
68                 try{
69                         // Get Variables                                
70                         
71                         String cloudConfiguration = execution.getVariable("cloudConfiguration")         
72                         utils.log("DEBUG", "Cloud Configuration: " + cloudConfiguration, isDebugEnabled)        
73                         
74                         String requestId = execution.getVariable("msoRequestId")
75                         execution.setVariable("requestId", requestId)                   
76                         execution.setVariable("mso-request-id", requestId)
77                         utils.log("DEBUG", "Incoming Request Id is: " + requestId, isDebugEnabled)
78
79                         String serviceInstanceId = execution.getVariable("serviceInstanceId")                   
80                         utils.log("DEBUG", "Incoming Service Instance Id is: " + serviceInstanceId, isDebugEnabled)
81
82                         String vnfId = execution.getVariable("vnfId")                   
83                         utils.log("DEBUG", "Incoming Vnf Id is: " + vnfId, isDebugEnabled)                      
84                         
85                         String source = "VID"
86                         execution.setVariable("DDVAM_source", source)
87                         utils.log("DEBUG", "Incoming Source is: " + source, isDebugEnabled)
88                         
89                         execution.setVariable("DDVAM_isVidRequest", "true")
90                         
91                         String sdncVersion = execution.getVariable("sdncVersion")
92                         if (sdncVersion == null) {
93                                 sdncVersion = "1702"
94                         }
95                         execution.setVariable("DDVAM_sdncVersion", sdncVersion)
96                         utils.log("DEBUG", "Incoming Sdnc Version is: " + sdncVersion, isDebugEnabled)
97                         
98                         String sdncCallbackUrl = (String) execution.getVariable('URN_mso_workflow_sdncadapter_callback')
99                         if (sdncCallbackUrl == null || sdncCallbackUrl.trim().isEmpty()) {
100                                 def msg = 'Required variable \'URN_mso_workflow_sdncadapter_callback\' is missing'
101                                 logError(msg)
102                                 exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg)
103                         }
104                         execution.setVariable("sdncCallbackUrl", sdncCallbackUrl)
105                         utils.logAudit("SDNC Callback URL: " + sdncCallbackUrl)
106                         logDebug("SDNC Callback URL is: " + sdncCallbackUrl, isDebugEnabled)
107                         
108                         if (!sdncVersion.equals("1702")) {
109                                 //String vnfModelInfo = execution.getVariable("vnfModelInfo")
110                                 //String serviceModelInfo = execution.getVariable("serviceModelInfo")
111                                 
112                                 String serviceId = execution.getVariable("productFamilyId")
113                                 execution.setVariable("DDVAM_serviceId", serviceId)
114                                 utils.log("DEBUG", "Incoming Service Id is: " + serviceId, isDebugEnabled)
115                                 
116                                         
117                                 //String modelInvariantId = jsonUtil.getJsonValue(vnfModelInfo, "modelInvariantId")
118                                 //execution.setVariable("DDVAM_modelInvariantId", modelInvariantId)
119                                 //utils.log("DEBUG", "Incoming Invariant Id is: " + modelInvariantId, isDebugEnabled)
120                                 
121                                 //String modelVersionId = jsonUtil.getJsonValue(vnfModelInfo, "modelVersionId")
122                                 //if (modelVersionId == null) {
123                                 //      modelVersionId = ""
124                                 //}
125                                 //execution.setVariable("DDVAM_modelVersionId", modelVersionId)
126                                 //utils.log("DEBUG", "Incoming Version Id is: " + modelVersionId, isDebugEnabled)
127         
128                                 //String modelVersion = jsonUtil.getJsonValue(vnfModelInfo, "modelVersion")
129                                 //execution.setVariable("DDVAM_modelVersion", modelVersion)
130                                 //utils.log("DEBUG", "Incoming Model Version is: " + modelVersion, isDebugEnabled)
131                                 
132                                 //String modelName = jsonUtil.getJsonValue(vnfModelInfo, "modelName")
133                                 //execution.setVariable("DDVAM_modelName", modelName)
134                                 //utils.log("DEBUG", "Incoming Model Name is: " + modelName, isDebugEnabled)
135                                 
136                                 //String modelCustomizationId = jsonUtil.getJsonValue(vnfModelInfo, "modelCustomizationId")
137                                 //if (modelCustomizationId == null) {
138                                 //      modelCustomizationId = ""
139                                 //}
140                                 //execution.setVariable("DDVAM_modelCustomizationId", modelCustomizationId)
141                                 //utils.log("DEBUG", "Incoming Model Customization Id is: " + modelCustomizationId, isDebugEnabled)
142                                         
143                                 String cloudSiteId = execution.getVariable("lcpCloudRegionId")
144                                 execution.setVariable("DDVAM_cloudSiteId", cloudSiteId)
145                                 utils.log("DEBUG", "Incoming Cloud Site Id is: " + cloudSiteId, isDebugEnabled)
146                                         
147                                 String tenantId = execution.getVariable("tenantId")
148                                 execution.setVariable("DDVAM_tenantId", tenantId)
149                                 utils.log("DEBUG", "Incoming Tenant Id is: " + tenantId, isDebugEnabled)
150                                 
151                                 String globalSubscriberId = execution.getVariable("globalSubscriberId")
152                                 if (globalSubscriberId == null) {
153                                         globalSubscriberId = ""
154                                 }
155                                 execution.setVariable("DDVAM_globalSubscriberId", globalSubscriberId)
156                                 utils.log("DEBUG", "Incoming Global Subscriber Id is: " + globalSubscriberId, isDebugEnabled)
157                         }
158                         execution.setVariable("DDVAM_moduleCount", 0)
159                         execution.setVariable("DDVAM_nextModule", 0)
160                         
161                         
162                 }catch(BpmnError b){
163                         utils.log("DEBUG", "Rethrowing MSOWorkflowException", isDebugEnabled)
164                         throw b
165                 }catch(Exception e){
166                         utils.log("DEBUG", " Error Occured in DoCreateVnfAndModules PreProcessRequest method!" + e.getMessage(), isDebugEnabled)
167                         exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "Internal Error - Occured in DoCreateVnf PreProcessRequest")
168
169                 }
170                 utils.log("DEBUG", "*** COMPLETED DoDeleteVnfAndModules PreProcessRequest Process ***", isDebugEnabled)
171         }       
172
173         
174         
175         public void preProcessAddOnModule(Execution execution){
176                 def isDebugLogEnabled = execution.getVariable("isDebugLogEnabled")
177                 execution.setVariable("prefix", Prefix)
178                 logDebug(" ======== STARTED preProcessAddOnModule ======== ", isDebugLogEnabled)
179                 
180                 try {                   
181                         JSONArray addOnModules = (JSONArray) execution.getVariable("addOnModules")
182                         int addOnIndex = (int) execution.getVariable("addOnModulesDeployed")
183                         
184                         JSONObject addOnModule = addOnModules[addOnIndex]
185                         
186                         def newVfModuleId = UUID.randomUUID().toString()
187                         execution.setVariable("addOnVfModuleId", newVfModuleId)
188                         
189                         execution.setVariable("instancesOfThisModelDeployed", 0)
190                         
191                         JSONObject addOnVfModuleModelInfoObject = jsonUtil.getJsonValueForKey(addOnModule, "modelInfo")
192                         String addOnVfModuleModelInfo = addOnVfModuleModelInfoObject.toString()
193                         execution.setVariable("addOnVfModuleModelInfo", addOnVfModuleModelInfo)
194                         String addOnVfModuleLabel = jsonUtil.getJsonValueForKey(addOnModule, "vfModuleLabel")
195                         execution.setVariable("addOnVfModuleLabel", addOnVfModuleLabel)
196                         String addOnPersonaModelId = jsonUtil.getJsonValueForKey(addOnVfModuleModelInfoObject, "modelInvariantUuid")
197                         execution.setVariable("addOnPersonaModelId", addOnPersonaModelId)
198                         String addOnInitialCount = jsonUtil.getJsonValueForKey(addOnModule, "initialCount")
199                         execution.setVariable("initialCount", addOnInitialCount)
200                                         
201                 
202                 }catch(Exception e){
203                         utils.log("ERROR", "Exception Occured Processing preProcessAddOnModule. Exception is:\n" + e, isDebugLogEnabled)
204                         exceptionUtil.buildAndThrowWorkflowException(execution, 1002, "Error Occurred during preProcessAddOnModule Method:\n" + e.getMessage())
205                 }
206                 logDebug("======== COMPLETED preProcessSDNCAssignRequest ======== ", isDebugLogEnabled)
207         }
208         
209         /**
210          * Using the received vnfId and vfModuleId, query AAI to get the corresponding VNF info.
211          * A 200 response is expected with the VNF info in the response body. Will find out the base module info.
212          *
213          * @param execution The flow's execution instance.
214          */
215         public void queryAAIVfModule(Execution execution) {
216                 def isDebugLogEnabled=execution.getVariable("isDebugLogEnabled")
217                 def method = getClass().getSimpleName() + '.queryAAIVfModule(' +
218                         'execution=' + execution.getId() +
219                         ')'
220                 logDebug('Entered ' + method, isDebugLogEnabled)
221
222                 try {
223                         def vnfId = execution.getVariable('vnfId')
224                         
225                         AaiUtil aaiUriUtil = new AaiUtil(this)
226                         String  aai_uri = aaiUriUtil.getNetworkGenericVnfUri(execution)
227                         logDebug('AAI URI is: ' + aai_uri, isDebugLogEnabled)
228
229                         String endPoint = execution.getVariable("URN_aai_endpoint") + "${aai_uri}/" + UriUtils.encode(vnfId, "UTF-8") + "?depth=1"
230                         utils.logAudit("AAI endPoint: " + endPoint)
231
232                         try {
233                                 utils.logAudit("createVfModule - invoking httpGet() to AAI")
234                                 APIResponse response = aaiUriUtil.executeAAIGetCall(execution, endPoint)
235
236                                 def responseData = response.getResponseBodyAsString()
237                                 if (responseData != null) {
238                                         logDebug("Received generic VNF data: " + responseData, isDebugLogEnabled)
239
240                                 }
241
242                                 utils.logAudit("createVfModule - queryAAIVfModule Response: " + responseData)
243                                 utils.logAudit("createVfModule - queryAAIVfModule ResponseCode: " + response.getStatusCode())
244
245                                 execution.setVariable('DCVFM_queryAAIVfModuleResponseCode', response.getStatusCode())
246                                 execution.setVariable('DCVFM_queryAAIVfModuleResponse', responseData)
247                                 logDebug('Response code:' + response.getStatusCode(), isDebugLogEnabled)
248                                 logDebug('Response:' + System.lineSeparator() + responseData, isDebugLogEnabled)
249                                 //Map<String, String>[] vfModules = new HashMap<String,String>[]
250                                 def vfModulesList = new ArrayList<Map<String,String>>()
251                                 def vfModules = null
252                                 def vfModuleBaseEntry = null
253                                 if (response.getStatusCode() == 200) {
254                                         // Parse the VNF record from A&AI to find base module info
255                                         logDebug('Parsing the VNF data to find base module info', isDebugLogEnabled)
256                                         if (responseData != null) {
257                                                 def vfModulesText = utils.getNodeXml(responseData, "vf-modules")
258                                                 logDebug("vModulesText: " + vfModulesText, isDebugLogEnabled)
259                                                 if (vfModulesText != null && !vfModulesText.trim().isEmpty()) {
260                                                         def xmlVfModules= new XmlSlurper().parseText(vfModulesText)
261                                                         vfModules = xmlVfModules.'**'.findAll {it.name() == "vf-module"}
262                                                         execution.setVariable("DDVAM_moduleCount", vfModules.size())
263                                                         int vfModulesSize = 0
264                                                         for (i in 0..vfModules.size()-1) {
265                                                                 def vfModuleXml = groovy.xml.XmlUtil.serialize(vfModules[i])
266                                                         
267                                                                 Map<String, String> vfModuleEntry = new HashMap<String, String>()
268                                                                 def vfModuleId = utils.getNodeText1(vfModuleXml, "vf-module-id")
269                                                                 vfModuleEntry.put("vfModuleId", vfModuleId)
270                                                                 def vfModuleName = utils.getNodeText1(vfModuleXml, "vf-module-name")
271                                                                 vfModuleEntry.put("vfModuleName", vfModuleName)
272                                                                 
273                                                                 def isBaseVfModule = utils.getNodeText(vfModuleXml, "is-base-vf-module")
274                                                                 // Save base vf module for last
275                                                                 if (isBaseVfModule == "true") {
276                                                                         vfModuleBaseEntry = vfModuleEntry
277                                                                 }
278                                                                 else {                                          
279                                                                         vfModulesList.add(vfModuleEntry)
280                                                                 }
281                                                         }
282                                                         if (vfModuleBaseEntry != null) {
283                                                                 vfModulesList.add(vfModuleBaseEntry)
284                                                         }                                       
285                                                 }
286                                                 
287                                         }                                       
288                                 }
289                                 execution.setVariable("DDVAM_vfModules", vfModulesList)
290                         } catch (Exception ex) {
291                                 ex.printStackTrace()
292                                 logDebug('Exception occurred while executing AAI GET:' + ex.getMessage(),isDebugLogEnabled)
293                                 exceptionUtil.buildAndThrowWorkflowException(execution, 1002, 'AAI GET Failed:' + ex.getMessage())
294                         }
295                         logDebug('Exited ' + method, isDebugLogEnabled)
296                 } catch (BpmnError e) {
297                         throw e;
298                 } catch (Exception e) {
299                         logError('Caught exception in ' + method, e)
300                         exceptionUtil.buildAndThrowWorkflowException(execution, 1002, 'Error in queryAAIVfModule(): ' + e.getMessage())
301                 }
302         }
303         
304         public void prepareNextModuleToDelete(Execution execution){
305                 def isDebugLogEnabled = execution.getVariable("isDebugLogEnabled")
306                 execution.setVariable("prefix", Prefix)
307                 logDebug(" ======== STARTED prepareNextModuleToDelete ======== ", isDebugLogEnabled)
308                 
309                 try {
310                         int i = execution.getVariable("DDVAM_nextModule")
311                         def vfModules = execution.getVariable("DDVAM_vfModules")
312                         def vfModule = vfModules[i]
313                         
314                         def vfModuleId = vfModule.get("vfModuleId")
315                         execution.setVariable("DDVAM_vfModuleId", vfModuleId)
316                         
317                         def vfModuleName = vfModule.get("vfModuleName")
318                         execution.setVariable("DDVAM_vfModuleName", vfModuleName)
319                         
320                         
321                         // HARDCODED FOR NOW
322                         def vfModuleModelInfo = ""
323                         execution.setVariable("DDVAM_vfModuleModelInfo", vfModuleModelInfo)                     
324                         
325                 }catch(Exception e){
326                         utils.log("ERROR", "Exception Occured Processing preProcessAddOnModule. Exception is:\n" + e, isDebugLogEnabled)
327                         exceptionUtil.buildAndThrowWorkflowException(execution, 1002, "Error Occurred during prepareNextModuleToDelete Method:\n" + e.getMessage())
328                 }
329                 logDebug("======== COMPLETED prepareNextModuleToDelete ======== ", isDebugLogEnabled)
330         }
331         
332         public void preProcessSDNCDeactivateRequest(Execution execution){
333                 def isDebugLogEnabled = execution.getVariable("isDebugLogEnabled")
334                 execution.setVariable("prefix", Prefix)
335                 logDebug(" ======== STARTED preProcessSDNCDeactivateRequest ======== ", isDebugLogEnabled)
336                 def vnfId = execution.getVariable("vnfId")
337                 def serviceInstanceId = execution.getVariable("serviceInstanceId")              
338
339                 try{
340                         //Build SDNC Request
341                         
342                         String deactivateSDNCRequest = buildSDNCRequest(execution, serviceInstanceId, "deactivate")
343
344                         deactivateSDNCRequest = utils.formatXml(deactivateSDNCRequest)
345                         execution.setVariable("DDVAM_deactivateSDNCRequest", deactivateSDNCRequest)
346                         logDebug("Outgoing DeactivateSDNCRequest is: \n" + deactivateSDNCRequest, isDebugLogEnabled)
347                         utils.logAudit("Outgoing DeactivateSDNCRequest is: \n" + deactivateSDNCRequest)
348
349                 }catch(Exception e){
350                         utils.log("ERROR", "Exception Occured Processing preProcessSDNCDeactivateRequest. Exception is:\n" + e, isDebugLogEnabled)
351                         exceptionUtil.buildAndThrowWorkflowException(execution, 1002, "Error Occurred during preProcessSDNCDeactivateRequest Method:\n" + e.getMessage())
352                 }
353                 logDebug("======== COMPLETED preProcessSDNCDeactivateRequest ======== ", isDebugLogEnabled)
354         }
355         
356         public void preProcessSDNCUnassignRequest(Execution execution) {
357                 def method = getClass().getSimpleName() + '.preProcessSDNCUnassignRequest(' +
358                         'execution=' + execution.getId() +
359                         ')'
360                 def isDebugLogEnabled = execution.getVariable('isDebugLogEnabled')
361                 logDebug('Entered ' + method, isDebugLogEnabled)
362                 execution.setVariable("prefix", Prefix)
363                 logDebug(" ======== STARTED preProcessSDNCUnassignRequest Process ======== ", isDebugLogEnabled)
364                 try{
365                         String vnfId = execution.getVariable("vnfId")
366                         String serviceInstanceId = execution.getVariable("serviceInstanceId")
367
368                         String unassignSDNCRequest = buildSDNCRequest(execution, serviceInstanceId, "unassign")
369
370                         execution.setVariable("DDVAM_unassignSDNCRequest", unassignSDNCRequest)
371                         logDebug("Outgoing UnassignSDNCRequest is: \n" + unassignSDNCRequest, isDebugLogEnabled)
372                         utils.logAudit("Outgoing UnassignSDNCRequest is: \n"  + unassignSDNCRequest)
373
374                 }catch(Exception e){
375                         log.debug("Exception Occured Processing preProcessSDNCUnassignRequest. Exception is:\n" + e, isDebugLogEnabled)
376                         exceptionUtil.buildAndThrowWorkflowException(execution, 1002, "Error Occured during  preProcessSDNCUnassignRequest Method:\n" + e.getMessage())
377                 }
378                 logDebug("======== COMPLETED  preProcessSDNCUnassignRequest Process ======== ", isDebugLogEnabled)
379         }
380         
381         public String buildSDNCRequest(Execution execution, String svcInstId, String action){
382                 
383                                 String uuid = execution.getVariable('testReqId') // for junits
384                                 if(uuid==null){
385                                         uuid = execution.getVariable("msoRequestId") + "-" +    System.currentTimeMillis()
386                                 }
387                                 def callbackURL = execution.getVariable("sdncCallbackUrl")
388                                 def requestId = execution.getVariable("msoRequestId")
389                                 def serviceId = execution.getVariable("DDVAM_serviceId")                                
390                                 def tenantId = execution.getVariable("DDVAM_tenantId")
391                                 def source = execution.getVariable("DDVAM_source")
392                                 def vnfId = execution.getVariable("vnfId")
393                                 def serviceInstanceId = execution.getVariable("serviceInstanceId")
394                                 def cloudSiteId = execution.getVariable("DDVAM_cloudSiteId")                            
395                                 def modelCustomizationId = execution.getVariable("DDVAM_modelCustomizationId")                          
396                                 //def serviceModelInfo = execution.getVariable("serviceModelInfo")
397                                 //def vnfModelInfo = execution.getVariable("vnfModelInfo")
398                                 //String serviceEcompModelInformation = sdncAdapterUtils.modelInfoToEcompModelInformation(serviceModelInfo)
399                                 //String vnfEcompModelInformation = sdncAdapterUtils.modelInfoToEcompModelInformation(vnfModelInfo)                             
400                                 def globalSubscriberId = execution.getVariable("DDVAM_globalSubscriberId")
401                                 def sdncVersion = execution.getVariable("DDVAM_sdncVersion")                                            
402                                 
403                                 String sdncRequest =
404                                 """<sdncadapterworkflow:SDNCAdapterWorkflowRequest xmlns:ns5="http://org.openecomp/mso/request/types/v1"
405                                                                                                         xmlns:sdncadapterworkflow="http://org.openecomp/mso/workflow/schema/v1"
406                                                                                                         xmlns:sdncadapter="http://org.openecomp/workflow/sdnc/adapter/schema/v1">
407            <sdncadapter:RequestHeader>
408                                 <sdncadapter:RequestId>${uuid}</sdncadapter:RequestId>
409                                 <sdncadapter:SvcInstanceId>${svcInstId}</sdncadapter:SvcInstanceId>
410                                 <sdncadapter:SvcAction>${action}</sdncadapter:SvcAction>
411                                 <sdncadapter:SvcOperation>vnf-topology-operation</sdncadapter:SvcOperation>
412                                 <sdncadapter:CallbackUrl>${callbackURL}</sdncadapter:CallbackUrl>
413                                 <sdncadapter:MsoAction>generic-resource</sdncadapter:MsoAction>
414                 </sdncadapter:RequestHeader>
415         <sdncadapterworkflow:SDNCRequestData>
416                 <request-information>
417                         <request-id>${requestId}</request-id>
418                         <request-action>DeleteVnfInstance</request-action>
419                         <source>${source}</source>
420                         <notification-url/>
421                         <order-number/>
422                         <order-version/>
423                 </request-information>
424                 <service-information>
425                         <service-id/>
426                         <subscription-service-type/>                    
427                         <service-instance-id>${serviceInstanceId}</service-instance-id>
428                         <global-customer-id/>
429                 </service-information>
430                 <vnf-information>
431                         <vnf-id>${vnfId}</vnf-id>
432                         <vnf-type/>                     
433                 </vnf-information>
434                 <vnf-request-input>                     
435                         <vnf-name/>
436                         <tenant>${tenantId}</tenant>
437                         <aic-cloud-region>${cloudSiteId}</aic-cloud-region>                     
438                 </vnf-request-input>
439         </sdncadapterworkflow:SDNCRequestData>
440         </sdncadapterworkflow:SDNCAdapterWorkflowRequest>"""
441                 
442                         utils.logAudit("sdncRequest:  " + sdncRequest)
443                         return sdncRequest
444         }
445                 
446         public void validateSDNCResponse(Execution execution, String response, String method){
447                 def isDebugLogEnabled=execution.getVariable("isDebugLogEnabled")
448                 execution.setVariable("prefix",Prefix)
449                 logDebug(" *** STARTED ValidateSDNCResponse Process*** ", isDebugLogEnabled)
450
451                 WorkflowException workflowException = execution.getVariable("WorkflowException")
452                 boolean successIndicator = execution.getVariable("SDNCA_SuccessIndicator")
453
454                 utils.logAudit("workflowException: " + workflowException)
455
456                 SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils(this)
457                 sdncAdapterUtils.validateSDNCResponse(execution, response, workflowException, successIndicator)
458
459                 utils.logAudit("SDNCResponse: " + response)
460
461                 String sdncResponse = response
462                 if(execution.getVariable(Prefix + 'sdncResponseSuccess') == true){
463                         logDebug("Received a Good Response from SDNC Adapter for " + method + " SDNC Call.  Response is: \n" + sdncResponse, isDebugLogEnabled)                 
464                 }else{
465                         logDebug("Received a BAD Response from SDNC Adapter for " + method + " SDNC Call.", isDebugLogEnabled)
466                         throw new BpmnError("MSOWorkflowException")
467                 }
468                 logDebug(" *** COMPLETED ValidateSDNCResponse Process*** ", isDebugLogEnabled)
469         }
470         
471         
472         
473         
474         
475         
476         
477 }