2 * ============LICENSE_START=======================================================
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
11 * http://www.apache.org/licenses/LICENSE-2.0
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=========================================================
20 package org.openecomp.mso.bpmn.infrastructure.scripts
22 import java.awt.Component.BaselineResizeBehavior
23 import java.util.UUID;
25 import org.json.JSONObject;
26 import org.json.JSONArray;
27 import org.camunda.bpm.engine.delegate.BpmnError
28 import org.camunda.bpm.engine.delegate.DelegateExecution;
30 import static org.apache.commons.lang3.StringUtils.*;
32 import org.openecomp.mso.bpmn.core.json.JsonUtils
33 import org.openecomp.mso.rest.APIResponse
34 import org.openecomp.mso.rest.RESTClient
35 import org.openecomp.mso.rest.RESTConfig
36 import org.openecomp.mso.bpmn.common.scripts.AaiUtil
37 import org.openecomp.mso.bpmn.common.scripts.AbstractServiceTaskProcessor
38 import org.openecomp.mso.bpmn.common.scripts.ExceptionUtil
39 import org.openecomp.mso.bpmn.common.scripts.SDNCAdapterUtils
40 import org.openecomp.mso.bpmn.common.scripts.VidUtils
41 import org.openecomp.mso.bpmn.core.domain.ModelInfo
42 import org.openecomp.mso.bpmn.core.domain.ModuleResource
43 import org.openecomp.mso.bpmn.core.domain.ServiceDecomposition
44 import org.openecomp.mso.bpmn.core.domain.VnfResource
45 import org.openecomp.mso.bpmn.core.RollbackData
46 import org.openecomp.mso.bpmn.core.WorkflowException
47 import org.springframework.web.util.UriUtils;
50 * This class supports the macro VID Flow
51 * with the deletion of a generic vnf and related VF modules.
53 class DoDeleteVnfAndModules extends AbstractServiceTaskProcessor {
55 String Prefix="DDVAM_"
56 ExceptionUtil exceptionUtil = new ExceptionUtil()
57 JsonUtils jsonUtil = new JsonUtils()
58 VidUtils vidUtils = new VidUtils(this)
59 SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils(this)
62 * This method gets and validates the incoming
68 public void preProcessRequest(DelegateExecution execution) {
69 def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
70 execution.setVariable("prefix",Prefix)
71 utils.log("DEBUG", " *** STARTED DoDeleteVnfAndModules PreProcessRequest Process*** ", isDebugEnabled)
76 String cloudConfiguration = execution.getVariable("cloudConfiguration")
77 utils.log("DEBUG", "Cloud Configuration: " + cloudConfiguration, isDebugEnabled)
79 String requestId = execution.getVariable("msoRequestId")
80 execution.setVariable("requestId", requestId)
81 execution.setVariable("mso-request-id", requestId)
82 utils.log("DEBUG", "Incoming Request Id is: " + requestId, isDebugEnabled)
84 String serviceInstanceId = execution.getVariable("serviceInstanceId")
85 utils.log("DEBUG", "Incoming Service Instance Id is: " + serviceInstanceId, isDebugEnabled)
87 String vnfId = execution.getVariable("vnfId")
88 utils.log("DEBUG", "Incoming Vnf Id is: " + vnfId, isDebugEnabled)
91 execution.setVariable("DDVAM_source", source)
92 utils.log("DEBUG", "Incoming Source is: " + source, isDebugEnabled)
94 execution.setVariable("DDVAM_isVidRequest", "true")
96 String sdncVersion = execution.getVariable("sdncVersion")
97 if (sdncVersion == null) {
100 execution.setVariable("DDVAM_sdncVersion", sdncVersion)
101 utils.log("DEBUG", "Incoming Sdnc Version is: " + sdncVersion, isDebugEnabled)
103 // Set aLaCarte flag to false
104 execution.setVariable("aLaCarte", false)
106 String sdncCallbackUrl = (String) execution.getVariable('URN_mso_workflow_sdncadapter_callback')
107 if (sdncCallbackUrl == null || sdncCallbackUrl.trim().isEmpty()) {
108 def msg = 'Required variable \'URN_mso_workflow_sdncadapter_callback\' is missing'
110 exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg)
112 execution.setVariable("sdncCallbackUrl", sdncCallbackUrl)
113 utils.logAudit("SDNC Callback URL: " + sdncCallbackUrl)
114 logDebug("SDNC Callback URL is: " + sdncCallbackUrl, isDebugEnabled)
117 if (!sdncVersion.equals("1702")) {
118 //String vnfModelInfo = execution.getVariable("vnfModelInfo")
119 //String serviceModelInfo = execution.getVariable("serviceModelInfo")
121 String serviceId = execution.getVariable("productFamilyId")
122 execution.setVariable("DDVAM_serviceId", serviceId)
123 utils.log("DEBUG", "Incoming Service Id is: " + serviceId, isDebugEnabled)
126 //String modelInvariantId = jsonUtil.getJsonValue(vnfModelInfo, "modelInvariantId")
127 //execution.setVariable("DDVAM_modelInvariantId", modelInvariantId)
128 //utils.log("DEBUG", "Incoming Invariant Id is: " + modelInvariantId, isDebugEnabled)
130 //String modelVersionId = jsonUtil.getJsonValue(vnfModelInfo, "modelVersionId")
131 //if (modelVersionId == null) {
132 // modelVersionId = ""
134 //execution.setVariable("DDVAM_modelVersionId", modelVersionId)
135 //utils.log("DEBUG", "Incoming Version Id is: " + modelVersionId, isDebugEnabled)
137 //String modelVersion = jsonUtil.getJsonValue(vnfModelInfo, "modelVersion")
138 //execution.setVariable("DDVAM_modelVersion", modelVersion)
139 //utils.log("DEBUG", "Incoming Model Version is: " + modelVersion, isDebugEnabled)
141 //String modelName = jsonUtil.getJsonValue(vnfModelInfo, "modelName")
142 //execution.setVariable("DDVAM_modelName", modelName)
143 //utils.log("DEBUG", "Incoming Model Name is: " + modelName, isDebugEnabled)
145 //String modelCustomizationId = jsonUtil.getJsonValue(vnfModelInfo, "modelCustomizationId")
146 //if (modelCustomizationId == null) {
147 // modelCustomizationId = ""
149 //execution.setVariable("DDVAM_modelCustomizationId", modelCustomizationId)
150 //utils.log("DEBUG", "Incoming Model Customization Id is: " + modelCustomizationId, isDebugEnabled)
152 String cloudSiteId = execution.getVariable("lcpCloudRegionId")
153 execution.setVariable("DDVAM_cloudSiteId", cloudSiteId)
154 utils.log("DEBUG", "Incoming Cloud Site Id is: " + cloudSiteId, isDebugEnabled)
156 String tenantId = execution.getVariable("tenantId")
157 execution.setVariable("DDVAM_tenantId", tenantId)
158 utils.log("DEBUG", "Incoming Tenant Id is: " + tenantId, isDebugEnabled)
160 String globalSubscriberId = execution.getVariable("globalSubscriberId")
161 if (globalSubscriberId == null) {
162 globalSubscriberId = ""
164 execution.setVariable("DDVAM_globalSubscriberId", globalSubscriberId)
165 utils.log("DEBUG", "Incoming Global Subscriber Id is: " + globalSubscriberId, isDebugEnabled)
168 execution.setVariable("DDVAM_vfModulesFromDecomposition", null)
169 // Retrieve serviceDecomposition if present
170 ServiceDecomposition serviceDecomposition = execution.getVariable("serviceDecomposition")
171 if (serviceDecomposition != null) {
172 utils.log("DEBUG", "Getting Catalog DB data from ServiceDecomposition object: " + serviceDecomposition.toJsonString(), isDebugEnabled)
173 List<VnfResource> vnfs = serviceDecomposition.getServiceVnfs()
174 utils.log("DEBUG", "Read vnfs", isDebugEnabled)
176 utils.log("DEBUG", "Error - vnfs are empty in serviceDecomposition object", isDebugEnabled)
177 exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "Internal Error - Occured in preProcessRequest - vnfs are empty")
179 VnfResource vnf = vnfs[0]
182 utils.log("DEBUG", "Error - vnf is empty in serviceDecomposition object", isDebugEnabled)
183 exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "Internal Error - Occured in preProcessRequest - vnf is empty")
186 List<ModuleResource> vfModules = vnf.getAllVfModuleObjects()
188 execution.setVariable("DDVAM_vfModulesFromDecomposition", vfModules)
191 execution.setVariable("DDVAM_moduleCount", 0)
192 execution.setVariable("DDVAM_nextModule", 0)
196 utils.log("DEBUG", "Rethrowing MSOWorkflowException", isDebugEnabled)
199 utils.log("DEBUG", " Error Occured in DoCreateVnfAndModules PreProcessRequest method!" + e.getMessage(), isDebugEnabled)
200 exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "Internal Error - Occured in DoCreateVnf PreProcessRequest")
203 utils.log("DEBUG", "*** COMPLETED DoDeleteVnfAndModules PreProcessRequest Process ***", isDebugEnabled)
208 public void preProcessAddOnModule(DelegateExecution execution){
209 def isDebugLogEnabled = execution.getVariable("isDebugLogEnabled")
210 execution.setVariable("prefix", Prefix)
211 logDebug(" ======== STARTED preProcessAddOnModule ======== ", isDebugLogEnabled)
214 JSONArray addOnModules = (JSONArray) execution.getVariable("addOnModules")
215 int addOnIndex = (int) execution.getVariable("addOnModulesDeployed")
217 JSONObject addOnModule = addOnModules[addOnIndex]
219 def newVfModuleId = UUID.randomUUID().toString()
220 execution.setVariable("addOnVfModuleId", newVfModuleId)
222 execution.setVariable("instancesOfThisModelDeployed", 0)
224 JSONObject addOnVfModuleModelInfoObject = jsonUtil.getJsonValueForKey(addOnModule, "modelInfo")
225 String addOnVfModuleModelInfo = addOnVfModuleModelInfoObject.toString()
226 execution.setVariable("addOnVfModuleModelInfo", addOnVfModuleModelInfo)
227 String addOnVfModuleLabel = jsonUtil.getJsonValueForKey(addOnModule, "vfModuleLabel")
228 execution.setVariable("addOnVfModuleLabel", addOnVfModuleLabel)
229 String addOnPersonaModelId = jsonUtil.getJsonValueForKey(addOnVfModuleModelInfoObject, "modelInvariantUuid")
230 execution.setVariable("addOnPersonaModelId", addOnPersonaModelId)
231 String addOnInitialCount = jsonUtil.getJsonValueForKey(addOnModule, "initialCount")
232 execution.setVariable("initialCount", addOnInitialCount)
236 utils.log("ERROR", "Exception Occured Processing preProcessAddOnModule. Exception is:\n" + e, isDebugLogEnabled)
237 exceptionUtil.buildAndThrowWorkflowException(execution, 1002, "Error Occurred during preProcessAddOnModule Method:\n" + e.getMessage())
239 logDebug("======== COMPLETED preProcessSDNCAssignRequest ======== ", isDebugLogEnabled)
243 * Using the received vnfId and vfModuleId, query AAI to get the corresponding VNF info.
244 * A 200 response is expected with the VNF info in the response body. Will find out the base module info.
246 * @param execution The flow's execution instance.
248 public void queryAAIVfModule(DelegateExecution execution) {
249 def isDebugLogEnabled=execution.getVariable("isDebugLogEnabled")
250 def method = getClass().getSimpleName() + '.queryAAIVfModule(' +
251 'execution=' + execution.getId() +
253 logDebug('Entered ' + method, isDebugLogEnabled)
256 def vnfId = execution.getVariable('vnfId')
258 AaiUtil aaiUriUtil = new AaiUtil(this)
259 String aai_uri = aaiUriUtil.getNetworkGenericVnfUri(execution)
260 logDebug('AAI URI is: ' + aai_uri, isDebugLogEnabled)
262 String endPoint = execution.getVariable("URN_aai_endpoint") + "${aai_uri}/" + UriUtils.encode(vnfId, "UTF-8") + "?depth=1"
263 utils.logAudit("AAI endPoint: " + endPoint)
266 utils.logAudit("createVfModule - invoking httpGet() to AAI")
267 APIResponse response = aaiUriUtil.executeAAIGetCall(execution, endPoint)
269 def responseData = response.getResponseBodyAsString()
270 if (responseData != null) {
271 logDebug("Received generic VNF data: " + responseData, isDebugLogEnabled)
275 utils.logAudit("createVfModule - queryAAIVfModule Response: " + responseData)
276 utils.logAudit("createVfModule - queryAAIVfModule ResponseCode: " + response.getStatusCode())
278 execution.setVariable('DCVFM_queryAAIVfModuleResponseCode', response.getStatusCode())
279 execution.setVariable('DCVFM_queryAAIVfModuleResponse', responseData)
280 logDebug('Response code:' + response.getStatusCode(), isDebugLogEnabled)
281 logDebug('Response:' + System.lineSeparator() + responseData, isDebugLogEnabled)
282 //Map<String, String>[] vfModules = new HashMap<String,String>[]
283 List<ModuleResource> vfModulesFromDecomposition = execution.getVariable("DDVAM_vfModulesFromDecomposition")
284 def vfModulesList = new ArrayList<Map<String,String>>()
286 def vfModuleBaseEntry = null
287 if (response.getStatusCode() == 200) {
288 // Parse the VNF record from A&AI to find base module info
289 logDebug('Parsing the VNF data to find base module info', isDebugLogEnabled)
290 if (responseData != null) {
291 def vfModulesText = utils.getNodeXml(responseData, "vf-modules")
292 logDebug("vModulesText: " + vfModulesText, isDebugLogEnabled)
293 if (vfModulesText != null && !vfModulesText.trim().isEmpty()) {
294 def xmlVfModules= new XmlSlurper().parseText(vfModulesText)
295 vfModules = xmlVfModules.'**'.findAll {it.name() == "vf-module"}
296 execution.setVariable("DDVAM_moduleCount", vfModules.size())
297 int vfModulesSize = 0
298 ModelInfo vfModuleModelInfo = null
299 for (i in 0..vfModules.size()-1) {
300 def vfModuleXml = groovy.xml.XmlUtil.serialize(vfModules[i])
302 Map<String, String> vfModuleEntry = new HashMap<String, String>()
303 def vfModuleId = utils.getNodeText1(vfModuleXml, "vf-module-id")
304 vfModuleEntry.put("vfModuleId", vfModuleId)
305 def vfModuleName = utils.getNodeText1(vfModuleXml, "vf-module-name")
306 vfModuleEntry.put("vfModuleName", vfModuleName)
308 // Find the model for this vf module in decomposition if specified
309 if (vfModulesFromDecomposition != null) {
310 logDebug("vfModulesFromDecomposition is not null", isDebugLogEnabled)
311 def vfModuleUuid = utils.getNodeText1(vfModuleXml, "model-version-id")
312 if (vfModuleUuid == null) {
313 vfModuleUuid = utils.getNodeText1(vfModuleXml, "persona-model-version")
315 logDebug("vfModule UUID is: " + vfModuleUuid, isDebugLogEnabled)
316 for (j in 0..vfModulesFromDecomposition.size()-1) {
317 ModuleResource mr = vfModulesFromDecomposition[j]
318 if (mr.getModelInfo().getModelUuid() == vfModuleUuid) {
319 logDebug("Found modelInfo", isDebugLogEnabled)
320 vfModuleModelInfo = mr.getModelInfo()
326 if (vfModuleModelInfo != null) {
327 String vfModuleModelInfoString = vfModuleModelInfo.toString()
328 def vfModuleModelInfoValue = jsonUtil.getJsonValue(vfModuleModelInfoString, "modelInfo")
329 vfModuleEntry.put("vfModuleModelInfo", vfModuleModelInfoValue)
332 vfModuleEntry.put("vfModuleModelInfo", null)
336 def isBaseVfModule = utils.getNodeText(vfModuleXml, "is-base-vf-module")
337 // Save base vf module for last
338 if (isBaseVfModule == "true") {
339 vfModuleBaseEntry = vfModuleEntry
342 vfModulesList.add(vfModuleEntry)
345 if (vfModuleBaseEntry != null) {
346 vfModulesList.add(vfModuleBaseEntry)
352 execution.setVariable("DDVAM_vfModules", vfModulesList)
353 } catch (Exception ex) {
355 logDebug('Exception occurred while executing AAI GET:' + ex.getMessage(),isDebugLogEnabled)
356 exceptionUtil.buildAndThrowWorkflowException(execution, 1002, 'AAI GET Failed:' + ex.getMessage())
358 logDebug('Exited ' + method, isDebugLogEnabled)
359 } catch (BpmnError e) {
361 } catch (Exception e) {
362 logError('Caught exception in ' + method, e)
363 exceptionUtil.buildAndThrowWorkflowException(execution, 1002, 'Error in queryAAIVfModule(): ' + e.getMessage())
367 public void prepareNextModuleToDelete(DelegateExecution execution){
368 def isDebugLogEnabled = execution.getVariable("isDebugLogEnabled")
369 execution.setVariable("prefix", Prefix)
370 logDebug(" ======== STARTED prepareNextModuleToDelete ======== ", isDebugLogEnabled)
373 int i = execution.getVariable("DDVAM_nextModule")
374 def vfModules = execution.getVariable("DDVAM_vfModules")
375 def vfModule = vfModules[i]
377 def vfModuleId = vfModule.get("vfModuleId")
378 execution.setVariable("DDVAM_vfModuleId", vfModuleId)
380 def vfModuleName = vfModule.get("vfModuleName")
381 execution.setVariable("DDVAM_vfModuleName", vfModuleName)
383 def vfModuleModelInfo = vfModule.get("vfModuleModelInfo")
384 logDebug("vfModuleModelInfo for module delete: " + vfModuleModelInfo, isDebugLogEnabled)
385 execution.setVariable("DDVAM_vfModuleModelInfo", vfModuleModelInfo)
388 utils.log("ERROR", "Exception Occured Processing preProcessAddOnModule. Exception is:\n" + e, isDebugLogEnabled)
389 exceptionUtil.buildAndThrowWorkflowException(execution, 1002, "Error Occurred during prepareNextModuleToDelete Method:\n" + e.getMessage())
391 logDebug("======== COMPLETED prepareNextModuleToDelete ======== ", isDebugLogEnabled)
394 public void preProcessSDNCDeactivateRequest(DelegateExecution execution){
395 def isDebugLogEnabled = execution.getVariable("isDebugLogEnabled")
396 execution.setVariable("prefix", Prefix)
397 logDebug(" ======== STARTED preProcessSDNCDeactivateRequest ======== ", isDebugLogEnabled)
398 def vnfId = execution.getVariable("vnfId")
399 def serviceInstanceId = execution.getVariable("serviceInstanceId")
404 String deactivateSDNCRequest = buildSDNCRequest(execution, serviceInstanceId, "deactivate")
406 deactivateSDNCRequest = utils.formatXml(deactivateSDNCRequest)
407 execution.setVariable("DDVAM_deactivateSDNCRequest", deactivateSDNCRequest)
408 logDebug("Outgoing DeactivateSDNCRequest is: \n" + deactivateSDNCRequest, isDebugLogEnabled)
409 utils.logAudit("Outgoing DeactivateSDNCRequest is: \n" + deactivateSDNCRequest)
412 utils.log("ERROR", "Exception Occured Processing preProcessSDNCDeactivateRequest. Exception is:\n" + e, isDebugLogEnabled)
413 exceptionUtil.buildAndThrowWorkflowException(execution, 1002, "Error Occurred during preProcessSDNCDeactivateRequest Method:\n" + e.getMessage())
415 logDebug("======== COMPLETED preProcessSDNCDeactivateRequest ======== ", isDebugLogEnabled)
418 public void preProcessSDNCUnassignRequest(DelegateExecution execution) {
419 def method = getClass().getSimpleName() + '.preProcessSDNCUnassignRequest(' +
420 'execution=' + execution.getId() +
422 def isDebugLogEnabled = execution.getVariable('isDebugLogEnabled')
423 logDebug('Entered ' + method, isDebugLogEnabled)
424 execution.setVariable("prefix", Prefix)
425 logDebug(" ======== STARTED preProcessSDNCUnassignRequest Process ======== ", isDebugLogEnabled)
427 String vnfId = execution.getVariable("vnfId")
428 String serviceInstanceId = execution.getVariable("serviceInstanceId")
430 String unassignSDNCRequest = buildSDNCRequest(execution, serviceInstanceId, "unassign")
432 execution.setVariable("DDVAM_unassignSDNCRequest", unassignSDNCRequest)
433 logDebug("Outgoing UnassignSDNCRequest is: \n" + unassignSDNCRequest, isDebugLogEnabled)
434 utils.logAudit("Outgoing UnassignSDNCRequest is: \n" + unassignSDNCRequest)
437 log.debug("Exception Occured Processing preProcessSDNCUnassignRequest. Exception is:\n" + e, isDebugLogEnabled)
438 exceptionUtil.buildAndThrowWorkflowException(execution, 1002, "Error Occured during preProcessSDNCUnassignRequest Method:\n" + e.getMessage())
440 logDebug("======== COMPLETED preProcessSDNCUnassignRequest Process ======== ", isDebugLogEnabled)
443 public String buildSDNCRequest(DelegateExecution execution, String svcInstId, String action){
445 String uuid = execution.getVariable('testReqId') // for junits
447 uuid = execution.getVariable("msoRequestId") + "-" + System.currentTimeMillis()
449 def callbackURL = execution.getVariable("sdncCallbackUrl")
450 def requestId = execution.getVariable("msoRequestId")
451 def serviceId = execution.getVariable("DDVAM_serviceId")
452 def tenantId = execution.getVariable("DDVAM_tenantId")
453 def source = execution.getVariable("DDVAM_source")
454 def vnfId = execution.getVariable("vnfId")
455 def serviceInstanceId = execution.getVariable("serviceInstanceId")
456 def cloudSiteId = execution.getVariable("DDVAM_cloudSiteId")
457 def modelCustomizationId = execution.getVariable("DDVAM_modelCustomizationId")
458 //def serviceModelInfo = execution.getVariable("serviceModelInfo")
459 //def vnfModelInfo = execution.getVariable("vnfModelInfo")
460 //String serviceEcompModelInformation = sdncAdapterUtils.modelInfoToEcompModelInformation(serviceModelInfo)
461 //String vnfEcompModelInformation = sdncAdapterUtils.modelInfoToEcompModelInformation(vnfModelInfo)
462 def globalSubscriberId = execution.getVariable("DDVAM_globalSubscriberId")
463 def sdncVersion = execution.getVariable("DDVAM_sdncVersion")
466 """<sdncadapterworkflow:SDNCAdapterWorkflowRequest xmlns:ns5="http://org.openecomp/mso/request/types/v1"
467 xmlns:sdncadapterworkflow="http://org.openecomp/mso/workflow/schema/v1"
468 xmlns:sdncadapter="http://org.openecomp/workflow/sdnc/adapter/schema/v1">
469 <sdncadapter:RequestHeader>
470 <sdncadapter:RequestId>${uuid}</sdncadapter:RequestId>
471 <sdncadapter:SvcInstanceId>${svcInstId}</sdncadapter:SvcInstanceId>
472 <sdncadapter:SvcAction>${action}</sdncadapter:SvcAction>
473 <sdncadapter:SvcOperation>vnf-topology-operation</sdncadapter:SvcOperation>
474 <sdncadapter:CallbackUrl>${callbackURL}</sdncadapter:CallbackUrl>
475 <sdncadapter:MsoAction>generic-resource</sdncadapter:MsoAction>
476 </sdncadapter:RequestHeader>
477 <sdncadapterworkflow:SDNCRequestData>
478 <request-information>
479 <request-id>${requestId}</request-id>
480 <request-action>DeleteVnfInstance</request-action>
481 <source>${source}</source>
485 </request-information>
486 <service-information>
488 <subscription-service-type/>
489 <service-instance-id>${serviceInstanceId}</service-instance-id>
490 <global-customer-id/>
491 </service-information>
493 <vnf-id>${vnfId}</vnf-id>
498 <tenant>${tenantId}</tenant>
499 <aic-cloud-region>${cloudSiteId}</aic-cloud-region>
501 </sdncadapterworkflow:SDNCRequestData>
502 </sdncadapterworkflow:SDNCAdapterWorkflowRequest>"""
504 utils.logAudit("sdncRequest: " + sdncRequest)
508 public void validateSDNCResponse(DelegateExecution execution, String response, String method){
509 def isDebugLogEnabled=execution.getVariable("isDebugLogEnabled")
510 execution.setVariable("prefix",Prefix)
511 logDebug(" *** STARTED ValidateSDNCResponse Process*** ", isDebugLogEnabled)
513 WorkflowException workflowException = execution.getVariable("WorkflowException")
514 boolean successIndicator = execution.getVariable("SDNCA_SuccessIndicator")
516 utils.logAudit("workflowException: " + workflowException)
518 SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils(this)
519 sdncAdapterUtils.validateSDNCResponse(execution, response, workflowException, successIndicator)
521 utils.logAudit("SDNCResponse: " + response)
523 String sdncResponse = response
524 if(execution.getVariable(Prefix + 'sdncResponseSuccess') == true){
525 logDebug("Received a Good Response from SDNC Adapter for " + method + " SDNC Call. Response is: \n" + sdncResponse, isDebugLogEnabled)
527 logDebug("Received a BAD Response from SDNC Adapter for " + method + " SDNC Call.", isDebugLogEnabled)
528 throw new BpmnError("MSOWorkflowException")
530 logDebug(" *** COMPLETED ValidateSDNCResponse Process*** ", isDebugLogEnabled)