2 * ============LICENSE_START=======================================================
\r
4 * ================================================================================
\r
5 * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
\r
6 * ================================================================================
\r
7 * Licensed under the Apache License, Version 2.0 (the "License");
\r
8 * you may not use this file except in compliance with the License.
\r
9 * You may obtain a copy of the License at
\r
11 * http://www.apache.org/licenses/LICENSE-2.0
\r
13 * Unless required by applicable law or agreed to in writing, software
\r
14 * distributed under the License is distributed on an "AS IS" BASIS,
\r
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
\r
16 * See the License for the specific language governing permissions and
\r
17 * limitations under the License.
\r
18 * ============LICENSE_END=========================================================
\r
21 package org.openecomp.mso.bpmn.infrastructure.scripts;
\r
23 import groovy.json.JsonSlurper
\r
24 import groovy.json.JsonOutput
\r
26 import org.camunda.bpm.engine.delegate.BpmnError
\r
27 import org.camunda.bpm.engine.delegate.DelegateExecution
\r
28 import org.onap.appc.client.lcm.model.Action
\r
29 import org.apache.commons.lang3.*
\r
30 import org.openecomp.mso.bpmn.common.scripts.AbstractServiceTaskProcessor;
\r
31 import org.openecomp.mso.bpmn.common.scripts.ExceptionUtil;
\r
32 import org.openecomp.mso.bpmn.common.scripts.NetworkUtils;
\r
33 import org.openecomp.mso.bpmn.common.scripts.SDNCAdapterUtils;
\r
34 import org.openecomp.mso.bpmn.common.scripts.VidUtils;
\r
35 import org.openecomp.mso.bpmn.core.RollbackData
\r
36 import org.openecomp.mso.bpmn.core.WorkflowException
\r
37 import org.openecomp.mso.bpmn.core.json.JsonUtils
\r
39 public class CreateVfModuleInfra extends AbstractServiceTaskProcessor {
\r
41 ExceptionUtil exceptionUtil = new ExceptionUtil()
\r
42 JsonUtils jsonUtil = new JsonUtils()
\r
45 * Validates the request message and sets up the workflow.
\r
46 * @param execution the execution
\r
48 public void preProcessRequest(DelegateExecution execution) {
\r
49 def method = getClass().getSimpleName() + '.preProcessRequest(' +
\r
50 'execution=' + execution.getId() +
\r
52 def isDebugLogEnabled = execution.getVariable('isDebugLogEnabled')
\r
53 logDebug('Entered ' + method, isDebugLogEnabled)
\r
55 execution.setVariable("CVFMI_sentSyncResponse", false)
\r
57 def prefix = 'CVFMI_'
\r
58 logDebug('Entered 1' + method, isDebugLogEnabled)
\r
59 execution.setVariable('prefix', prefix)
\r
60 logDebug('Entered 2' + method, isDebugLogEnabled)
\r
61 execution.setVariable("isVidRequest", "false")
\r
63 logDebug("Set variables", isDebugLogEnabled)
\r
65 def rollbackData = execution.getVariable("RollbackData")
\r
66 if (rollbackData == null) {
\r
67 rollbackData = new RollbackData()
\r
69 execution.setVariable("RollbackData", rollbackData)
\r
71 logDebug("Set rollback data", isDebugLogEnabled)
\r
72 def incomingRequest = execution.getVariable('bpmnRequest')
\r
74 utils.log("DEBUG", "Incoming Infra Request: " + incomingRequest, isDebugLogEnabled)
\r
75 utils.logAudit("CreateVfModule Infra incoming Request: " + incomingRequest)
\r
77 setBasicDBAuthHeader(execution, isDebugLogEnabled)
\r
79 // check if request is xml or json
\r
81 def jsonSlurper = new JsonSlurper()
\r
82 def jsonOutput = new JsonOutput()
\r
83 Map reqMap = jsonSlurper.parseText(incomingRequest)
\r
84 utils.log("DEBUG", " Request is in JSON format.", isDebugLogEnabled)
\r
86 def serviceInstanceId = execution.getVariable('serviceInstanceId')
\r
87 def vnfId = execution.getVariable('vnfId')
\r
89 execution.setVariable(prefix + 'serviceInstanceId', serviceInstanceId)
\r
90 execution.setVariable(prefix+'vnfId', vnfId)
\r
91 execution.setVariable("isVidRequest", "true")
\r
94 def asdcServiceModelVersion = ''
\r
95 def serviceModelInfo = null
\r
96 def vnfModelInfo = null
\r
98 def relatedInstanceList = reqMap.requestDetails?.relatedInstanceList
\r
100 if (relatedInstanceList != null) {
\r
101 relatedInstanceList.each {
\r
102 if (it.relatedInstance.modelInfo?.modelType == 'service') {
\r
103 asdcServiceModelVersion = it.relatedInstance.modelInfo?.modelVersion
\r
104 serviceModelInfo = jsonOutput.toJson(it.relatedInstance.modelInfo)
\r
107 if (it.relatedInstance.modelInfo.modelType == 'vnf') {
\r
108 vnfName = it.relatedInstance.instanceName ?: ''
\r
109 vnfModelInfo = jsonOutput.toJson(it.relatedInstance.modelInfo)
\r
114 execution.setVariable(prefix + 'vnfName', vnfName)
\r
115 execution.setVariable(prefix + 'asdcServiceModelVersion', asdcServiceModelVersion)
\r
116 execution.setVariable(prefix + 'serviceModelInfo', serviceModelInfo)
\r
117 execution.setVariable(prefix + 'vnfModelInfo', vnfModelInfo)
\r
120 def vnfType = execution.getVariable('vnfType')
\r
121 execution.setVariable(prefix + 'vnfType', vnfType)
\r
122 def vfModuleId = execution.getVariable('vfModuleId')
\r
123 execution.setVariable(prefix + 'vfModuleId', vfModuleId)
\r
124 def volumeGroupId = execution.getVariable('volumeGroupId')
\r
125 execution.setVariable(prefix + 'volumeGroupId', volumeGroupId)
\r
126 def userParams = reqMap.requestDetails?.requestParameters?.userParams
\r
128 Map<String, String> userParamsMap = [:]
\r
129 if (userParams != null) {
\r
130 userParams.each { userParam ->
\r
131 userParamsMap.put(userParam.name, jsonOutput.toJson(userParam.value).toString())
\r
135 utils.log("DEBUG", 'Processed user params: ' + userParamsMap, isDebugLogEnabled)
\r
137 execution.setVariable(prefix + 'vfModuleInputParams', userParamsMap)
\r
139 def isBaseVfModule = "false"
\r
140 if (execution.getVariable('isBaseVfModule') == true) {
\r
141 isBaseVfModule = "true"
\r
144 execution.setVariable(prefix + 'isBaseVfModule', isBaseVfModule)
\r
146 def requestId = execution.getVariable("mso-request-id")
\r
147 execution.setVariable(prefix + 'requestId', requestId)
\r
149 def vfModuleModelInfo = jsonOutput.toJson(reqMap.requestDetails?.modelInfo)
\r
150 execution.setVariable(prefix + 'vfModuleModelInfo', vfModuleModelInfo)
\r
152 def suppressRollback = reqMap.requestDetails?.requestInfo?.suppressRollback
\r
155 def backoutOnFailure = ""
\r
156 if(suppressRollback != null){
\r
157 if ( suppressRollback == true) {
\r
158 backoutOnFailure = "false"
\r
159 } else if ( suppressRollback == false) {
\r
160 backoutOnFailure = "true"
\r
164 execution.setVariable('disableRollback', suppressRollback)
\r
166 def vfModuleName = reqMap.requestDetails?.requestInfo?.instanceName ?: null
\r
167 execution.setVariable(prefix + 'vfModuleName', vfModuleName)
\r
169 def serviceId = reqMap.requestDetails?.requestParameters?.serviceId ?: ''
\r
170 execution.setVariable(prefix + 'serviceId', serviceId)
\r
172 def usePreload = reqMap.requestDetails?.requestParameters?.usePreload
\r
173 execution.setVariable(prefix + 'usePreload', usePreload)
\r
175 // This is aLaCarte flow, so aLaCarte flag is always on
\r
176 execution.setVariable(prefix + 'aLaCarte', true)
\r
178 def cloudConfiguration = reqMap.requestDetails?.cloudConfiguration
\r
179 def lcpCloudRegionId = cloudConfiguration.lcpCloudRegionId
\r
180 execution.setVariable(prefix + 'lcpCloudRegionId', lcpCloudRegionId)
\r
181 def tenantId = cloudConfiguration.tenantId
\r
182 execution.setVariable(prefix + 'tenantId', tenantId)
\r
184 def globalSubscriberId = reqMap.requestDetails?.subscriberInfo?.globalSubscriberId ?: ''
\r
185 execution.setVariable(prefix + 'globalSubscriberId', globalSubscriberId)
\r
187 execution.setVariable(prefix + 'sdncVersion', '1702')
\r
189 execution.setVariable("CreateVfModuleInfraSuccessIndicator", false)
\r
190 execution.setVariable("RollbackCompleted", false)
\r
192 execution.setVariable("isDebugLogEnabled", isDebugLogEnabled)
\r
195 def source = reqMap.requestDetails?.requestInfo?.source
\r
196 execution.setVariable("CVFMI_source", source)
\r
198 //For Completion Handler & Fallout Handler
\r
199 String requestInfo =
\r
200 """<request-info xmlns="http://org.openecomp/mso/infra/vnf-request/v1">
\r
201 <request-id>${requestId}</request-id>
\r
202 <action>CREATE</action>
\r
203 <source>${source}</source>
\r
206 execution.setVariable("CVFMI_requestInfo", requestInfo)
\r
210 execution.setVariable("CVFMI_originalWorkflowException", null)
\r
213 def newVfModuleId = UUID.randomUUID().toString()
\r
214 execution.setVariable("newVfModuleId", newVfModuleId)
\r
215 execution.setVariable(prefix + 'vfModuleId', newVfModuleId)
\r
216 execution.setVariable('actionHealthCheck', Action.HealthCheck)
\r
217 execution.setVariable('actionConfigScaleOut', Action.ConfigScaleOut)
\r
218 def controllerType = execution.getVariable('controllerType')
\r
219 execution.setVariable(prefix + 'controllerType', controllerType)
\r
220 execution.setVariable('healthCheckIndex0', 0)
\r
222 logDebug('RequestInfo: ' + execution.getVariable("CVFMI_requestInfo"), isDebugLogEnabled)
\r
224 logDebug('rollbackEnabled: ' + execution.getVariable("CVFMI_rollbackEnabled"), isDebugLogEnabled)
\r
226 logDebug('Exited ' + method, isDebugLogEnabled)
\r
227 } catch (BpmnError bpmnError) {
\r
230 catch(groovy.json.JsonException je) {
\r
231 utils.log("DEBUG", " Request is not in JSON format.", isDebugLogEnabled)
\r
232 exceptionUtil.buildAndThrowWorkflowException(execution, 400, "Internal Error - During PreProcessRequest")
\r
234 catch(Exception e) {
\r
235 String restFaultMessage = e.getMessage()
\r
236 //execution.setVariable("CVFMODVOL2_RESTFault", restFaultMessage)
\r
237 //execution.setVariable("CVFMODVOL2_isDataOk", false)
\r
238 utils.log("ERROR", " Exception Encountered - " + "\n" + restFaultMessage, isDebugLogEnabled)
\r
239 exceptionUtil.buildAndThrowWorkflowException(execution, 400, "Internal Error - During PreProcessRequest")
\r
245 * Validates a workflow response.
\r
246 * @param execution the execution
\r
247 * @param responseVar the execution variable in which the response is stored
\r
248 * @param responseCodeVar the execution variable in which the response code is stored
\r
249 * @param errorResponseVar the execution variable in which the error response is stored
\r
251 public void validateWorkflowResponse(DelegateExecution execution, String responseVar,
\r
252 String responseCodeVar, String errorResponseVar) {
\r
253 SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils(this)
\r
254 sdncAdapterUtils.validateSDNCResponse(execution, responseVar, responseCodeVar, errorResponseVar)
\r
259 * Sends the empty, synchronous response back to the API Handler.
\r
260 * @param execution the execution
\r
262 public void sendResponse(DelegateExecution execution) {
\r
263 def method = getClass().getSimpleName() + '.sendResponse(' +
\r
264 'execution=' + execution.getId() +
\r
266 def isDebugLogEnabled = execution.getVariable('isDebugLogEnabled')
\r
267 logDebug('Entered ' + method, isDebugLogEnabled)
\r
270 def requestInfo = execution.getVariable('CVFMI_requestInfo')
\r
271 def requestId = execution.getVariable('CVFMI_requestId')
\r
272 def source = execution.getVariable('CVFMI_source')
\r
274 // RESTResponse (for API Handler (APIH) Reply Task)
\r
275 def newVfModuleId = execution.getVariable("newVfModuleId")
\r
276 String synchResponse = """{"requestReferences":{"instanceId":"${newVfModuleId}","requestId":"${requestId}"}}""".trim()
\r
278 sendWorkflowResponse(execution, 200, synchResponse)
\r
280 execution.setVariable("CVFMI_sentSyncResponse", true)
\r
281 utils.logAudit("CreateVfModule Infra Response: " + synchResponse)
\r
282 logDebug('Exited ' + method, isDebugLogEnabled)
\r
283 } catch (BpmnError e) {
\r
285 } catch (Exception e) {
\r
286 logError('Caught exception in ' + method, e)
\r
287 exceptionUtil.buildAndThrowWorkflowException(execution, 1002, 'Error in sendResponse(): ' + e.getMessage())
\r
293 * @param execution the execution
\r
295 public void postProcessResponse(DelegateExecution execution){
\r
296 def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
\r
298 utils.log("DEBUG", " ======== STARTED PostProcessResponse Process ======== ", isDebugEnabled)
\r
300 def requestInfo = execution.getVariable("CVFMI_requestInfo")
\r
301 def action = utils.getNodeText1(requestInfo, "action")
\r
303 utils.log("DEBUG", "requestInfo is: " + requestInfo, isDebugEnabled)
\r
304 utils.log("DEBUG", "action is: " + action, isDebugEnabled)
\r
307 """ <aetgt:MsoCompletionRequest xmlns:aetgt="http://org.openecomp/mso/workflow/schema/v1"
\r
308 xmlns:ns="http://org.openecomp/mso/request/types/v1"
\r
309 xmlns:ns8="http://org.openecomp/mso/workflow/schema/v1">
\r
310 <request-info xmlns="http://org.openecomp/mso/infra/vnf-request/v1">
\r
313 <ns8:status-message>Vf Module has been created successfully.</ns8:status-message>
\r
314 <ns8:mso-bpel-name>BPMN</ns8:mso-bpel-name>
\r
315 </aetgt:MsoCompletionRequest>"""
\r
317 payload = utils.formatXml(payload)
\r
318 execution.setVariable("CVFMI_SuccessFlag", true)
\r
319 execution.setVariable("CVFMI_msoCompletionRequest", payload)
\r
320 utils.logAudit("CreateVfModuleInfra completion request: " + payload)
\r
321 utils.log("DEBUG", "Outgoing MsoCompletionRequest: \n" + payload, isDebugEnabled)
\r
323 }catch(Exception e){
\r
324 utils.log("ERROR", "Exception Occured Processing PostProcessResponse. Exception is:\n" + e, isDebugEnabled)
\r
325 execution.setVariable("CVFMI_ErrorResponse", "Error Occured during PostProcessResponse Method:\n" + e.getMessage())
\r
327 utils.log("DEBUG", "======== COMPLETED PostProcessResponse Process ======== ", isDebugEnabled)
\r
335 * Validates the request, request id and service instance id. If a problem is found,
\r
336 * a WorkflowException is generated and an MSOWorkflowException event is thrown. This
\r
337 * method also sets up the log context for the workflow.
\r
338 * @param execution the execution
\r
339 * @return the validated request
\r
341 public String validateInfraRequest(DelegateExecution execution) {
\r
342 def method = getClass().getSimpleName() + '.validateInfraRequest(' +
\r
343 'execution=' + execution.getId() +
\r
345 def isDebugLogEnabled = execution.getVariable('isDebugLogEnabled')
\r
346 logDebug('Entered ' + method, isDebugLogEnabled)
\r
348 String processKey = getProcessKey(execution);
\r
349 def prefix = execution.getVariable("prefix")
\r
351 if (prefix == null) {
\r
352 exceptionUtil.buildAndThrowWorkflowException(execution, 1002, processKey + " prefix is null")
\r
356 def request = execution.getVariable(prefix + 'Request')
\r
358 if (request == null) {
\r
359 request = execution.getVariable(processKey + 'Request')
\r
361 if (request == null) {
\r
362 request = execution.getVariable('bpmnRequest')
\r
365 setVariable(execution, processKey + 'Request', null);
\r
366 setVariable(execution, 'bpmnRequest', null);
\r
367 setVariable(execution, prefix + 'Request', request);
\r
370 if (request == null) {
\r
371 exceptionUtil.buildAndThrowWorkflowException(execution, 1002, processKey + " request is null")
\r
376 def requestId = execution.getVariable("mso-request-id")
\r
378 if (requestId == null) {
\r
379 exceptionUtil.buildAndThrowWorkflowException(execution, 1002, processKey + " request has no mso-request-id")
\r
382 setVariable(execution, prefix + 'requestId', requestId)
\r
384 def serviceInstanceId = execution.getVariable("mso-service-instance-id")
\r
386 if (serviceInstanceId == null) {
\r
387 exceptionUtil.buildAndThrowWorkflowException(execution, 1002, processKey + " request message has no mso-service-instance-id")
\r
390 utils.logContext(requestId, serviceInstanceId)
\r
392 utils.logAudit("CreateVfModule incoming request: " + request)
\r
393 logDebug('Incoming message: ' + System.lineSeparator() + request, isDebugLogEnabled)
\r
394 logDebug('Exited ' + method, isDebugLogEnabled)
\r
396 } catch (BpmnError e) {
\r
398 } catch (Exception e) {
\r
399 logError('Caught exception in ' + method, e)
\r
400 exceptionUtil.buildAndThrowWorkflowException(execution, 1002, "Invalid Message")
\r
404 public void prepareUpdateInfraRequest(DelegateExecution execution){
\r
405 def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
\r
407 utils.log("DEBUG", " ======== STARTED prepareUpdateInfraRequest Process ======== ", isDebugEnabled)
\r
411 String requestInfo = execution.getVariable("CVFMI_requestInfo")
\r
412 def aicCloudRegion = execution.getVariable("CVFMI_lcpCloudRegionId")
\r
413 def tenantId = execution.getVariable("CVFMI_tenantId")
\r
414 def requestId = utils.getNodeText1(requestInfo, "request-id")
\r
415 def vnfId = execution.getVariable("CVFMI_vnfId")
\r
416 def vfModuleId = execution.getVariable("CVFMI_vfModuleId")
\r
417 // vfModuleName may be generated by DoCreateVfModule subprocess if it is not specified on the input
\r
418 def vfModuleName = execution.getVariable("CVFMI_vfModuleName")
\r
420 def dbAdapterEndpoint = execution.getVariable("URN_mso_adapters_openecomp_db_endpoint")
\r
421 execution.setVariable("CVFMI_dbAdapterEndpoint", dbAdapterEndpoint)
\r
422 utils.log("DEBUG", "DB Adapter Endpoint is: " + dbAdapterEndpoint, isDebugEnabled)
\r
425 """<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
\r
426 xmlns:ns="http://org.openecomp.mso/requestsdb">
\r
429 <ns:updateInfraRequest xmlns:ns="http://org.openecomp.mso/requestsdb">
\r
430 <requestId>${requestId}</requestId>
\r
431 <lastModifiedBy>BPMN</lastModifiedBy>
\r
432 <statusMessage>VF Module successfully created</statusMessage>
\r
433 <responseBody></responseBody>
\r
434 <requestStatus>COMPLETE</requestStatus>
\r
435 <progress>100</progress>
\r
436 <vnfOutputs><vnf-outputs xmlns="http://org.openecomp/mso/infra/vnf-request/v1" xmlns:aetgt="http://org.openecomp/mso/infra/vnf-request/v1" xmlns:rest="http://schemas.activebpel.org/REST/2007/12/01/aeREST.xsd"><vnf-id>${vnfId}</vnf-id><vf-module-id>${vfModuleId}</vf-module-id></vnf-outputs></vnfOutputs>
\r
437 <vfModuleId>${vfModuleId}</vfModuleId>
\r
438 <vfModuleName>${vfModuleName}</vfModuleName>
\r
439 </ns:updateInfraRequest>
\r
441 </soapenv:Envelope>"""
\r
443 payload = utils.formatXml(payload)
\r
444 execution.setVariable("CVFMI_updateInfraRequest", payload)
\r
445 utils.log("DEBUG", "Outgoing UpdateInfraRequest: \n" + payload, isDebugEnabled)
\r
446 utils.logAudit("CreateVfModuleInfra Outgoing UpdateInfra Request: " + payload)
\r
448 }catch(Exception e){
\r
449 utils.log("ERROR", "Exception Occured Processing prepareUpdateInfraRequest. Exception is:\n" + e, isDebugEnabled)
\r
450 execution.setVariable("CVFMI_ErrorResponse", "Error Occurred during prepareUpdateInfraRequest Method:\n" + e.getMessage())
\r
452 utils.log("DEBUG", "======== COMPLETED prepareUpdateInfraRequest Process ======== ", isDebugEnabled)
\r
456 * Builds a "FalloutHandler" request and stores it in the specified execution variable.
\r
458 * @param execution the execution
\r
459 * @param resultVar the execution variable in which the result will be stored
\r
461 public void falloutHandlerPrep(DelegateExecution execution, String resultVar) {
\r
462 def method = getClass().getSimpleName() + '.falloutHandlerPrep(' +
\r
463 'execution=' + execution.getId() +
\r
464 ', resultVar=' + resultVar +
\r
466 def isDebugLogEnabled = execution.getVariable('isDebugLogEnabled')
\r
467 logDebug('Entered ' + method, isDebugLogEnabled)
\r
471 def WorkflowException workflowException = execution.getVariable("WorkflowException")
\r
472 def requestInformation = execution.getVariable("CVFMI_requestInfo")
\r
473 def errorResponseCode = workflowException.getErrorCode()
\r
474 def errorResponseMsg = workflowException.getErrorMessage()
\r
475 def encErrorResponseMsg = ""
\r
476 if (errorResponseMsg != null) {
\r
477 encErrorResponseMsg = errorResponseMsg.replace("&", "&").replace("<", "<").replace(">", ">")
\r
480 String content = """
\r
481 <aetgt:FalloutHandlerRequest xmlns:aetgt="http://org.openecomp/mso/workflow/schema/v1"
\r
482 xmlns:reqtype="http://org.openecomp/mso/request/types/v1"
\r
483 xmlns:msoservtypes="http://org.openecomp/mso/request/types/v1"
\r
484 xmlns:structuredtypes="http://org.openecomp/mso/structured/types/v1">
\r
485 ${requestInformation}
\r
486 <aetgt:WorkflowException>
\r
487 <aetgt:ErrorMessage>${encErrorResponseMsg}</aetgt:ErrorMessage>
\r
488 <aetgt:ErrorCode>${errorResponseCode}</aetgt:ErrorCode>
\r
489 </aetgt:WorkflowException>
\r
490 </aetgt:FalloutHandlerRequest>
\r
493 logDebug("CONTENT before translation: " + content, isDebugLogEnabled)
\r
494 content = utils.formatXml(content)
\r
495 logDebug(resultVar + ' = ' + System.lineSeparator() + content, isDebugLogEnabled)
\r
496 utils.logAudit("CreateVfModuleInfra FallOutHander Request: " + content)
\r
497 execution.setVariable(resultVar, content)
\r
499 logDebug('Exited ' + method, isDebugLogEnabled)
\r
500 } catch (BpmnError e) {
\r
502 } catch (Exception e) {
\r
503 logError('Caught exception in ' + method, e)
\r
504 exceptionUtil.buildWorkflowException(execution, 2000, 'Internal Error')
\r
508 public void logAndSaveOriginalException(DelegateExecution execution) {
\r
509 def method = getClass().getSimpleName() + '.validateRollbackResponse(' +
\r
510 'execution=' + execution.getId() +
\r
512 def isDebugLogEnabled = execution.getVariable('isDebugLogEnabled')
\r
513 logDebug('Entered ' + method, isDebugLogEnabled)
\r
515 logWorkflowException(execution, 'CreateVfModuleInfra caught an event')
\r
516 saveWorkflowException(execution, 'CVFMI_originalWorkflowException')
\r
519 public void validateRollbackResponse(DelegateExecution execution) {
\r
520 def method = getClass().getSimpleName() + '.validateRollbackResponse(' +
\r
521 'execution=' + execution.getId() +
\r
523 def isDebugLogEnabled = execution.getVariable('isDebugLogEnabled')
\r
524 logDebug('Entered ' + method, isDebugLogEnabled)
\r
526 def originalException = execution.getVariable("CVFMI_originalWorkflowException")
\r
527 execution.setVariable("WorkflowException", originalException)
\r
529 execution.setVariable("RollbackCompleted", true)
\r
533 public void sendErrorResponse(DelegateExecution execution){
\r
534 def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
\r
536 utils.log("DEBUG", " *** STARTED CreateVfModulenfra sendErrorResponse Process *** ", isDebugEnabled)
\r
538 def sentSyncResponse = execution.getVariable("CVFMI_sentSyncResponse")
\r
539 if(sentSyncResponse == false){
\r
540 WorkflowException wfex = execution.getVariable("WorkflowException")
\r
541 String response = exceptionUtil.buildErrorResponseXml(wfex)
\r
543 utils.logAudit(response)
\r
544 sendWorkflowResponse(execution, 500, response)
\r
546 utils.log("DEBUG", "Not Sending Error Response. Sync Response Already Sent", isDebugEnabled)
\r
549 } catch (Exception ex) {
\r
550 utils.log("DEBUG", "Error Occured in CreateVfModuleInfra sendErrorResponse Process " + ex.getMessage(), isDebugEnabled)
\r
551 exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "Internal Error - Occured in CreateVfModuleInfra sendErrorResponse Process")
\r
554 utils.log("DEBUG", "*** COMPLETED CreateVfModuleInfra sendErrorResponse Process ***", isDebugEnabled)
\r