2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2018 Huawei Technologies Co., Ltd. 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.apache.commons.lang3.*
26 import org.camunda.bpm.engine.delegate.BpmnError
27 import org.camunda.bpm.engine.delegate.DelegateExecution
28 import org.json.JSONArray
29 import org.json.JSONObject
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.core.WorkflowException
34 import org.onap.so.bpmn.core.domain.Resource
35 import org.onap.so.bpmn.core.json.JsonUtils
36 import org.springframework.web.util.UriUtils
41 * This groovy class supports the <class>UpdateCustomE2EServiceInstance.bpmn</class> process.
42 * AlaCarte flow for 1702 ServiceInstance Update
45 public class UpdateCustomE2EServiceInstance extends AbstractServiceTaskProcessor {
46 String Prefix="UPDSI_"
47 ExceptionUtil exceptionUtil = new ExceptionUtil()
48 JsonUtils jsonUtil = new JsonUtils()
51 public void preProcessRequest (DelegateExecution execution) {
52 def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
53 execution.setVariable("prefix",Prefix)
55 utils.log("INFO", " *** preProcessRequest() *** ", isDebugEnabled)
59 String siRequest = execution.getVariable("bpmnRequest")
60 utils.logAudit(siRequest)
62 String requestId = execution.getVariable("mso-request-id")
63 execution.setVariable("msoRequestId", requestId)
64 utils.log("INFO", "Input Request:" + siRequest + " reqId:" + requestId, isDebugEnabled)
66 String serviceInstanceId = execution.getVariable("serviceInstanceId")
67 if (isBlank(serviceInstanceId)) {
68 msg = "Input serviceInstanceId' is null"
69 exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
72 //subscriberInfo for aai
73 String globalSubscriberId = jsonUtil.getJsonValue(siRequest, "requestDetails.subscriberInfo.globalSubscriberId")
74 if (isBlank(globalSubscriberId)) {
75 msg = "Input globalSubscriberId' is null"
76 exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
78 execution.setVariable("globalSubscriberId", globalSubscriberId)
82 execution.setVariable("source", jsonUtil.getJsonValue(siRequest, "requestDetails.requestInfo.source"))
83 execution.setVariable("serviceInstanceName", jsonUtil.getJsonValue(siRequest, "requestDetails.requestInfo.instanceName"))
84 execution.setVariable("disableRollback", jsonUtil.getJsonValue(siRequest, "requestDetails.requestInfo.suppressRollback"))
85 String productFamilyId = jsonUtil.getJsonValue(siRequest, "requestDetails.requestInfo.productFamilyId")
86 if (isBlank(productFamilyId))
88 msg = "Input productFamilyId is null"
89 utils.log("INFO", msg, isDebugEnabled)
91 execution.setVariable("productFamilyId", productFamilyId)
95 String userParams = jsonUtil.getJsonValue(siRequest, "requestDetails.requestParameters.userParams")
96 utils.log("INFO", "userParams:" + userParams, isDebugEnabled)
97 List<String> paramList = jsonUtil.StringArrayToList(execution, userParams)
98 String uuiRequest = jsonUtil.getJsonValue(paramList.get(0), "UUIRequest")
99 if (isBlank(uuiRequest)) {
100 msg = "Input uuiRequest is null"
101 utils.log("INFO", msg, isDebugEnabled)
102 exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
105 execution.setVariable("uuiRequest", uuiRequest)
108 utils.log("INFO", "uuiRequest:\n" + uuiRequest, isDebugEnabled)
110 //serviceType for aai
111 String serviceType = jsonUtil.getJsonValue(uuiRequest, "service.serviceType")
112 if (isBlank(serviceType)) {
113 msg = "Input serviceType is null"
114 utils.log("INFO", msg, isDebugEnabled)
115 exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
117 execution.setVariable("serviceType", serviceType)
121 String modelInvariantUuid = jsonUtil.getJsonValue(uuiRequest, "service.serviceInvariantUuid")
122 utils.log("INFO","modelInvariantUuid: " + modelInvariantUuid, isDebugEnabled)
123 execution.setVariable("modelInvariantUuid", modelInvariantUuid)
124 execution.setVariable("model-invariant-id-target", modelInvariantUuid)
126 String modelUuid = jsonUtil.getJsonValue(uuiRequest, "service.serviceUuid")
127 utils.log("INFO","modelUuid: " + modelUuid, isDebugEnabled)
128 execution.setVariable("modelUuid", modelUuid)
129 execution.setVariable("model-version-id-target", modelUuid)
131 String serviceModelName = jsonUtil.getJsonValue(uuiRequest, "service.parameters.templateName")
132 utils.log("INFO","serviceModelName: " + serviceModelName, isDebugEnabled)
133 if(serviceModelName == null) {
134 serviceModelName = ""
136 execution.setVariable("serviceModelName", serviceModelName)
139 String operationId = jsonUtil.getJsonValue(siRequest, "operationId")
140 if (isBlank(operationId)) {
141 operationId = UUID.randomUUID().toString()
143 execution.setVariable("operationId", operationId)
144 execution.setVariable("operationType", "update")
145 execution.setVariable("hasResourcetoUpdate", false)
147 execution.setVariable("URN_mso_adapters_openecomp_db_endpoint","http://mso.mso.testlab.openecomp.org:8080/dbadapters/RequestsDbAdapter")
149 } catch (BpmnError e) {
151 } catch (Exception ex){
152 msg = "Exception in preProcessRequest " + ex.getMessage()
153 utils.log("INFO", msg, isDebugEnabled)
154 exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
156 utils.log("INFO"," ***** Exit preProcessRequest *****", isDebugEnabled)
160 public void postProcessAAIGET(DelegateExecution execution) {
161 def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
162 utils.log("INFO"," ***** postProcessAAIGET ***** ", isDebugEnabled)
166 String serviceInstanceId = execution.getVariable("serviceInstanceId")
167 boolean foundInAAI = execution.getVariable("GENGS_FoundIndicator")
168 String serviceType = ""
171 utils.log("INFO","Found Service-instance in AAI", isDebugEnabled)
173 String siData = execution.getVariable("GENGS_service")
174 utils.log("INFO", "SI Data", isDebugEnabled)
177 msg = "Could not retrive ServiceInstance data from AAI, Id:" + serviceInstanceId
178 utils.log("INFO", msg, isDebugEnabled)
179 exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
182 utils.log("INFO", "SI Data" + siData, isDebugEnabled)
184 // serviceInstanceName
185 String serviceInstanceName = execution.getVariable("serviceInstanceName")
186 if(isBlank(serviceInstanceName) && utils.nodeExists(siData, "service-instance-name")) {
187 serviceInstanceName = utils.getNodeText(siData, "service-instance-name")
188 execution.setVariable("serviceInstanceName", serviceInstanceName)
191 // Get Template uuid and version
192 if (utils.nodeExists(siData, "model-invariant-id") && utils.nodeExists(siData, "model-version-id") ) {
193 utils.log("INFO", "SI Data model-invariant-id and model-version-id exist:", isDebugEnabled)
195 def modelInvariantId = utils.getNodeText(siData, "model-invariant-id")
196 def modelVersionId = utils.getNodeText(siData, "model-version-id")
198 // Set Original Template info
199 execution.setVariable("model-invariant-id-original", modelInvariantId)
200 execution.setVariable("model-version-id-original", modelVersionId)
203 //get related service instances (vnf/network or volume) for delete
204 if (utils.nodeExists(siData, "relationship-list")) {
205 utils.log("INFO", "SI Data relationship-list exists:", isDebugEnabled)
207 JSONArray jArray = new JSONArray()
209 XmlParser xmlParser = new XmlParser()
210 Node root = xmlParser.parseText(siData)
211 def relation_list = utils.getChildNode(root, 'relationship-list')
212 def relationships = utils.getIdenticalChildren(relation_list, 'relationship')
214 for (def relation: relationships) {
215 def jObj = getRelationShipData(relation, isDebugEnabled)
219 execution.setVariable("serviceRelationShip", jArray.toString())
222 boolean succInAAI = execution.getVariable("GENGS_SuccessIndicator")
224 utils.log("INFO","Error getting Service-instance from AAI", + serviceInstanceId, isDebugEnabled)
225 WorkflowException workflowException = execution.getVariable("WorkflowException")
226 utils.logAudit("workflowException: " + workflowException)
227 if(workflowException != null){
228 exceptionUtil.buildAndThrowWorkflowException(execution, workflowException.getErrorCode(), workflowException.getErrorMessage())
232 msg = "Failure in postProcessAAIGET GENGS_SuccessIndicator:" + succInAAI
233 utils.log("INFO", msg, isDebugEnabled)
234 exceptionUtil.buildAndThrowWorkflowException(execution, 2500, msg)
238 utils.log("INFO","Service-instance NOT found in AAI. Silent Success", isDebugEnabled)
240 }catch (BpmnError e) {
242 } catch (Exception ex) {
243 msg = "Exception in DoDeleteE2EServiceInstance.postProcessAAIGET. " + ex.getMessage()
244 utils.log("INFO", msg, isDebugEnabled)
245 exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
247 utils.log("INFO"," *** Exit postProcessAAIGET *** ", isDebugEnabled)
250 private JSONObject getRelationShipData(node, isDebugEnabled){
251 JSONObject jObj = new JSONObject()
253 def relation = utils.nodeToString(node)
254 def rt = utils.getNodeText(relation, "related-to")
256 def rl = utils.getNodeText(relation, "related-link")
257 utils.log("INFO", "ServiceInstance Related NS/Configuration :" + rl, isDebugEnabled)
259 def rl_datas = utils.getIdenticalChildren(node, "relationship-data")
260 for(def rl_data : rl_datas) {
261 def eKey = utils.getChildNodeText(rl_data, "relationship-key")
262 def eValue = utils.getChildNodeText(rl_data, "relationship-value")
264 if ((rt == "service-instance" && eKey.equals("service-instance.service-instance-id"))
265 //for overlay/underlay
266 || (rt == "configuration" && eKey.equals("configuration.configuration-id"))){
267 jObj.put("resourceInstanceId", eValue)
271 def rl_props = utils.getIdenticalChildren(node, "related-to-property")
272 for(def rl_prop : rl_props) {
273 def eKey = utils.getChildNodeText(rl_prop, "property-key")
274 def eValue = utils.getChildNodeText(rl_prop, "property-value")
275 if((rt == "service-instance" && eKey.equals("service-instance.service-instance-name"))
276 //for overlay/underlay
277 || (rt == "configuration" && eKey.equals("configuration.configuration-type"))){
278 jObj.put("resourceType", eValue)
282 utils.log("INFO", "Relationship related to Resource:" + jObj.toString(), isDebugEnabled)
288 public void preCompareModelVersions(DelegateExecution execution) {
289 def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
292 public void postCompareModelVersions(DelegateExecution execution) {
293 def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
294 utils.log("DEBUG", " ======== STARTED postCompareModelVersions Process ======== ", isDebugEnabled)
296 def hasResourcetoUpdate = false
297 def hasResourcetoAdd = false
298 def hasResourcetoDelete = false
299 List<Resource> addResourceList = execution.getVariable("addResourceList")
300 List<Resource> delResourceList = execution.getVariable("delResourceList")
302 if(addResourceList != null && !addResourceList.isEmpty()) {
303 hasResourcetoAdd = true
306 if(delResourceList != null && !delResourceList.isEmpty()) {
307 hasResourcetoDelete = true
310 hasResourcetoUpdate = hasResourcetoAdd || hasResourcetoDelete
311 execution.setVariable("hasResourcetoUpdate", hasResourcetoUpdate)
313 utils.log("DEBUG", "======== COMPLETED postCompareModelVersions Process ======== ", isDebugEnabled)
317 * Init the service Operation Status
319 public void prepareInitServiceOperationStatus(DelegateExecution execution){
320 def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
321 utils.log("DEBUG", " ======== STARTED prepareInitServiceOperationStatus Process ======== ", isDebugEnabled)
323 String serviceId = execution.getVariable("serviceInstanceId")
324 String operationId = execution.getVariable("operationId")
325 String operationType = execution.getVariable("operationType")
327 String result = "processing"
328 String progress = "0"
330 String operationContent = "Prepare service updating"
331 utils.log("DEBUG", "Generated new operation for Service Instance serviceId:" + serviceId + " operationId:" + operationId, isDebugEnabled)
332 serviceId = UriUtils.encode(serviceId,"UTF-8")
333 execution.setVariable("serviceInstanceId", serviceId)
334 execution.setVariable("operationId", operationId)
335 execution.setVariable("operationType", operationType)
337 def dbAdapterEndpoint = execution.getVariable("URN_mso_adapters_openecomp_db_endpoint")
338 execution.setVariable("CVFMI_dbAdapterEndpoint", dbAdapterEndpoint)
339 utils.log("DEBUG", "DB Adapter Endpoint is: " + dbAdapterEndpoint, isDebugEnabled)
342 """<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
343 xmlns:ns="http://org.onap.so/requestsdb">
346 <ns:updateServiceOperationStatus xmlns:ns="http://org.onap.so/requestsdb">
347 <serviceId>${MsoUtils.xmlEscape(serviceId)}</serviceId>
348 <operationId>${MsoUtils.xmlEscape(operationId)}</operationId>
349 <operationType>${MsoUtils.xmlEscape(operationType)}</operationType>
350 <userId>${MsoUtils.xmlEscape(userId)}</userId>
351 <result>${MsoUtils.xmlEscape(result)}</result>
352 <operationContent>${MsoUtils.xmlEscape(operationContent)}</operationContent>
353 <progress>${MsoUtils.xmlEscape(progress)}</progress>
354 <reason>${MsoUtils.xmlEscape(reason)}</reason>
355 </ns:updateServiceOperationStatus>
357 </soapenv:Envelope>"""
359 payload = utils.formatXml(payload)
360 execution.setVariable("CVFMI_updateServiceOperStatusRequest", payload)
361 utils.log("DEBUG", "Outgoing updateServiceOperStatusRequest: \n" + payload, isDebugEnabled)
362 utils.logAudit("CreateVfModuleInfra Outgoing updateServiceOperStatusRequest Request: " + payload)
365 utils.log("ERROR", "Exception Occured Processing prepareInitServiceOperationStatus. Exception is:\n" + e, isDebugEnabled)
366 execution.setVariable("CVFMI_ErrorResponse", "Error Occurred during prepareInitServiceOperationStatus Method:\n" + e.getMessage())
368 utils.log("DEBUG", "======== COMPLETED prepareInitServiceOperationStatus Process ======== ", isDebugEnabled)
372 * Update the service Operation Status
374 public void preUpdateServiceOperationStatus(DelegateExecution execution){
375 def method = getClass().getSimpleName() + '.preUpdateServiceOperationStatus(' +'execution=' + execution.getId() +')'
376 def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
377 utils.log("INFO","Entered " + method, isDebugEnabled)
380 String serviceId = execution.getVariable("serviceInstanceId")
381 String operationId = execution.getVariable("operationId")
382 String operationType = execution.getVariable("operationType")
383 String serviceName = execution.getVariable("serviceInstanceName")
384 String result = execution.getVariable("operationResult")
385 String progress = execution.getVariable("progress")
386 String reason = execution.getVariable("operationReason")
388 utils.log("INFO", "progress: " + progress , isDebugEnabled)
390 String operationContent = "Prepare service : " + execution.getVariable("operationStatus")
392 utils.log("INFO", "Generated new operation for Service Instance serviceId:" + serviceId + " operationId:" + operationId, isDebugEnabled)
393 serviceId = UriUtils.encode(serviceId,"UTF-8")
394 execution.setVariable("serviceInstanceId", serviceId)
395 execution.setVariable("operationId", operationId)
396 execution.setVariable("operationType", operationType)
398 def dbAdapterEndpoint = "http://mso.mso.testlab.openecomp.org:8080/dbadapters/RequestsDbAdapter"
399 execution.setVariable("CVFMI_dbAdapterEndpoint", dbAdapterEndpoint)
400 utils.log("INFO", "DB Adapter Endpoint is: " + dbAdapterEndpoint, isDebugEnabled)
402 execution.setVariable("URN_mso_openecomp_adapters_db_endpoint","http://mso.mso.testlab.openecomp.org:8080/dbadapters/RequestsDbAdapter")
404 """<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
405 xmlns:ns="http://org.onap.so/requestsdb">
408 <ns:updateServiceOperationStatus xmlns:ns="http://org.onap.so/requestsdb">
409 <serviceId>${MsoUtils.xmlEscape(serviceId)}</serviceId>
410 <operationId>${MsoUtils.xmlEscape(operationId)}</operationId>
411 <operationType>${MsoUtils.xmlEscape(operationType)}</operationType>
412 <userId>${MsoUtils.xmlEscape(userId)}</userId>
413 <result>${MsoUtils.xmlEscape(result)}</result>
414 <operationContent>${MsoUtils.xmlEscape(operationContent)}</operationContent>
415 <progress>${MsoUtils.xmlEscape(progress)}</progress>
416 <reason>${MsoUtils.xmlEscape(reason)}</reason>
417 </ns:updateServiceOperationStatus>
419 </soapenv:Envelope>"""
421 payload = utils.formatXml(payload)
422 execution.setVariable("CVFMI_updateServiceOperStatusRequest", payload)
423 utils.log("INFO", "Outgoing preUpdateServiceOperationStatus: \n" + payload, isDebugEnabled)
427 utils.log("ERROR", "Exception Occured Processing preUpdateServiceOperationStatus. Exception is:\n" + e, isDebugEnabled)
428 execution.setVariable("CVFMI_ErrorResponse", "Error Occurred during preUpdateServiceOperationStatus Method:\n" + e.getMessage())
430 utils.log("INFO", "======== COMPLETED preUpdateServiceOperationStatus Process ======== ", isDebugEnabled)
431 utils.log("INFO", "Exited " + method, isDebugEnabled)
434 public void sendSyncResponse (DelegateExecution execution) {
435 def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
436 utils.log("INFO", " *** sendSyncResponse *** ", isDebugEnabled)
439 String operationId = execution.getVariable("operationId")
440 def hasResourcetoUpdate = execution.getVariable("hasResourcetoUpdate")
442 String updateServiceResp = ""
443 if(hasResourcetoUpdate) {
444 // RESTResponse for API Handler (APIH) Reply Task
445 updateServiceResp = """{"operationId":"${operationId}"}""".trim()
448 updateServiceResp = """{"OperationResult":"No Resource to Add or Delete or Service Instance not found in AAI."}"""
451 utils.log("INFO", " sendSyncResponse to APIH:" + "\n" + updateServiceResp, isDebugEnabled)
452 sendWorkflowResponse(execution, 202, updateServiceResp)
453 execution.setVariable("sentSyncResponse", true)
455 } catch (Exception ex) {
456 String msg = "Exceptuion in sendSyncResponse:" + ex.getMessage()
457 utils.log("INFO", msg, isDebugEnabled)
458 exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
460 utils.log("INFO"," ***** Exit sendSyncResopnse *****", isDebugEnabled)
463 public void sendSyncError (DelegateExecution execution) {
464 def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
465 utils.log("INFO", " *** sendSyncError *** ", isDebugEnabled)
468 String errorMessage = ""
470 if (execution.getVariable("WorkflowException") instanceof WorkflowException) {
471 WorkflowException wfe = execution.getVariable("WorkflowException")
472 errorMessage = wfe.getErrorMessage()
473 errorCode = wfe.getErrorCode()
475 errorMessage = "Sending Sync Error."
478 String buildworkflowException =
479 """<aetgt:WorkflowException xmlns:aetgt="http://org.onap/so/workflow/schema/v1">
480 <aetgt:ErrorMessage>${MsoUtils.xmlEscape(errorMessage)}</aetgt:ErrorMessage>
481 <aetgt:ErrorCode>${MsoUtils.xmlEscape(errorCode)}</aetgt:ErrorCode>
482 </aetgt:WorkflowException>"""
484 utils.logAudit(buildworkflowException)
485 sendWorkflowResponse(execution, 500, buildworkflowException)
487 } catch (Exception ex) {
488 utils.log("INFO", " Sending Sync Error Activity Failed. " + "\n" + ex.getMessage(), isDebugEnabled)
493 public void prepareCompletionRequest (DelegateExecution execution) {
494 def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
495 utils.log("INFO", " *** prepareCompletion *** ", isDebugEnabled)
498 String requestId = execution.getVariable("msoRequestId")
499 String serviceInstanceId = execution.getVariable("serviceInstanceId")
500 String source = execution.getVariable("source")
502 String msoCompletionRequest =
503 """<aetgt:MsoCompletionRequest xmlns:aetgt="http://org.onap/so/workflow/schema/v1"
504 xmlns:ns="http://org.onap/so/request/types/v1">
505 <request-info xmlns="http://org.onap/so/infra/vnf-request/v1">
506 <request-id>${MsoUtils.xmlEscape(requestId)}</request-id>
507 <action>UPDATE</action>
508 <source>${MsoUtils.xmlEscape(source)}</source>
510 <status-message>Service Instance was updated successfully.</status-message>
511 <serviceInstanceId>${MsoUtils.xmlEscape(serviceInstanceId)}</serviceInstanceId>
512 <mso-bpel-name>UpdateCustomE2EServiceInstance</mso-bpel-name>
513 </aetgt:MsoCompletionRequest>"""
516 String xmlMsoCompletionRequest = utils.formatXml(msoCompletionRequest)
518 execution.setVariable("completionRequest", xmlMsoCompletionRequest)
519 utils.log("INFO", " Overall SUCCESS Response going to CompleteMsoProcess - " + "\n" + xmlMsoCompletionRequest, isDebugEnabled)
521 } catch (Exception ex) {
522 String msg = " Exception in prepareCompletion:" + ex.getMessage()
523 utils.log("INFO", msg, isDebugEnabled)
524 exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
526 utils.log("INFO", "*** Exit prepareCompletionRequest ***", isDebugEnabled)
529 public void prepareFalloutRequest(DelegateExecution execution){
530 def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
531 utils.log("INFO", " *** prepareFalloutRequest *** ", isDebugEnabled)
534 WorkflowException wfex = execution.getVariable("WorkflowException")
535 utils.log("INFO", " Input Workflow Exception: " + wfex.toString(), isDebugEnabled)
536 String requestId = execution.getVariable("msoRequestId")
537 String source = execution.getVariable("source")
539 """<request-info xmlns="http://org.onap/so/infra/vnf-request/v1">
540 <request-id>${MsoUtils.xmlEscape(requestId)}</request-id>
541 <action>UPDATE</action>
542 <source>${MsoUtils.xmlEscape(source)}</source>
545 String falloutRequest = exceptionUtil.processMainflowsBPMNException(execution, requestInfo)
546 execution.setVariable("falloutRequest", falloutRequest)
547 } catch (Exception ex) {
548 utils.log("INFO", "Exception prepareFalloutRequest:" + ex.getMessage(), isDebugEnabled)
549 String errorException = " Bpmn error encountered in UpdateCustomE2EServiceInstance flow. FalloutHandlerRequest, buildErrorResponse() - " + ex.getMessage()
550 String requestId = execution.getVariable("msoRequestId")
551 String falloutRequest =
552 """<aetgt:FalloutHandlerRequest xmlns:aetgt="http://org.onap/so/workflow/schema/v1"
553 xmlns:ns="http://org.onap/so/request/types/v1"
554 xmlns:wfsch="http://org.onap/so/workflow/schema/v1">
555 <request-info xmlns="http://org.onap/so/infra/vnf-request/v1">
556 <request-id>${MsoUtils.xmlEscape(requestId)}</request-id>
557 <action>UPDATE</action>
560 <aetgt:WorkflowException xmlns:aetgt="http://org.onap/so/workflow/schema/v1">
561 <aetgt:ErrorMessage>${MsoUtils.xmlEscape(errorException)}</aetgt:ErrorMessage>
562 <aetgt:ErrorCode>7000</aetgt:ErrorCode>
563 </aetgt:WorkflowException>
564 </aetgt:FalloutHandlerRequest>"""
566 execution.setVariable("falloutRequest", falloutRequest)
568 utils.log("INFO", "*** Exit prepareFalloutRequest ***", isDebugEnabled)