2 * © 2016 AT&T Intellectual Property. All rights reserved. Used under license from AT&T Intellectual Property.
\r
4 package org.openecomp.mso.bpmn.vcpe.scripts
\r
6 import groovy.xml.XmlUtil
\r
9 import org.openecomp.mso.bpmn.common.scripts.CatalogDbUtils;
\r
10 import org.openecomp.mso.bpmn.common.scripts.ExceptionUtil
\r
11 import org.openecomp.mso.bpmn.common.scripts.NetworkUtils;
\r
12 import org.openecomp.mso.bpmn.common.scripts.VidUtils;
\r
13 import org.openecomp.mso.bpmn.core.json.JsonUtils
\r
14 import org.openecomp.mso.bpmn.core.WorkflowException
\r
15 import org.openecomp.mso.rest.APIResponse
\r
16 import org.openecomp.mso.bpmn.common.scripts.AbstractServiceTaskProcessor
\r
18 import java.util.UUID;
\r
20 import org.camunda.bpm.engine.delegate.BpmnError
\r
21 import org.camunda.bpm.engine.runtime.Execution
\r
22 import org.json.JSONObject;
\r
23 import org.json.JSONArray;
\r
24 import org.apache.commons.lang3.*
\r
25 import org.apache.commons.codec.binary.Base64;
\r
26 import org.springframework.web.util.UriUtils;
\r
29 * This groovy class supports the <class>DeleteVcpeResCustService.bpmn</class> process.
\r
34 public class DeleteVcpeResCustService extends AbstractServiceTaskProcessor {
\r
36 String Prefix="DELVAS_"
\r
37 ExceptionUtil exceptionUtil = new ExceptionUtil()
\r
38 JsonUtils jsonUtil = new JsonUtils()
\r
39 VidUtils vidUtils = new VidUtils()
\r
40 CatalogDbUtils catalogDbUtils = new CatalogDbUtils()
\r
41 NetworkUtils networkUtils = new NetworkUtils()
\r
44 * This method is executed during the preProcessRequest task of the <class>DeleteVcpeResCustService.bpmn</class> process.
\r
47 public InitializeProcessVariables(Execution execution){
\r
48 /* Initialize all the process variables in this block */
\r
50 execution.setVariable("DeleteVcpeResCustServiceRequest", "")
\r
51 execution.setVariable("msoRequestId", "")
\r
52 execution.setVariable("DELVAS_vnfsDeletedCount", 0)
\r
53 execution.setVariable("DELVAS_vnfsCount", 0)
\r
54 execution.setVariable("DELVAS_networksCount", 0)
\r
55 execution.setVariable("DELVAS_networksDeletedCount", 0)
\r
58 // **************************************************
\r
59 // Pre or Prepare Request Section
\r
60 // **************************************************
\r
62 * This method is executed during the preProcessRequest task of the <class>CreateServiceInstance.bpmn</class> process.
\r
65 public void preProcessRequest (Execution execution) {
\r
66 def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
\r
67 execution.setVariable("prefix",Prefix)
\r
69 utils.log("DEBUG", " ***** Inside preProcessRequest DeleteVcpeResCustService Request ***** ", isDebugEnabled)
\r
72 // initialize flow variables
\r
73 InitializeProcessVariables(execution)
\r
75 // check for incoming json message/input
\r
76 String DeleteVcpeResCustServiceRequest = execution.getVariable("bpmnRequest")
\r
77 utils.logAudit(DeleteVcpeResCustServiceRequest)
\r
78 execution.setVariable("DeleteVcpeResCustServiceRequest", DeleteVcpeResCustServiceRequest);
\r
79 println 'DeleteVcpeResCustServiceRequest - ' + DeleteVcpeResCustServiceRequest
\r
81 // extract requestId
\r
82 String requestId = execution.getVariable("mso-request-id")
\r
83 execution.setVariable("msoRequestId", requestId)
\r
85 String serviceInstanceId = execution.getVariable("serviceInstanceId")
\r
86 if ((serviceInstanceId == null) || (serviceInstanceId.isEmpty())) {
\r
87 String dataErrorMessage = " Element 'serviceInstanceId' is missing. "
\r
88 exceptionUtil.buildAndThrowWorkflowException(execution, 2500, dataErrorMessage)
\r
91 String requestAction = execution.getVariable("requestAction")
\r
92 execution.setVariable("requestAction", requestAction)
\r
94 String source = jsonUtil.getJsonValue(DeleteVcpeResCustServiceRequest, "requestDetails.requestInfo.source")
\r
95 if ((source == null) || (source.isEmpty())) {
\r
96 execution.setVariable("source", "VID")
\r
98 execution.setVariable("source", source)
\r
101 // extract globalSubscriberId
\r
102 String globalSubscriberId = jsonUtil.getJsonValue(DeleteVcpeResCustServiceRequest, "requestDetails.subscriberInfo.globalSubscriberId")
\r
104 // global-customer-id is optional on Delete
\r
106 execution.setVariable("globalSubscriberId", globalSubscriberId)
\r
107 execution.setVariable("globalCustomerId", globalSubscriberId)
\r
109 String suppressRollback = jsonUtil.getJsonValue(DeleteVcpeResCustServiceRequest, "requestDetails.requestInfo.suppressRollback")
\r
110 execution.setVariable("disableRollback", suppressRollback)
\r
111 utils.log("DEBUG", "Incoming Suppress/Disable Rollback is: " + suppressRollback, isDebugEnabled)
\r
113 String productFamilyId = jsonUtil.getJsonValue(DeleteVcpeResCustServiceRequest, "requestDetails.requestInfo.productFamilyId")
\r
114 execution.setVariable("productFamilyId", productFamilyId)
\r
115 utils.log("DEBUG", "Incoming productFamilyId is: " + productFamilyId, isDebugEnabled)
\r
117 // extract subscriptionServiceType
\r
118 String subscriptionServiceType = jsonUtil.getJsonValue(DeleteVcpeResCustServiceRequest, "requestDetails.requestParameters.subscriptionServiceType")
\r
119 execution.setVariable("subscriptionServiceType", subscriptionServiceType)
\r
120 utils.log("DEBUG", "Incoming subscriptionServiceType is: " + subscriptionServiceType, isDebugEnabled)
\r
122 // extract cloud configuration
\r
123 String lcpCloudRegionId = jsonUtil.getJsonValue(DeleteVcpeResCustServiceRequest, "requestDetails.cloudConfiguration.lcpCloudRegionId")
\r
124 execution.setVariable("lcpCloudRegionId", lcpCloudRegionId)
\r
125 utils.log("DEBUG","lcpCloudRegionId: "+ lcpCloudRegionId, isDebugEnabled)
\r
126 String tenantId = jsonUtil.getJsonValue(DeleteVcpeResCustServiceRequest, "requestDetails.cloudConfiguration.tenantId")
\r
127 execution.setVariable("tenantId", tenantId)
\r
128 utils.log("DEBUG","tenantId: "+ tenantId, isDebugEnabled)
\r
130 String sdncVersion = "1702"
\r
131 execution.setVariable("sdncVersion", sdncVersion)
\r
132 utils.log("DEBUG","sdncVersion: "+ sdncVersion, isDebugEnabled)
\r
134 //For Completion Handler & Fallout Handler
\r
135 String requestInfo =
\r
136 """<request-info xmlns="http://org.openecomp/mso/infra/vnf-request/v1">
\r
137 <request-id>${requestId}</request-id>
\r
138 <action>DELETE</action>
\r
139 <source>${source}</source>
\r
142 execution.setVariable("DELVAS_requestInfo", requestInfo)
\r
144 //Setting for Generic Sub Flows
\r
145 execution.setVariable("GENGS_type", "service-instance")
\r
147 utils.log("DEBUG", " ***** Completed preProcessRequest DeleteVcpeResCustServiceRequest Request ***** ", isDebugEnabled)
\r
149 } catch (BpmnError e) {
\r
151 } catch (Exception ex){
\r
152 String exceptionMessage = "Bpmn error encountered in DeleteVcpeResCustService flow. Unexpected from method preProcessRequest() - " + ex.getMessage()
\r
153 exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage)
\r
157 public void sendSyncResponse (Execution execution) {
\r
158 def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
\r
160 utils.log("DEBUG", " ***** Inside sendSyncResponse of DeleteVcpeResCustService ***** ", isDebugEnabled)
\r
163 String serviceInstanceId = execution.getVariable("serviceInstanceId")
\r
164 String requestId = execution.getVariable("mso-request-id")
\r
166 // RESTResponse (for API Handler (APIH) Reply Task)
\r
167 String syncResponse ="""{"requestReferences":{"instanceId":"${serviceInstanceId}","requestId":"${requestId}"}}""".trim()
\r
169 utils.log("DEBUG", " sendSynchResponse: xmlSyncResponse - " + "\n" + syncResponse, isDebugEnabled)
\r
170 sendWorkflowResponse(execution, 202, syncResponse)
\r
171 } catch (Exception ex) {
\r
172 String exceptionMessage = "Bpmn error encountered in DeleteVcpeResCustService flow. Unexpected from method preProcessRequest() - " + ex.getMessage()^M
173 exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage)
\r
177 public void prepareServiceDelete (Execution execution) {
\r
178 def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
\r
179 utils.log("DEBUG", " ***** Inside prepareServiceInstanceDelete() of DeleteVcpeResCustService ***** ", isDebugEnabled)
\r
183 String serviceInstanceId = execution.getVariable("serviceInstanceId")
\r
185 // confirm if ServiceInstance was found
\r
186 if ( !execution.getVariable("GENGS_FoundIndicator") )
\r
188 String exceptionMessage = "Bpmn error encountered in DeleteVcpeResCustService flow. Service Instance was not found in AAI by id: " + serviceInstanceId
\r
189 exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage)
\r
192 // get variable within incoming json
\r
193 String DeleteVcpeResCustServiceRequest = execution.getVariable("DeleteVcpeResCustServiceRequest");
\r
195 // get SI extracted by GenericGetService
\r
196 String serviceInstanceAaiRecord = execution.getVariable("GENGS_service");
\r
198 utils.log("DEBUG", "serviceInstanceAaiRecord: "+serviceInstanceAaiRecord, isDebugEnabled)
\r
200 // determine if AR needs to be deleted
\r
201 boolean DELVAS_TunnelXConn = false
\r
202 boolean DELVAS_BRG = false
\r
203 String TXC_allottedResourceId
\r
204 String BRG_allottedResourceId
\r
205 XmlParser xmlParser = new XmlParser()
\r
206 def groovy.util.Node siNode = xmlParser.parseText(serviceInstanceAaiRecord)
\r
207 def groovy.util.Node arList = utils.getChildNode(siNode, 'allotted-resources')
\r
208 if (arList != null) {
\r
209 def groovy.util.NodeList ars = utils.getIdenticalChildren(arList, 'allotted-resource')
\r
210 for (groovy.util.Node ar in ars) {
\r
211 def groovy.util.Node type = utils.getChildNode(ar, 'type')
\r
212 if ((type != null) && (type.text().equals('TunnelXConn'))) {
\r
213 utils.log("DEBUG","TunnelXConn AR found", isDebugEnabled)
\r
214 def groovy.util.Node id = utils.getChildNode(ar, 'id')
\r
216 DELVAS_TunnelXConn = true
\r
217 TXC_allottedResourceId = id
\r
220 if ((type != null) && (type.text().equals('BRG'))) {
\r
221 utils.log("DEBUG","FW AR found", isDebugEnabled)
\r
222 def groovy.util.Node id = utils.getChildNode(ar, 'id')
\r
225 BRG_allottedResourceId = id
\r
230 execution.setVariable("DELVAS_TunnelXConn", DELVAS_TunnelXConn)
\r
231 utils.log("DEBUG", "DELVAS_TunnelXConn : " + DELVAS_TunnelXConn, isDebugEnabled)
\r
232 execution.setVariable("TXC_allottedResourceId", TXC_allottedResourceId)
\r
233 utils.log("DEBUG", "TXC_allottedResourceId : " + TXC_allottedResourceId, isDebugEnabled)
\r
235 execution.setVariable("DELVAS_BRG", DELVAS_BRG)
\r
236 utils.log("DEBUG", "DELVAS_BRG : " + DELVAS_BRG, isDebugEnabled)
\r
237 execution.setVariable("BRG_allottedResourceId", BRG_allottedResourceId)
\r
238 utils.log("DEBUG", "BRG_allottedResourceId : " + BRG_allottedResourceId, isDebugEnabled)
\r
240 String relationship = ""
\r
242 relationship = networkUtils.getFirstNodeXml(serviceInstanceAaiRecord, "relationship-list")
\r
243 } catch (Exception ex) {
\r
244 //no relationships found
\r
246 utils.log("DEBUG", " relationship string - " + relationship, isDebugEnabled)
\r
249 int networksCount = 0
\r
251 if (relationship != null && relationship.length() > 0){
\r
252 relationship = relationship.trim().replace("tag0:","").replace(":tag0","")
\r
254 // Check if Network TableREf is present, then build a List of network policy
\r
255 List relatedVnfIdList = networkUtils.getRelatedVnfIdList(relationship)
\r
256 vnfsCount = relatedVnfIdList.size()
\r
257 execution.setVariable("DELVAS_vnfsCount", vnfsCount)
\r
258 utils.log("DEBUG", " DELVAS_vnfsCount : " + vnfsCount, isDebugEnabled)
\r
259 execution.setVariable("DELVAS_relatedVnfIdList", relatedVnfIdList)
\r
261 // Check if Network TableREf is present, then build a List of network policy
\r
262 List relatedNetworkIdList = networkUtils.getRelatedNetworkIdList(relationship)
\r
263 networksCount = relatedNetworkIdList.size()
\r
264 execution.setVariable("DELVAS_networksCount", networksCount)
\r
265 utils.log("DEBUG", " DELVAS_networksCount : " + networksCount, isDebugEnabled)
\r
266 execution.setVariable("DELVAS_relatedNetworkIdList", relatedNetworkIdList)
\r
268 execution.setVariable("DELVAS_vnfsCount", 0)
\r
269 utils.log("DEBUG", " DELVAS_vnfsCount : " + vnfsCount, isDebugEnabled)
\r
270 execution.setVariable("DELVAS_networksCount", 0)
\r
271 utils.log("DEBUG", " DELVAS_networksCount : " + networksCount, isDebugEnabled)
\r
274 utils.log("DEBUG", " ***** Completed prepareServiceInstanceDelete() of DeleteVcpeCusRestService ***** ", isDebugEnabled)
\r
275 } catch (BpmnError e){
\r
277 } catch (Exception ex) {
\r
278 sendSyncError(execution)
\r
279 String exceptionMessage = "Bpmn error encountered in DeleteVcpeCusRestService flow. prepareServiceInstanceDelete() - " + ex.getMessage()
\r
280 utils.log("DEBUG", exceptionMessage, isDebugEnabled)
\r
281 exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage)
\r
286 // *******************************
\r
288 // *******************************
\r
289 public void prepareVnfAndModulesDelete (Execution execution) {
\r
290 def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
\r
293 utils.log("DEBUG", " ***** Inside prepareVnfAndModulesDelete of DeleteServiceInstanceMacro ***** ", isDebugEnabled)
\r
295 List vnfList = execution.getVariable("DELVAS_relatedVnfIdList")
\r
296 Integer vnfsDeletedCount = execution.getVariable("DELVAS_vnfsDeletedCount")
\r
297 String vnfModelInfoString = ""
\r
299 if (vnfList.size() > 0 ) {
\r
300 vnfId = vnfList.get(vnfsDeletedCount.intValue())
\r
303 execution.setVariable("vnfId", vnfId)
\r
304 utils.log("DEBUG", "need to delete vnfId:" + vnfId, isDebugEnabled)
\r
306 utils.log("DEBUG", " ***** Completed prepareVnfAndModulesDelete of DeleteServiceInstanceMacro ***** ", isDebugEnabled)
\r
307 } catch (Exception ex) {
\r
308 // try error in method block
\r
309 String exceptionMessage = "Bpmn error encountered in DeleteServiceInstanceMacro flow. Unexpected Error from method prepareVnfAndModulesDelete() - " + ex.getMessage()
\r
310 exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage)
\r
314 // *******************************
\r
315 // Validate Vnf request Section -> increment count
\r
316 // *******************************
\r
317 public void validateVnfDelete (Execution execution) {
\r
318 def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
\r
321 utils.log("DEBUG", " ***** Inside validateVnfDelete of DeleteVcpeCusRestService ***** ", isDebugEnabled)
\r
323 String vnfsDeletedCount = execution.getVariable("DELVAS_vnfsDeletedCount")
\r
326 execution.setVariable("DELVAS_vnfsDeletedCount", vnfsDeletedCount)
\r
328 utils.log("DEBUG", " ***** Completed validateVnfDelete of DeleteVcpeCusRestService ***** "+" vnf # "+vnfsDeletedCount, isDebugEnabled)
\r
329 } catch (Exception ex) {
\r
330 // try error in method block
\r
331 String exceptionMessage = "Bpmn error encountered in DeleteVcpeCusRestService flow. Unexpected Error from method validateVnfDelete() - " + ex.getMessage()
\r
332 exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage)
\r
336 // *******************************
\r
337 // Generate Network request Section
\r
338 // *******************************
\r
339 public void prepareNetworkDelete (Execution execution) {
\r
340 def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
\r
343 utils.log("DEBUG", " ***** Inside prepareNetworkDelete of DeleteVcpeCusRestService ***** ", isDebugEnabled)
\r
345 List networkList = execution.getVariable("DELVAS_relatedNetworkIdList")
\r
346 Integer networksDeletedCount = execution.getVariable("DELVAS_networksDeletedCount")
\r
348 String networkId = ""
\r
349 if (networkList.size() > 0) {
\r
350 networkId = networkList.get(networksDeletedCount.intValue())
\r
353 execution.setVariable("networkId", networkId)
\r
354 utils.log("DEBUG", "need to delete networkId:" + networkId, isDebugEnabled)
\r
356 utils.log("DEBUG", " ***** Completed prepareNetworkDelete of DeleteVcpeCusRestService ***** ", isDebugEnabled)
\r
357 } catch (Exception ex) {
\r
358 // try error in method block
\r
359 String exceptionMessage = q"Bpmn error encountered in DeleteVcpeCusRestService flow. Unexpected Error from method prepareNetworkDelete() - " + ex.getMessage()
\r
360 exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage)
\r
364 // *******************************
\r
365 // Validate Network request Section
\r
366 // *******************************
\r
367 public void validateNetworkDelete (Execution execution) {
\r
368 def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
\r
371 utils.log("DEBUG", " ***** Inside validateNetworkDelete of DeleteVcpeCusRestService ***** ", isDebugEnabled)
\r
373 Integer networksDeletedCount = execution.getVariable("DELVAS_networksDeletedCount")
\r
374 networksDeletedCount++
\r
376 execution.setVariable("DELVAS_networksDeletedCount", networksDeletedCount)
\r
378 utils.log("DEBUG", " ***** Completed validateNetworkDelete of DeleteVcpeCusRestService ***** ", isDebugEnabled)
\r
379 } catch (Exception ex) {
\r
380 // try error in method block
\r
381 String exceptionMessage = "Bpmn error encountered in DeleteVcpeCusRestService flow. Unexpected Error from method validateNetworkDelete() - " + ex.getMessage()
\r
382 exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage)
\r
387 // *****************************************
\r
388 // Prepare Completion request Section
\r
389 // *****************************************
\r
390 public void postProcessResponse (Execution execution) {
\r
391 def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
\r
392 utils.log("DEBUG", " ***** Inside postProcessResponse of DeleteVcpeCusRestService ***** ", isDebugEnabled)
\r
395 String source = execution.getVariable("source")
\r
396 String requestId = execution.getVariable("msoRequestId")
\r
398 String msoCompletionRequest =
\r
399 """<aetgt:MsoCompletionRequest xmlns:aetgt="http://org.openecomp/mso/workflow/schema/v1"
\r
400 xmlns:ns="http://org.openecomp/mso/request/types/v1">
\r
401 <request-info xmlns="http://org.openecomp/mso/infra/vnf-request/v1">
\r
402 <request-id>${requestId}</request-id>
\r
403 <action>DELETE</action>
\r
404 <source>${source}</source>
\r
406 <aetgt:status-message>vCPE Res Cust Service Instance has been deleted successfully.</aetgt:status-message>
\r
407 <aetgt:mso-bpel-name>BPMN Service Instance macro action: DELETE</aetgt:mso-bpel-name>
\r
408 </aetgt:MsoCompletionRequest>"""
\r
411 String xmlMsoCompletionRequest = utils.formatXml(msoCompletionRequest)
\r
413 utils.logAudit(xmlMsoCompletionRequest)
\r
414 execution.setVariable("DELVAS_Success", true)
\r
415 execution.setVariable("DELVAS_CompleteMsoProcessRequest", xmlMsoCompletionRequest)
\r
416 utils.log("DEBUG", " SUCCESS flow, going to CompleteMsoProcess - " + "\n" + xmlMsoCompletionRequest, isDebugEnabled)
\r
417 } catch (BpmnError e) {
\r
420 } catch (Exception ex) {
\r
421 // try error in method block
\r
422 String exceptionMessage = "Bpmn error encountered in DeleteServiceInstance flow. Unexpected Error from method postProcessResponse() - " + ex.getMessage()
\r
423 exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage)
\r
427 public void prepareFalloutRequest(Execution execution){
\r
428 def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
\r
429 utils.log("DEBUG", " *** STARTED DeleteVcpeCusRestService prepareFalloutRequest Process *** ", isDebugEnabled)
\r
432 WorkflowException wfex = execution.getVariable("WorkflowException")
\r
433 utils.log("DEBUG", " Incoming Workflow Exception: " + wfex.toString(), isDebugEnabled)
\r
434 String requestInfo = execution.getVariable("DELVAS_requestInfo")
\r
435 utils.log("DEBUG", " Incoming Request Info: " + requestInfo, isDebugEnabled)
\r
437 String falloutRequest = exceptionUtil.processMainflowsBPMNException(execution, requestInfo)
\r
439 execution.setVariable("DELVAS_falloutRequest", falloutRequest)
\r
440 } catch (Exception ex) {
\r
441 utils.log("DEBUG", "Error Occured in DeleteVcpeCusRestService prepareFalloutRequest Process " + ex.getMessage(), isDebugEnabled)
\r
442 exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "Internal Error - Occured in DeleteVcpeCusRestService prepareFalloutRequest Process")
\r
444 utils.log("DEBUG", "*** COMPLETED DeleteVcpeCusRestService prepareFalloutRequest Process ***", isDebugEnabled)
\r
448 public void sendSyncError (Execution execution) {
\r
449 def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
\r
450 utils.log("DEBUG", " ***** Inside sendSyncError() of DeleteServiceInstanceInfra ***** ", isDebugEnabled)
\r
453 String errorMessage = ""
\r
454 if (execution.getVariable("WorkflowException") instanceof WorkflowException) {
\r
455 WorkflowException wfe = execution.getVariable("WorkflowException")
\r
456 errorMessage = wfe.getErrorMessage()
\r
458 errorMessage = "Sending Sync Error."
\r
461 String buildworkflowException =
\r
462 """<aetgt:WorkflowException xmlns:aetgt="http://org.openecomp/mso/workflow/schema/v1">
\r
463 <aetgt:ErrorMessage>${errorMessage}</aetgt:ErrorMessage>
\r
464 <aetgt:ErrorCode>7000</aetgt:ErrorCode>
\r
465 </aetgt:WorkflowException>"""
\r
467 utils.logAudit(buildworkflowException)
\r
468 sendWorkflowResponse(execution, 500, buildworkflowException)
\r
469 } catch (Exception ex) {
\r
470 utils.log("DEBUG", " Sending Sync Error Activity Failed. " + "\n" + ex.getMessage(), isDebugEnabled)
\r
474 public void processJavaException(Execution execution){
\r
475 def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
\r
476 execution.setVariable("prefix",Prefix)
\r
478 utils.log("DEBUG", "Caught a Java Exception", isDebugEnabled)
\r
479 utils.log("DEBUG", "Started processJavaException Method", isDebugEnabled)
\r
480 utils.log("DEBUG", "Variables List: " + execution.getVariables(), isDebugEnabled)
\r
481 execution.setVariable("DELVAS_unexpectedError", "Caught a Java Lang Exception") // Adding this line temporarily until this flows error handling gets updated
\r
482 exceptionUtil.buildAndThrowWorkflowException(execution, 500, "Caught a Java Lang Exception")
\r
483 }catch(BpmnError b){
\r
484 utils.log("ERROR", "Rethrowing MSOWorkflowException", isDebugEnabled)
\r
486 }catch(Exception e){
\r
487 utils.log("DEBUG", "Caught Exception during processJavaException Method: " + e, isDebugEnabled)
\r
488 execution.setVariable("DELVAS_unexpectedError", "Exception in processJavaException method") // Adding this line temporarily until this flows error handling gets updated
\r
489 exceptionUtil.buildAndThrowWorkflowException(execution, 500, "Exception in processJavaException method")
\r
491 utils.log("DEBUG", "Completed processJavaException Method", isDebugEnabled)
\r