Minior Change - Licence Statement
[so.git] / bpmn / so-bpmn-infrastructure-common / src / main / groovy / org / onap / so / bpmn / infrastructure / scripts / UpdateCustomE2EServiceInstance.groovy
1 /*-
2  * ============LICENSE_START=======================================================
3  * ONAP - SO
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
10  *
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  * ============LICENSE_END=========================================================
19  */
20
21 package org.onap.so.bpmn.infrastructure.scripts;
22
23 import static org.apache.commons.lang3.StringUtils.*;
24
25 import javax.ws.rs.NotFoundException
26
27 import org.apache.commons.lang3.*
28 import org.camunda.bpm.engine.delegate.BpmnError
29 import org.camunda.bpm.engine.delegate.DelegateExecution
30 import org.json.JSONArray
31 import org.json.JSONObject
32 import org.onap.aai.domain.yang.ServiceInstance
33 import org.onap.so.bpmn.common.scripts.AbstractServiceTaskProcessor
34 import org.onap.so.bpmn.common.scripts.ExceptionUtil
35 import org.onap.so.bpmn.common.scripts.MsoUtils
36 import org.onap.so.bpmn.core.WorkflowException
37 import org.onap.so.bpmn.core.domain.Resource
38 import org.onap.so.bpmn.core.json.JsonUtils
39 import org.onap.so.bpmn.core.UrnPropertiesReader
40 import org.onap.so.client.aai.AAIObjectType
41 import org.onap.so.client.aai.AAIResourcesClient
42 import org.onap.so.client.aai.entities.AAIResultWrapper
43 import org.onap.so.client.aai.entities.uri.AAIResourceUri
44 import org.onap.so.client.aai.entities.uri.AAIUriFactory
45 import org.springframework.web.util.UriUtils
46
47 import groovy.json.*
48
49 /**
50  * This groovy class supports the <class>UpdateCustomE2EServiceInstance.bpmn</class> process.
51  * AlaCarte flow for 1702 ServiceInstance Update
52  *
53  */
54 public class UpdateCustomE2EServiceInstance extends AbstractServiceTaskProcessor {
55         String Prefix="UPDSI_"
56         ExceptionUtil exceptionUtil = new ExceptionUtil()
57         JsonUtils jsonUtil = new JsonUtils()
58
59
60         public void preProcessRequest (DelegateExecution execution) {
61                 def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
62                 execution.setVariable("prefix",Prefix)
63                 String msg = ""
64                 utils.log("INFO", " *** preProcessRequest() *** ", isDebugEnabled)
65
66                 try {
67
68                         String siRequest = execution.getVariable("bpmnRequest")
69                         utils.logAudit(siRequest)
70
71                         String requestId = execution.getVariable("mso-request-id")
72                         execution.setVariable("msoRequestId", requestId)
73                         utils.log("INFO", "Input Request:" + siRequest + " reqId:" + requestId, isDebugEnabled)
74
75                         String serviceInstanceId = execution.getVariable("serviceInstanceId")
76                         if (isBlank(serviceInstanceId)) {
77                                 msg = "Input serviceInstanceId' is null"
78                                 exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
79                         }
80
81                         //subscriberInfo for aai
82                         String globalSubscriberId = jsonUtil.getJsonValue(siRequest, "requestDetails.subscriberInfo.globalSubscriberId")
83                         if (isBlank(globalSubscriberId)) {
84                                 msg = "Input globalSubscriberId' is null"
85                                 exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
86                         } else {
87                                 execution.setVariable("globalSubscriberId", globalSubscriberId)
88                         }
89
90                         //requestDetails
91                         execution.setVariable("source", jsonUtil.getJsonValue(siRequest, "requestDetails.requestInfo.source"))
92                         execution.setVariable("serviceInstanceName", jsonUtil.getJsonValue(siRequest, "requestDetails.requestInfo.instanceName"))
93                         execution.setVariable("disableRollback", jsonUtil.getJsonValue(siRequest, "requestDetails.requestInfo.suppressRollback"))
94                         String productFamilyId = jsonUtil.getJsonValue(siRequest, "requestDetails.requestInfo.productFamilyId")
95                         if (isBlank(productFamilyId))
96                         {
97                                 msg = "Input productFamilyId is null"
98                                 utils.log("INFO", msg, isDebugEnabled)
99                         } else {
100                                 execution.setVariable("productFamilyId", productFamilyId)
101                         }
102
103                          //user params
104                  String userParams = jsonUtil.getJsonValue(siRequest, "requestDetails.requestParameters.userParams")
105              utils.log("INFO", "userParams:" + userParams, isDebugEnabled)
106                  List<String> paramList = jsonUtil.StringArrayToList(execution, userParams)
107                  String uuiRequest = jsonUtil.getJsonValue(paramList.get(0), "UUIRequest")
108                         if (isBlank(uuiRequest)) {
109                                 msg = "Input uuiRequest is null"
110                                 utils.log("INFO", msg, isDebugEnabled)
111                                 exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
112                         } else
113                         {
114                                 execution.setVariable("uuiRequest", uuiRequest)
115                         }
116
117                         utils.log("INFO", "uuiRequest:\n" + uuiRequest,  isDebugEnabled)
118
119                         //serviceType for aai
120                         String serviceType = jsonUtil.getJsonValue(uuiRequest, "service.serviceType")
121                         if (isBlank(serviceType)) {
122                                 msg = "Input serviceType is null"
123                                 utils.log("INFO", msg, isDebugEnabled)
124                                 exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
125                         } else {
126                                 execution.setVariable("serviceType", serviceType)
127                         }
128
129                         // target model info
130                         String modelInvariantUuid = jsonUtil.getJsonValue(uuiRequest, "service.serviceInvariantUuid")
131                         utils.log("INFO","modelInvariantUuid: " + modelInvariantUuid, isDebugEnabled)
132                         execution.setVariable("modelInvariantUuid", modelInvariantUuid)
133                         execution.setVariable("model-invariant-id-target", modelInvariantUuid)
134
135                         String modelUuid = jsonUtil.getJsonValue(uuiRequest, "service.serviceUuid")
136                         utils.log("INFO","modelUuid: " + modelUuid, isDebugEnabled)
137                         execution.setVariable("modelUuid", modelUuid)
138                         execution.setVariable("model-version-id-target", modelUuid)
139
140                         String serviceModelName = jsonUtil.getJsonValue(uuiRequest, "service.parameters.templateName")
141                         utils.log("INFO","serviceModelName: " + serviceModelName, isDebugEnabled)
142                         if(serviceModelName == null) {
143                                 serviceModelName = ""
144                         }
145                         execution.setVariable("serviceModelName", serviceModelName)
146
147                         //operationId
148                         String operationId = jsonUtil.getJsonValue(siRequest, "operationId")
149                         if (isBlank(operationId)) {
150                                 operationId = UUID.randomUUID().toString()
151                          }
152                         execution.setVariable("operationId", operationId)
153                         execution.setVariable("operationType", "update")
154                         execution.setVariable("hasResourcetoUpdate", false)
155
156                 } catch (BpmnError e) {
157                         throw e;
158                 } catch (Exception ex){
159                         msg = "Exception in preProcessRequest " + ex.getMessage()
160                         utils.log("INFO", msg, isDebugEnabled)
161                         exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
162                 }
163                 utils.log("INFO"," ***** Exit preProcessRequest *****",  isDebugEnabled)
164         }
165
166         /**
167          * Gets the service instance and its relationships from aai
168          */
169         public void getServiceInstance(DelegateExecution execution) {
170                 try {
171                         String serviceInstanceId = execution.getVariable('serviceInstanceId')
172                         String globalSubscriberId = execution.getVariable('globalSubscriberId')
173                         String serviceType = execution.getVariable('serviceType')
174
175                         AAIResourcesClient resourceClient = new AAIResourcesClient()
176                         AAIResourceUri serviceInstanceUri = AAIUriFactory.createResourceUri(AAIObjectType.SERVICE_INSTANCE, globalSubscriberId, serviceType, serviceInstanceId)
177                         AAIResultWrapper wrapper = resourceClient.get(serviceInstanceUri, NotFoundException.class)
178
179                         Optional<ServiceInstance> si = wrapper.asBean(ServiceInstance.class)
180                         execution.setVariable("serviceInstanceName", si.get().getServiceInstanceName())
181                         execution.setVariable("model-invariant-id-original", si.get().getModelInvariantId())
182                         execution.setVariable("model-version-id-original", si.get().getModelVersionId())
183
184                         JSONObject ob = new JSONObject(wrapper.getJson())
185                         JSONArray ar = ob.getJSONObject("relationship-list").getJSONArray("relationship")
186
187                         execution.setVariable("serviceRelationShip", ar.toString())
188
189
190                 }catch(BpmnError e) {
191                         throw e;
192                 }catch(NotFoundException e) {
193                         exceptionUtil.buildAndThrowWorkflowException(execution, 404, "Service-instance does not exist AAI")
194                 }catch(Exception ex) {
195                         String msg = "Internal Error in getServiceInstance: " + ex.getMessage()
196                         exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
197                 }
198         }
199
200         public void preCompareModelVersions(DelegateExecution execution) {
201                 def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
202         }
203
204         public void postCompareModelVersions(DelegateExecution execution) {
205                 def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
206                 utils.log("DEBUG", " ======== STARTED postCompareModelVersions Process ======== ", isDebugEnabled)
207
208                 def hasResourcetoUpdate = false
209                 def hasResourcetoAdd = false
210                 def hasResourcetoDelete = false
211                 List<Resource> addResourceList =  execution.getVariable("addResourceList")
212                 List<Resource> delResourceList =  execution.getVariable("delResourceList")
213
214                 if(addResourceList != null && !addResourceList.isEmpty()) {
215                         hasResourcetoAdd = true
216                 }
217
218                 if(delResourceList != null && !delResourceList.isEmpty()) {
219                         hasResourcetoDelete = true
220                 }
221
222                 hasResourcetoUpdate = hasResourcetoAdd || hasResourcetoDelete
223                 execution.setVariable("hasResourcetoUpdate", hasResourcetoUpdate)
224
225                 utils.log("DEBUG", "======== COMPLETED postCompareModelVersions Process ======== ", isDebugEnabled)
226         }
227
228         /**
229          * Init the service Operation Status
230          */
231         public void prepareInitServiceOperationStatus(DelegateExecution execution){
232                 def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
233                 utils.log("DEBUG", " ======== STARTED prepareInitServiceOperationStatus Process ======== ", isDebugEnabled)
234                 try{
235                         String serviceId = execution.getVariable("serviceInstanceId")
236                         String operationId = execution.getVariable("operationId")
237                         String operationType = execution.getVariable("operationType")
238                         String userId = ""
239                         String result = "processing"
240                         String progress = "0"
241                         String reason = ""
242                         String operationContent = "Prepare service updating"
243                         utils.log("DEBUG", "Generated new operation for Service Instance serviceId:" + serviceId + " operationId:" + operationId, isDebugEnabled)
244                         serviceId = UriUtils.encode(serviceId,"UTF-8")
245                         execution.setVariable("serviceInstanceId", serviceId)
246                         execution.setVariable("operationId", operationId)
247                         execution.setVariable("operationType", operationType)
248
249                         def dbAdapterEndpoint = UrnPropertiesReader.getVariable("mso.adapters.openecomp.db.endpoint", execution)
250                         execution.setVariable("CVFMI_dbAdapterEndpoint", dbAdapterEndpoint)
251                         utils.log("DEBUG", "DB Adapter Endpoint is: " + dbAdapterEndpoint, isDebugEnabled)
252
253                         String payload =
254                                 """<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
255                         xmlns:ns="http://org.onap.so/requestsdb">
256                         <soapenv:Header/>
257                         <soapenv:Body>
258                             <ns:updateServiceOperationStatus xmlns:ns="http://org.onap.so/requestsdb">
259                             <serviceId>${MsoUtils.xmlEscape(serviceId)}</serviceId>
260                             <operationId>${MsoUtils.xmlEscape(operationId)}</operationId>
261                             <operationType>${MsoUtils.xmlEscape(operationType)}</operationType>
262                             <userId>${MsoUtils.xmlEscape(userId)}</userId>
263                             <result>${MsoUtils.xmlEscape(result)}</result>
264                             <operationContent>${MsoUtils.xmlEscape(operationContent)}</operationContent>
265                             <progress>${MsoUtils.xmlEscape(progress)}</progress>
266                             <reason>${MsoUtils.xmlEscape(reason)}</reason>
267                         </ns:updateServiceOperationStatus>
268                     </soapenv:Body>
269                 </soapenv:Envelope>"""
270
271                         payload = utils.formatXml(payload)
272                         execution.setVariable("CVFMI_updateServiceOperStatusRequest", payload)
273                         utils.log("DEBUG", "Outgoing updateServiceOperStatusRequest: \n" + payload, isDebugEnabled)
274                         utils.logAudit("CreateVfModuleInfra Outgoing updateServiceOperStatusRequest Request: " + payload)
275
276                 }catch(Exception e){
277                         utils.log("ERROR", "Exception Occured Processing prepareInitServiceOperationStatus. Exception is:\n" + e, isDebugEnabled)
278                         execution.setVariable("CVFMI_ErrorResponse", "Error Occurred during prepareInitServiceOperationStatus Method:\n" + e.getMessage())
279                 }
280                 utils.log("DEBUG", "======== COMPLETED prepareInitServiceOperationStatus Process ======== ", isDebugEnabled)
281         }
282
283         /**
284          * Update the service Operation Status
285          */
286         public void preUpdateServiceOperationStatus(DelegateExecution execution){
287                 def method = getClass().getSimpleName() + '.preUpdateServiceOperationStatus(' +'execution=' + execution.getId() +')'
288                 def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
289                 utils.log("INFO","Entered " + method, isDebugEnabled)
290
291                 try{
292                         String serviceId = execution.getVariable("serviceInstanceId")
293                         String operationId = execution.getVariable("operationId")
294                         String operationType = execution.getVariable("operationType")
295                         String serviceName = execution.getVariable("serviceInstanceName")
296                         String result = execution.getVariable("operationResult")
297                         String progress = execution.getVariable("progress")
298                         String reason = execution.getVariable("operationReason")
299                         String userId = ""
300                         utils.log("INFO", "progress: " + progress , isDebugEnabled)
301
302                         String operationContent = "Prepare service : " + execution.getVariable("operationStatus")
303
304                         utils.log("INFO", "Generated new operation for Service Instance serviceId:" + serviceId + " operationId:" + operationId, isDebugEnabled)
305                         serviceId = UriUtils.encode(serviceId,"UTF-8")
306                         execution.setVariable("serviceInstanceId", serviceId)
307                         execution.setVariable("operationId", operationId)
308                         execution.setVariable("operationType", operationType)
309
310             def dbAdapterEndpoint = UrnPropertiesReader.getVariable("mso.adapters.openecomp.db.endpoint", execution)
311             execution.setVariable("CVFMI_dbAdapterEndpoint", dbAdapterEndpoint)
312                         utils.log("INFO", "DB Adapter Endpoint is: " + dbAdapterEndpoint, isDebugEnabled)
313
314                         String payload =
315                                 """<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
316                         xmlns:ns="http://org.onap.so/requestsdb">
317                         <soapenv:Header/>
318                         <soapenv:Body>
319                             <ns:updateServiceOperationStatus xmlns:ns="http://org.onap.so/requestsdb">
320                             <serviceId>${MsoUtils.xmlEscape(serviceId)}</serviceId>
321                             <operationId>${MsoUtils.xmlEscape(operationId)}</operationId>
322                             <operationType>${MsoUtils.xmlEscape(operationType)}</operationType>
323                             <userId>${MsoUtils.xmlEscape(userId)}</userId>
324                             <result>${MsoUtils.xmlEscape(result)}</result>
325                             <operationContent>${MsoUtils.xmlEscape(operationContent)}</operationContent>
326                             <progress>${MsoUtils.xmlEscape(progress)}</progress>
327                             <reason>${MsoUtils.xmlEscape(reason)}</reason>
328                         </ns:updateServiceOperationStatus>
329                     </soapenv:Body>
330                 </soapenv:Envelope>"""
331
332                         payload = utils.formatXml(payload)
333                         execution.setVariable("CVFMI_updateServiceOperStatusRequest", payload)
334                         utils.log("INFO", "Outgoing preUpdateServiceOperationStatus: \n" + payload, isDebugEnabled)
335
336
337                 }catch(Exception e){
338                         utils.log("ERROR", "Exception Occured Processing preUpdateServiceOperationStatus. Exception is:\n" + e, isDebugEnabled)
339                         execution.setVariable("CVFMI_ErrorResponse", "Error Occurred during preUpdateServiceOperationStatus Method:\n" + e.getMessage())
340                 }
341                 utils.log("INFO", "======== COMPLETED preUpdateServiceOperationStatus Process ======== ", isDebugEnabled)
342                 utils.log("INFO", "Exited " + method, isDebugEnabled)
343         }
344
345         public void sendSyncResponse (DelegateExecution execution) {
346                 def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
347                 utils.log("INFO", " *** sendSyncResponse *** ", isDebugEnabled)
348
349                 try {
350                         String operationId = execution.getVariable("operationId")
351                         def hasResourcetoUpdate = execution.getVariable("hasResourcetoUpdate")
352
353                         String updateServiceResp = ""
354                         if(hasResourcetoUpdate) {
355                                 // RESTResponse for API Handler (APIH) Reply Task
356                                 updateServiceResp = """{"operationId":"${operationId}"}""".trim()
357                         }
358                         else {
359                                 updateServiceResp =  """{"OperationResult":"No Resource to Add or Delete or Service Instance not found in AAI."}"""
360                         }
361
362                         utils.log("INFO", " sendSyncResponse to APIH:" + "\n" + updateServiceResp, isDebugEnabled)
363                         sendWorkflowResponse(execution, 202, updateServiceResp)
364                         execution.setVariable("sentSyncResponse", true)
365
366                 } catch (Exception ex) {
367                         String msg = "Exceptuion in sendSyncResponse:" + ex.getMessage()
368                         utils.log("INFO", msg, isDebugEnabled)
369                         exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
370                 }
371                 utils.log("INFO"," ***** Exit sendSyncResopnse *****",  isDebugEnabled)
372         }
373
374         public void sendSyncError (DelegateExecution execution) {
375                 def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
376                 utils.log("INFO", " *** sendSyncError *** ", isDebugEnabled)
377
378                 try {
379                         String errorMessage = ""
380                         int errorCode = 7000
381                         if (execution.getVariable("WorkflowException") instanceof WorkflowException) {
382                                 WorkflowException wfe = execution.getVariable("WorkflowException")
383                                 errorMessage = wfe.getErrorMessage()
384                                 errorCode = wfe.getErrorCode()
385                         } else {
386                                 errorMessage = "Sending Sync Error."
387                         }
388
389                         String buildworkflowException =
390                                         """<aetgt:WorkflowException xmlns:aetgt="http://org.onap/so/workflow/schema/v1">
391                                         <aetgt:ErrorMessage>${MsoUtils.xmlEscape(errorMessage)}</aetgt:ErrorMessage>
392                                         <aetgt:ErrorCode>${MsoUtils.xmlEscape(errorCode)}</aetgt:ErrorCode>
393                                    </aetgt:WorkflowException>"""
394
395                         utils.logAudit(buildworkflowException)
396                         sendWorkflowResponse(execution, 500, buildworkflowException)
397
398                 } catch (Exception ex) {
399                         utils.log("INFO", " Sending Sync Error Activity Failed. " + "\n" + ex.getMessage(), isDebugEnabled)
400                 }
401
402         }
403
404         public void prepareCompletionRequest (DelegateExecution execution) {
405                 def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
406                 utils.log("INFO", " *** prepareCompletion *** ", isDebugEnabled)
407
408                 try {
409                         String requestId = execution.getVariable("msoRequestId")
410                         String serviceInstanceId = execution.getVariable("serviceInstanceId")
411                         String source = execution.getVariable("source")
412
413                         String msoCompletionRequest =
414                                         """<aetgt:MsoCompletionRequest xmlns:aetgt="http://org.onap/so/workflow/schema/v1"
415                                                                 xmlns:ns="http://org.onap/so/request/types/v1">
416                                                 <request-info xmlns="http://org.onap/so/infra/vnf-request/v1">
417                                                         <request-id>${MsoUtils.xmlEscape(requestId)}</request-id>
418                                                         <action>UPDATE</action>
419                                                         <source>${MsoUtils.xmlEscape(source)}</source>
420                                                 </request-info>
421                                                 <status-message>Service Instance was updated successfully.</status-message>
422                                                 <serviceInstanceId>${MsoUtils.xmlEscape(serviceInstanceId)}</serviceInstanceId>
423                                                 <mso-bpel-name>UpdateCustomE2EServiceInstance</mso-bpel-name>
424                                         </aetgt:MsoCompletionRequest>"""
425
426                         // Format Response
427                         String xmlMsoCompletionRequest = utils.formatXml(msoCompletionRequest)
428
429                         execution.setVariable("completionRequest", xmlMsoCompletionRequest)
430                         utils.log("INFO", " Overall SUCCESS Response going to CompleteMsoProcess - " + "\n" + xmlMsoCompletionRequest, isDebugEnabled)
431
432                 } catch (Exception ex) {
433                         String msg = " Exception in prepareCompletion:" + ex.getMessage()
434                         utils.log("INFO", msg, isDebugEnabled)
435                         exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
436                 }
437                 utils.log("INFO", "*** Exit prepareCompletionRequest ***", isDebugEnabled)
438         }
439
440         public void prepareFalloutRequest(DelegateExecution execution){
441                 def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
442                 utils.log("INFO", " *** prepareFalloutRequest *** ", isDebugEnabled)
443
444                 try {
445                         WorkflowException wfex = execution.getVariable("WorkflowException")
446                         utils.log("INFO", " Input Workflow Exception: " + wfex.toString(), isDebugEnabled)
447                         String requestId = execution.getVariable("msoRequestId")
448                         String source = execution.getVariable("source")
449                         String requestInfo =
450                                         """<request-info xmlns="http://org.onap/so/infra/vnf-request/v1">
451                                         <request-id>${MsoUtils.xmlEscape(requestId)}</request-id>
452                                         <action>UPDATE</action>
453                                         <source>${MsoUtils.xmlEscape(source)}</source>
454                                    </request-info>"""
455
456                         String falloutRequest = exceptionUtil.processMainflowsBPMNException(execution, requestInfo)
457                         execution.setVariable("falloutRequest", falloutRequest)
458                 } catch (Exception ex) {
459                         utils.log("INFO", "Exception prepareFalloutRequest:" + ex.getMessage(), isDebugEnabled)
460                         String errorException = "  Bpmn error encountered in UpdateCustomE2EServiceInstance flow. FalloutHandlerRequest,  buildErrorResponse() - " + ex.getMessage()
461                         String requestId = execution.getVariable("msoRequestId")
462                         String falloutRequest =
463                                         """<aetgt:FalloutHandlerRequest xmlns:aetgt="http://org.onap/so/workflow/schema/v1"
464                                                                      xmlns:ns="http://org.onap/so/request/types/v1"
465                                                                      xmlns:wfsch="http://org.onap/so/workflow/schema/v1">
466                                            <request-info xmlns="http://org.onap/so/infra/vnf-request/v1">
467                                               <request-id>${MsoUtils.xmlEscape(requestId)}</request-id>
468                                               <action>UPDATE</action>
469                                               <source>UUI</source>
470                                            </request-info>
471                                                 <aetgt:WorkflowException xmlns:aetgt="http://org.onap/so/workflow/schema/v1">
472                                                         <aetgt:ErrorMessage>${MsoUtils.xmlEscape(errorException)}</aetgt:ErrorMessage>
473                                                         <aetgt:ErrorCode>7000</aetgt:ErrorCode>
474                                                 </aetgt:WorkflowException>
475                                         </aetgt:FalloutHandlerRequest>"""
476
477                         execution.setVariable("falloutRequest", falloutRequest)
478                 }
479                 utils.log("INFO", "*** Exit prepareFalloutRequest ***", isDebugEnabled)
480         }
481 }