Update template analysis process
[so.git] / bpmn / so-bpmn-infrastructure-common / src / main / groovy / org / onap / so / bpmn / infrastructure / scripts / CreateSliceService.groovy
1 /*-
2  * ============LICENSE_START=======================================================
3  * ONAP - SO
4  * ================================================================================
5  * Copyright (C) 2019 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 com.fasterxml.jackson.databind.ObjectMapper
24 import org.onap.aai.domain.yang.ServiceInstance
25 import org.onap.so.client.HttpClient
26 import org.onap.so.client.HttpClientFactory
27 import org.onap.aaiclient.client.aai.AAIObjectType
28 import org.onap.aaiclient.client.aai.AAIResourcesClient
29 import org.onap.aaiclient.client.aai.entities.uri.AAIResourceUri
30 import org.onap.aaiclient.client.aai.entities.uri.AAIUriFactory
31
32 import javax.ws.rs.core.Response
33
34 import static org.apache.commons.lang3.StringUtils.*
35 import org.springframework.web.util.UriUtils
36 import groovy.json.JsonSlurper
37 import org.camunda.bpm.engine.delegate.BpmnError
38 import org.camunda.bpm.engine.delegate.DelegateExecution
39 import org.onap.logging.filter.base.ONAPComponents
40 import org.onap.so.beans.nsmf.SliceTaskParams
41 import org.onap.so.db.request.beans.OrchestrationTask
42 import org.onap.so.bpmn.common.scripts.AbstractServiceTaskProcessor
43 import org.onap.so.bpmn.common.scripts.ExceptionUtil
44 import org.onap.so.bpmn.common.scripts.OofUtils
45 import org.onap.so.bpmn.core.UrnPropertiesReader
46 import org.onap.so.bpmn.common.scripts.MsoUtils
47 import org.onap.so.bpmn.core.json.JsonUtils
48 import org.onap.logging.filter.base.ErrorCode
49 import org.onap.so.logger.LoggingAnchor
50 import org.onap.so.logger.MessageEnum
51 import org.slf4j.Logger
52 import org.slf4j.LoggerFactory
53
54 public class CreateSliceService extends AbstractServiceTaskProcessor {
55     String Prefix = "CRESS_"
56
57     ExceptionUtil exceptionUtil = new ExceptionUtil()
58     JsonUtils jsonUtil = new JsonUtils()
59     JsonSlurper jsonSlurper = new JsonSlurper()
60     ObjectMapper objectMapper = new ObjectMapper()
61     OofUtils oofUtils = new OofUtils()
62     private static final Logger logger = LoggerFactory.getLogger(CreateSliceService.class)
63
64
65     public void preProcessRequest(DelegateExecution execution) {
66         logger.debug("Start preProcessRequest")
67         execution.setVariable("prefix", Prefix)
68         String msg = ""
69
70         try {
71             String ssRequest = execution.getVariable("bpmnRequest")
72             logger.debug(ssRequest)
73
74             String requestId = execution.getVariable("mso-request-id")
75             execution.setVariable("msoRequestId", requestId)
76             logger.debug("Input Request:" + ssRequest + " reqId:" + requestId)
77
78             String serviceInstanceId = execution.getVariable("serviceInstanceId")
79             if (isBlank(serviceInstanceId)) {
80                 serviceInstanceId = UUID.randomUUID().toString()
81             }
82
83             String operationId = UUID.randomUUID().toString()
84             execution.setVariable("operationId", operationId)
85
86             logger.debug("Generated new Service Instance:" + serviceInstanceId)
87             serviceInstanceId = UriUtils.encode(serviceInstanceId, "UTF-8")
88             execution.setVariable("serviceInstanceId", serviceInstanceId)
89
90             //subscriberInfo
91             String globalSubscriberId = jsonUtil.getJsonValue(ssRequest, "requestDetails.subscriberInfo.globalSubscriberId")
92             if (isBlank(globalSubscriberId)) {
93                 msg = "Input globalSubscriberId' is null"
94                 exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
95             } else {
96                 execution.setVariable("globalSubscriberId", globalSubscriberId)
97             }
98
99             //requestInfo
100             execution.setVariable("source", jsonUtil.getJsonValue(ssRequest, "requestDetails.requestInfo.source"))
101             execution.setVariable("serviceInstanceName", jsonUtil.getJsonValue(ssRequest, "requestDetails.requestInfo.instanceName"))
102             execution.setVariable("disableRollback", jsonUtil.getJsonValue(ssRequest, "requestDetails.requestInfo.suppressRollback"))
103             String productFamilyId = jsonUtil.getJsonValue(ssRequest, "requestDetails.requestInfo.productFamilyId")
104             if (isBlank(productFamilyId)) {
105                 msg = "Input productFamilyId is null"
106                 logger.debug(msg)
107                 //exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
108             } else {
109                 execution.setVariable("productFamilyId", productFamilyId)
110             }
111
112             //modelInfo
113             String serviceModelInfo = jsonUtil.getJsonValue(ssRequest, "requestDetails.modelInfo")
114             if (isBlank(serviceModelInfo)) {
115                 msg = "Input serviceModelInfo is null"
116                 logger.debug(msg)
117                 exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
118             } else {
119                 execution.setVariable("serviceModelInfo", serviceModelInfo)
120             }
121
122             logger.debug("modelInfo: " + serviceModelInfo)
123
124             //requestParameters
125             String subscriptionServiceType = jsonUtil.getJsonValue(ssRequest, "requestDetails.requestParameters.subscriptionServiceType")
126             if (isBlank(subscriptionServiceType)) {
127                 msg = "Input subscriptionServiceType is null"
128                 logger.debug(msg)
129                 exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
130             } else {
131                 execution.setVariable("subscriptionServiceType", subscriptionServiceType)
132             }
133             logger.debug("subscriptionServiceType: " + subscriptionServiceType)
134
135             /*
136             * Extracting User Parameters from incoming Request and converting into a Map
137             */
138             Map reqMap = jsonSlurper.parseText(ssRequest)
139
140             //InputParams
141             def userParamsList = reqMap.requestDetails?.requestParameters?.userParams
142
143             Map<String, String> inputMap = [:]
144             if (userParamsList) {
145                 for (def i = 0; i < userParamsList.size(); i++) {
146                     def userParams1 = userParamsList.get(i)
147                     userParams1.each { param -> inputMap.put(param.key, param.value) }
148                 }
149             }
150
151             logger.debug("User Input Parameters map: " + inputMap.toString())
152             String uuiRequest = inputMap.get("UUIRequest")
153             Map uuiReqMap = jsonSlurper.parseText(uuiRequest)
154             Map<String, Object> serviceObject = (Map<String, Object>) uuiReqMap.get("service")
155             Map<String, Object> parameterObject = (Map<String, Object>) serviceObject.get("parameters")
156             Map<String, Object> requestInputs = (Map<String, Object>) parameterObject.get("requestInputs")
157
158             def serviceProfile = [:]
159             for(entry in requestInputs) {
160                 serviceProfile[entry.key] = entry.value
161             }
162
163             execution.setVariable("serviceInputParams", inputMap)
164             execution.setVariable("uuiRequest", uuiRequest)
165             execution.setVariable("serviceProfile", serviceProfile)
166
167             //TODO
168             //execution.setVariable("serviceInputParams", jsonUtil.getJsonValue(siRequest, "requestDetails.requestParameters.userParams"))
169             //execution.setVariable("failExists", true)
170
171         } catch (BpmnError e) {
172             throw e
173         } catch (Exception ex) {
174             msg = "Exception in preProcessRequest " + ex.getMessage()
175             logger.debug(msg)
176             exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
177         }
178         logger.debug("Finish preProcessRequest")
179     }
180
181     public void prepareSelectNSTRequest(DelegateExecution execution) {
182         logger.debug("Start prepareSelectNSTRequest")
183         String requestId = execution.getVariable("msoRequestId")
184             String messageType = "NSTSelectionResponse"
185         Map<String, Object> serviceProfile = execution.getVariable("serviceProfile")
186                 execution.setVariable("nstSelectionUrl", "/api/oof/v1/selection/nst")
187                 execution.setVariable("nstSelection_messageType",messageType)
188                 execution.setVariable("nstSelection_correlator",requestId)
189                 String timeout = UrnPropertiesReader.getVariable("mso.adapters.oof.timeout", execution);
190                 execution.setVariable("nstSelection_timeout",timeout)
191         String oofRequest = oofUtils.buildSelectNSTRequest(requestId,messageType, serviceProfile)
192         execution.setVariable("nstSelection_oofRequest",oofRequest)
193         logger.debug("Finish prepareSelectNSTRequest")
194
195     }
196         
197         public void processNSTSolutions(DelegateExecution execution) {
198                 Map<String, Object> nstSolution
199                 try {
200                         logger.debug("Start processing NSTSolutions")
201                         Map<String, Object> resMap = objectMapper.readValue(execution.getVariable("nstSelection_oofResponse"),Map.class)
202                         List<Map<String, Object>> nstSolutions = (List<Map<String, Object>>) resMap.get("solutions")
203                         nstSolution = nstSolutions.get(0)
204                         execution.setVariable("nstSolution", nstSolution)
205                 } catch (Exception ex) {
206                         logger.debug( "Failed to get NST solution suggested by OOF.")
207                         exceptionUtil.buildAndThrowWorkflowException(execution, 401, "Failed to get NST solution suggested by OOF.")
208                 }
209
210         }
211
212     public void prepareDecomposeService(DelegateExecution execution) {
213         logger.debug("Start prepareDecomposeService")
214         String uuiRequest = execution.getVariable("uuiRequest")
215         String ssModelInvariantUuid = jsonUtil.getJsonValue(uuiRequest, "service.serviceInvariantUuid")
216         String ssModelUuid = jsonUtil.getJsonValue(uuiRequest, "service.serviceUuid")
217         String ssServiceModelInfo = """{
218             "modelInvariantUuid":"${ssModelInvariantUuid}",
219             "modelUuid":"${ssModelUuid}",
220             "modelVersion":""
221              }"""
222         execution.setVariable("ssServiceModelInfo", ssServiceModelInfo)
223
224         logger.debug("Finish prepareDecomposeService")
225     }
226
227     public void processDecomposition(DelegateExecution execution) {
228         logger.debug("Start processDecomposition")
229         String uuiRequest = execution.getVariable("uuiRequest")
230         Map<String, Object> serviceProfile = execution.getVariable("serviceProfile")
231         Map<String, Object> nstSolution = execution.getVariable("nstSolution")
232
233         Map uuiReqMap = jsonSlurper.parseText(uuiRequest)
234         Map<String, Object> serviceObject = (Map<String, Object>) uuiReqMap.get("service")
235         String subscriptionServiceType = serviceObject.get("serviceType")
236
237         String serviceType = (String) serviceProfile.get("sST")
238         String resourceSharingLevel = (String) serviceProfile.get("resourceSharingLevel")
239         String nstModelUuid = (String) nstSolution.get("UUID")
240         String nstModelInvariantUuid = (String) nstSolution.get("invariantUUID")
241
242         execution.setVariable("subscriptionServiceType", subscriptionServiceType)
243         execution.setVariable("serviceType", serviceType)
244         execution.setVariable("resourceSharingLevel", resourceSharingLevel)
245         execution.setVariable("nstModelUuid", nstModelUuid)
246         execution.setVariable("nstModelInvariantUuid", nstModelInvariantUuid)
247
248         logger.debug("Finish processDecomposition")
249     }
250
251     public void prepareCreateOrchestrationTask(DelegateExecution execution) {
252         logger.debug("Start createOrchestrationTask")
253         String taskId = execution.getBusinessKey()
254         execution.setVariable("orchestrationTaskId", taskId)
255         logger.debug("BusinessKey: " + taskId)
256         String serviceInstanceId = execution.getVariable("serviceInstanceId")
257         String serviceInstanceName = execution.getVariable("serviceInstanceName")
258         String taskName = "SliceServiceTask"
259         String taskStatus = "Planning"
260         String isManual = "false"
261         String requestMethod = "POST"
262         execution.setVariable("CSSOT_taskId", taskId)
263         execution.setVariable("CSSOT_name", taskName)
264         execution.setVariable("CSSOT_status", taskStatus)
265         execution.setVariable("CSSOT_isManual", isManual)
266         execution.setVariable("CSSOT_requestMethod", requestMethod)
267
268         Map<String, Object> serviceProfile = execution.getVariable("serviceProfile")
269
270         SliceTaskParams sliceTaskParams = new SliceTaskParams()
271         sliceTaskParams.setServiceId(serviceInstanceId)
272         sliceTaskParams.setServiceName(serviceInstanceName)
273         sliceTaskParams.setServiceProfile(serviceProfile)
274         execution.setVariable("sliceTaskParams", sliceTaskParams)
275
276         String paramJson = sliceTaskParams.convertToJson()
277         execution.setVariable("CSSOT_paramJson", paramJson)
278         logger.debug("CSSOT_paramJson: " + paramJson)
279
280         logger.debug("Finish createOrchestrationTask")
281     }
282
283     public void prepareUpdateOrchestrationTask(DelegateExecution execution) {
284         logger.debug("Start prepareUpdateOrchestrationTask")
285         String requestMethod = "PUT"
286         String taskStatus = execution.getVariable("taskStatus")
287         SliceTaskParams sliceTaskParams = execution.getVariable("sliceTaskParams")
288         String paramJson = sliceTaskParams.convertToJson()
289         execution.setVariable("CSSOT_status", taskStatus)
290         execution.setVariable("CSSOT_paramJson", paramJson)
291         execution.setVariable("CSSOT_requestMethod", requestMethod)
292         logger.debug("Finish prepareUpdateOrchestrationTask")
293     }
294
295     public void prepareGetUserOptions(DelegateExecution execution) {
296         logger.debug("Start prepareGetUserOptions")
297         String requestMethod = "GET"
298         execution.setVariable("taskAction", "commit")
299         String taskAction = execution.getVariable("taskAction")
300         logger.debug("task action is: " + taskAction)
301         if (!"commit".equals(taskAction) && !"abort".equals(taskAction)) {
302             String msg = "Unknown task action: " + taskAction
303             logger.debug(msg)
304             exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
305         }
306         execution.setVariable("CSSOT_requestMethod", requestMethod)
307         logger.debug("Finish prepareGetUserOptions")
308     }
309
310     public void processUserOptions(DelegateExecution execution) {
311         logger.debug("Start processUserOptions")
312         String response = execution.getVariable("CSSOT_dbResponse")
313         OrchestrationTask orchestrationTask = objectMapper.readValue(response, OrchestrationTask.class)
314         String paramJson = orchestrationTask.getParams()
315         logger.debug("paramJson: " + paramJson)
316         SliceTaskParams sliceTaskParams = new SliceTaskParams()
317         sliceTaskParams.convertFromJson(paramJson)
318         execution.setVariable("sliceTaskParams", sliceTaskParams)
319         logger.debug("Finish processUserOptions")
320     }
321
322     public void updateAAIOrchStatus(DelegateExecution execution) {
323         logger.debug("Start updateAAIOrchStatus")
324         String serviceInstanceId = execution.getVariable("serviceInstanceId")
325         String orchStatus = execution.getVariable("orchestrationStatus")
326
327         try {
328             ServiceInstance si = ServiceInstance si = new ServiceInstance()
329             si.setOrchestrationStatus(orchStatus)
330             AAIResourcesClient client = new AAIResourcesClient()
331             AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectType.SERVICE_INSTANCE, serviceInstanceId)
332             client.update(uri, si)
333         } catch (BpmnError e) {
334             throw e
335         } catch (Exception ex) {
336             String msg = "Exception in CreateSliceService.updateAAIOrchStatus " + ex.getMessage()
337             logger.info(msg)
338             exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
339         }
340
341         logger.debug("Finish updateAAIOrchStatus")
342     }
343
344     public void prepareInitServiceOperationStatus(DelegateExecution execution) {
345         logger.debug("Start prepareInitServiceOperationStatus")
346         try{
347             String serviceId = execution.getVariable("serviceInstanceId")
348             String operationId = execution.getVariable("operationId")
349             String operationType = "CREATE"
350             String userId = execution.getVariable("globalSubscriberId")
351             String result = "processing"
352             String progress = "0"
353             String reason = ""
354             String operationContent = "Prepare service creation"
355             logger.debug("Generated new operation for Service Instance serviceId:" + serviceId + " operationId:" + operationId)
356             serviceId = UriUtils.encode(serviceId,"UTF-8")
357             execution.setVariable("serviceInstanceId", serviceId)
358             execution.setVariable("operationType", operationType)
359
360             def dbAdapterEndpoint = UrnPropertiesReader.getVariable("mso.adapters.openecomp.db.endpoint",execution)
361             execution.setVariable("CSSOS_dbAdapterEndpoint", dbAdapterEndpoint)
362             logger.debug("DB Adapter Endpoint is: " + dbAdapterEndpoint)
363             def dbAdapterAuth = UrnPropertiesReader.getVariable("mso.requestDb.auth")
364             Map<String, String> CSSOS_headerMap = [:]
365             CSSOS_headerMap.put("content-type", "application/soap+xml")
366             CSSOS_headerMap.put("Authorization", dbAdapterAuth)
367             execution.setVariable("CSSOS_headerMap", CSSOS_headerMap)
368             logger.debug("DB Adapter Header is: " + CSSOS_headerMap)
369
370             String payload =
371                     """<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
372                         xmlns:ns="http://org.onap.so/requestsdb">
373                         <soapenv:Header/>
374                         <soapenv:Body>
375                             <ns:initServiceOperationStatus xmlns:ns="http://org.onap.so/requestsdb">
376                             <serviceId>${MsoUtils.xmlEscape(serviceId)}</serviceId>
377                             <operationId>${MsoUtils.xmlEscape(operationId)}</operationId>
378                             <operationType>${MsoUtils.xmlEscape(operationType)}</operationType>
379                             <userId>${MsoUtils.xmlEscape(userId)}</userId>
380                             <result>${MsoUtils.xmlEscape(result)}</result>
381                             <operationContent>${MsoUtils.xmlEscape(operationContent)}</operationContent>
382                             <progress>${MsoUtils.xmlEscape(progress)}</progress>
383                             <reason>${MsoUtils.xmlEscape(reason)}</reason>
384                         </ns:initServiceOperationStatus>
385                     </soapenv:Body>
386                 </soapenv:Envelope>"""
387
388             payload = utils.formatXml(payload)
389             execution.setVariable("CSSOS_updateServiceOperStatusRequest", payload)
390             logger.debug("Outgoing updateServiceOperStatusRequest: \n" + payload)
391         }catch(Exception e){
392             logger.error(LoggingAnchor.FIVE, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
393                     "Exception Occured Processing prepareInitServiceOperationStatus.", "BPMN",
394                     ErrorCode.UnknownError.getValue(), "Exception is:\n" + e)
395         }
396         logger.debug("Finish prepareInitServiceOperationStatus")
397     }
398
399     public void prepareUpdateServiceOperationStatus(DelegateExecution execution) {
400         logger.debug("Start preUpdateServiceOperationStatus")
401         try{
402             String serviceId = execution.getVariable("serviceInstanceId")
403             String operationId = execution.getVariable("operationId")
404             String operationType = execution.getVariable("operationType")
405             String userId = execution.getVariable("globalSubscriberId")
406             String result = execution.getVariable("operationResult")
407             String progress = execution.getVariable("operationProgress")
408             String reason = execution.getVariable("operationReason")
409             String operationContent = "service: " + result + " progress: " + progress
410
411             String payload =
412                     """<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
413                         xmlns:ns="http://org.onap.so/requestsdb">
414                         <soapenv:Header/>
415                         <soapenv:Body>
416                             <ns:initServiceOperationStatus xmlns:ns="http://org.onap.so/requestsdb">
417                             <serviceId>${MsoUtils.xmlEscape(serviceId)}</serviceId>
418                             <operationId>${MsoUtils.xmlEscape(operationId)}</operationId>
419                             <operationType>${MsoUtils.xmlEscape(operationType)}</operationType>
420                             <userId>${MsoUtils.xmlEscape(userId)}</userId>
421                             <result>${MsoUtils.xmlEscape(result)}</result>
422                             <operationContent>${MsoUtils.xmlEscape(operationContent)}</operationContent>
423                             <progress>${MsoUtils.xmlEscape(progress)}</progress>
424                             <reason>${MsoUtils.xmlEscape(reason)}</reason>
425                         </ns:initServiceOperationStatus>
426                     </soapenv:Body>
427                 </soapenv:Envelope>"""
428
429             payload = utils.formatXml(payload)
430             execution.setVariable("CSSOS_updateServiceOperStatusRequest", payload)
431             logger.debug("Outgoing updateServiceOperStatusRequest: \n" + payload)
432
433         }catch(Exception e){
434             logger.error(LoggingAnchor.FIVE, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
435                     "Exception Occured Processing preUpdateServiceOperationStatus.", "BPMN",
436                     ErrorCode.UnknownError.getValue(), "Exception is:\n" + e.getMessage())
437         }
438         logger.debug("Finish preUpdateServiceOperationStatus")
439     }
440
441     public void sendSyncResponse(DelegateExecution execution) {
442         logger.debug("Start sendSyncResponse")
443         try {
444             String operationId = execution.getVariable("operationId")
445             String serviceInstanceId = execution.getVariable("serviceInstanceId")
446             // RESTResponse for API Handler (APIH) Reply Task
447             String createServiceRestRequest = """{"service":{"serviceId":"${serviceInstanceId}","operationId":"${operationId}"}}""".trim()
448             logger.debug("sendSyncResponse to APIH:" + "\n" + createServiceRestRequest)
449             sendWorkflowResponse(execution, 202, createServiceRestRequest)
450             execution.setVariable("sentSyncResponse", true)
451         } catch (Exception e) {
452             String msg = "Exceptuion in sendSyncResponse:" + e.getMessage()
453             logger.debug(msg)
454             exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
455         }
456         logger.debug("Finish sendSyncResponse")
457     }
458
459     public void prepareCompletionRequest (DelegateExecution execution) {
460         logger.trace("Start prepareCompletionRequest")
461         try {
462             String requestId = execution.getVariable("msoRequestId")
463             String serviceInstanceId = execution.getVariable("serviceInstanceId")
464             String source = execution.getVariable("source")
465
466             String msoCompletionRequest =
467                     """<aetgt:MsoCompletionRequest xmlns:aetgt="http://org.onap/so/workflow/schema/v1"
468                                 xmlns:ns="http://org.onap/so/request/types/v1">
469                         <request-info xmlns="http://org.onap/so/infra/vnf-request/v1">
470                             <request-id>${MsoUtils.xmlEscape(requestId)}</request-id>
471                             <action>CREATE</action>
472                             <source>${MsoUtils.xmlEscape(source)}</source>
473                         </request-info>
474                         <status-message>Service Instance was created successfully.</status-message>
475                         <serviceInstanceId>${MsoUtils.xmlEscape(serviceInstanceId)}</serviceInstanceId>
476                         <mso-bpel-name>CreateGenericALaCarteServiceInstance</mso-bpel-name>
477                     </aetgt:MsoCompletionRequest>"""
478
479             // Format Response
480             String xmlMsoCompletionRequest = utils.formatXml(msoCompletionRequest)
481
482             execution.setVariable("completionRequest", xmlMsoCompletionRequest)
483             logger.debug("Overall SUCCESS Response going to CompleteMsoProcess - " + "\n" + xmlMsoCompletionRequest)
484
485         } catch (Exception ex) {
486             String msg = " Exception in prepareCompletion:" + ex.getMessage()
487             logger.debug(msg)
488             exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
489         }
490         logger.trace("Finish prepareCompletionRequest")
491     }
492
493 }
494