execution.setVariable('prefix', Prefix)
try{
- def rollbackData = execution.getVariable("RollbackData")
+ def rollbackData = execution.getVariable("rollbackData")
if (rollbackData == null) {
rollbackData = new RollbackData()
}
def requestId = execution.getVariable("msoRequestId")
execution.setVariable("DCVFM_requestId", requestId)
logDebug("requestId: " + requestId, isDebugLogEnabled)
+ rollbackData.put("VFMODULE", "msorequestid", requestId)
// Set mso-request-id to request-id for VNF Adapter interface
execution.setVariable("mso-request-id", requestId)
//serviceId
//backoutOnFailure
def disableRollback = execution.getVariable("disableRollback")
def backoutOnFailure = true
- if (disableRollback != null && disableRollback.equals("true")) {
+ if (disableRollback != null && disableRollback == true) {
backoutOnFailure = false
}
execution.setVariable("DCVFM_backoutOnFailure", backoutOnFailure)
execution.setVariable("DCVFM_asdcServiceModelVersion", asdcServiceModelVersion)
logDebug("asdcServiceModelVersion: " + asdcServiceModelVersion, isDebugLogEnabled)
//personaModelId
- execution.setVariable("DCVFM_personaModelId", jsonUtil.getJsonValue(vfModuleModelInfo, "modelInvariantId"))
+ execution.setVariable("DCVFM_personaModelId", jsonUtil.getJsonValue(vfModuleModelInfo, "modelInvariantUuid"))
//personaModelVersion
- execution.setVariable("DCVFM_personaModelVersion", jsonUtil.getJsonValue(vfModuleModelInfo, "modelVersionId"))
+ execution.setVariable("DCVFM_personaModelVersion", jsonUtil.getJsonValue(vfModuleModelInfo, "modelUuid"))
//vfModuleLabel
def vfModuleLabel = execution.getVariable("vfModuleLabel")
if (vfModuleLabel != null) {
logDebug("SDNC Callback URL is: " + sdncCallbackUrl, isDebugLogEnabled)
- execution.setVariable("RollbackData", rollbackData)
+ execution.setVariable("rollbackData", rollbackData)
}catch(BpmnError b){
throw b
}catch(Exception e){
def createResponse = execution.getVariable('DCVFM_createVfModuleResponse')
utils.logAudit("createVfModule Response: " + createResponse)
- def rollbackData = execution.getVariable("RollbackData")
+ def rollbackData = execution.getVariable("rollbackData")
String vnfName = utils.getNodeText1(createResponse, 'vnf-name')
if (vnfName != null) {
execution.setVariable('DCVFM_vnfName', vnfName)
rollbackData.put("VFMODULE", "vfmoduleid", vfModuleId)
rollbackData.put("VFMODULE", "rollbackCreateAAIVfModule", "true")
rollbackData.put("VFMODULE", "rollbackPrepareUpdateVfModule", "true")
- execution.setVariable("RollbackData", rollbackData)
+ execution.setVariable("rollbackData", rollbackData)
} catch (Exception ex) {
ex.printStackTrace()
logDebug('Exception occurred while postProcessing CreateAAIVfModule request:' + ex.getMessage(),isDebugLogEnabled)
}
Map<String, String> vnfParamsMap = execution.getVariable("DCVFM_vnfParamsMap")
+ String vfModuleParams = ""
+ //Get SDNC Response Data for VF Module Topology
+ String vfModuleSdncGetResponse = execution.getVariable('DCVFM_getSDNCAdapterResponse')
+ utils.logAudit("sdncGetResponse: " + vfModuleSdncGetResponse)
+ def sdncVersion = execution.getVariable("sdncVersion")
- //Get SDNC Response Data for VnfSubCreate Request
- String sdncGetResponse = execution.getVariable('DCVFM_getSDNCAdapterResponse')
- utils.logAudit("sdncGetResponse: " + sdncGetResponse)
-
- String vfModuleParams = buildVfModuleParams(vnfParamsMap, sdncGetResponse, vnfId, vnfName,
+ if (!sdncVersion.equals("1707")) {
+
+ vfModuleParams = buildVfModuleParams(vnfParamsMap, vfModuleSdncGetResponse, vnfId, vnfName,
vfModuleId, vfModuleName, vfModuleIndex)
+ }
+ else {
+ //Get SDNC Response Data for Vnf Topology
+ String vnfSdncGetResponse = execution.getVariable('DCVFM_getVnfSDNCAdapterResponse')
+ utils.logAudit("vnfSdncGetResponse: " + vnfSdncGetResponse)
+
+ vfModuleParams = buildVfModuleParamsFromCombinedTopologies(vnfParamsMap, vnfSdncGetResponse, vfModuleSdncGetResponse, vnfId, vnfName,
+ vfModuleId, vfModuleName, vfModuleIndex)
+ }
def svcInstId = ""
if (serviceInstanceId == null || serviceInstanceId.isEmpty()) {
def modelCustomizationUuid = execution.getVariable("DCVFM_modelCustomizationUuid")
def modelCustomizationUuidString = ""
if (!usePreload) {
- modelCustomizationUuidString = "<modelCustomizationUuid>" + modelCustomizationUuid + "</modelCustomizationUuid>"
+ modelCustomizationUuidString = "<model-customization-uuid>" + modelCustomizationUuid + "</model-customization-uuid>"
}
String sdncVNFParamsXml = ""
xmlns:sdncadapterworkflow="http://org.openecomp/mso/workflow/schema/v1"
xmlns:sdncadapter="http://org.openecomp/workflow/sdnc/adapter/schema/v1">
<sdncadapter:RequestHeader>
- <sdncadapter:RequestId>${requestId}</sdncadapter:RequestId>
+ <sdncadapter:RequestId>${uuid}</sdncadapter:RequestId>
<sdncadapter:SvcInstanceId>${svcInstId}</sdncadapter:SvcInstanceId>
<sdncadapter:SvcAction>${action}</sdncadapter:SvcAction>
<sdncadapter:SvcOperation>vnf-topology-operation</sdncadapter:SvcOperation>
xmlns:sdncadapterworkflow="http://org.openecomp/mso/workflow/schema/v1"
xmlns:sdncadapter="http://org.openecomp/workflow/sdnc/adapter/schema/v1">
<sdncadapter:RequestHeader>
- <sdncadapter:RequestId>${requestId}</sdncadapter:RequestId>
+ <sdncadapter:RequestId>${uuid}</sdncadapter:RequestId>
<sdncadapter:SvcInstanceId>${svcInstId}</sdncadapter:SvcInstanceId>
<sdncadapter:SvcAction>${action}</sdncadapter:SvcAction>
<sdncadapter:SvcOperation>vf-module-topology-operation</sdncadapter:SvcOperation>
logDebug("VNF Adapter Response is: " + vnfResponse, isDebugLogEnabled)
utils.logAudit("createVnfAResponse is: \n" + vnfResponse)
- RollbackData rollbackData = execution.getVariable("RollbackData")
+ RollbackData rollbackData = execution.getVariable("rollbackData")
if(vnfResponse != null){
if(vnfResponse.contains("createVfModuleResponse")){
}
rollbackData.put("VFMODULE", "rollbackVnfAdapterCreate", "true")
- execution.setVariable("RollbackData", rollbackData)
+ execution.setVariable("rollbackData", rollbackData)
}catch(BpmnError b){
throw b
String sdncResponse = response
if(execution.getVariable(Prefix + 'sdncResponseSuccess') == true){
logDebug("Received a Good Response from SDNC Adapter for " + method + " SDNC Call. Response is: \n" + sdncResponse, isDebugLogEnabled)
- RollbackData rollbackData = execution.getVariable("RollbackData")
+ RollbackData rollbackData = execution.getVariable("rollbackData")
if(method.equals("assign")){
rollbackData.put("VFMODULE", "rollbackSDNCRequestAssign", "true")
else if (method.equals("activate")) {
rollbackData.put("VFMODULE", "rollbackSDNCRequestActivate", "true")
}
- execution.setVariable("RollbackData", rollbackData)
+ execution.setVariable("rollbackData", rollbackData)
}else{
logDebug("Received a BAD Response from SDNC Adapter for " + method + " SDNC Call.", isDebugLogEnabled)
throw new BpmnError("MSOWorkflowException")
// get variables
List fqdnList = execution.getVariable("DCVFM_contrailNetworkPolicyFqdnList")
int fqdnCount = fqdnList.size()
- def rollbackData = execution.getVariable("RollbackData")
+ def rollbackData = execution.getVariable("rollbackData")
execution.setVariable("DCVFM_networkPolicyFqdnCount", fqdnCount)
logDebug("DCVFM_networkPolicyFqdnCount - " + fqdnCount, isDebugLogEnabled)
logDebug(" AddAAINetworkPolicy Success REST Response, , NetworkPolicy #" + counting + " : " + "\n" + aaiResponseAsStringPut, isDebugLogEnabled)
rollbackData.put("VFMODULE", "rollbackCreateNetworkPoliciesAAI", "true")
rollbackData.put("VFMODULE", "contrailNetworkPolicyFqdn" + i, fqdn)
- execution.setVariable("RollbackData", rollbackData)
+ execution.setVariable("rollbackData", rollbackData)
} else {
// aai all errors
logDebug('Entered ' + method, isDebugLogEnabled)
try {
- def rollbackData = execution.getVariable("RollbackData")
+ def rollbackData = execution.getVariable("rollbackData")
def vnfId = execution.getVariable('DCVFM_vnfId')
def oamManagementV4Address = execution.getVariable("DCVFM_oamManagementV4Address")
def oamManagementV6Address = execution.getVariable("DCVFM_oamManagementV6Address")
exceptionUtil.buildAndThrowWorkflowException(execution, 1002, 'Error in postProcessUpdateAAIGenericVnf(): ' + e.getMessage())
}
}
+
+ public void preProcessRollback (Execution execution) {
+ def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
+ utils.log("DEBUG"," ***** preProcessRollback ***** ", isDebugEnabled)
+ try {
+
+ Object workflowException = execution.getVariable("WorkflowException");
+
+ if (workflowException instanceof WorkflowException) {
+ utils.log("DEBUG", "Prev workflowException: " + workflowException.getErrorMessage(), isDebugEnabled)
+ execution.setVariable("prevWorkflowException", workflowException);
+ //execution.setVariable("WorkflowException", null);
+ }
+ } catch (BpmnError e) {
+ utils.log("DEBUG", "BPMN Error during preProcessRollback", isDebugEnabled)
+ } catch(Exception ex) {
+ String msg = "Exception in preProcessRollback. " + ex.getMessage()
+ utils.log("DEBUG", msg, isDebugEnabled)
+ }
+ utils.log("DEBUG"," *** Exit preProcessRollback *** ", isDebugEnabled)
+ }
+ public void postProcessRollback (Execution execution) {
+ def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
+ utils.log("DEBUG"," ***** postProcessRollback ***** ", isDebugEnabled)
+ String msg = ""
+ try {
+ Object workflowException = execution.getVariable("prevWorkflowException");
+ if (workflowException instanceof WorkflowException) {
+ utils.log("DEBUG", "Setting prevException to WorkflowException: ", isDebugEnabled)
+ execution.setVariable("WorkflowException", workflowException);
+ }
+ execution.setVariable("rollbackData", null)
+ } catch (BpmnError b) {
+ utils.log("DEBUG", "BPMN Error during postProcessRollback", isDebugEnabled)
+ throw b;
+ } catch(Exception ex) {
+ msg = "Exception in postProcessRollback. " + ex.getMessage()
+ utils.log("DEBUG", msg, isDebugEnabled)
+ }
+ utils.log("DEBUG"," *** Exit postProcessRollback *** ", isDebugEnabled)
+ }
}