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=========================================================
21 package org.onap.so.bpmn.infrastructure.scripts
23 import static org.apache.commons.lang3.StringUtils.*;
25 import org.camunda.bpm.engine.delegate.BpmnError
26 import org.camunda.bpm.engine.delegate.DelegateExecution;
27 import org.json.JSONArray;
28 import org.json.JSONObject;
29 import org.onap.so.bpmn.common.scripts.AaiUtil
30 import org.onap.so.bpmn.common.scripts.AbstractServiceTaskProcessor
31 import org.onap.so.bpmn.common.scripts.ExceptionUtil
32 import org.onap.so.bpmn.common.scripts.MsoUtils
33 import org.onap.so.bpmn.common.scripts.SDNCAdapterUtils
34 import org.onap.so.bpmn.common.scripts.VidUtils
35 import org.onap.so.bpmn.core.UrnPropertiesReader
36 import org.onap.so.bpmn.core.WorkflowException
37 import org.onap.so.bpmn.core.domain.ModelInfo
38 import org.onap.so.bpmn.core.domain.ModuleResource
39 import org.onap.so.bpmn.core.domain.ServiceDecomposition
40 import org.onap.so.bpmn.core.domain.VnfResource
41 import org.onap.so.bpmn.core.json.JsonUtils
42 import org.onap.so.client.graphinventory.entities.uri.Depth
43 import org.onap.so.client.aai.entities.uri.AAIResourceUri
44 import org.onap.so.client.aai.entities.uri.AAIUriFactory
45 import org.onap.so.client.aai.AAIObjectType
46 import org.onap.so.logger.MessageEnum
47 import org.onap.so.logger.MsoLogger
48 import org.onap.so.rest.APIResponse
49 import org.springframework.web.util.UriUtils;
52 * This class supports the macro VID Flow
53 * with the deletion of a generic vnf and related VF modules.
55 class DoDeleteVnfAndModules extends AbstractServiceTaskProcessor {
56 private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, DoDeleteVnfAndModules.class);
58 String Prefix="DDVAM_"
59 ExceptionUtil exceptionUtil = new ExceptionUtil()
60 JsonUtils jsonUtil = new JsonUtils()
61 VidUtils vidUtils = new VidUtils(this)
62 SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils(this)
65 * This method gets and validates the incoming
71 public void preProcessRequest(DelegateExecution execution) {
73 execution.setVariable("prefix",Prefix)
74 msoLogger.trace("STARTED DoDeleteVnfAndModules PreProcessRequest Process")
79 String cloudConfiguration = execution.getVariable("cloudConfiguration")
80 msoLogger.debug("Cloud Configuration: " + cloudConfiguration)
82 String requestId = execution.getVariable("msoRequestId")
83 execution.setVariable("requestId", requestId)
84 execution.setVariable("mso-request-id", requestId)
85 msoLogger.debug("Incoming Request Id is: " + requestId)
87 String serviceInstanceId = execution.getVariable("serviceInstanceId")
88 msoLogger.debug("Incoming Service Instance Id is: " + serviceInstanceId)
90 String vnfId = execution.getVariable("vnfId")
91 msoLogger.debug("Incoming Vnf Id is: " + vnfId)
94 execution.setVariable("DDVAM_source", source)
95 msoLogger.debug("Incoming Source is: " + source)
97 execution.setVariable("DDVAM_isVidRequest", "true")
99 String sdncVersion = execution.getVariable("sdncVersion")
100 if (sdncVersion == null) {
103 execution.setVariable("DDVAM_sdncVersion", sdncVersion)
104 msoLogger.debug("Incoming Sdnc Version is: " + sdncVersion)
106 // Set aLaCarte flag to false
107 execution.setVariable("aLaCarte", false)
109 String sdncCallbackUrl = (String) UrnPropertiesReader.getVariable("mso.workflow.sdncadapter.callback", execution)
110 if (sdncCallbackUrl == null || sdncCallbackUrl.trim().isEmpty()) {
111 def msg = 'Required variable \'mso.workflow.sdncadapter.callback\' is missing'
112 msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, msg, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "Exception");
113 exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg)
115 execution.setVariable("sdncCallbackUrl", sdncCallbackUrl)
116 msoLogger.debug("SDNC Callback URL: " + sdncCallbackUrl)
117 msoLogger.debug("SDNC Callback URL is: " + sdncCallbackUrl)
120 if (!sdncVersion.equals("1702")) {
121 //String vnfModelInfo = execution.getVariable("vnfModelInfo")
122 //String serviceModelInfo = execution.getVariable("serviceModelInfo")
124 String serviceId = execution.getVariable("productFamilyId")
125 execution.setVariable("DDVAM_serviceId", serviceId)
126 msoLogger.debug("Incoming Service Id is: " + serviceId)
129 //String modelInvariantId = jsonUtil.getJsonValue(vnfModelInfo, "modelInvariantId")
130 //execution.setVariable("DDVAM_modelInvariantId", modelInvariantId)
131 //msoLogger.debug("Incoming Invariant Id is: " + modelInvariantId)
133 //String modelVersionId = jsonUtil.getJsonValue(vnfModelInfo, "modelVersionId")
134 //if (modelVersionId == null) {
135 // modelVersionId = ""
137 //execution.setVariable("DDVAM_modelVersionId", modelVersionId)
138 //msoLogger.debug("Incoming Version Id is: " + modelVersionId)
140 //String modelVersion = jsonUtil.getJsonValue(vnfModelInfo, "modelVersion")
141 //execution.setVariable("DDVAM_modelVersion", modelVersion)
142 //msoLogger.debug("Incoming Model Version is: " + modelVersion)
144 //String modelName = jsonUtil.getJsonValue(vnfModelInfo, "modelName")
145 //execution.setVariable("DDVAM_modelName", modelName)
146 //msoLogger.debug("Incoming Model Name is: " + modelName)
148 //String modelCustomizationId = jsonUtil.getJsonValue(vnfModelInfo, "modelCustomizationId")
149 //if (modelCustomizationId == null) {
150 // modelCustomizationId = ""
152 //execution.setVariable("DDVAM_modelCustomizationId", modelCustomizationId)
153 //msoLogger.debug("Incoming Model Customization Id is: " + modelCustomizationId)
155 String cloudSiteId = execution.getVariable("lcpCloudRegionId")
156 execution.setVariable("DDVAM_cloudSiteId", cloudSiteId)
157 msoLogger.debug("Incoming Cloud Site Id is: " + cloudSiteId)
159 String tenantId = execution.getVariable("tenantId")
160 execution.setVariable("DDVAM_tenantId", tenantId)
161 msoLogger.debug("Incoming Tenant Id is: " + tenantId)
163 String globalSubscriberId = execution.getVariable("globalSubscriberId")
164 if (globalSubscriberId == null) {
165 globalSubscriberId = ""
167 execution.setVariable("DDVAM_globalSubscriberId", globalSubscriberId)
168 msoLogger.debug("Incoming Global Subscriber Id is: " + globalSubscriberId)
171 execution.setVariable("DDVAM_vfModulesFromDecomposition", null)
172 // Retrieve serviceDecomposition if present
173 ServiceDecomposition serviceDecomposition = execution.getVariable("serviceDecomposition")
174 if (serviceDecomposition != null) {
175 msoLogger.debug("Getting Catalog DB data from ServiceDecomposition object: " + serviceDecomposition.toJsonString())
176 List<VnfResource> vnfs = serviceDecomposition.getVnfResources()
177 msoLogger.debug("Read vnfs")
179 msoLogger.debug("Error - vnfs are empty in serviceDecomposition object")
180 exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "Internal Error - Occured in preProcessRequest - vnfs are empty")
182 VnfResource vnf = vnfs[0]
185 msoLogger.debug("Error - vnf is empty in serviceDecomposition object")
186 exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "Internal Error - Occured in preProcessRequest - vnf is empty")
189 List<ModuleResource> vfModules = vnf.getAllVfModuleObjects()
191 execution.setVariable("DDVAM_vfModulesFromDecomposition", vfModules)
194 execution.setVariable("DDVAM_moduleCount", 0)
195 execution.setVariable("DDVAM_nextModule", 0)
199 msoLogger.debug("Rethrowing MSOWorkflowException")
202 msoLogger.debug(" Error Occured in DoCreateVnfAndModules PreProcessRequest method!" + e.getMessage())
203 exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "Internal Error - Occured in DoCreateVnf PreProcessRequest")
206 msoLogger.trace("COMPLETED DoDeleteVnfAndModules PreProcessRequest Process ")
211 public void preProcessAddOnModule(DelegateExecution execution){
213 execution.setVariable("prefix", Prefix)
214 msoLogger.trace("STARTED preProcessAddOnModule ")
217 JSONArray addOnModules = (JSONArray) execution.getVariable("addOnModules")
218 int addOnIndex = (int) execution.getVariable("addOnModulesDeployed")
220 JSONObject addOnModule = addOnModules[addOnIndex]
222 def newVfModuleId = UUID.randomUUID().toString()
223 execution.setVariable("addOnVfModuleId", newVfModuleId)
225 execution.setVariable("instancesOfThisModelDeployed", 0)
227 JSONObject addOnVfModuleModelInfoObject = jsonUtil.getJsonValueForKey(addOnModule, "modelInfo")
228 String addOnVfModuleModelInfo = addOnVfModuleModelInfoObject.toString()
229 execution.setVariable("addOnVfModuleModelInfo", addOnVfModuleModelInfo)
230 String addOnVfModuleLabel = jsonUtil.getJsonValueForKey(addOnModule, "vfModuleLabel")
231 execution.setVariable("addOnVfModuleLabel", addOnVfModuleLabel)
232 String addOnPersonaModelId = jsonUtil.getJsonValueForKey(addOnVfModuleModelInfoObject, "modelInvariantUuid")
233 execution.setVariable("addOnPersonaModelId", addOnPersonaModelId)
234 String addOnInitialCount = jsonUtil.getJsonValueForKey(addOnModule, "initialCount")
235 execution.setVariable("initialCount", addOnInitialCount)
239 msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, "Exception Occured Processing preProcessAddOnModule." + e, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e);
240 exceptionUtil.buildAndThrowWorkflowException(execution, 1002, "Error Occurred during preProcessAddOnModule Method:\n" + e.getMessage())
242 msoLogger.trace("COMPLETED preProcessSDNCAssignRequest ")
246 * Using the received vnfId and vfModuleId, query AAI to get the corresponding VNF info.
247 * A 200 response is expected with the VNF info in the response body. Will find out the base module info.
249 * @param execution The flow's execution instance.
251 public void queryAAIVfModule(DelegateExecution execution) {
253 def method = getClass().getSimpleName() + '.queryAAIVfModule(' +
254 'execution=' + execution.getId() +
256 msoLogger.trace('Entered ' + method)
259 def vnfId = execution.getVariable('vnfId')
261 AaiUtil aaiUriUtil = new AaiUtil(this)
262 AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectType.GENERIC_VNF, vnfId).depth(Depth.ONE)
263 String endPoint = aaiUriUtil.createAaiUri(uri)
265 msoLogger.debug("AAI endPoint: " + endPoint)
268 msoLogger.debug("createVfModule - invoking httpGet() to AAI")
269 APIResponse response = aaiUriUtil.executeAAIGetCall(execution, endPoint)
271 def responseData = response.getResponseBodyAsString()
272 if (responseData != null) {
273 msoLogger.debug("Received generic VNF data: " + responseData)
277 msoLogger.debug("createVfModule - queryAAIVfModule Response: " + responseData)
278 msoLogger.debug("createVfModule - queryAAIVfModule ResponseCode: " + response.getStatusCode())
280 execution.setVariable('DCVFM_queryAAIVfModuleResponseCode', response.getStatusCode())
281 execution.setVariable('DCVFM_queryAAIVfModuleResponse', responseData)
282 msoLogger.debug('Response code:' + response.getStatusCode())
283 msoLogger.debug('Response:' + System.lineSeparator() + responseData)
284 //Map<String, String>[] vfModules = new HashMap<String,String>[]
285 List<ModuleResource> vfModulesFromDecomposition = execution.getVariable("DDVAM_vfModulesFromDecomposition")
286 def vfModulesList = new ArrayList<Map<String,String>>()
288 def vfModuleBaseEntry = null
289 if (response.getStatusCode() == 200) {
290 // Parse the VNF record from A&AI to find base module info
291 msoLogger.debug('Parsing the VNF data to find base module info')
292 if (responseData != null) {
293 def vfModulesText = utils.getNodeXml(responseData, "vf-modules")
294 msoLogger.debug("vModulesText: " + vfModulesText)
295 if (vfModulesText != null && !vfModulesText.trim().isEmpty()) {
296 def xmlVfModules= new XmlSlurper().parseText(vfModulesText)
297 vfModules = xmlVfModules.'**'.findAll {it.name() == "vf-module"}
298 execution.setVariable("DDVAM_moduleCount", vfModules.size())
299 int vfModulesSize = 0
300 ModelInfo vfModuleModelInfo = null
301 for (i in 0..vfModules.size()-1) {
302 def vfModuleXml = groovy.xml.XmlUtil.serialize(vfModules[i])
304 Map<String, String> vfModuleEntry = new HashMap<String, String>()
305 def vfModuleId = utils.getNodeText(vfModuleXml, "vf-module-id")
306 vfModuleEntry.put("vfModuleId", vfModuleId)
307 def vfModuleName = utils.getNodeText(vfModuleXml, "vf-module-name")
308 vfModuleEntry.put("vfModuleName", vfModuleName)
310 // Find the model for this vf module in decomposition if specified
311 if (vfModulesFromDecomposition != null) {
312 msoLogger.debug("vfModulesFromDecomposition is not null")
313 def vfModuleUuid = utils.getNodeText(vfModuleXml, "model-version-id")
314 if (vfModuleUuid == null) {
315 vfModuleUuid = utils.getNodeText(vfModuleXml, "persona-model-version")
317 msoLogger.debug("vfModule UUID is: " + vfModuleUuid)
318 for (j in 0..vfModulesFromDecomposition.size()-1) {
319 ModuleResource mr = vfModulesFromDecomposition[j]
320 if (mr.getModelInfo().getModelUuid() == vfModuleUuid) {
321 msoLogger.debug("Found modelInfo")
322 vfModuleModelInfo = mr.getModelInfo()
328 if (vfModuleModelInfo != null) {
329 String vfModuleModelInfoString = vfModuleModelInfo.toString()
330 def vfModuleModelInfoValue = jsonUtil.getJsonValue(vfModuleModelInfoString, "modelInfo")
331 vfModuleEntry.put("vfModuleModelInfo", vfModuleModelInfoValue)
334 vfModuleEntry.put("vfModuleModelInfo", null)
338 def isBaseVfModule = utils.getNodeText(vfModuleXml, "is-base-vf-module")
339 // Save base vf module for last
340 if (isBaseVfModule == "true") {
341 vfModuleBaseEntry = vfModuleEntry
344 vfModulesList.add(vfModuleEntry)
347 if (vfModuleBaseEntry != null) {
348 vfModulesList.add(vfModuleBaseEntry)
354 execution.setVariable("DDVAM_vfModules", vfModulesList)
355 } catch (Exception ex) {
357 msoLogger.debug('Exception occurred while executing AAI GET:' + ex.getMessage())
358 exceptionUtil.buildAndThrowWorkflowException(execution, 1002, 'AAI GET Failed:' + ex.getMessage())
360 msoLogger.trace('Exited ' + method)
361 } catch (BpmnError e) {
363 } catch (Exception e) {
364 msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e);
365 exceptionUtil.buildAndThrowWorkflowException(execution, 1002, 'Error in queryAAIVfModule(): ' + e.getMessage())
369 public void prepareNextModuleToDelete(DelegateExecution execution){
371 execution.setVariable("prefix", Prefix)
372 msoLogger.trace("STARTED prepareNextModuleToDelete ")
375 int i = execution.getVariable("DDVAM_nextModule")
376 def vfModules = execution.getVariable("DDVAM_vfModules")
377 def vfModule = vfModules[i]
379 def vfModuleId = vfModule.get("vfModuleId")
380 execution.setVariable("DDVAM_vfModuleId", vfModuleId)
382 def vfModuleName = vfModule.get("vfModuleName")
383 execution.setVariable("DDVAM_vfModuleName", vfModuleName)
385 def vfModuleModelInfo = vfModule.get("vfModuleModelInfo")
386 msoLogger.debug("vfModuleModelInfo for module delete: " + vfModuleModelInfo)
387 execution.setVariable("DDVAM_vfModuleModelInfo", vfModuleModelInfo)
390 msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, "Exception Occured Processing preProcessAddOnModule." + e, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e);
391 exceptionUtil.buildAndThrowWorkflowException(execution, 1002, "Error Occurred during prepareNextModuleToDelete Method:\n" + e.getMessage())
393 msoLogger.trace("COMPLETED prepareNextModuleToDelete ")
396 public void preProcessSDNCDeactivateRequest(DelegateExecution execution){
398 execution.setVariable("prefix", Prefix)
399 msoLogger.trace("STARTED preProcessSDNCDeactivateRequest ")
400 def vnfId = execution.getVariable("vnfId")
401 def serviceInstanceId = execution.getVariable("serviceInstanceId")
406 String deactivateSDNCRequest = buildSDNCRequest(execution, serviceInstanceId, "deactivate")
408 deactivateSDNCRequest = utils.formatXml(deactivateSDNCRequest)
409 execution.setVariable("DDVAM_deactivateSDNCRequest", deactivateSDNCRequest)
410 msoLogger.debug("Outgoing DeactivateSDNCRequest is: \n" + deactivateSDNCRequest)
411 msoLogger.debug("Outgoing DeactivateSDNCRequest is: \n" + deactivateSDNCRequest)
414 msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, "Exception Occured Processing preProcessSDNCDeactivateRequest." + e, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e);
415 exceptionUtil.buildAndThrowWorkflowException(execution, 1002, "Error Occurred during preProcessSDNCDeactivateRequest Method:\n" + e.getMessage())
417 msoLogger.trace("COMPLETED preProcessSDNCDeactivateRequest ")
420 public void preProcessSDNCUnassignRequest(DelegateExecution execution) {
421 def method = getClass().getSimpleName() + '.preProcessSDNCUnassignRequest(' +
422 'execution=' + execution.getId() +
425 msoLogger.trace('Entered ' + method)
426 execution.setVariable("prefix", Prefix)
427 msoLogger.trace("STARTED preProcessSDNCUnassignRequest Process ")
429 String vnfId = execution.getVariable("vnfId")
430 String serviceInstanceId = execution.getVariable("serviceInstanceId")
432 String unassignSDNCRequest = buildSDNCRequest(execution, serviceInstanceId, "unassign")
434 execution.setVariable("DDVAM_unassignSDNCRequest", unassignSDNCRequest)
435 msoLogger.debug("Outgoing UnassignSDNCRequest is: \n" + unassignSDNCRequest)
436 msoLogger.debug("Outgoing UnassignSDNCRequest is: \n" + unassignSDNCRequest)
439 msoLogger.debug("Exception Occured Processing preProcessSDNCUnassignRequest. Exception is:\n" + e)
440 exceptionUtil.buildAndThrowWorkflowException(execution, 1002, "Error Occured during preProcessSDNCUnassignRequest Method:\n" + e.getMessage())
442 msoLogger.trace("COMPLETED preProcessSDNCUnassignRequest Process ")
445 public String buildSDNCRequest(DelegateExecution execution, String svcInstId, String action){
447 String uuid = execution.getVariable('testReqId') // for junits
449 uuid = execution.getVariable("msoRequestId") + "-" + System.currentTimeMillis()
451 def callbackURL = execution.getVariable("sdncCallbackUrl")
452 def requestId = execution.getVariable("msoRequestId")
453 def serviceId = execution.getVariable("DDVAM_serviceId")
454 def tenantId = execution.getVariable("DDVAM_tenantId")
455 def source = execution.getVariable("DDVAM_source")
456 def vnfId = execution.getVariable("vnfId")
457 def serviceInstanceId = execution.getVariable("serviceInstanceId")
458 def cloudSiteId = execution.getVariable("DDVAM_cloudSiteId")
459 def modelCustomizationId = execution.getVariable("DDVAM_modelCustomizationId")
460 //def serviceModelInfo = execution.getVariable("serviceModelInfo")
461 //def vnfModelInfo = execution.getVariable("vnfModelInfo")
462 //String serviceEcompModelInformation = sdncAdapterUtils.modelInfoToEcompModelInformation(serviceModelInfo)
463 //String vnfEcompModelInformation = sdncAdapterUtils.modelInfoToEcompModelInformation(vnfModelInfo)
464 def globalSubscriberId = execution.getVariable("DDVAM_globalSubscriberId")
465 def sdncVersion = execution.getVariable("DDVAM_sdncVersion")
468 """<sdncadapterworkflow:SDNCAdapterWorkflowRequest xmlns:ns5="http://org.onap/so/request/types/v1"
469 xmlns:sdncadapterworkflow="http://org.onap/so/workflow/schema/v1"
470 xmlns:sdncadapter="http://org.onap/workflow/sdnc/adapter/schema/v1">
471 <sdncadapter:RequestHeader>
472 <sdncadapter:RequestId>${MsoUtils.xmlEscape(uuid)}</sdncadapter:RequestId>
473 <sdncadapter:SvcInstanceId>${MsoUtils.xmlEscape(svcInstId)}</sdncadapter:SvcInstanceId>
474 <sdncadapter:SvcAction>${MsoUtils.xmlEscape(action)}</sdncadapter:SvcAction>
475 <sdncadapter:SvcOperation>vnf-topology-operation</sdncadapter:SvcOperation>
476 <sdncadapter:CallbackUrl>${MsoUtils.xmlEscape(callbackURL)}</sdncadapter:CallbackUrl>
477 <sdncadapter:MsoAction>generic-resource</sdncadapter:MsoAction>
478 </sdncadapter:RequestHeader>
479 <sdncadapterworkflow:SDNCRequestData>
480 <request-information>
481 <request-id>${MsoUtils.xmlEscape(requestId)}</request-id>
482 <request-action>DeleteVnfInstance</request-action>
483 <source>${MsoUtils.xmlEscape(source)}</source>
487 </request-information>
488 <service-information>
490 <subscription-service-type/>
491 <service-instance-id>${MsoUtils.xmlEscape(serviceInstanceId)}</service-instance-id>
492 <global-customer-id/>
493 </service-information>
495 <vnf-id>${MsoUtils.xmlEscape(vnfId)}</vnf-id>
500 <tenant>${MsoUtils.xmlEscape(tenantId)}</tenant>
501 <aic-cloud-region>${MsoUtils.xmlEscape(cloudSiteId)}</aic-cloud-region>
503 </sdncadapterworkflow:SDNCRequestData>
504 </sdncadapterworkflow:SDNCAdapterWorkflowRequest>"""
506 msoLogger.debug("sdncRequest: " + sdncRequest)
510 public void validateSDNCResponse(DelegateExecution execution, String response, String method){
512 execution.setVariable("prefix",Prefix)
513 msoLogger.trace("STARTED ValidateSDNCResponse Process")
515 WorkflowException workflowException = execution.getVariable("WorkflowException")
516 boolean successIndicator = execution.getVariable("SDNCA_SuccessIndicator")
518 msoLogger.debug("workflowException: " + workflowException)
520 SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils(this)
521 sdncAdapterUtils.validateSDNCResponse(execution, response, workflowException, successIndicator)
523 msoLogger.debug("SDNCResponse: " + response)
525 String sdncResponse = response
526 if(execution.getVariable(Prefix + 'sdncResponseSuccess') == true){
527 msoLogger.debug("Received a Good Response from SDNC Adapter for " + method + " SDNC Call. Response is: \n" + sdncResponse)
529 msoLogger.debug("Received a BAD Response from SDNC Adapter for " + method + " SDNC Call.")
530 throw new BpmnError("MSOWorkflowException")
532 msoLogger.trace("COMPLETED ValidateSDNCResponse Process")