[MSO-8] Update the maven dependency
[so.git] / bpmn / MSOInfrastructureBPMN / src / main / groovy / org / openecomp / mso / bpmn / infrastructure / scripts / DeleteGenericMacroServiceNetworkVnf.groovy
1 /*-
2  * ============LICENSE_START=======================================================
3  * OPENECOMP - MSO
4  * ================================================================================
5  * Copyright (C) 2017 AT&T Intellectual Property. 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.openecomp.mso.bpmn.infrastructure.scripts;
21
22 import groovy.xml.XmlUtil
23 import groovy.json.*
24
25 import org.openecomp.mso.bpmn.core.json.JsonUtils
26 import org.openecomp.mso.bpmn.common.scripts.AbstractServiceTaskProcessor
27 import org.openecomp.mso.bpmn.common.scripts.CatalogDbUtils
28 import org.openecomp.mso.bpmn.common.scripts.ExceptionUtil
29 import org.openecomp.mso.bpmn.common.scripts.NetworkUtils
30 import org.openecomp.mso.bpmn.common.scripts.VidUtils
31 import org.openecomp.mso.bpmn.core.WorkflowException
32 import org.openecomp.mso.rest.APIResponse;
33
34
35 import java.util.UUID;
36
37 import org.camunda.bpm.engine.delegate.BpmnError
38 import org.camunda.bpm.engine.runtime.Execution
39 import org.json.JSONObject;
40 import org.json.JSONArray;
41 import org.apache.commons.lang3.*
42 import org.apache.commons.codec.binary.Base64;
43 import org.springframework.web.util.UriUtils;
44
45 /**
46  * This groovy class supports the <class>DeleteViprAtmService.bpmn</class> process.
47  *
48  */
49 public class DeleteGenericMacroServiceNetworkVnf extends AbstractServiceTaskProcessor {
50
51         String Prefix="DELVAS_"
52         ExceptionUtil exceptionUtil = new ExceptionUtil()
53         JsonUtils jsonUtil = new JsonUtils()
54         VidUtils vidUtils = new VidUtils()
55         CatalogDbUtils catalogDbUtils = new CatalogDbUtils()
56         NetworkUtils networkUtils = new NetworkUtils()
57
58         /**
59          * This method is executed during the preProcessRequest task of the <class>DeleteViprAtmService.bpmn</class> process.
60          * @param execution
61          */
62         public InitializeProcessVariables(Execution execution){
63                 /* Initialize all the process variables in this block */
64
65                 execution.setVariable("deleteViprAtmServiceRequest", "")
66                 execution.setVariable("msoRequestId", "")
67                 execution.setVariable("DELVAS_vnfsDeletedCount", 0)
68                 execution.setVariable("DELVAS_vnfsCount", 0)
69                 execution.setVariable("DELVAS_networksCount", 0)
70                 execution.setVariable("DELVAS_networksDeletedCount", 0)
71         }
72
73         // **************************************************
74         //     Pre or Prepare Request Section
75         // **************************************************
76         /**
77          * This method is executed during the preProcessRequest task of the <class>CreateServiceInstance.bpmn</class> process.
78          * @param execution
79          */
80         public void preProcessRequest (Execution execution) {
81                 def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
82                 execution.setVariable("prefix",Prefix)
83
84                 utils.log("DEBUG", " ***** Inside preProcessRequest DeleteViprAtmService Request ***** ", isDebugEnabled)
85
86                 try {
87                         // initialize flow variables
88                         InitializeProcessVariables(execution)
89
90                         // check for incoming json message/input
91                         String deleteViprAtmServiceRequest = execution.getVariable("bpmnRequest")
92                         utils.logAudit(deleteViprAtmServiceRequest)
93                         execution.setVariable("deleteViprAtmServiceRequest", deleteViprAtmServiceRequest);
94                         println 'deleteViprAtmServiceRequest - ' + deleteViprAtmServiceRequest
95
96                         // extract requestId
97                         String requestId = execution.getVariable("mso-request-id")
98                         execution.setVariable("msoRequestId", requestId)
99
100                         String serviceInstanceId = execution.getVariable("serviceInstanceId")
101                         if ((serviceInstanceId == null) || (serviceInstanceId.isEmpty())) {
102                                 String dataErrorMessage = " Element 'serviceInstanceId' is missing. "
103                                 exceptionUtil.buildAndThrowWorkflowException(execution, 2500, dataErrorMessage)
104                         }
105                         
106                         String requestAction = execution.getVariable("requestAction")
107                         execution.setVariable("requestAction", requestAction)
108
109                         String source = jsonUtil.getJsonValue(deleteViprAtmServiceRequest, "requestDetails.requestInfo.source")
110                         if ((source == null) || (source.isEmpty())) {
111                                 execution.setVariable("source", "VID")
112                         } else {
113                                 execution.setVariable("source", source)
114                         }
115
116                         // extract globalSubscriberId
117                         String globalSubscriberId = jsonUtil.getJsonValue(deleteViprAtmServiceRequest, "requestDetails.subscriberInfo.globalSubscriberId")
118
119                         // global-customer-id is optional on Delete
120
121                         execution.setVariable("globalSubscriberId", globalSubscriberId)
122                         execution.setVariable("globalCustomerId", globalSubscriberId)
123                         
124                         String suppressRollback = jsonUtil.getJsonValue(deleteViprAtmServiceRequest, "requestDetails.requestInfo.suppressRollback")
125                         execution.setVariable("disableRollback", suppressRollback)
126                         utils.log("DEBUG", "Incoming Suppress/Disable Rollback is: " + suppressRollback, isDebugEnabled)
127                         
128                         String productFamilyId = jsonUtil.getJsonValue(deleteViprAtmServiceRequest, "requestDetails.requestInfo.productFamilyId")
129                         execution.setVariable("productFamilyId", productFamilyId)
130                         utils.log("DEBUG", "Incoming productFamilyId is: " + productFamilyId, isDebugEnabled)
131                         
132                         // extract subscriptionServiceType
133                         String subscriptionServiceType = jsonUtil.getJsonValue(deleteViprAtmServiceRequest, "requestDetails.requestParameters.subscriptionServiceType")
134                         execution.setVariable("subscriptionServiceType", subscriptionServiceType)
135                         utils.log("DEBUG", "Incoming subscriptionServiceType is: " + subscriptionServiceType, isDebugEnabled)
136                         
137                         // extract cloud configuration
138                         String lcpCloudRegionId = jsonUtil.getJsonValue(deleteViprAtmServiceRequest, "requestDetails.cloudConfiguration.lcpCloudRegionId")
139                         execution.setVariable("lcpCloudRegionId", lcpCloudRegionId)
140                         utils.log("DEBUG","lcpCloudRegionId: "+ lcpCloudRegionId, isDebugEnabled)
141                         String tenantId = jsonUtil.getJsonValue(deleteViprAtmServiceRequest, "requestDetails.cloudConfiguration.tenantId")
142                         execution.setVariable("tenantId", tenantId)
143                         utils.log("DEBUG","tenantId: "+ tenantId, isDebugEnabled)
144
145                         String sdncVersion = "1702"
146                         execution.setVariable("sdncVersion", sdncVersion)
147                         utils.log("DEBUG","sdncVersion: "+ sdncVersion, isDebugEnabled)
148                         
149                         //For Completion Handler & Fallout Handler
150                         String requestInfo =
151                         """<request-info xmlns="http://org.openecomp/mso/infra/vnf-request/v1">
152                                         <request-id>${requestId}</request-id>
153                                         <action>DELETE</action>
154                                         <source>${source}</source>
155                                    </request-info>"""
156
157                         execution.setVariable("DELVAS_requestInfo", requestInfo)
158                         
159                         //Setting for Generic Sub Flows
160                         execution.setVariable("GENGS_type", "service-instance")
161                         
162                         utils.log("DEBUG", " ***** Completed preProcessRequest DeleteViprAtmService Request ***** ", isDebugEnabled)
163
164                 } catch (BpmnError e) {
165                         throw e;
166                 } catch (Exception ex){
167                         String exceptionMessage = "Bpmn error encountered in DeleteViprAtmService flow. Unexpected from method preProcessRequest() - " + ex.getMessage()
168                         exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage)
169                 }
170         }
171
172         public void sendSyncResponse (Execution execution) {
173                 def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
174
175                 utils.log("DEBUG", " ***** Inside sendSyncResponse of DeleteViprAtmService ***** ", isDebugEnabled)
176
177                 try {
178                         String serviceInstanceId = execution.getVariable("serviceInstanceId")
179                         String requestId = execution.getVariable("mso-request-id")
180
181                         // RESTResponse (for API Handler (APIH) Reply Task)
182                         String syncResponse ="""{"requestReferences":{"instanceId":"${serviceInstanceId}","requestId":"${requestId}"}}""".trim()
183
184                         utils.log("DEBUG", " sendSynchResponse: xmlSyncResponse - " + "\n" + syncResponse, isDebugEnabled)
185                         sendWorkflowResponse(execution, 202, syncResponse)
186                 } catch (Exception ex) {
187                         String exceptionMessage = "Bpmn error encountered in DeleteViprAtmService flow. Unexpected from method sendSyncResponse() - " + ex.getMessage()
188                         exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage)
189                 }
190         }
191
192         public void prepareServiceInstanceDelete (Execution execution) {
193                 def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
194                 utils.log("DEBUG", " ***** Inside prepareServiceInstanceDelete() of DeleteViprAtmService ***** ", isDebugEnabled)
195                 
196                 try {
197                         
198                         String serviceInstanceId = execution.getVariable("serviceInstanceId")
199                         
200                         // confirm if ServiceInstance was found
201                         if ( !execution.getVariable("GENGS_FoundIndicator") )
202                         {
203                                 String exceptionMessage = "Bpmn error encountered in DeleteViprAtmService flow. Service Instance was not found in AAI by id: " + serviceInstanceId
204                                 exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage)
205                         }
206                         
207                         // get variable within incoming json
208                         String deleteViprAtmServiceRequest = execution.getVariable("deleteViprAtmServiceRequest");
209                         
210                         // get SI extracted by GenericGetService
211                         String serviceInstanceAaiRecord = execution.getVariable("GENGS_service");
212                         
213                         utils.log("DEBUG", "serviceInstanceAaiRecord: "+serviceInstanceAaiRecord, isDebugEnabled)
214                         
215                         String relationship = ""
216                         try {
217                                 relationship = networkUtils.getFirstNodeXml(serviceInstanceAaiRecord, "relationship-list")
218                         } catch (Exception ex) {
219                                 //no relationships found
220                         }
221                         utils.log("DEBUG", " relationship string - " + relationship, isDebugEnabled)
222                         
223                         int vnfsCount = 0
224                         int networksCount = 0
225                         
226                         if (relationship != null && relationship.length() > 0){
227                                 relationship = relationship.trim().replace("tag0:","").replace(":tag0","")
228                                 
229                                 // Check if Network TableREf is present, then build a List of network policy
230                                 List relatedVnfIdList = networkUtils.getRelatedVnfIdList(relationship)
231                                 vnfsCount = relatedVnfIdList.size()
232                                 execution.setVariable("DELVAS_vnfsCount", vnfsCount)
233                                 utils.log("DEBUG", " DELVAS_vnfsCount : " + vnfsCount, isDebugEnabled)
234                                 execution.setVariable("DELVAS_relatedVnfIdList", relatedVnfIdList)
235                                 
236                                 // Check if Network TableREf is present, then build a List of network policy
237                                 List relatedNetworkIdList = networkUtils.getRelatedNetworkIdList(relationship)
238                                 networksCount = relatedNetworkIdList.size()
239                                 execution.setVariable("DELVAS_networksCount", networksCount)
240                                 utils.log("DEBUG", " DELVAS_networksCount : " + networksCount, isDebugEnabled)
241                                 execution.setVariable("DELVAS_relatedNetworkIdList", relatedNetworkIdList)
242                                 execution.setVariable("relatedNetworkIdListString", relatedNetworkIdList.toString())
243                         } else {
244                                 execution.setVariable("DELVAS_vnfsCount", 0)
245                                 utils.log("DEBUG", " DELVAS_vnfsCount : " + vnfsCount, isDebugEnabled)
246                                 execution.setVariable("DELVAS_networksCount", 0)
247                                 utils.log("DEBUG", " DELVAS_networksCount : " + networksCount, isDebugEnabled)
248                         }
249                         
250                         utils.log("DEBUG", " ***** Completed prepareServiceInstanceDelete() of DeleteViprAtmService ***** ", isDebugEnabled)
251                 } catch (Exception ex) {
252                         sendSyncError(execution)
253                    String exceptionMessage = "Bpmn error encountered in DeleteViprAtmService flow. prepareServiceInstanceDelete() - " + ex.getMessage()
254                    utils.log("DEBUG", exceptionMessage, isDebugEnabled)
255                    exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage)
256                 }
257         }
258         
259         
260         // *******************************
261         //     
262         // *******************************
263         public void prepareVnfAndModulesDelete (Execution execution) {
264                 def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
265
266                 try {
267                         utils.log("DEBUG", " ***** Inside prepareVnfAndModulesDelete of DeleteServiceInstanceMacro ***** ", isDebugEnabled)
268
269                         List vnfList = execution.getVariable("DELVAS_relatedVnfIdList")
270                         Integer vnfsDeletedCount = execution.getVariable("DELVAS_vnfsDeletedCount")
271                         String vnfModelInfoString = ""
272                         String vnfId = ""
273                         if (vnfList.size() > 0 ) {
274                                 vnfId = vnfList.get(vnfsDeletedCount.intValue())
275                         }
276                                                         
277                         execution.setVariable("vnfId", vnfId)
278                         utils.log("DEBUG", "need to delete vnfId:" + vnfId, isDebugEnabled)
279
280                         utils.log("DEBUG", " ***** Completed prepareVnfAndModulesDelete of DeleteServiceInstanceMacro ***** ", isDebugEnabled)
281                 } catch (Exception ex) {
282                         // try error in method block
283                         String exceptionMessage = "Bpmn error encountered in DeleteServiceInstanceMacro flow. Unexpected Error from method prepareVnfAndModulesDelete() - " + ex.getMessage()
284                         exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage)
285                 }
286          }
287         
288         // *******************************
289         //     Validate Vnf request Section -> increment count
290         // *******************************
291         public void validateVnfDelete (Execution execution) {
292                 def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
293
294                 try {
295                         utils.log("DEBUG", " ***** Inside validateVnfDelete of DeleteViprAtmService ***** ", isDebugEnabled)
296
297                         String vnfsDeletedCount = execution.getVariable("DELVAS_vnfsDeletedCount")
298                         vnfsDeletedCount++
299                         
300                         execution.setVariable("DELVAS_vnfsDeletedCount", vnfsDeletedCount)
301                         
302                         utils.log("DEBUG", " ***** Completed validateVnfDelete of DeleteViprAtmService ***** "+" vnf # "+vnfsDeletedCount, isDebugEnabled)
303                 } catch (Exception ex) {
304                         // try error in method block
305                         String exceptionMessage = "Bpmn error encountered in DeleteViprAtmService flow. Unexpected Error from method validateVnfDelete() - " + ex.getMessage()
306                         exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage)
307                 }
308          }
309         
310         // *******************************
311         //     Generate Network request Section
312         // *******************************
313         public void prepareNetworkDelete (Execution execution) {
314                 def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
315
316                 try {
317                         utils.log("DEBUG", " ***** Inside prepareNetworkDelete of DeleteViprAtmService ***** ", isDebugEnabled)
318
319                         List networkList = execution.getVariable("DELVAS_relatedNetworkIdList")
320                         utils.log("DEBUG", "array networkList from execution: "+ networkList, isDebugEnabled)
321                         
322                         if (networkList == null || networkList.size() < 1){
323                                 networkList = Arrays.asList(execution.getVariable("relatedNetworkIdListString"))
324                                 utils.log("DEBUG", "array from string networkList: "+ networkList, isDebugEnabled)
325                         }
326
327                         Integer networksDeletedCount = execution.getVariable("DELVAS_networksDeletedCount")
328
329                         String networkId = ""
330                         if (networkList.size() > 0) {
331                                 networkId = (String) networkList.get(networksDeletedCount.intValue())
332                         }
333                                                         
334                         execution.setVariable("networkId", networkId)
335                         utils.log("DEBUG", "need to delete networkId:" + networkId, isDebugEnabled)
336                         
337                         utils.log("DEBUG", " ***** Completed prepareNetworkDelete of DeleteViprAtmService ***** ", isDebugEnabled)
338                 } catch (Exception ex) {
339                         // try error in method block
340                         String exceptionMessage = q"Bpmn error encountered in DeleteViprAtmService flow. Unexpected Error from method prepareNetworkDelete() - " + ex.getMessage()
341                         exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage)
342                 }
343          }
344         
345         // *******************************
346         //     Validate Network request Section
347         // *******************************
348         public void validateNetworkDelete (Execution execution) {
349                 def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
350
351                 try {
352                         utils.log("DEBUG", " ***** Inside validateNetworkDelete of DeleteViprAtmService ***** ", isDebugEnabled)
353
354                         Integer networksDeletedCount = execution.getVariable("DELVAS_networksDeletedCount")
355                         networksDeletedCount++
356                         
357                         execution.setVariable("DELVAS_networksDeletedCount", networksDeletedCount)
358                         
359                         utils.log("DEBUG", " ***** Completed validateNetworkDelete of DeleteViprAtmService ***** ", isDebugEnabled)
360                 } catch (Exception ex) {
361                         // try error in method block
362                         String exceptionMessage = "Bpmn error encountered in DeleteViprAtmService flow. Unexpected Error from method validateNetworkDelete() - " + ex.getMessage()
363                         exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage)
364                 }
365          }
366
367         
368         // *****************************************
369         //     Prepare Completion request Section
370         // *****************************************
371         public void postProcessResponse (Execution execution) {
372                 def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
373                 utils.log("DEBUG", " ***** Inside postProcessResponse of DeleteViprAtmService ***** ", isDebugEnabled)
374
375                 try {
376                         String source = execution.getVariable("source")
377                         String requestId = execution.getVariable("msoRequestId")
378
379                         String msoCompletionRequest =
380                                         """<aetgt:MsoCompletionRequest xmlns:aetgt="http://org.openecomp/mso/workflow/schema/v1"
381                                                                         xmlns:ns="http://org.openecomp/mso/request/types/v1">
382                                                         <request-info xmlns="http://org.openecomp/mso/infra/vnf-request/v1">
383                                                                 <request-id>${requestId}</request-id>
384                                                                 <action>DELETE</action>
385                                                                 <source>${source}</source>
386                                                            </request-info>
387                                                         <aetgt:status-message>vIPR ATM Service Instance has been deleted successfully.</aetgt:status-message>
388                                                            <aetgt:mso-bpel-name>BPMN Service Instance macro action: DELETE</aetgt:mso-bpel-name>
389                                                 </aetgt:MsoCompletionRequest>"""
390
391                         // Format Response
392                         String xmlMsoCompletionRequest = utils.formatXml(msoCompletionRequest)
393
394                         utils.logAudit(xmlMsoCompletionRequest)
395                         execution.setVariable("DELVAS_Success", true)
396                         execution.setVariable("DELVAS_CompleteMsoProcessRequest", xmlMsoCompletionRequest)
397                         utils.log("DEBUG", " SUCCESS flow, going to CompleteMsoProcess - " + "\n" + xmlMsoCompletionRequest, isDebugEnabled)
398                 } catch (BpmnError e) {
399                 throw e;
400
401                 } catch (Exception ex) {
402                         // try error in method block
403                         String exceptionMessage = "Bpmn error encountered in DeleteServiceInstance flow. Unexpected Error from method postProcessResponse() - " + ex.getMessage()
404                         exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage)
405                 }
406         }
407
408         public void prepareFalloutRequest(Execution execution){
409                 def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
410                 utils.log("DEBUG", " *** STARTED DeleteViprAtmService prepareFalloutRequest Process *** ", isDebugEnabled)
411
412                 try {
413                         WorkflowException wfex = execution.getVariable("WorkflowException")
414                         utils.log("DEBUG", " Incoming Workflow Exception: " + wfex.toString(), isDebugEnabled)
415                         String requestInfo = execution.getVariable("DELVAS_requestInfo")
416                         utils.log("DEBUG", " Incoming Request Info: " + requestInfo, isDebugEnabled)
417
418                         String falloutRequest = exceptionUtil.processMainflowsBPMNException(execution, requestInfo)
419
420                         execution.setVariable("DELVAS_falloutRequest", falloutRequest)
421                 } catch (Exception ex) {
422                         utils.log("DEBUG", "Error Occured in DeleteViprAtmService prepareFalloutRequest Process " + ex.getMessage(), isDebugEnabled)
423                         exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "Internal Error - Occured in DeleteViprAtmService prepareFalloutRequest Process")
424                 }
425                 utils.log("DEBUG", "*** COMPLETED DeleteViprAtmService prepareFalloutRequest Process ***", isDebugEnabled)
426         }
427
428
429         public void sendSyncError (Execution execution) {
430                 def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
431                 utils.log("DEBUG", " ***** Inside sendSyncError() of DeleteServiceInstanceInfra ***** ", isDebugEnabled)
432
433                 try {
434                         String errorMessage = ""
435                         if (execution.getVariable("WorkflowException") instanceof WorkflowException) {
436                                 WorkflowException wfe = execution.getVariable("WorkflowException")
437                                 errorMessage = wfe.getErrorMessage()
438                         } else {
439                                 errorMessage = "Sending Sync Error."
440                         }
441
442                         String buildworkflowException =
443                                 """<aetgt:WorkflowException xmlns:aetgt="http://org.openecomp/mso/workflow/schema/v1">
444                                         <aetgt:ErrorMessage>${errorMessage}</aetgt:ErrorMessage>
445                                         <aetgt:ErrorCode>7000</aetgt:ErrorCode>
446                                    </aetgt:WorkflowException>"""
447
448                         utils.logAudit(buildworkflowException)
449                         sendWorkflowResponse(execution, 500, buildworkflowException)
450                 } catch (Exception ex) {
451                         utils.log("DEBUG", " Sending Sync Error Activity Failed. " + "\n" + ex.getMessage(), isDebugEnabled)
452                 }
453         }
454
455         public void processJavaException(Execution execution){
456                 def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
457                 execution.setVariable("prefix",Prefix)
458                 try{
459                         utils.log("DEBUG", "Caught a Java Exception", isDebugEnabled)
460                         utils.log("DEBUG", "Started processJavaException Method", isDebugEnabled)
461                         utils.log("DEBUG", "Variables List: " + execution.getVariables(), isDebugEnabled)
462                         execution.setVariable("DELVAS_unexpectedError", "Caught a Java Lang Exception")  // Adding this line temporarily until this flows error handling gets updated
463                         exceptionUtil.buildAndThrowWorkflowException(execution, 500, "Caught a Java Lang Exception")
464                 }catch(BpmnError b){
465                         utils.log("ERROR", "Rethrowing MSOWorkflowException", isDebugEnabled)
466                         throw b
467                 }catch(Exception e){
468                         utils.log("DEBUG", "Caught Exception during processJavaException Method: " + e, isDebugEnabled)
469                         execution.setVariable("DELVAS_unexpectedError", "Exception in processJavaException method")  // Adding this line temporarily until this flows error handling gets updated
470                         exceptionUtil.buildAndThrowWorkflowException(execution, 500, "Exception in processJavaException method")
471                 }
472                 utils.log("DEBUG", "Completed processJavaException Method", isDebugEnabled)
473         }
474
475
476 }