import org.openecomp.mso.bpmn.common.scripts.ExceptionUtil\r
import org.camunda.bpm.engine.delegate.BpmnError\r
import org.camunda.bpm.engine.impl.cmd.AbstractSetVariableCmd\r
-import org.camunda.bpm.engine.runtime.Execution\r
+import org.camunda.bpm.engine.delegate.DelegateExecution\r
import org.openecomp.mso.rest.APIResponse\r
import org.openecomp.mso.rest.RESTClient\r
import org.openecomp.mso.rest.RESTConfig\r
import org.openecomp.mso.bpmn.core.domain.VnfResource\r
import org.openecomp.mso.client.aai.*\r
\r
-import org.openecomp.mso.client.appc.ApplicationControllerClient;\r
-import org.openecomp.mso.client.appc.ApplicationControllerSupport;\r
-import org.openecomp.appc.client.lcm.model.Action;\r
-import org.openecomp.appc.client.lcm.model.ActionIdentifiers;\r
-import org.openecomp.appc.client.lcm.model.LockInput\r
-import org.openecomp.appc.client.lcm.model.UnlockInput\r
-import org.openecomp.appc.client.lcm.model.HealthCheckInput\r
-import org.openecomp.appc.client.lcm.model.StartInput\r
-import org.openecomp.appc.client.lcm.model.StopInput\r
-import org.openecomp.appc.client.lcm.model.Flags\r
-import org.openecomp.appc.client.lcm.model.Status\r
+import org.openecomp.mso.client.appc.ApplicationControllerOrchestrator\r
+import org.onap.appc.client.lcm.model.Action;\r
+import org.onap.appc.client.lcm.model.ActionIdentifiers;\r
+import org.onap.appc.client.lcm.model.LockInput\r
+import org.onap.appc.client.lcm.model.UnlockInput\r
+import org.onap.appc.client.lcm.model.HealthCheckInput\r
+import org.onap.appc.client.lcm.model.StartInput\r
+import org.onap.appc.client.lcm.model.StopInput\r
+import org.onap.appc.client.lcm.model.Flags\r
+import org.onap.appc.client.lcm.model.Status\r
\r
\r
\r
-public class UpdateVnfInfra extends AbstractServiceTaskProcessor {\r
+public class UpdateVnfInfra extends VnfCmBase {\r
\r
ExceptionUtil exceptionUtil = new ExceptionUtil()\r
- JsonUtils jsonUtils = new JsonUtils()\r
- ApplicationControllerClient appcClient = new ApplicationControllerClient()\r
+ JsonUtils jsonUtils = new JsonUtils() \r
def prefix = "UPDVnfI_"\r
\r
/**\r
*\r
* @param execution The flow's execution instance.\r
*/\r
- public void initProcessVariables(Execution execution) {\r
+ public void initProcessVariables(DelegateExecution execution) {\r
execution.setVariable('prefix', 'UPDVnfI_')\r
- execution.setVariable('UPDVnfI_Request', null)\r
- execution.setVariable('UPDVnfI_requestInfo', null)\r
- execution.setVariable('UPDVnfI_requestId', null)\r
- execution.setVariable('UPDVnfI_source', null)\r
- execution.setVariable('UPDVnfI_vnfInputs', null)\r
- execution.setVariable('UPDVnfI_vnfId', null) \r
- execution.setVariable('UPDVnfI_tenantId', null) \r
- execution.setVariable('UPDVnfI_vnfParams', null) \r
+ execution.setVariable('Request', null) \r
+ execution.setVariable('source', null)\r
+ execution.setVariable('vnfInputs', null) \r
+ execution.setVariable('tenantId', null) \r
+ execution.setVariable('vnfParams', null) \r
execution.setVariable('UpdateVnfSuccessIndicator', false)\r
- execution.setVariable('UPDVnfI_serviceType', null)\r
- execution.setVariable('UPDVnfI_nfRole', null)\r
- execution.setVariable('UPDVnfI_currentActivity', 'UPDVnfI')\r
- execution.setVariable('UPDVnfI_workStep', null)\r
- execution.setVariable('UPDVnfI_failedActivity', null)\r
- execution.setVariable('UPDVnfI_errorCode', "0")\r
- execution.setVariable('UPDVnfI_errorText', null)\r
- execution.setVariable('UPDVnfI_healthCheckIndex', 1)\r
+ execution.setVariable('serviceType', null)\r
+ execution.setVariable('nfRole', null)\r
+ execution.setVariable('currentActivity', 'UPDVnfI')\r
+ execution.setVariable('workStep', null)\r
+ execution.setVariable('failedActivity', null)\r
+ execution.setVariable('errorCode', "0")\r
+ execution.setVariable('errorText', null)\r
+ execution.setVariable('healthCheckIndex0', 0)\r
+ execution.setVariable('healthCheckIndex1', 1)\r
+ execution.setVariable("rollbackSetClosedLoopDisabledFlag", false)\r
+ execution.setVariable("rollbackVnfStop", false)\r
+ execution.setVariable("rollbackVnfLock", false)\r
+ execution.setVariable("rollbackQuiesceTraffic", false)\r
+ execution.setVariable("rollbackSetVnfInMaintenanceFlag", false)\r
}\r
\r
/**\r
*\r
* @param execution The flow's execution instance.\r
*/\r
- public void preProcessRequest(Execution execution) {\r
+ public void preProcessRequest(DelegateExecution execution) {\r
def method = getClass().getSimpleName() + '.preProcessRequest(' +\r
'execution=' + execution.getId() +\r
')'\r
def jsonOutput = new JsonOutput()\r
Map reqMap = jsonSlurper.parseText(incomingRequest)\r
utils.log("DEBUG", " Request is in JSON format.", isDebugLogEnabled)\r
-\r
- def serviceInstanceId = execution.getVariable('serviceInstanceId')\r
- def vnfId = execution.getVariable('vnfId')\r
\r
- execution.setVariable(prefix + 'serviceInstanceId', serviceInstanceId)\r
- execution.setVariable(prefix + 'vnfId', vnfId)\r
- execution.setVariable("isVidRequest", "true") \r
+ execution.setVariable("isVidRequest", "true")\r
+ execution.setVariable('serviceType', 'Mobility')\r
+ execution.setVariable('actionLock', Action.Lock)\r
+ execution.setVariable('actionUnlock', Action.Unlock)\r
+ execution.setVariable('actionHealthCheck', Action.HealthCheck)\r
+ execution.setVariable('actionStart', Action.Start)\r
+ execution.setVariable('actionStop', Action.Stop)\r
\r
def asdcServiceModelVersion = ''\r
def serviceModelInfo = null\r
}\r
} \r
\r
- execution.setVariable(prefix + 'asdcServiceModelVersion', asdcServiceModelVersion)\r
- execution.setVariable(prefix + 'serviceModelInfo', serviceModelInfo)\r
+ execution.setVariable('asdcServiceModelVersion', asdcServiceModelVersion)\r
+ execution.setVariable('serviceModelInfo', serviceModelInfo)\r
def vnfModelInfo = jsonOutput.toJson(reqMap.requestDetails?.modelInfo)\r
- execution.setVariable(prefix + 'vnfModelInfo', vnfModelInfo)\r
+ execution.setVariable('vnfModelInfo', vnfModelInfo)\r
def vnfModelInvariantUuid = jsonUtils.getJsonValue(vnfModelInfo, "modelInvariantUuid")\r
- execution.setVariable(prefix + 'vnfModelInvariantUuid', vnfModelInvariantUuid) \r
+ execution.setVariable('vnfModelInvariantUuid', vnfModelInvariantUuid) \r
logDebug("vnfModelInvariantUuid: " + vnfModelInvariantUuid, isDebugLogEnabled) \r
\r
def vnfType = execution.getVariable('vnfType')\r
- execution.setVariable(prefix + 'vnfType', vnfType)\r
+ execution.setVariable('vnfType', vnfType)\r
\r
def userParams = reqMap.requestDetails?.requestParameters?.userParams \r
\r
Map<String, String> userParamsMap = [:]\r
if (userParams != null) {\r
userParams.each { userParam ->\r
- userParamsMap.put(userParam.name, userParam.value)\r
+ userParamsMap.put(userParam.name, userParam.value.toString())\r
} \r
} \r
\r
utils.log("DEBUG", 'Processed user params: ' + userParamsMap, isDebugLogEnabled) \r
\r
- execution.setVariable(prefix + 'vfModuleInputParams', userParamsMap) \r
+ execution.setVariable('vfModuleInputParams', userParamsMap) \r
\r
def requestId = execution.getVariable("mso-request-id")\r
- execution.setVariable(prefix + 'requestId', requestId)\r
+ execution.setVariable('requestId', requestId)\r
execution.setVariable('msoRequestId', requestId)\r
\r
\r
def vnfName = reqMap.requestDetails?.requestInfo?.instanceName ?: null\r
- execution.setVariable(prefix + 'vnfName', vnfName)\r
+ execution.setVariable('vnfName', vnfName)\r
\r
def requestorId = reqMap.requestDetails?.requestInfo?.requestorId ?: null\r
- execution.setVariable(prefix + 'requestorId', requestorId)\r
+ execution.setVariable('requestorId', requestorId)\r
\r
def usePreload = reqMap.requestDetails?.requestParameters?.usePreload\r
- execution.setVariable(prefix + 'usePreload', usePreload)\r
+ execution.setVariable('usePreload', usePreload)\r
\r
def cloudConfiguration = reqMap.requestDetails?.cloudConfiguration\r
def lcpCloudRegionId = cloudConfiguration.lcpCloudRegionId\r
- execution.setVariable(prefix + 'lcpCloudRegionId', lcpCloudRegionId)\r
+ execution.setVariable('lcpCloudRegionId', lcpCloudRegionId)\r
def tenantId = cloudConfiguration.tenantId\r
- execution.setVariable(prefix + 'tenantId', tenantId)\r
+ execution.setVariable('tenantId', tenantId)\r
\r
def globalSubscriberId = reqMap.requestDetails?.subscriberInfo?.globalSubscriberId ?: ''\r
- execution.setVariable(prefix + 'globalSubscriberId', globalSubscriberId)\r
+ execution.setVariable('globalSubscriberId', globalSubscriberId)\r
\r
- execution.setVariable(prefix + 'sdncVersion', '1702')\r
+ execution.setVariable('sdncVersion', '1702')\r
\r
execution.setVariable("UpdateVnfInfraSuccessIndicator", false)\r
\r
execution.setVariable("isDebugLogEnabled", isDebugLogEnabled) \r
\r
def source = reqMap.requestDetails?.requestInfo?.source\r
- execution.setVariable(prefix + "source", source)\r
+ execution.setVariable("source", source)\r
\r
//For Completion Handler & Fallout Handler\r
String requestInfo =\r
<source>${source}</source>\r
</request-info>"""\r
\r
- execution.setVariable(prefix + "requestInfo", requestInfo) \r
+ execution.setVariable("requestInfo", requestInfo) \r
\r
- logDebug('RequestInfo: ' + execution.getVariable(prefix + "requestInfo"), isDebugLogEnabled) \r
+ logDebug('RequestInfo: ' + execution.getVariable("requestInfo"), isDebugLogEnabled) \r
\r
logDebug('Exited ' + method, isDebugLogEnabled)\r
\r
*\r
* @param execution The flow's execution instance.\r
*/\r
- public void sendSynchResponse(Execution execution) {\r
+ public void sendSynchResponse(DelegateExecution execution) {\r
def method = getClass().getSimpleName() + '.sendSynchResponse(' +\r
'execution=' + execution.getId() +\r
')'\r
\r
\r
try {\r
- def requestInfo = execution.getVariable('UPDVnfI_requestInfo')\r
- def requestId = execution.getVariable('UPDVnfI_requestId')\r
- def source = execution.getVariable('UPDVnfI_source')\r
+ def requestInfo = execution.getVariable('requestInfo')\r
+ def requestId = execution.getVariable('requestId')\r
+ def source = execution.getVariable('source')\r
def progress = getNodeTextForce(requestInfo, 'progress')\r
if (progress.isEmpty()) {\r
progress = '0'\r
*\r
* @param execution The flow's execution instance.\r
*/\r
- public void getVnfResourceDecomposition(Execution execution) {\r
+ public void getVnfResourceDecomposition(DelegateExecution execution) {\r
def method = getClass().getSimpleName() + '.getVnfResourceDecomposition(' +\r
'execution=' + execution.getId() +\r
')'\r
\r
try {\r
ServiceDecomposition serviceDecomposition = execution.getVariable("serviceDecomposition")\r
- String vnfModelInvariantUuid = execution.getVariable(prefix + 'vnfModelInvariantUuid')\r
+ String vnfModelInvariantUuid = execution.getVariable('vnfModelInvariantUuid')\r
logDebug("vnfModelInvariantUuid: " + vnfModelInvariantUuid, isDebugLogEnabled)\r
List<VnfResource> vnfResources = serviceDecomposition.getServiceVnfs()\r
\r
\r
if (vnfModelInvariantUuid.equals(modelInvariantUuidFromDecomposition)) {\r
VnfResource vnfResourceDecomposition = vnfResources[i]\r
- execution.setVariable(prefix + 'vnfResourceDecomposition', vnfResourceDecomposition)\r
+ execution.setVariable('vnfResourceDecomposition', vnfResourceDecomposition)\r
def nfRole = vnfResourceDecomposition.getNfRole() \r
- execution.setVariable(prefix + 'nfRole', nfRole)\r
+ execution.setVariable('nfRole', nfRole)\r
logDebug("vnfResourceDecomposition: " + vnfResourceDecomposition.toJsonString(), isDebugLogEnabled) \r
break\r
}\r
*\r
* @param execution The flow's execution instance.\r
*/\r
- public void checkIfVnfInMaintInAAI(Execution execution) {\r
+ public void checkIfVnfInMaintInAAI(DelegateExecution execution) {\r
def method = getClass().getSimpleName() + '.checkIfVnfInMaintInAAI(' +\r
'execution=' + execution.getId() +\r
')'\r
def isDebugLogEnabled = execution.getVariable('isDebugLogEnabled')\r
- execution.setVariable(prefix + 'errorCode', "0")\r
- execution.setVariable(prefix + "workStep", "checkIfVnfInMaintInAAI")\r
- execution.setVariable(prefix + "failedActivity", "AAI")\r
+ execution.setVariable('errorCode', "0")\r
+ execution.setVariable("workStep", "checkIfVnfInMaintInAAI")\r
+ execution.setVariable("failedActivity", "AAI")\r
logDebug('Entered ' + method, isDebugLogEnabled)\r
\r
try {\r
def vnfId = execution.getVariable("vnfId")\r
boolean isInMaint = aaiValidator.isVNFLocked(vnfId, transactionLoggingUuid)\r
logDebug("isInMaint result: " + isInMaint, isDebugLogEnabled)\r
- execution.setVariable(prefix + 'isVnfInMaintenance', isInMaint)\r
+ execution.setVariable('isVnfInMaintenance', isInMaint)\r
+ \r
+ if (isInMaint) {\r
+ execution.setVariable("errorCode", "1003")\r
+ execution.setVariable("errorText", "VNF is in maintenance in A&AI")\r
+ }\r
+\r
\r
logDebug('Exited ' + method, isDebugLogEnabled)\r
} catch (BpmnError e) {\r
throw e;\r
} catch (Exception e) {\r
logError('Caught exception in ' + method, e) \r
- execution.setVariable(prefix + "errorCode", "1002")\r
- execution.setVariable(prefix + "errorText", e.getMessage())\r
+ execution.setVariable("errorCode", "1002")\r
+ execution.setVariable("errorText", e.getMessage())\r
//exceptionUtil.buildAndThrowWorkflowException(execution, 1002, 'Error in checkIfVnfInMaintInAAI(): ' + e.getMessage())\r
}\r
}\r
*\r
* @param execution The flow's execution instance.\r
*/\r
- public void checkIfPserversInMaintInAAI(Execution execution) {\r
+ public void checkIfPserversInMaintInAAI(DelegateExecution execution) {\r
def method = getClass().getSimpleName() + '.checkIfPserversInMaintInAAI(' +\r
'execution=' + execution.getId() +\r
')'\r
def isDebugLogEnabled = execution.getVariable('isDebugLogEnabled')\r
- execution.setVariable(prefix + 'errorCode', "0")\r
+ execution.setVariable('errorCode', "0")\r
logDebug('Entered ' + method, isDebugLogEnabled)\r
- execution.setVariable(prefix + "workStep", "checkIfPserversInMaintInAAI")\r
- execution.setVariable(prefix + "failedActivity", "AAI")\r
+ execution.setVariable("workStep", "checkIfPserversInMaintInAAI")\r
+ execution.setVariable("failedActivity", "AAI")\r
\r
try {\r
def transactionLoggingUuid = UUID.randomUUID().toString()\r
def vnfId = execution.getVariable("vnfId") \r
boolean areLocked = aaiValidator.isPhysicalServerLocked(vnfId, transactionLoggingUuid)\r
logDebug("areLocked result: " + areLocked, isDebugLogEnabled)\r
- execution.setVariable(prefix + 'arePserversLocked', areLocked)\r
+ execution.setVariable('arePserversLocked', areLocked)\r
+ \r
+ if (areLocked) {\r
+ execution.setVariable("errorCode", "1003")\r
+ execution.setVariable("errorText", "pServers are locked in A&AI")\r
+ }\r
\r
logDebug('Exited ' + method, isDebugLogEnabled)\r
} catch (BpmnError e) {\r
throw e;\r
} catch (Exception e) {\r
logError('Caught exception in ' + method, e)\r
- execution.setVariable(prefix + "errorCode", "1002")\r
- execution.setVariable(prefix + "errorText", e.getMessage())\r
+ execution.setVariable("errorCode", "1002")\r
+ execution.setVariable("errorText", e.getMessage())\r
//exceptionUtil.buildAndThrowWorkflowException(execution, 1002, 'Error in checkIfPserversInMaintInAAI(): ' + e.getMessage())\r
}\r
}\r
* @param execution The flow's execution instance.\r
* @param inMaint The boolean value of the flag to set\r
*/\r
- public void setVnfInMaintFlagInAAI(Execution execution, boolean inMaint) {\r
+ public void setVnfInMaintFlagInAAI(DelegateExecution execution, boolean inMaint) {\r
def method = getClass().getSimpleName() + '.setVnfInMaintFlagInAAI(' +\r
'execution=' + execution.getId() +\r
')'\r
def isDebugLogEnabled = execution.getVariable('isDebugLogEnabled')\r
- execution.setVariable(prefix + 'errorCode', "0")\r
+ execution.setVariable('errorCode', "0")\r
logDebug('Entered ' + method, isDebugLogEnabled)\r
if (inMaint) {\r
- execution.setVariable(prefix + "workStep", "setVnfInMaintFlagInAAI")\r
+ execution.setVariable("workStep", "setVnfInMaintFlagInAAI")\r
}\r
else {\r
- execution.setVariable(prefix + "workStep", "unsetVnfInMaintFlagInAAI")\r
+ execution.setVariable("workStep", "unsetVnfInMaintFlagInAAI")\r
}\r
- execution.setVariable(prefix + "failedActivity", "AAI")\r
+ execution.setVariable("failedActivity", "AAI")\r
\r
try {\r
def transactionLoggingUuid = UUID.randomUUID().toString()\r
def vnfId = execution.getVariable("vnfId")\r
if (inMaint) {\r
aaiUpdator.updateVnfToLocked(vnfId, transactionLoggingUuid)\r
+ execution.setVariable("rollbackSetVnfInMaintenanceFlag", true)\r
}\r
else {\r
aaiUpdator.updateVnfToUnLocked(vnfId, transactionLoggingUuid)\r
throw e;\r
} catch (Exception e) {\r
logError('Caught exception in ' + method, e)\r
- execution.setVariable(prefix + "errorCode", "1002")\r
- execution.setVariable(prefix + "errorText", e.getMessage())\r
+ execution.setVariable("errorCode", "1002")\r
+ execution.setVariable("errorText", e.getMessage())\r
//exceptionUtil.buildAndThrowWorkflowException(execution, 1002, 'Error in setVnfInMaintFlagInAAI(): ' + e.getMessage())\r
}\r
}\r
\r
- /**\r
- * Call APP-C client to execute specified APP-C command for this VNF.\r
- *\r
- *\r
- * @param execution The flow's execution instance.\r
- * @param action The action to take in APP-C.\r
- */\r
- public void runAppcCommand(Execution execution, Action action) {\r
- def method = getClass().getSimpleName() + '.runAppcCommand(' +\r
- 'execution=' + execution.getId() +\r
- ')'\r
- def isDebugLogEnabled = execution.getVariable('isDebugLogEnabled')\r
- execution.setVariable(prefix + 'errorCode', "0")\r
- logDebug('Entered ' + method, isDebugLogEnabled)\r
- \r
- try {\r
- logDebug("Running APP-C action: " + action.toString(), isDebugLogEnabled)\r
- String vnfId = execution.getVariable('vnfId')\r
- String msoRequestId = execution.getVariable(prefix + 'requestId')\r
- execution.setVariable('msoRequestId', msoRequestId) \r
- execution.setVariable(prefix + "failedActivity", "APP-C") \r
- \r
- ApplicationControllerSupport support = new ApplicationControllerSupport() \r
- appcClient.appCSupport=support \r
- org.springframework.test.util.ReflectionTestUtils.setField(support, "lcmModelPackage", "org.openecomp.appc.client.lcm.model"); \r
- Flags flags = new Flags(); \r
- ActionIdentifiers actionIdentifiers = new ActionIdentifiers(); \r
- actionIdentifiers.setVnfId(vnfId);\r
- Status appcStatus\r
- switch(action) {\r
- case Action.Lock:\r
- execution.setVariable(prefix + 'workStep', "LockVNF")\r
- appcStatus = appcClient.runCommand(Action.Lock,actionIdentifiers,flags,null,msoRequestId) \r
- break\r
- case Action.Unlock:\r
- execution.setVariable(prefix + 'workStep', "UnlockVNF")\r
- appcStatus = appcClient.runCommand(Action.Unlock,actionIdentifiers,flags,null,msoRequestId) \r
- break\r
- case Action.HealthCheck:\r
- def healthCheckIndex = execution.getVariable(prefix + 'healthCheckIndex')\r
- execution.setVariable(prefix + 'workStep', "HealthCheckVNF" + healthCheckIndex)\r
- execution.setVariable(prefix + 'healthCheckIndex', healthCheckIndex + 1)\r
- appcStatus = appcClient.runCommand(Action.HealthCheck,actionIdentifiers,flags,null,msoRequestId) \r
- break\r
- case Action.Start:\r
- execution.setVariable(prefix + 'workStep', "StartVNF")\r
- appcStatus = appcClient.runCommand(Action.Start,actionIdentifiers,flags,null,msoRequestId) \r
- break\r
- case Action.Stop:\r
- execution.setVariable(prefix + 'workStep', "StopVNF")\r
- appcStatus = appcClient.runCommand(Action.Stop,actionIdentifiers,flags,null,msoRequestId) \r
- break\r
- default:\r
- break\r
- }\r
- logDebug("Completed AppC request", isDebugLogEnabled) \r
- int appcCode = appcStatus.getCode()\r
- logDebug("AppC status code is: " + appcCode, isDebugLogEnabled)\r
- logDebug("AppC status message is: " + appcStatus.getMessage(), isDebugLogEnabled)\r
- if (support.getCategoryOf(appcStatus) == ApplicationControllerSupport.StatusCategory.ERROR) {\r
- execution.setVariable(prefix + "errorCode", Integer.toString(appcCode))\r
- execution.setVariable(prefix + "errorText", appcStatus.getMessage()) \r
- } \r
- logDebug('Exited ' + method, isDebugLogEnabled)\r
- } catch (BpmnError e) {\r
- logError('Caught exception in ' + method, e)\r
- execution.setVariable(prefix + "errorCode", "1002")\r
- execution.setVariable(prefix + "errorText", e.getMessage())\r
- //throw e;\r
- } catch (java.lang.NoSuchMethodError e) {\r
- logError('Caught exception in ' + method, e)\r
- execution.setVariable(prefix + "errorCode", "1002")\r
- execution.setVariable(prefix + "errorText", e.getMessage())\r
- //throw e;\r
- } catch (Exception e) {\r
- logError('Caught exception in ' + method, e)\r
- execution.setVariable(prefix + "errorCode", "1002")\r
- execution.setVariable(prefix + "errorText", e.getMessage())\r
- \r
- //exceptionUtil.buildAndThrowWorkflowException(execution, 1002, 'Error in ' + method + ': ' + e.getMessage())\r
- }\r
- }\r
-\r
-\r
-\r
\r
\r
- /**\r
- * Builds a "CompletionHandler" request and stores it in the specified execution variable.\r
- *\r
- * @param execution the execution\r
- * @param resultVar the execution variable in which the result will be stored\r
- */\r
- public void completionHandlerPrep(Execution execution, String resultVar) {\r
- def method = getClass().getSimpleName() + '.completionHandlerPrep(' +\r
- 'execution=' + execution.getId() +\r
- ', resultVar=' + resultVar +\r
- ')'\r
- def isDebugLogEnabled = execution.getVariable('isDebugLogEnabled')\r
- logDebug('Entered ' + method, isDebugLogEnabled) \r
- \r
-\r
- try {\r
- appcClient.shutdownclient()\r
- def requestInfo = getVariable(execution, 'UPDVnfI_requestInfo')\r
-\r
- String content = """\r
- <sdncadapterworkflow:MsoCompletionRequest xmlns:sdncadapterworkflow="http://org.openecomp/mso/workflow/schema/v1"\r
- xmlns:reqtype="http://org.openecomp/mso/request/types/v1">\r
- ${requestInfo}\r
- <sdncadapterworkflow:mso-bpel-name>MSO_ACTIVATE_BPEL</sdncadapterworkflow:mso-bpel-name>\r
- </sdncadapterworkflow:MsoCompletionRequest>\r
- """\r
-\r
- content = utils.formatXml(content)\r
- logDebug(resultVar + ' = ' + System.lineSeparator() + content, isDebugLogEnabled)\r
- execution.setVariable(resultVar, content)\r
-\r
- logDebug('Exited ' + method, isDebugLogEnabled)\r
- } catch (BpmnError e) {\r
- throw e;\r
- } catch (Exception e) {\r
- logError('Caught exception in ' + method, e)\r
- exceptionUtil.buildAndThrowWorkflowException(execution, 2000, 'Internal Error')\r
- }\r
- }\r
- \r
/**\r
* Prepare DoUpdateVnfAndModules call.\r
*\r
*\r
* @param execution The flow's execution instance.\r
*/\r
- public void prepDoUpdateVnfAndModules(Execution execution) {\r
+ public void prepDoUpdateVnfAndModules(DelegateExecution execution) {\r
def method = getClass().getSimpleName() + '.prepDoUpdateVnfAndModules(' +\r
'execution=' + execution.getId() +\r
')'\r
def isDebugLogEnabled = execution.getVariable('isDebugLogEnabled')\r
- execution.setVariable(prefix + 'errorCode', "0")\r
+ execution.setVariable('errorCode', "0")\r
logDebug('Entered ' + method, isDebugLogEnabled)\r
- execution.setVariable(prefix + "workStep", "doUpdateVnfAndModules")\r
- execution.setVariable(prefix + "failedActivity", "MSO Update VNF")\r
+ execution.setVariable("workStep", "doUpdateVnfAndModules")\r
+ execution.setVariable("failedActivity", "MSO Update VNF")\r
logDebug('Exited ' + method, isDebugLogEnabled)\r
\r
}\r
\r
- /**\r
- * Builds a "FalloutHandler" request and stores it in the specified execution variable.\r
- *\r
- * @param execution the execution\r
- * @param resultVar the execution variable in which the result will be stored\r
- */\r
- public void falloutHandlerPrep(Execution execution, String resultVar) {\r
- def method = getClass().getSimpleName() + '.falloutHandlerPrep(' +\r
- 'execution=' + execution.getId() +\r
- ', resultVar=' + resultVar +\r
- ')'\r
- def isDebugLogEnabled = execution.getVariable('isDebugLogEnabled')\r
- logDebug('Entered ' + method, isDebugLogEnabled)\r
-\r
- try {\r
- def prefix = execution.getVariable('prefix')\r
- def request = getVariable(execution, prefix+'Request')\r
- def requestInformation = execution.getVariable(prefix + "requestInfo") \r
- \r
- appcClient.shutdownclient()\r
-\r
- def WorkflowException workflowException = execution.getVariable("WorkflowException")\r
- def errorResponseCode = workflowException.getErrorCode()\r
- def errorResponseMsg = workflowException.getErrorMessage()\r
- def encErrorResponseMsg = ""\r
- if (errorResponseMsg != null) {\r
- encErrorResponseMsg = errorResponseMsg.replace("&", "&").replace("<", "<").replace(">", ">")\r
- }\r
-\r
- String content = """\r
- <sdncadapterworkflow:FalloutHandlerRequest xmlns:sdncadapterworkflow="http://org.openecomp/mso/workflow/schema/v1"\r
- xmlns:reqtype="http://org.openecomp/mso/request/types/v1"\r
- xmlns:msoservtypes="http://org.openecomp/mso/request/types/v1"\r
- xmlns:structuredtypes="http://org.openecomp/mso/structured/types/v1">\r
- ${requestInformation}\r
- <sdncadapterworkflow:WorkflowException>\r
- <sdncadapterworkflow:ErrorMessage>${encErrorResponseMsg}</sdncadapterworkflow:ErrorMessage>\r
- <sdncadapterworkflow:ErrorCode>${errorResponseCode}</sdncadapterworkflow:ErrorCode>\r
- </sdncadapterworkflow:WorkflowException>\r
- </sdncadapterworkflow:FalloutHandlerRequest>\r
- """\r
- content = utils.formatXml(content)\r
- logDebug(resultVar + ' = ' + System.lineSeparator() + content, isDebugLogEnabled)\r
- execution.setVariable(resultVar, content)\r
-\r
- logDebug('Exited ' + method, isDebugLogEnabled)\r
- } catch (BpmnError e) {\r
- throw e;\r
- } catch (Exception e) {\r
- logError('Caught exception in ' + method, e)\r
- exceptionUtil.buildWorkflowException(execution, 2000, 'Internal Error')\r
- }\r
- }\r
\r
/**\r
* Handle Abort disposition from RainyDayHandler\r
*\r
* @param execution The flow's execution instance. \r
*/\r
- public void abortProcessing(Execution execution) {\r
+ public void abortProcessing(DelegateExecution execution) {\r
def method = getClass().getSimpleName() + '.abortProcessing(' +\r
'execution=' + execution.getId() +\r
')'\r
def isDebugLogEnabled = execution.getVariable('isDebugLogEnabled')\r
logDebug('Entered ' + method, isDebugLogEnabled)\r
\r
- def errorText = execution.getVariable(prefix + "errorText")\r
- def errorCode = execution.getVariable(prefix + "errorCode")\r
+ def errorText = execution.getVariable("errorText")\r
+ def errorCode = execution.getVariable("errorCode")\r
\r
exceptionUtil.buildAndThrowWorkflowException(execution, errorCode as Integer, errorText)\r
}\r
\r
- /**\r
- * Handle Manual disposition from RainyDayHandler\r
- *\r
- * @param execution The flow's execution instance. \r
- */\r
- public void manualProcessing(Execution execution) {\r
- def method = getClass().getSimpleName() + '.manualProcessing(' +\r
- 'execution=' + execution.getId() +\r
- ')'\r
- def isDebugLogEnabled = execution.getVariable('isDebugLogEnabled')\r
- logDebug('Entered ' + method, isDebugLogEnabled)\r
- \r
- def taskId = execution.getVariable("UPDVnfI_taskId") \r
- \r
- exceptionUtil.buildAndThrowWorkflowException(execution, 2000, "Processing halted - manual task created: " + taskId)\r
- }\r
+ \r
\r
\r
}\r