Merge "Add required dependency to fix compilation"
[so.git] / bpmn / MSOInfrastructureBPMN / src / main / groovy / org / openecomp / mso / bpmn / infrastructure / scripts / UpdateVnfInfra.groovy
1 /*-\r
2  * ============LICENSE_START=======================================================\r
3  * ONAP - SO\r
4  * ================================================================================\r
5  * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.\r
6  * ================================================================================\r
7  * Licensed under the Apache License, Version 2.0 (the "License");\r
8  * you may not use this file except in compliance with the License.\r
9  * You may obtain a copy of the License at\r
10  *      http://www.apache.org/licenses/LICENSE-2.0\r
11  * \r
12  * Unless required by applicable law or agreed to in writing, software\r
13  * distributed under the License is distributed on an "AS IS" BASIS,\r
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
15  * See the License for the specific language governing permissions and\r
16  * limitations under the License.\r
17  * ============LICENSE_END=========================================================\r
18  */\r
19 \r
20 package org.openecomp.mso.bpmn.infrastructure.scripts\r
21 \r
22 import groovy.json.JsonOutput\r
23 import groovy.json.JsonSlurper\r
24 import groovy.util.Node\r
25 import groovy.util.XmlParser;\r
26 import groovy.xml.QName\r
27 \r
28 import java.beans.MetaData.java_lang_Class_PersistenceDelegate\r
29 import java.io.Serializable;\r
30 import java.util.UUID;\r
31 import org.openecomp.mso.bpmn.common.scripts.ExceptionUtil\r
32 import org.camunda.bpm.engine.delegate.BpmnError\r
33 import org.camunda.bpm.engine.impl.cmd.AbstractSetVariableCmd\r
34 import org.camunda.bpm.engine.delegate.DelegateExecution\r
35 import org.openecomp.mso.rest.APIResponse\r
36 import org.openecomp.mso.rest.RESTClient\r
37 import org.openecomp.mso.rest.RESTConfig\r
38 import org.openecomp.mso.bpmn.common.scripts.AbstractServiceTaskProcessor;\r
39 import org.openecomp.mso.bpmn.common.scripts.VidUtils;\r
40 import org.openecomp.mso.bpmn.core.RollbackData\r
41 import org.openecomp.mso.bpmn.core.WorkflowException\r
42 import org.openecomp.mso.bpmn.common.scripts.ExceptionUtil\r
43 import org.openecomp.mso.bpmn.core.json.JsonUtils\r
44 import org.openecomp.mso.bpmn.core.domain.ModelInfo\r
45 import org.openecomp.mso.bpmn.core.domain.ServiceDecomposition\r
46 import org.openecomp.mso.bpmn.core.domain.VnfResource\r
47 import org.openecomp.mso.client.aai.*\r
48 \r
49 import org.openecomp.mso.client.appc.ApplicationControllerOrchestrator\r
50 import org.onap.appc.client.lcm.model.Action;\r
51 import org.onap.appc.client.lcm.model.ActionIdentifiers;\r
52 import org.onap.appc.client.lcm.model.LockInput\r
53 import org.onap.appc.client.lcm.model.UnlockInput\r
54 import org.onap.appc.client.lcm.model.HealthCheckInput\r
55 import org.onap.appc.client.lcm.model.StartInput\r
56 import org.onap.appc.client.lcm.model.StopInput\r
57 import org.onap.appc.client.lcm.model.Flags\r
58 import org.onap.appc.client.lcm.model.Status\r
59 \r
60 \r
61 \r
62 public class UpdateVnfInfra extends VnfCmBase {\r
63 \r
64         ExceptionUtil exceptionUtil = new ExceptionUtil()\r
65         JsonUtils jsonUtils = new JsonUtils()   \r
66         def prefix = "UPDVnfI_"\r
67 \r
68         /**\r
69          * Initialize the flow's variables.\r
70          *\r
71          * @param execution The flow's execution instance.\r
72          */\r
73         public void initProcessVariables(DelegateExecution execution) {\r
74                 execution.setVariable('prefix', 'UPDVnfI_')\r
75                 execution.setVariable('Request', null)          \r
76                 execution.setVariable('source', null)\r
77                 execution.setVariable('vnfInputs', null)                        \r
78                 execution.setVariable('tenantId', null)         \r
79                 execution.setVariable('vnfParams', null)                \r
80                 execution.setVariable('UpdateVnfSuccessIndicator', false)\r
81                 execution.setVariable('serviceType', null)\r
82                 execution.setVariable('nfRole', null)\r
83                 execution.setVariable('currentActivity', 'UPDVnfI')\r
84                 execution.setVariable('workStep', null)\r
85                 execution.setVariable('failedActivity', null)\r
86                 execution.setVariable('errorCode', "0")\r
87                 execution.setVariable('errorText', null)\r
88                 execution.setVariable('healthCheckIndex0', 0)\r
89                 execution.setVariable('healthCheckIndex1', 1)\r
90                 execution.setVariable("rollbackSetClosedLoopDisabledFlag", false)\r
91                 execution.setVariable("rollbackVnfStop", false)\r
92                 execution.setVariable("rollbackVnfLock", false)\r
93                 execution.setVariable("rollbackQuiesceTraffic", false)\r
94                 execution.setVariable("rollbackSetVnfInMaintenanceFlag", false)\r
95         }\r
96 \r
97         /**\r
98          * Check for missing elements in the received request.\r
99          *\r
100          * @param execution The flow's execution instance.\r
101          */\r
102         public void preProcessRequest(DelegateExecution execution) {\r
103                 def method = getClass().getSimpleName() + '.preProcessRequest(' +\r
104                 'execution=' + execution.getId() +\r
105                 ')'\r
106                 initProcessVariables(execution)\r
107                 def isDebugLogEnabled = execution.getVariable('isDebugLogEnabled')\r
108                 logDebug('Entered ' + method, isDebugLogEnabled)\r
109 \r
110                 initProcessVariables(execution)         \r
111 \r
112                 def incomingRequest = execution.getVariable('bpmnRequest')\r
113 \r
114                 utils.log("DEBUG", "Incoming Infra Request: " + incomingRequest, isDebugLogEnabled)\r
115                 try {\r
116                         def jsonSlurper = new JsonSlurper()\r
117                         def jsonOutput = new JsonOutput()\r
118                         Map reqMap = jsonSlurper.parseText(incomingRequest)\r
119                         utils.log("DEBUG", " Request is in JSON format.", isDebugLogEnabled)\r
120                         \r
121                         execution.setVariable("isVidRequest", "true")\r
122                         execution.setVariable('serviceType', 'Mobility')\r
123                         execution.setVariable('actionLock', Action.Lock)\r
124                         execution.setVariable('actionUnlock', Action.Unlock)\r
125                         execution.setVariable('actionHealthCheck', Action.HealthCheck)\r
126                         execution.setVariable('actionStart', Action.Start)\r
127                         execution.setVariable('actionStop', Action.Stop)\r
128                         \r
129                         def asdcServiceModelVersion = ''\r
130                         def serviceModelInfo = null\r
131                         \r
132                         def relatedInstanceList = reqMap.requestDetails?.relatedInstanceList\r
133                                                 \r
134                         if (relatedInstanceList != null) {\r
135                                 relatedInstanceList.each {\r
136                                         if (it.relatedInstance.modelInfo?.modelType == 'service') {\r
137                                                 utils.log("DEBUG", "PROCESSING SERVICE INFO", isDebugLogEnabled)\r
138                                                 asdcServiceModelVersion = it.relatedInstance.modelInfo?.modelVersion\r
139                                                 serviceModelInfo = jsonOutput.toJson(it.relatedInstance.modelInfo)\r
140                                                 utils.log("DEBUG", "ServiceModelInfo: " + serviceModelInfo, isDebugLogEnabled)\r
141                                                 def modelInvariant = jsonUtils.getJsonValue(serviceModelInfo, "modelInvariantUuid")\r
142                                                 utils.log("DEBUG", "modelInvariant: " + modelInvariant, isDebugLogEnabled)\r
143                                         }\r
144                                         \r
145                                 }\r
146                         }               \r
147                         \r
148                         execution.setVariable('asdcServiceModelVersion', asdcServiceModelVersion)\r
149                         execution.setVariable('serviceModelInfo', serviceModelInfo)\r
150                         def vnfModelInfo = jsonOutput.toJson(reqMap.requestDetails?.modelInfo)\r
151                         execution.setVariable('vnfModelInfo', vnfModelInfo)\r
152                         def vnfModelInvariantUuid = jsonUtils.getJsonValue(vnfModelInfo, "modelInvariantUuid")\r
153                         execution.setVariable('vnfModelInvariantUuid', vnfModelInvariantUuid)   \r
154                         logDebug("vnfModelInvariantUuid: " + vnfModelInvariantUuid, isDebugLogEnabled)  \r
155                         \r
156                         def vnfType = execution.getVariable('vnfType')\r
157                         execution.setVariable('vnfType', vnfType)\r
158                         \r
159                         def userParams = reqMap.requestDetails?.requestParameters?.userParams                                   \r
160                         \r
161                         Map<String, String> userParamsMap = [:]\r
162                         if (userParams != null) {\r
163                                 userParams.each { userParam ->\r
164                                         userParamsMap.put(userParam.name, userParam.value.toString())\r
165                                 }                                                       \r
166                         }               \r
167                                                 \r
168                         utils.log("DEBUG", 'Processed user params: ' + userParamsMap, isDebugLogEnabled)                \r
169                         \r
170                         execution.setVariable('vfModuleInputParams', userParamsMap)                     \r
171                                                 \r
172                         def requestId = execution.getVariable("mso-request-id")\r
173                         execution.setVariable('requestId', requestId)\r
174                         execution.setVariable('msoRequestId', requestId)\r
175                         \r
176                         \r
177                         def vnfName = reqMap.requestDetails?.requestInfo?.instanceName ?: null\r
178                         execution.setVariable('vnfName', vnfName)\r
179                         \r
180                         def requestorId = reqMap.requestDetails?.requestInfo?.requestorId ?: null\r
181                         execution.setVariable('requestorId', requestorId)\r
182                         \r
183                         def usePreload = reqMap.requestDetails?.requestParameters?.usePreload\r
184                         execution.setVariable('usePreload', usePreload)\r
185                         \r
186                         def cloudConfiguration = reqMap.requestDetails?.cloudConfiguration\r
187                         def lcpCloudRegionId    = cloudConfiguration.lcpCloudRegionId\r
188                         execution.setVariable('lcpCloudRegionId', lcpCloudRegionId)\r
189                         def tenantId = cloudConfiguration.tenantId\r
190                         execution.setVariable('tenantId', tenantId)\r
191                         \r
192                         def globalSubscriberId = reqMap.requestDetails?.subscriberInfo?.globalSubscriberId ?: ''\r
193                         execution.setVariable('globalSubscriberId', globalSubscriberId)\r
194                         \r
195                         execution.setVariable('sdncVersion', '1702')\r
196 \r
197                         execution.setVariable("UpdateVnfInfraSuccessIndicator", false)\r
198                                                 \r
199                         execution.setVariable("isDebugLogEnabled", isDebugLogEnabled)                   \r
200                         \r
201                         def source = reqMap.requestDetails?.requestInfo?.source\r
202                         execution.setVariable("source", source)\r
203                         \r
204                         //For Completion Handler & Fallout Handler\r
205                         String requestInfo =\r
206                         """<request-info xmlns="http://org.openecomp/mso/infra/vnf-request/v1">\r
207                                         <request-id>${requestId}</request-id>\r
208                                         <action>UPDATE</action>\r
209                                         <source>${source}</source>\r
210                                    </request-info>"""\r
211                         \r
212                         execution.setVariable("requestInfo", requestInfo)                       \r
213                         \r
214                         logDebug('RequestInfo: ' + execution.getVariable("requestInfo"), isDebugLogEnabled)             \r
215                         \r
216                         logDebug('Exited ' + method, isDebugLogEnabled)\r
217 \r
218                 }\r
219                 catch(groovy.json.JsonException je) {\r
220                         utils.log("DEBUG", " Request is not in JSON format.", isDebugLogEnabled)\r
221                         exceptionUtil.buildAndThrowWorkflowException(execution, 5000, "Invalid request format")\r
222 \r
223                 }\r
224                 catch(Exception e) {\r
225                         String restFaultMessage = e.getMessage()\r
226                         utils.log("ERROR", " Exception Encountered - " + "\n" + restFaultMessage, isDebugLogEnabled)\r
227                         exceptionUtil.buildAndThrowWorkflowException(execution, 5000, restFaultMessage)\r
228                 }       \r
229         }\r
230 \r
231         /**\r
232          * Prepare and send the sychronous response for this flow.\r
233          *\r
234          * @param execution The flow's execution instance.\r
235          */\r
236         public void sendSynchResponse(DelegateExecution execution) {\r
237                 def method = getClass().getSimpleName() + '.sendSynchResponse(' +\r
238                         'execution=' + execution.getId() +\r
239                         ')'\r
240                 def isDebugLogEnabled = execution.getVariable('isDebugLogEnabled')\r
241                 logDebug('Entered ' + method, isDebugLogEnabled)\r
242 \r
243 \r
244                 try {\r
245                         def requestInfo = execution.getVariable('requestInfo')\r
246                         def requestId = execution.getVariable('requestId')\r
247                         def source = execution.getVariable('source')\r
248                         def progress = getNodeTextForce(requestInfo, 'progress')\r
249                         if (progress.isEmpty()) {\r
250                                 progress = '0'\r
251                         }\r
252                         def startTime = getNodeTextForce(requestInfo, 'start-time')\r
253                         if (startTime.isEmpty()) {\r
254                                 startTime = System.currentTimeMillis()\r
255                         }\r
256 \r
257                         // RESTResponse (for API Handler (APIH) Reply Task)\r
258                         def vnfId = execution.getVariable("vnfId")\r
259                         String synchResponse = """{"requestReferences":{"instanceId":"${vnfId}","requestId":"${requestId}"}}""".trim()\r
260 \r
261                         sendWorkflowResponse(execution, 200, synchResponse)\r
262 \r
263                         logDebug('Exited ' + method, isDebugLogEnabled)\r
264                 } catch (BpmnError e) {\r
265                         throw e;\r
266                 } catch (Exception e) {\r
267                         logError('Caught exception in ' + method, e)\r
268                         exceptionUtil.buildAndThrowWorkflowException(execution, 1002, 'Error in sendResponse(): ' + e.getMessage())\r
269                 }\r
270         }\r
271         \r
272         \r
273 \r
274         /**\r
275          * Get VnfResource decomposition object for this VNF.\r
276          *      \r
277          *\r
278          * @param execution The flow's execution instance.\r
279          */\r
280         public void getVnfResourceDecomposition(DelegateExecution execution) {\r
281                 def method = getClass().getSimpleName() + '.getVnfResourceDecomposition(' +\r
282                         'execution=' + execution.getId() +\r
283                         ')'\r
284                 def isDebugLogEnabled = execution.getVariable('isDebugLogEnabled')\r
285                 logDebug('Entered ' + method, isDebugLogEnabled)\r
286 \r
287                 try {\r
288                         ServiceDecomposition serviceDecomposition = execution.getVariable("serviceDecomposition")\r
289                         String vnfModelInvariantUuid = execution.getVariable('vnfModelInvariantUuid')\r
290                         logDebug("vnfModelInvariantUuid: " + vnfModelInvariantUuid, isDebugLogEnabled)\r
291                         List<VnfResource> vnfResources = serviceDecomposition.getServiceVnfs()\r
292                         \r
293                         for (i in 0..vnfResources.size()-1) {\r
294                                 ModelInfo modelInfo = vnfResources[i].getModelInfo()\r
295                                 String modelInvariantUuidFromDecomposition = modelInfo.getModelInvariantUuid()\r
296                                 logDebug("modelInvariantUuidFromDecomposition: " + modelInvariantUuidFromDecomposition, isDebugLogEnabled)\r
297                                 \r
298                                 if (vnfModelInvariantUuid.equals(modelInvariantUuidFromDecomposition)) {\r
299                                         VnfResource vnfResourceDecomposition = vnfResources[i]\r
300                                         execution.setVariable('vnfResourceDecomposition', vnfResourceDecomposition)\r
301                                         def nfRole = vnfResourceDecomposition.getNfRole()                                       \r
302                                         execution.setVariable('nfRole', nfRole)\r
303                                         logDebug("vnfResourceDecomposition: " + vnfResourceDecomposition.toJsonString(), isDebugLogEnabled)                                     \r
304                                         break\r
305                                 }\r
306                                 else {\r
307                                         //exception!\r
308                                 }\r
309                                 \r
310                         }\r
311 \r
312                         logDebug('Exited ' + method, isDebugLogEnabled)\r
313                 } catch (BpmnError e) {\r
314                         throw e;\r
315                 } catch (Exception e) {\r
316                         logError('Caught exception in ' + method, e)\r
317                         exceptionUtil.buildAndThrowWorkflowException(execution, 1002, 'Error in getVnfResourceDecomposition(): ' + e.getMessage())\r
318                 }\r
319         }\r
320         \r
321         /**\r
322          * Check if this VNF is already in maintenance in A&AI.\r
323          *\r
324          *\r
325          * @param execution The flow's execution instance.\r
326          */\r
327         public void checkIfVnfInMaintInAAI(DelegateExecution execution) {\r
328                 def method = getClass().getSimpleName() + '.checkIfVnfInMaintInAAI(' +\r
329                         'execution=' + execution.getId() +\r
330                         ')'\r
331                 def isDebugLogEnabled = execution.getVariable('isDebugLogEnabled')\r
332                 execution.setVariable('errorCode', "0")\r
333                 execution.setVariable("workStep", "checkIfVnfInMaintInAAI")\r
334                 execution.setVariable("failedActivity", "AAI")\r
335                 logDebug('Entered ' + method, isDebugLogEnabled)\r
336 \r
337                 try {\r
338                         def transactionLoggingUuid = UUID.randomUUID().toString()\r
339                         AAIRestClientImpl client = new AAIRestClientImpl()\r
340                         AAIValidatorImpl aaiValidator = new AAIValidatorImpl()\r
341                         aaiValidator.setClient(client)\r
342                         def vnfId = execution.getVariable("vnfId")\r
343                         boolean isInMaint = aaiValidator.isVNFLocked(vnfId, transactionLoggingUuid)\r
344                         logDebug("isInMaint result: " + isInMaint, isDebugLogEnabled)\r
345                         execution.setVariable('isVnfInMaintenance', isInMaint)\r
346                         \r
347                         if (isInMaint) {\r
348                                 execution.setVariable("errorCode", "1003")\r
349                                 execution.setVariable("errorText", "VNF is in maintenance in A&AI")\r
350                         }\r
351 \r
352 \r
353                         logDebug('Exited ' + method, isDebugLogEnabled)\r
354                 } catch (BpmnError e) {\r
355                         throw e;\r
356                 } catch (Exception e) {\r
357                         logError('Caught exception in ' + method, e)                    \r
358                         execution.setVariable("errorCode", "1002")\r
359                         execution.setVariable("errorText", e.getMessage())\r
360                         //exceptionUtil.buildAndThrowWorkflowException(execution, 1002, 'Error in checkIfVnfInMaintInAAI(): ' + e.getMessage())\r
361                 }\r
362         }\r
363         \r
364         \r
365         /**\r
366          * Check if this VNF's pservers are locked in A&AI.\r
367          *\r
368          *\r
369          * @param execution The flow's execution instance.\r
370          */\r
371         public void checkIfPserversInMaintInAAI(DelegateExecution execution) {\r
372                 def method = getClass().getSimpleName() + '.checkIfPserversInMaintInAAI(' +\r
373                         'execution=' + execution.getId() +\r
374                         ')'\r
375                 def isDebugLogEnabled = execution.getVariable('isDebugLogEnabled')\r
376                 execution.setVariable('errorCode', "0")\r
377                 logDebug('Entered ' + method, isDebugLogEnabled)\r
378                 execution.setVariable("workStep", "checkIfPserversInMaintInAAI")\r
379                 execution.setVariable("failedActivity", "AAI")\r
380 \r
381                 try {\r
382                         def transactionLoggingUuid = UUID.randomUUID().toString()\r
383                         AAIRestClientImpl client = new AAIRestClientImpl()\r
384                         AAIValidatorImpl aaiValidator = new AAIValidatorImpl()\r
385                         aaiValidator.setClient(client)\r
386                         def vnfId = execution.getVariable("vnfId")                      \r
387                         boolean areLocked = aaiValidator.isPhysicalServerLocked(vnfId, transactionLoggingUuid)\r
388                         logDebug("areLocked result: " + areLocked, isDebugLogEnabled)\r
389                         execution.setVariable('arePserversLocked', areLocked)\r
390                         \r
391                         if (areLocked) {\r
392                                 execution.setVariable("errorCode", "1003")\r
393                                 execution.setVariable("errorText", "pServers are locked in A&AI")\r
394                         }\r
395 \r
396                         logDebug('Exited ' + method, isDebugLogEnabled)\r
397                 } catch (BpmnError e) {\r
398                         throw e;\r
399                 } catch (Exception e) {\r
400                         logError('Caught exception in ' + method, e)\r
401                         execution.setVariable("errorCode", "1002")\r
402                         execution.setVariable("errorText", e.getMessage())\r
403                         //exceptionUtil.buildAndThrowWorkflowException(execution, 1002, 'Error in checkIfPserversInMaintInAAI(): ' + e.getMessage())\r
404                 }\r
405         }\r
406         \r
407         /**\r
408          * Set inMaint flag for this VNF to the specified value in A&AI.\r
409          *\r
410          *\r
411          * @param execution The flow's execution instance.\r
412          * @param inMaint The boolean value of the flag to set\r
413          */\r
414         public void setVnfInMaintFlagInAAI(DelegateExecution execution, boolean inMaint) {\r
415                 def method = getClass().getSimpleName() + '.setVnfInMaintFlagInAAI(' +\r
416                         'execution=' + execution.getId() +\r
417                         ')'\r
418                 def isDebugLogEnabled = execution.getVariable('isDebugLogEnabled')\r
419                 execution.setVariable('errorCode', "0")\r
420                 logDebug('Entered ' + method, isDebugLogEnabled)\r
421                 if (inMaint) {\r
422                         execution.setVariable("workStep", "setVnfInMaintFlagInAAI")\r
423                 }\r
424                 else {\r
425                         execution.setVariable("workStep", "unsetVnfInMaintFlagInAAI")\r
426                 }\r
427                 execution.setVariable("failedActivity", "AAI")\r
428 \r
429                 try {\r
430                         def transactionLoggingUuid = UUID.randomUUID().toString()\r
431                         AAIRestClientImpl client = new AAIRestClientImpl()\r
432                         AAIUpdatorImpl aaiUpdator = new AAIUpdatorImpl()\r
433                         aaiUpdator.setClient(client)\r
434                         def vnfId = execution.getVariable("vnfId")\r
435                         if (inMaint) {\r
436                                 aaiUpdator.updateVnfToLocked(vnfId, transactionLoggingUuid)\r
437                                 execution.setVariable("rollbackSetVnfInMaintenanceFlag", true)\r
438                         }\r
439                         else {\r
440                                 aaiUpdator.updateVnfToUnLocked(vnfId, transactionLoggingUuid)\r
441                         }\r
442                                                         \r
443                         logDebug('Exited ' + method, isDebugLogEnabled)\r
444                 } catch (BpmnError e) {\r
445                         throw e;\r
446                 } catch (Exception e) {\r
447                         logError('Caught exception in ' + method, e)\r
448                         execution.setVariable("errorCode", "1002")\r
449                         execution.setVariable("errorText", e.getMessage())\r
450                         //exceptionUtil.buildAndThrowWorkflowException(execution, 1002, 'Error in setVnfInMaintFlagInAAI(): ' + e.getMessage())\r
451                 }\r
452         }\r
453         \r
454         \r
455 \r
456         /**\r
457         * Prepare DoUpdateVnfAndModules call.\r
458         *\r
459         *\r
460         * @param execution The flow's execution instance.\r
461         */\r
462    public void prepDoUpdateVnfAndModules(DelegateExecution execution) {\r
463            def method = getClass().getSimpleName() + '.prepDoUpdateVnfAndModules(' +\r
464                    'execution=' + execution.getId() +\r
465                    ')'\r
466            def isDebugLogEnabled = execution.getVariable('isDebugLogEnabled')\r
467            execution.setVariable('errorCode', "0")\r
468            logDebug('Entered ' + method, isDebugLogEnabled)\r
469            execution.setVariable("workStep", "doUpdateVnfAndModules")\r
470            execution.setVariable("failedActivity", "MSO Update VNF")\r
471            logDebug('Exited ' + method, isDebugLogEnabled)\r
472            \r
473    }\r
474         \r
475         \r
476         /**\r
477          * Handle Abort disposition from RainyDayHandler\r
478          *\r
479          * @param execution The flow's execution instance.       \r
480          */\r
481         public void abortProcessing(DelegateExecution execution) {\r
482                 def method = getClass().getSimpleName() + '.abortProcessing(' +\r
483                         'execution=' + execution.getId() +\r
484                         ')'\r
485                 def isDebugLogEnabled = execution.getVariable('isDebugLogEnabled')\r
486                 logDebug('Entered ' + method, isDebugLogEnabled)\r
487                 \r
488                 def errorText = execution.getVariable("errorText")\r
489                 def errorCode = execution.getVariable("errorCode")\r
490                 \r
491                 exceptionUtil.buildAndThrowWorkflowException(execution, errorCode as Integer, errorText)\r
492         }\r
493         \r
494         \r
495 \r
496         \r
497 }\r