2 * ============LICENSE_START=======================================================
\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
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
20 package org.openecomp.mso.bpmn.infrastructure.scripts
\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
28 import java.io.Serializable;
\r
29 import java.util.UUID;
\r
30 import org.openecomp.mso.bpmn.common.scripts.ExceptionUtil
\r
31 import org.camunda.bpm.engine.delegate.BpmnError
\r
32 import org.camunda.bpm.engine.impl.cmd.AbstractSetVariableCmd
\r
33 import org.camunda.bpm.engine.delegate.DelegateExecution
\r
34 import org.openecomp.mso.rest.APIResponse
\r
35 import org.openecomp.mso.rest.RESTClient
\r
36 import org.openecomp.mso.rest.RESTConfig
\r
37 import org.openecomp.mso.bpmn.common.scripts.AbstractServiceTaskProcessor;
\r
38 import org.openecomp.mso.bpmn.common.scripts.VidUtils;
\r
39 import org.openecomp.mso.bpmn.core.RollbackData
\r
40 import org.openecomp.mso.bpmn.core.WorkflowException
\r
41 import org.openecomp.mso.bpmn.common.scripts.ExceptionUtil
\r
42 import org.openecomp.mso.bpmn.core.json.JsonUtils
\r
43 import org.openecomp.mso.bpmn.core.domain.ModelInfo
\r
44 import org.openecomp.mso.bpmn.core.domain.ServiceDecomposition
\r
45 import org.openecomp.mso.bpmn.core.domain.VnfResource
\r
46 import org.openecomp.mso.client.aai.*
\r
48 import org.openecomp.mso.client.appc.ApplicationControllerOrchestrator
\r
49 import org.onap.appc.client.lcm.model.Action;
\r
50 import org.onap.appc.client.lcm.model.ActionIdentifiers;
\r
51 import org.onap.appc.client.lcm.model.LockInput
\r
52 import org.onap.appc.client.lcm.model.UnlockInput
\r
53 import org.onap.appc.client.lcm.model.HealthCheckInput
\r
54 import org.onap.appc.client.lcm.model.StartInput
\r
55 import org.onap.appc.client.lcm.model.Flags
\r
56 import org.onap.appc.client.lcm.model.Status
\r
60 public class ReplaceVnfInfra extends VnfCmBase {
\r
62 ExceptionUtil exceptionUtil = new ExceptionUtil()
\r
63 JsonUtils jsonUtils = new JsonUtils()
\r
64 def prefix = "RPLVnfI_"
\r
67 * Initialize the flow's variables.
\r
69 * @param execution The flow's execution instance.
\r
71 public void initProcessVariables(DelegateExecution execution) {
\r
72 execution.setVariable('prefix', 'RPLVnfI_')
\r
73 execution.setVariable('Request', null)
\r
74 execution.setVariable('requestInfo', null)
\r
75 execution.setVariable('source', null)
\r
76 execution.setVariable('vnfInputs', null)
\r
77 execution.setVariable('tenantId', null)
\r
78 execution.setVariable('vnfParams', null)
\r
79 execution.setVariable('controllerType', null)
\r
80 execution.setVariable('cloudConfiguration', null)
\r
81 execution.setVariable('ReplaceVnfSuccessIndicator', false)
\r
82 execution.setVariable('serviceType', null)
\r
83 execution.setVariable('nfRole', null)
\r
84 execution.setVariable('currentActivity', 'RPLVnfI')
\r
85 execution.setVariable('workStep', null)
\r
86 execution.setVariable('failedActivity', null)
\r
87 execution.setVariable('errorCode', "0")
\r
88 execution.setVariable('errorText', null)
\r
89 execution.setVariable('healthCheckIndex', 1)
\r
90 execution.setVariable('retainResources', true)
\r
91 execution.setVariable('productFamilyId', null)
\r
92 execution.setVariable('healthCheckIndex0', 0)
\r
93 execution.setVariable('healthCheckIndex1', 1)
\r
94 execution.setVariable("rollbackSetClosedLoopDisabledFlag", false)
\r
95 execution.setVariable("rollbackVnfStop", false)
\r
96 execution.setVariable("rollbackVnfLock", false)
\r
97 execution.setVariable("rollbackQuiesceTraffic", false)
\r
98 execution.setVariable("rollbackSetVnfInMaintenanceFlag", false)
\r
102 * Check for missing elements in the received request.
\r
104 * @param execution The flow's execution instance.
\r
106 public void preProcessRequest(DelegateExecution execution) {
\r
107 def method = getClass().getSimpleName() + '.preProcessRequest(' +
\r
108 'execution=' + execution.getId() +
\r
110 initProcessVariables(execution)
\r
111 def isDebugLogEnabled = execution.getVariable('isDebugLogEnabled')
\r
112 logDebug('Entered ' + method, isDebugLogEnabled)
\r
114 initProcessVariables(execution)
\r
116 def incomingRequest = execution.getVariable('bpmnRequest')
\r
118 utils.log("DEBUG", "Incoming Infra Request: " + incomingRequest, isDebugLogEnabled)
\r
120 def jsonSlurper = new JsonSlurper()
\r
121 def jsonOutput = new JsonOutput()
\r
122 Map reqMap = jsonSlurper.parseText(incomingRequest)
\r
123 utils.log("DEBUG", " Request is in JSON format.", isDebugLogEnabled)
\r
125 def serviceInstanceId = execution.getVariable('serviceInstanceId')
\r
126 def vnfId = execution.getVariable('vnfId')
\r
128 execution.setVariable('serviceInstanceId', serviceInstanceId)
\r
129 execution.setVariable("isVidRequest", "true")
\r
130 execution.setVariable('serviceType', 'Mobility')
\r
131 execution.setVariable('retainResources', true)
\r
132 execution.setVariable('disableRollback', true)
\r
133 execution.setVariable('payload', "")
\r
134 execution.setVariable('actionLock', Action.Lock)
\r
135 execution.setVariable('actionUnlock', Action.Unlock)
\r
136 execution.setVariable('actionHealthCheck', Action.HealthCheck)
\r
137 execution.setVariable('actionStart', Action.Start)
\r
138 execution.setVariable('actionStop', Action.Stop)
\r
140 def asdcServiceModelVersion = ''
\r
141 def serviceModelInfo = null
\r
143 def relatedInstanceList = reqMap.requestDetails?.relatedInstanceList
\r
145 if (relatedInstanceList != null) {
\r
146 relatedInstanceList.each {
\r
147 if (it.relatedInstance.modelInfo?.modelType == 'service') {
\r
148 utils.log("DEBUG", "PROCESSING SERVICE INFO", isDebugLogEnabled)
\r
149 asdcServiceModelVersion = it.relatedInstance.modelInfo?.modelVersion
\r
150 serviceModelInfo = jsonOutput.toJson(it.relatedInstance.modelInfo)
\r
151 utils.log("DEBUG", "ServiceModelInfo: " + serviceModelInfo, isDebugLogEnabled)
\r
152 def modelInvariant = jsonUtils.getJsonValue(serviceModelInfo, "modelInvariantUuid")
\r
153 utils.log("DEBUG", "modelInvariant: " + modelInvariant, isDebugLogEnabled)
\r
159 execution.setVariable('asdcServiceModelVersion', asdcServiceModelVersion)
\r
160 execution.setVariable('serviceModelInfo', serviceModelInfo)
\r
161 def vnfModelInfo = jsonOutput.toJson(reqMap.requestDetails?.modelInfo)
\r
162 execution.setVariable('vnfModelInfo', vnfModelInfo)
\r
163 def vnfModelInvariantUuid = jsonUtils.getJsonValue(vnfModelInfo, "modelInvariantUuid")
\r
164 execution.setVariable('vnfModelInvariantUuid', vnfModelInvariantUuid)
\r
165 logDebug("vnfModelInvariantUuid: " + vnfModelInvariantUuid, isDebugLogEnabled)
\r
167 def vnfType = execution.getVariable('vnfType')
\r
168 execution.setVariable('vnfType', vnfType)
\r
170 def controllerType = reqMap.requestDetails?.requestParameters?.controllerType
\r
171 execution.setVariable('controllerType', controllerType)
\r
173 utils.log("DEBUG", 'Controller Type: ' + controllerType, isDebugLogEnabled)
\r
175 def userParams = reqMap.requestDetails?.requestParameters?.userParams
\r
177 Map<String, String> userParamsMap = [:]
\r
178 if (userParams != null) {
\r
179 userParams.each { userParam ->
\r
180 userParamsMap.put(userParam.name, userParam.value.toString())
\r
184 utils.log("DEBUG", 'Processed user params: ' + userParamsMap, isDebugLogEnabled)
\r
186 execution.setVariable('vfModuleInputParams', userParamsMap)
\r
188 def requestId = execution.getVariable("requestId")
\r
189 execution.setVariable('msoRequestId', requestId)
\r
190 utils.log("DEBUG", "requestId is: " + requestId, isDebugLogEnabled)
\r
192 def vnfName = reqMap.requestDetails?.requestInfo?.instanceName ?: null
\r
193 execution.setVariable('vnfName', vnfName)
\r
195 def requestorId = reqMap.requestDetails?.requestInfo?.requestorId ?: null
\r
196 execution.setVariable('requestorId', requestorId)
\r
198 def usePreload = reqMap.requestDetails?.requestParameters?.usePreload
\r
199 execution.setVariable('usePreload', usePreload)
\r
201 def productFamilyId = reqMap.requestDetails?.requestInfo?.productFamilyId ?: null
\r
202 execution.setVariable('productFamilyId', productFamilyId)
\r
204 def cloudConfiguration = jsonOutput.toJson(reqMap.requestDetails?.cloudConfiguration)
\r
205 execution.setVariable('cloudConfiguration', cloudConfiguration)
\r
206 def lcpCloudRegionId = jsonUtils.getJsonValue(cloudConfiguration, "lcpCloudRegionId")
\r
207 execution.setVariable('lcpCloudRegionId', lcpCloudRegionId)
\r
208 def tenantId = jsonUtils.getJsonValue(cloudConfiguration, "tenantId")
\r
209 execution.setVariable('tenantId', tenantId)
\r
211 def globalSubscriberId = reqMap.requestDetails?.subscriberInfo?.globalSubscriberId ?: ''
\r
212 execution.setVariable('globalSubscriberId', globalSubscriberId)
\r
214 execution.setVariable('sdncVersion', '1702')
\r
216 execution.setVariable("ReplaceVnfInfraSuccessIndicator", false)
\r
218 execution.setVariable("isDebugLogEnabled", isDebugLogEnabled)
\r
220 def source = reqMap.requestDetails?.requestInfo?.source
\r
221 execution.setVariable("source", source)
\r
223 //For Completion Handler & Fallout Handler
\r
224 String requestInfo =
\r
225 """<request-info xmlns="http://org.openecomp/mso/infra/vnf-request/v1">
\r
226 <request-id>${requestId}</request-id>
\r
227 <action>REPLACE</action>
\r
228 <source>${source}</source>
\r
231 execution.setVariable("requestInfo", requestInfo)
\r
233 logDebug('RequestInfo: ' + execution.getVariable("requestInfo"), isDebugLogEnabled)
\r
235 logDebug('Exited ' + method, isDebugLogEnabled)
\r
238 catch(groovy.json.JsonException je) {
\r
239 utils.log("DEBUG", " Request is not in JSON format.", isDebugLogEnabled)
\r
240 exceptionUtil.buildAndThrowWorkflowException(execution, 5000, "Invalid request format")
\r
243 catch(Exception e) {
\r
244 String restFaultMessage = e.getMessage()
\r
245 utils.log("ERROR", " Exception Encountered - " + "\n" + restFaultMessage, isDebugLogEnabled)
\r
246 exceptionUtil.buildAndThrowWorkflowException(execution, 5000, restFaultMessage)
\r
251 * Prepare and send the sychronous response for this flow.
\r
253 * @param execution The flow's execution instance.
\r
255 public void sendSynchResponse(DelegateExecution execution) {
\r
256 def method = getClass().getSimpleName() + '.sendSynchResponse(' +
\r
257 'execution=' + execution.getId() +
\r
259 def isDebugLogEnabled = execution.getVariable('isDebugLogEnabled')
\r
260 logDebug('Entered ' + method, isDebugLogEnabled)
\r
264 def requestInfo = execution.getVariable('requestInfo')
\r
265 def requestId = execution.getVariable('requestId')
\r
266 def source = execution.getVariable('source')
\r
267 def progress = getNodeTextForce(requestInfo, 'progress')
\r
268 if (progress.isEmpty()) {
\r
271 def startTime = getNodeTextForce(requestInfo, 'start-time')
\r
272 if (startTime.isEmpty()) {
\r
273 startTime = System.currentTimeMillis()
\r
276 // RESTResponse (for API Handler (APIH) Reply Task)
\r
277 def vnfId = execution.getVariable("vnfId")
\r
278 String synchResponse = """{"requestReferences":{"instanceId":"${vnfId}","requestId":"${requestId}"}}""".trim()
\r
280 sendWorkflowResponse(execution, 200, synchResponse)
\r
282 logDebug('Exited ' + method, isDebugLogEnabled)
\r
283 } catch (BpmnError e) {
\r
285 } catch (Exception e) {
\r
286 logError('Caught exception in ' + method, e)
\r
287 exceptionUtil.buildAndThrowWorkflowException(execution, 1002, 'Error in sendResponse(): ' + e.getMessage())
\r
294 * Get VnfResource decomposition object for this VNF.
\r
297 * @param execution The flow's execution instance.
\r
299 public void getVnfResourceDecomposition(DelegateExecution execution) {
\r
300 def method = getClass().getSimpleName() + '.getVnfResourceDecomposition(' +
\r
301 'execution=' + execution.getId() +
\r
303 def isDebugLogEnabled = execution.getVariable('isDebugLogEnabled')
\r
304 logDebug('Entered ' + method, isDebugLogEnabled)
\r
307 ServiceDecomposition serviceDecomposition = execution.getVariable("serviceDecomposition")
\r
308 String vnfModelInvariantUuid = execution.getVariable('vnfModelInvariantUuid')
\r
309 logDebug("vnfModelInvariantUuid: " + vnfModelInvariantUuid, isDebugLogEnabled)
\r
310 List<VnfResource> vnfResources = serviceDecomposition.getServiceVnfs()
\r
312 for (i in 0..vnfResources.size()-1) {
\r
313 ModelInfo modelInfo = vnfResources[i].getModelInfo()
\r
314 String modelInvariantUuidFromDecomposition = modelInfo.getModelInvariantUuid()
\r
315 logDebug("modelInvariantUuidFromDecomposition: " + modelInvariantUuidFromDecomposition, isDebugLogEnabled)
\r
317 if (vnfModelInvariantUuid.equals(modelInvariantUuidFromDecomposition)) {
\r
318 VnfResource vnfResourceDecomposition = vnfResources[i]
\r
319 execution.setVariable('vnfResourceDecomposition', vnfResourceDecomposition)
\r
320 def nfRole = vnfResourceDecomposition.getNfRole()
\r
321 execution.setVariable('nfRole', nfRole)
\r
322 logDebug("vnfResourceDecomposition: " + vnfResourceDecomposition.toJsonString(), isDebugLogEnabled)
\r
331 logDebug('Exited ' + method, isDebugLogEnabled)
\r
332 } catch (BpmnError e) {
\r
334 } catch (Exception e) {
\r
335 logError('Caught exception in ' + method, e)
\r
336 exceptionUtil.buildAndThrowWorkflowException(execution, 1002, 'Error in getVnfResourceDecomposition(): ' + e.getMessage())
\r
341 * Check if this VNF is already in maintenance in A&AI.
\r
344 * @param execution The flow's execution instance.
\r
346 public void checkIfVnfInMaintInAAI(DelegateExecution execution) {
\r
347 def method = getClass().getSimpleName() + '.checkIfVnfInMaintInAAI(' +
\r
348 'execution=' + execution.getId() +
\r
350 def isDebugLogEnabled = execution.getVariable('isDebugLogEnabled')
\r
351 execution.setVariable('errorCode', "0")
\r
352 execution.setVariable("workStep", "checkIfVnfInMaintInAAI")
\r
353 execution.setVariable("failedActivity", "AAI")
\r
354 logDebug('Entered ' + method, isDebugLogEnabled)
\r
357 def transactionLoggingUuid = UUID.randomUUID().toString()
\r
358 AAIRestClientImpl client = new AAIRestClientImpl()
\r
359 AAIValidatorImpl aaiValidator = new AAIValidatorImpl()
\r
360 aaiValidator.setClient(client)
\r
361 def vnfId = execution.getVariable("vnfId")
\r
362 boolean isInMaint = aaiValidator.isVNFLocked(vnfId, transactionLoggingUuid)
\r
363 logDebug("isInMaint result: " + isInMaint, isDebugLogEnabled)
\r
364 execution.setVariable('isVnfInMaintenance', isInMaint)
\r
367 execution.setVariable("errorCode", "1003")
\r
368 execution.setVariable("errorText", "VNF is in maintenance in A&AI")
\r
372 logDebug('Exited ' + method, isDebugLogEnabled)
\r
373 } catch (BpmnError e) {
\r
375 } catch (Exception e) {
\r
376 logError('Caught exception in ' + method, e)
\r
377 execution.setVariable("errorCode", "1002")
\r
378 execution.setVariable("errorText", e.getMessage())
\r
379 //exceptionUtil.buildAndThrowWorkflowException(execution, 1002, 'Error in checkIfVnfInMaintInAAI(): ' + e.getMessage())
\r
385 * Check if this VNF's pservers are locked in A&AI.
\r
388 * @param execution The flow's execution instance.
\r
390 public void checkIfPserversInMaintInAAI(DelegateExecution execution) {
\r
391 def method = getClass().getSimpleName() + '.checkIfPserversInMaintInAAI(' +
\r
392 'execution=' + execution.getId() +
\r
394 def isDebugLogEnabled = execution.getVariable('isDebugLogEnabled')
\r
395 execution.setVariable('errorCode', "0")
\r
396 logDebug('Entered ' + method, isDebugLogEnabled)
\r
397 execution.setVariable("workStep", "checkIfPserversInMaintInAAI")
\r
398 execution.setVariable("failedActivity", "AAI")
\r
401 def transactionLoggingUuid = UUID.randomUUID().toString()
\r
402 AAIRestClientImpl client = new AAIRestClientImpl()
\r
403 AAIValidatorImpl aaiValidator = new AAIValidatorImpl()
\r
404 aaiValidator.setClient(client)
\r
405 def vnfId = execution.getVariable("vnfId")
\r
406 boolean areLocked = aaiValidator.isPhysicalServerLocked(vnfId, transactionLoggingUuid)
\r
407 logDebug("areLocked result: " + areLocked, isDebugLogEnabled)
\r
408 execution.setVariable('arePserversLocked', areLocked)
\r
411 execution.setVariable("errorCode", "1003")
\r
412 execution.setVariable("errorText", "pServers are locked in A&AI")
\r
415 logDebug('Exited ' + method, isDebugLogEnabled)
\r
416 } catch (BpmnError e) {
\r
418 } catch (Exception e) {
\r
419 logError('Caught exception in ' + method, e)
\r
420 execution.setVariable("errorCode", "1002")
\r
421 execution.setVariable("errorText", e.getMessage())
\r
422 //exceptionUtil.buildAndThrowWorkflowException(execution, 1002, 'Error in checkIfPserversInMaintInAAI(): ' + e.getMessage())
\r
427 * Set inMaint flag for this VNF to the specified value in A&AI.
\r
430 * @param execution The flow's execution instance.
\r
431 * @param inMaint The boolean value of the flag to set
\r
433 public void setVnfInMaintFlagInAAI(DelegateExecution execution, boolean inMaint) {
\r
434 def method = getClass().getSimpleName() + '.setVnfInMaintFlagInAAI(' +
\r
435 'execution=' + execution.getId() +
\r
437 def isDebugLogEnabled = execution.getVariable('isDebugLogEnabled')
\r
438 execution.setVariable('errorCode', "0")
\r
439 logDebug('Entered ' + method, isDebugLogEnabled)
\r
441 execution.setVariable("workStep", "setVnfInMaintFlagInAAI")
\r
444 execution.setVariable("workStep", "unsetVnfInMaintFlagInAAI")
\r
446 execution.setVariable("failedActivity", "AAI")
\r
449 def transactionLoggingUuid = UUID.randomUUID().toString()
\r
450 AAIRestClientImpl client = new AAIRestClientImpl()
\r
451 AAIUpdatorImpl aaiUpdator = new AAIUpdatorImpl()
\r
452 aaiUpdator.setClient(client)
\r
453 def vnfId = execution.getVariable("vnfId")
\r
455 aaiUpdator.updateVnfToLocked(vnfId, transactionLoggingUuid)
\r
456 execution.setVariable("rollbackSetVnfInMaintenanceFlag", true)
\r
459 aaiUpdator.updateVnfToUnLocked(vnfId, transactionLoggingUuid)
\r
462 logDebug('Exited ' + method, isDebugLogEnabled)
\r
463 } catch (BpmnError e) {
\r
465 } catch (Exception e) {
\r
466 logError('Caught exception in ' + method, e)
\r
467 execution.setVariable("errorCode", "1002")
\r
468 execution.setVariable("errorText", e.getMessage())
\r
469 //exceptionUtil.buildAndThrowWorkflowException(execution, 1002, 'Error in setVnfInMaintFlagInAAI(): ' + e.getMessage())
\r
474 * Call APP-C client to execute specified APP-C command for this VNF.
\r
477 * @param execution The flow's execution instance.
\r
478 * @param action The action to take in APP-C.
\r
480 public void runAppcCommand(DelegateExecution execution, Action action) {
\r
481 def method = getClass().getSimpleName() + '.runAppcCommand(' +
\r
482 'execution=' + execution.getId() +
\r
484 def isDebugLogEnabled = execution.getVariable('isDebugLogEnabled')
\r
485 execution.setVariable('errorCode', "0")
\r
486 logDebug('Entered ' + method, isDebugLogEnabled)
\r
489 logDebug("Running APP-C action: " + action.toString(), isDebugLogEnabled)
\r
490 String vnfId = execution.getVariable('vnfId')
\r
491 String msoRequestId = execution.getVariable('requestId')
\r
492 execution.setVariable('msoRequestId', msoRequestId)
\r
493 execution.setVariable("failedActivity", "APP-C")
\r
494 execution.setVariable("workStep", action.toString() + "VNF")
\r
496 ApplicationControllerOrchestrator appcClient = new ApplicationControllerOrchestrator()
\r
497 Status appcStatus = null
\r
500 execution.setVariable('workStep', "LockVNF")
\r
501 appcStatus = appcClient.runCommand(Action.Lock,msoRequestId,vnfId,null)
\r
503 case Action.Unlock:
\r
504 execution.setVariable('workStep', "UnlockVNF")
\r
505 appcStatus = appcClient.runCommand(Action.Unlock,msoRequestId,vnfId,null)
\r
507 case Action.HealthCheck:
\r
508 def healthCheckIndex = execution.getVariable('healthCheckIndex')
\r
509 execution.setVariable('workStep', "HealthCheckVNF" + healthCheckIndex)
\r
510 execution.setVariable('healthCheckIndex', healthCheckIndex + 1)
\r
511 appcStatus = appcClient.runCommand(Action.HealthCheck,msoRequestId,vnfId,null)
\r
514 execution.setVariable('workStep', "StartVNF")
\r
515 appcStatus = appcClient.runCommand(Action.Start,msoRequestId,vnfId,null)
\r
518 execution.setVariable('workStep', "StopVNF")
\r
519 appcStatus = appcClient.runCommand(Action.Stop,msoRequestId,vnfId,null)
\r
524 logDebug("Completed AppC request", isDebugLogEnabled)
\r
525 int appcCode = appcStatus.getCode()
\r
526 logDebug("AppC status code is: " + appcCode, isDebugLogEnabled)
\r
527 logDebug("AppC status message is: " + appcStatus.getMessage(), isDebugLogEnabled)
\r
528 if (support.getCategoryOf(appcStatus) == ApplicationControllerSupport.StatusCategory.ERROR) {
\r
529 execution.setVariable("errorCode", Integer.toString(appcCode))
\r
530 execution.setVariable("errorText", appcStatus.getMessage())
\r
533 logDebug('Exited ' + method, isDebugLogEnabled)
\r
534 } catch (BpmnError e) {
\r
535 logError('Caught exception in ' + method, e)
\r
536 execution.setVariable("errorCode", "1002")
\r
537 execution.setVariable("errorText", e.getMessage())
\r
538 } catch (java.lang.NoSuchMethodError e) {
\r
539 logError('Caught exception in ' + method, e)
\r
540 execution.setVariable("errorCode", "1002")
\r
541 execution.setVariable("errorText", e.getMessage())
\r
542 } catch (Exception e) {
\r
543 logError('Caught exception in ' + method, e)
\r
544 execution.setVariable("errorCode", "1002")
\r
545 execution.setVariable("errorText", e.getMessage())
\r
552 * Prepare DoDeleteVnfAndModules call.
\r
555 * @param execution The flow's execution instance.
\r
557 public void prepDoDeleteVnfAndModules(DelegateExecution execution) {
\r
558 def method = getClass().getSimpleName() + '.prepDoDeleteVnfAndModules(' +
\r
559 'execution=' + execution.getId() +
\r
561 def isDebugLogEnabled = execution.getVariable('isDebugLogEnabled')
\r
562 execution.setVariable('errorCode', "0")
\r
563 logDebug('Entered ' + method, isDebugLogEnabled)
\r
564 execution.setVariable("workStep", "doDeleteVnfAndModules")
\r
565 execution.setVariable("failedActivity", "MSO Delete VNF")
\r
566 logDebug('Exited ' + method, isDebugLogEnabled)
\r
571 * Prepare DoCreateVnfAndModules call.
\r
574 * @param execution The flow's execution instance.
\r
576 public void prepDoCreateVnfAndModules(DelegateExecution execution) {
\r
577 def method = getClass().getSimpleName() + '.prepDoReplaceVnfAndModules(' +
\r
578 'execution=' + execution.getId() +
\r
580 def isDebugLogEnabled = execution.getVariable('isDebugLogEnabled')
\r
581 execution.setVariable('errorCode', "0")
\r
582 logDebug('Entered ' + method, isDebugLogEnabled)
\r
583 execution.setVariable("workStep", "doCreateVnfAndModules")
\r
584 execution.setVariable("failedActivity", "MSO Create VNF")
\r
585 logDebug('Exited ' + method, isDebugLogEnabled)
\r
591 * Handle Abort disposition from RainyDayHandler
\r
593 * @param execution The flow's execution instance.
\r
595 public void abortProcessing(DelegateExecution execution) {
\r
596 def method = getClass().getSimpleName() + '.abortProcessing(' +
\r
597 'execution=' + execution.getId() +
\r
599 def isDebugLogEnabled = execution.getVariable('isDebugLogEnabled')
\r
600 logDebug('Entered ' + method, isDebugLogEnabled)
\r
602 def errorText = execution.getVariable("errorText")
\r
603 def errorCode = execution.getVariable("errorCode")
\r
605 exceptionUtil.buildAndThrowWorkflowException(execution, errorCode as Integer, errorText)
\r
609 * Handle Manual disposition from RainyDayHandler
\r
611 * @param execution The flow's execution instance.
\r
613 public void manualProcessing(DelegateExecution execution) {
\r
614 def method = getClass().getSimpleName() + '.manualProcessing(' +
\r
615 'execution=' + execution.getId() +
\r
617 def isDebugLogEnabled = execution.getVariable('isDebugLogEnabled')
\r
618 logDebug('Entered ' + method, isDebugLogEnabled)
\r
620 def taskId = execution.getVariable("taskId")
\r
622 exceptionUtil.buildAndThrowWorkflowException(execution, 2000, "Processing halted - manual task created: " + taskId)
\r