Bugfixes for December 2018
[so.git] / bpmn / so-bpmn-infrastructure-common / src / main / groovy / org / onap / so / bpmn / infrastructure / scripts / DoDeleteE2EServiceInstance.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 package org.onap.so.bpmn.infrastructure.scripts
21
22 import groovy.json.JsonOutput
23 import groovy.json.JsonSlurper
24 import 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.AbstractServiceTaskProcessor
30 import org.onap.so.bpmn.common.scripts.ExceptionUtil
31 import org.onap.so.bpmn.common.scripts.MsoUtils
32 import org.onap.so.bpmn.core.UrnPropertiesReader
33 import org.onap.so.bpmn.core.WorkflowException
34 import org.onap.so.bpmn.core.domain.Resource
35 import org.onap.so.bpmn.core.domain.ServiceDecomposition
36 import org.onap.so.bpmn.core.json.JsonUtils
37 import org.onap.so.client.HttpClient
38 import org.onap.so.client.HttpClientFactory
39 import org.onap.so.logger.MsoLogger
40 import org.onap.so.utils.TargetEntity
41 import org.springframework.web.util.UriUtils
42 import org.w3c.dom.Document
43 import org.w3c.dom.Node
44 import org.xml.sax.InputSource
45
46 import javax.ws.rs.core.Response
47 import javax.xml.parsers.DocumentBuilder
48 import javax.xml.parsers.DocumentBuilderFactory
49
50 import static org.apache.commons.lang3.StringUtils.isBlank
51
52 /**
53  * This groovy class supports the <class>DoDeleteE2EServiceInstance.bpmn</class> process.
54  *
55  * Inputs:
56  * @param - msoRequestId
57  * @param - globalSubscriberId - O
58  * @param - subscriptionServiceType - O
59  * @param - serviceInstanceId
60  * @param - serviceInstanceName - O
61  * @param - serviceInputParams (should contain aic_zone for serviceTypes TRANSPORT,ATM)
62  * @param - sdncVersion
63  * @param - failNotFound - TODO
64  * @param - serviceInputParams - TODO
65  *
66  * @param - delResourceList
67  * @param - serviceRelationShip
68  *
69  * Outputs:
70  * @param - WorkflowException
71  *
72  * Rollback - Deferred
73  */
74 public class DoDeleteE2EServiceInstance extends AbstractServiceTaskProcessor {
75
76         String Prefix="DDEESI_"
77     ExceptionUtil exceptionUtil = new ExceptionUtil()
78     JsonUtils jsonUtil = new JsonUtils()
79     private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, DoDeleteE2EServiceInstance.class);
80
81
82     public void preProcessRequest (DelegateExecution execution) {
83         msoLogger.debug(" ***** preProcessRequest *****")
84         String msg = ""
85
86         try {
87             String requestId = execution.getVariable("msoRequestId")
88             execution.setVariable("prefix",Prefix)
89
90             //Inputs
91             //requestDetails.subscriberInfo. for AAI GET & PUT & SDNC assignToplology
92             String globalSubscriberId = execution.getVariable("globalSubscriberId") //globalCustomerId
93             if (globalSubscriberId == null)
94             {
95                 execution.setVariable("globalSubscriberId", "")
96             }
97
98             //requestDetails.requestParameters. for AAI PUT & SDNC assignTopology
99             String serviceType = execution.getVariable("serviceType")
100             if (serviceType == null)
101             {
102                 execution.setVariable("serviceType", "")
103             }
104
105             //Generated in parent for AAI PUT
106             String serviceInstanceId = execution.getVariable("serviceInstanceId")
107             if (isBlank(serviceInstanceId)){
108                 msg = "Input serviceInstanceId is null"
109                 msoLogger.info(msg)
110                 exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
111             }
112
113             String sdncCallbackUrl = UrnPropertiesReader.getVariable('URN_mso_workflow_sdncadapter_callback', execution)
114             if (isBlank(sdncCallbackUrl)) {
115                 msg = "URN_mso_workflow_sdncadapter_callback is null"
116                 msoLogger.info(msg)
117                 exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
118             }
119             execution.setVariable("sdncCallbackUrl", sdncCallbackUrl)
120             msoLogger.info("SDNC Callback URL: " + sdncCallbackUrl)
121
122             StringBuilder sbParams = new StringBuilder()
123             Map<String, String> paramsMap = execution.getVariable("serviceInputParams")
124
125             if (paramsMap != null) {
126                 sbParams.append("<service-input-parameters>")
127                 for (Map.Entry<String, String> entry : paramsMap.entrySet()) {
128                     String paramsXml
129                     String paramName = entry.getKey()
130                     String paramValue = entry.getValue()
131                     paramsXml =
132                             """ <param>
133                                                         <name>${MsoUtils.xmlEscape(paramName)}</name>
134                                                         <value>${MsoUtils.xmlEscape(paramValue)}</value>
135                                                         </param>
136                                                         """
137                     sbParams.append(paramsXml)
138                 }
139                 sbParams.append("</service-input-parameters>")
140             }
141             String siParamsXml = sbParams.toString()
142             if (siParamsXml == null)
143                 siParamsXml = ""
144             execution.setVariable("siParamsXml", siParamsXml)
145
146         } catch (BpmnError e) {
147             throw e;
148         } catch (Exception ex){
149             msg = "Exception in preProcessRequest " + ex.getMessage()
150             msoLogger.error(msg)
151             exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
152         }
153         msoLogger.debug("***** Exit preProcessRequest *****")
154     }
155
156     public void postProcessAAIGET(DelegateExecution execution) {
157         msoLogger.debug(" ***** postProcessAAIGET ***** ")
158         String msg = ""
159
160         try {
161             String serviceInstanceId = execution.getVariable("serviceInstanceId")
162             boolean foundInAAI = execution.getVariable("GENGS_FoundIndicator")
163             String serviceType = ""
164
165             if(foundInAAI){
166                 msoLogger.debug("Found Service-instance in AAI")
167
168                 String siData = execution.getVariable("GENGS_service")
169                 msoLogger.debug("SI Data")
170                 if (isBlank(siData))
171                 {
172                     msg = "Could not retrive ServiceInstance data from AAI to delete id:" + serviceInstanceId
173                     msoLogger.error(msg)
174                     exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
175                 }
176                 else
177                 {
178                     InputSource source = new InputSource(new StringReader(siData));
179                     DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance();
180                     DocumentBuilder docBuilder = docFactory.newDocumentBuilder()
181                     Document serviceXml = docBuilder.parse(source)
182                     serviceXml.getDocumentElement().normalize()
183                     // get model invariant id
184                     // Get Template uuid and version
185                     if (utils.nodeExists(siData, "model-invariant-id") && utils.nodeExists(siData, "model-version-id") ) {
186                         msoLogger.debug("SI Data model-invariant-id and model-version-id exist")
187                         def modelInvariantId  = serviceXml.getElementsByTagName("model-invariant-id").item(0).getTextContent()
188                         def modelVersionId  = serviceXml.getElementsByTagName("model-version-id").item(0).getTextContent()
189
190                         // Set Original Template info
191                         execution.setVariable("model-invariant-id-original", modelInvariantId)
192                         execution.setVariable("model-version-id-original", modelVersionId)
193                     }
194
195                     msoLogger.debug("SI Data" + siData)
196                     //Confirm there are no related service instances (vnf/network or volume)
197                     if (utils.nodeExists(siData, "relationship-list")) {
198                         msoLogger.debug("SI Data relationship-list exists")
199                         JSONArray jArray = new JSONArray()
200
201                         XmlParser xmlParser = new XmlParser()
202                         Node root = xmlParser.parseText(siData)
203                         def relation_list = utils.getChildNode(root, 'relationship-list')
204                         def relationships = utils.getIdenticalChildren(relation_list, 'relationship')
205
206                         for (def relation: relationships) {
207                                 def jObj = getRelationShipData(relation, isDebugEnabled)
208                                 jArray.put(jObj)
209                         }
210
211                         execution.setVariable("serviceRelationShip", jArray.toString())
212                         execution.setVariable("serviceRelationShip", jArray.toString())
213                     }
214                 }
215             }else{
216                 boolean succInAAI = execution.getVariable("GENGS_SuccessIndicator")
217                 if(!succInAAI){
218                     msoLogger.debug("Error getting Service-instance from AAI :" + serviceInstanceId)
219                     WorkflowException workflowException = execution.getVariable("WorkflowException")
220                     if(workflowException != null){
221                         msoLogger.error("workflowException: " + workflowException)
222                         exceptionUtil.buildAndThrowWorkflowException(execution, workflowException.getErrorCode(), workflowException.getErrorMessage())
223                     }
224                     else {
225                         msg = "Failure in postProcessAAIGET GENGS_SuccessIndicator:" + succInAAI
226                         msoLogger.error(msg)
227                         exceptionUtil.buildAndThrowWorkflowException(execution, 2500, msg)
228                     }
229                 }
230
231                 msoLogger.debug("Service-instance NOT found in AAI. Silent Success")
232             }
233         }catch (BpmnError e) {
234             throw e
235         } catch (Exception ex) {
236             msg = "Exception in DoDeleteE2EServiceInstance.postProcessAAIGET. " + ex.getMessage()
237             msoLogger.debug(msg)
238             exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
239         }
240         msoLogger.debug(" *** Exit postProcessAAIGET *** ")
241     }
242
243         private JSONObject getRelationShipData(node, isDebugEnabled){
244                 JSONObject jObj = new JSONObject()
245
246                 def relation  = utils.nodeToString(node)
247                 def rt  = utils.getNodeText(relation, "related-to")
248
249                 def rl  = utils.getNodeText(relation, "related-link")
250                 msoLogger.debug("ServiceInstance Related NS/Configuration :" + rl)
251
252                 def rl_datas = utils.getIdenticalChildren(node, "relationship-data")
253                 for(def rl_data : rl_datas) {
254                         def eKey =  utils.getChildNodeText(rl_data, "relationship-key")
255                         def eValue = utils.getChildNodeText(rl_data, "relationship-value")
256
257                         if ((rt == "service-instance" && eKey.equals("service-instance.service-instance-id"))
258                         //for overlay/underlay
259                         || (rt == "configuration" && eKey.equals("configuration.configuration-id")
260                         )){
261                                 jObj.put("resourceInstanceId", eValue)
262                         }
263                         // for sp-partner and others
264                         else if(eKey.endsWith("-id")){
265                                 jObj.put("resourceInstanceId", eValue)
266                                 String resourceName = rt + eValue;
267                                 jObj.put("resourceType", resourceName)
268                         }
269
270                         jObj.put("resourceLinkUrl", rl)
271                 }
272
273                 def rl_props = utils.getIdenticalChildren(node, "related-to-property")
274                 for(def rl_prop : rl_props) {
275                         def eKey =  utils.getChildNodeText(rl_prop, "property-key")
276                         def eValue = utils.getChildNodeText(rl_prop, "property-value")
277                         if((rt == "service-instance" && eKey.equals("service-instance.service-instance-name"))
278                         //for overlay/underlay
279                         || (rt == "configuration" && eKey.equals("configuration.configuration-type"))){
280                                 jObj.put("resourceType", eValue)
281                         }
282                 }
283
284                 msoLogger.debug("Relationship related to Resource:" + jObj.toString())
285                 return jObj
286         }
287
288    public void getCurrentNS(DelegateExecution execution){
289        utils.log("INFO", "======== Start getCurrentNS Process ======== ", isDebugEnabled)
290
291        def currentIndex = execution.getVariable("currentNSIndex")
292        List<String> nsSequence = execution.getVariable("nsSequence")
293        String nsResourceType =  nsSequence.get(currentIndex)
294
295        // GET AAI by Name, not ID, for process convenient
296        execution.setVariable("GENGS_type", "service-instance")
297        execution.setVariable("GENGS_serviceInstanceId", "")
298        execution.setVariable("GENGS_serviceInstanceName", nsResourceType)
299
300        msoLogger.debug("======== COMPLETED getCurrentNS Process ======== ")
301    }
302
303     public void prepareDecomposeService(DelegateExecution execution) {
304         try {
305             msoLogger.debug(" ***** Inside prepareDecomposeService of create generic e2e service ***** ")
306             String modelInvariantUuid = execution.getVariable("model-invariant-id-original")
307             String modelVersionId = execution.getVariable("model-version-id-original")
308
309             String serviceModelInfo = """{
310             "modelInvariantUuid":"${modelInvariantUuid}",
311             "modelUuid":"${modelVersionId}",
312             "modelVersion":""
313              }"""
314             execution.setVariable("serviceModelInfo", serviceModelInfo)
315
316             msoLogger.debug(" ***** Completed prepareDecomposeService of  create generic e2e service ***** ")
317         } catch (Exception ex) {
318             // try error in method block
319             String exceptionMessage = "Bpmn error encountered in  create generic e2e service flow. Unexpected Error from method prepareDecomposeService() - " + ex.getMessage()
320             msoLogger.error(exceptionMessage)
321             exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage)
322         }
323     }
324
325         private void generateRelatedResourceInfo(String response, JSONObject jObj){
326
327                 def xml = new XmlSlurper().parseText(response)
328                 def rtn = xml.childNodes()
329                 while (rtn.hasNext()) {
330                         groovy.util.slurpersupport.Node node = rtn.next()
331                         def key = node.name()
332                         def value = node.text()
333                         jObj.put(key, value)
334                 }
335         }
336
337         private JSONObject getRelatedResourceInAAI (DelegateExecution execution, JSONObject jObj)
338         {
339                 msoLogger.debug(" ***** Started getRelatedResourceInAAI *****")
340
341         String aai_endpoint = UrnPropertiesReader.getVariable("aai.endpoint", execution)
342                 String urlLink = jObj.get("resourceLinkUrl")
343                 String serviceAaiPath = "${aai_endpoint}${urlLink}"
344
345                 URL url = new URL(serviceAaiPath)
346                 HttpClient client = new HttpClientFactory().newXmlClient(url, TargetEntity.AAI)
347
348
349                 Response response = client.get()
350                 int responseCode = response.getStatus()
351                 execution.setVariable(Prefix + "GeRelatedResourceResponseCode", responseCode)
352                 msoLogger.debug("  Get RelatedResource code is: " + responseCode)
353
354                 String aaiResponse = response.readEntity(String.class)
355                 execution.setVariable(Prefix + "GetRelatedResourceResponse", aaiResponse)
356
357                 //Process Response
358                 if(responseCode == 200 || responseCode == 201 || responseCode == 202 )
359                         //200 OK 201 CREATED 202 ACCEPTED
360                 {
361                         msoLogger.debug("GET RelatedResource Received a Good Response")
362                         execution.setVariable(Prefix + "SuccessIndicator", true)
363                         execution.setVariable(Prefix + "FoundIndicator", true)
364
365                         generateRelatedResourceInfo(aaiResponse, jObj)
366
367                         //get model-invariant-uuid and model-uuid
368                         String modelInvariantId = ""
369                         String modelUuid = ""
370                         String modelCustomizationId = ""
371                         if(jObj.has("model-invariant-id")) {
372                                 modelInvariantId = jObj.get("model-invariant-id")
373                                 modelUuid = jObj.get("model-version-id")
374                                 modelCustomizationId = jObj.get("model-customization-id")
375                         }
376
377                         jObj.put("modelInvariantId", modelInvariantId)
378                         jObj.put("modelVersionId", modelUuid)
379                         jObj.put("modelCustomizationId", modelCustomizationId)
380                 }
381                 else {
382             String exceptionMessage = "Get RelatedResource Received a Bad Response Code. Response Code is: " + responseCode
383                         msoLogger.error(exceptionMessage)
384             exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage)
385         }
386
387                 msoLogger.debug(" ***** Exit getRelatedResourceInAAI *****")
388                 return jObj
389         }
390
391     public void postDecomposeService(DelegateExecution execution) {
392         msoLogger.debug(" ***** Inside processDecomposition() of  delete generic e2e service flow ***** ")
393         try {
394             ServiceDecomposition serviceDecomposition = execution.getVariable("serviceDecomposition")
395
396             // service model info
397             execution.setVariable("serviceModelInfo", serviceDecomposition.getModelInfo())
398
399             List<Resource> deleteResourceList = serviceDecomposition.getServiceResources()
400             String serviceRelationShip = execution.getVariable("serviceRelationShip")
401             def jsonSlurper = new JsonSlurper()
402             def jsonOutput = new JsonOutput()
403
404             List relationShipList = null
405             if (serviceRelationShip != null) {
406                 relationShipList = jsonSlurper.parseText(serviceRelationShip)
407             }
408
409             List<Resource> deleteRealResourceList = new ArrayList<Resource>()
410
411             //Set the real resource instance id to the decomosed resource list
412             //reset the resource instance id , because in the decompose flow ,its a random one.
413             //match the resource-instance-name and the model name
414             if (relationShipList != null) {
415                 relationShipList.each {
416
417                     JSONObject obj = getRelatedResourceInAAI(execution, (JSONObject)it)
418
419                     for (Resource resource : deleteResourceList) {
420
421                         String modelName = resource.getModelInfo().getModelName()
422
423                         String modelCustomizationUuid = resource.getModelInfo().getModelCustomizationUuid()
424                         if (StringUtils.containsIgnoreCase(obj.get("resourceType"), modelName)) {
425                             resource.setResourceId(obj.get("resourceInstanceId"))
426                             deleteRealResourceList.add(resource)
427                         }
428                         else if (modelCustomizationUuid.equals(obj.get("modelCustomizationId"))) {
429                             resource.setResourceId(obj.get("resourceInstanceId"))
430                             resource.setResourceInstanceName(obj.get("resourceType"))
431                             deleteRealResourceList.add(resource)
432                         }
433                     }
434                 }
435             }
436
437             // only delete real existing resources
438             execution.setVariable("deleteResourceList", deleteRealResourceList)
439             
440             boolean isDeleteResourceListValid = false
441             if(deleteRealResourceList.size() > 0) {
442                 isDeleteResourceListValid = true
443             }
444             execution.setVariable("isDeleteResourceListValid", isDeleteResourceListValid)
445
446             msoLogger.debug("delete resource list : " + deleteRealResourceList)
447         } catch (Exception ex) {
448             String exceptionMessage = "Bpmn error encountered in  create generic e2e service flow. processDecomposition() - " + ex.getMessage()
449             msoLogger.error(exceptionMessage)
450             exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage)
451         }
452         utils.log("DEBUG", " ***** exit processDecomposition() of  delete generic e2e service flow ***** ", isDebugEnabled)
453     }
454
455     public void preInitResourcesOperStatus(DelegateExecution execution){
456         msoLogger.debug(" ======== STARTED preInitResourcesOperStatus Process ======== ")
457         try{
458             String serviceId = execution.getVariable("serviceInstanceId")
459             String operationId = execution.getVariable("operationId")
460             String operationType = execution.getVariable("operationType")
461             String resourceTemplateUUIDs = ""
462             String result = "processing"
463             String progress = "0"
464             String reason = ""
465             String operationContent = "Prepare service creation"
466             msoLogger.debug("Generated new operation for Service Instance serviceId:" + serviceId + " operationId:" + operationId + " operationType:" + operationType)
467             serviceId = UriUtils.encode(serviceId,"UTF-8")
468             execution.setVariable("serviceInstanceId", serviceId)
469             execution.setVariable("operationId", operationId)
470             execution.setVariable("operationType", operationType)
471             List<Resource> deleteResourceList = execution.getVariable("deleteResourceList")
472
473             String serviceRelationShip = execution.getVariable("serviceRelationShip")
474             for(Resource resource : deleteResourceList){
475                     resourceTemplateUUIDs  = resourceTemplateUUIDs + resource.getModelInfo().getModelCustomizationUuid() + ":"
476             }
477
478             def dbAdapterEndpoint = UrnPropertiesReader.getVariable("mso.adapters.openecomp.db.endpoint", execution)
479             execution.setVariable("URN_mso_adapters_openecomp_db_endpoint", dbAdapterEndpoint)
480
481             String payload =
482                     """<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
483                         xmlns:ns="http://org.onap.so/requestsdb">
484                         <soapenv:Header/>
485                         <soapenv:Body>
486                             <ns:initResourceOperationStatus xmlns:ns="http://org.onap.so/requestsdb">
487                             <serviceId>${MsoUtils.xmlEscape(serviceId)}</serviceId>
488                             <operationId>${MsoUtils.xmlEscape(operationId)}</operationId>
489                             <operationType>${MsoUtils.xmlEscape(operationType)}</operationType>
490                             <resourceTemplateUUIDs>${MsoUtils.xmlEscape(resourceTemplateUUIDs)}</resourceTemplateUUIDs>
491                         </ns:initResourceOperationStatus>
492                     </soapenv:Body>
493                 </soapenv:Envelope>"""
494
495             payload = utils.formatXml(payload)
496             execution.setVariable("CVFMI_initResOperStatusRequest", payload)
497             msoLogger.debug("Outgoing initResourceOperationStatus: \n" + payload)
498             msoLogger.debug("CreateVfModuleInfra Outgoing initResourceOperationStatus Request: " + payload)
499
500         }catch(Exception e){
501             msoLogger.debug("Exception Occured Processing preInitResourcesOperStatus. Exception is:\n" + e)
502             execution.setVariable("CVFMI_ErrorResponse", "Error Occurred during preInitResourcesOperStatus Method:\n" + e.getMessage())
503         }
504         msoLogger.debug("======== COMPLETED preInitResourcesOperStatus Process ======== ")
505     }
506     
507     public void prepareUpdateServiceOperationStatus(DelegateExecution execution){
508         msoLogger.debug(" ======== STARTED prepareUpdateServiceOperationStatus Process ======== ")
509         try{
510             String serviceId = execution.getVariable("serviceInstanceId")
511             String operationId = execution.getVariable("operationId")
512             String userId = ""
513             String result = execution.getVariable("result")
514             String progress = execution.getVariable("progress")
515             String reason = ""
516             String operationContent = execution.getVariable("operationContent")
517             
518             serviceId = UriUtils.encode(serviceId,"UTF-8")
519
520             def dbAdapterEndpoint = UrnPropertiesReader.getVariable("mso.adapters.openecomp.db.endpoint", execution)
521             execution.setVariable("CVFMI_dbAdapterEndpoint", dbAdapterEndpoint)
522             msoLogger.debug("DB Adapter Endpoint is: " + dbAdapterEndpoint)
523
524             String payload =
525                     """<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
526                         xmlns:ns="http://org.onap.so/requestsdb">
527                         <soapenv:Header/>
528                         <soapenv:Body>
529                             <ns:updateServiceOperationStatus xmlns:ns="http://org.onap.so/requestsdb">
530                             <serviceId>${MsoUtils.xmlEscape(serviceId)}</serviceId>
531                             <operationId>${MsoUtils.xmlEscape(operationId)}</operationId>
532                             <operationType>DELETE</operationType>
533                             <userId>${MsoUtils.xmlEscape(userId)}</userId>
534                             <result>${MsoUtils.xmlEscape(result)}</result>
535                             <operationContent>${MsoUtils.xmlEscape(operationContent)}</operationContent>
536                             <progress>${MsoUtils.xmlEscape(progress)}</progress>
537                             <reason>${MsoUtils.xmlEscape(reason)}</reason>
538                         </ns:updateServiceOperationStatus>
539                     </soapenv:Body>
540                 </soapenv:Envelope>"""
541
542             payload = utils.formatXml(payload)
543             execution.setVariable("CVFMI_updateServiceOperStatusRequest", payload)
544             msoLogger.debug("Outgoing updateServiceOperStatusRequest: \n" + payload)
545
546         }catch(Exception e){
547             msoLogger.error("Exception Occured Processing prepareUpdateServiceOperationStatus. Exception is:\n" + e)
548             execution.setVariable("CVFMI_ErrorResponse", "Error Occurred during prepareUpdateServiceOperationStatus Method:\n" + e.getMessage())
549         }
550         msoLogger.debug("======== COMPLETED prepareUpdateServiceOperationStatus Process ======== ")
551     }
552
553      /**
554       * post config request.
555       */
556      public void postConfigRequest(execution){
557          //to do
558      }
559
560 }