[MSO-8] Second step of the rebase for MSO
[so.git] / bpmn / MSOInfrastructureBPMN / src / main / groovy / org / openecomp / mso / bpmn / infrastructure / scripts / DoCreateVnfAndModules.groovy
index e1fca3d..861da52 100644 (file)
-/*-
- * ============LICENSE_START=======================================================
- * OPENECOMP - MSO
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-package org.openecomp.mso.bpmn.infrastructure.scripts
-
-import java.util.UUID;
-
-import org.json.JSONObject;
-import org.json.JSONArray;
-
-import org.camunda.bpm.engine.delegate.BpmnError
-import org.camunda.bpm.engine.runtime.Execution;
-
-import static org.apache.commons.lang3.StringUtils.*;
-
-import org.openecomp.mso.bpmn.core.json.JsonUtils
-import org.openecomp.mso.bpmn.common.scripts.AbstractServiceTaskProcessor
-import org.openecomp.mso.bpmn.common.scripts.CatalogDbUtils
-import org.openecomp.mso.bpmn.common.scripts.ExceptionUtil
-import org.openecomp.mso.bpmn.common.scripts.VidUtils
-import org.openecomp.mso.bpmn.core.RollbackData
-import org.openecomp.mso.bpmn.core.WorkflowException
-
-
-
-/**
- * This class supports the macro VID Flow
- * with the creation of a generic vnf and related VF modules.
- */
-class DoCreateVnfAndModules extends AbstractServiceTaskProcessor {
-
-       String Prefix="DCVAM_"
-       ExceptionUtil exceptionUtil = new ExceptionUtil()
-       JsonUtils jsonUtil = new JsonUtils()
-       VidUtils vidUtils = new VidUtils(this)
-       CatalogDbUtils cutils = new CatalogDbUtils()
-
-       /**
-        * This method gets and validates the incoming
-        * request.
-        *
-        * @param - execution
-        */
-       public void preProcessRequest(Execution execution) {
-               def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
-               execution.setVariable("prefix",Prefix)
-               utils.log("DEBUG", " *** STARTED DoCreateVnfAndModules PreProcessRequest Process*** ", isDebugEnabled)
-
-               try{
-                       // Get Variables        
-                       
-                       
-                       String cloudConfiguration = execution.getVariable("cloudConfiguration")
-                       String vnfModelInfo = execution.getVariable("vnfModelInfo")
-                       
-                       String requestId = execution.getVariable("requestId")
-                       execution.setVariable("mso-request-id", requestId)
-                       utils.log("DEBUG", "Incoming Request Id is: " + requestId, isDebugEnabled)
-
-                       String serviceInstanceId = execution.getVariable("serviceInstanceId")                   
-                       utils.log("DEBUG", "Incoming Service Instance Id is: " + serviceInstanceId, isDebugEnabled)
-
-                       String vnfType = execution.getVariable("vnfType")                       
-                       utils.log("DEBUG", "Incoming Vnf Type is: " + vnfType, isDebugEnabled)
-
-                       String vnfName = execution.getVariable("vnfName")
-                       execution.setVariable("CREVI_vnfName", vnfName)
-                       utils.log("DEBUG", "Incoming Vnf Name is: " + vnfName, isDebugEnabled)
-
-                       String productFamilyId = execution.getVariable("productFamilyId")                       
-                       utils.log("DEBUG", "Incoming Product Family Id is: " + productFamilyId, isDebugEnabled)
-
-                       String source = "VID"
-                       execution.setVariable("source", source)
-                       utils.log("DEBUG", "Incoming Source is: " + source, isDebugEnabled)
-
-                       String disableRollback = execution.getVariable("disableRollback")                       
-                       utils.log("DEBUG", "Incoming Disable Rollback is: " + disableRollback, isDebugEnabled)
-                       
-                       String asdcServiceModelVersion = execution.getVariable("asdcServiceModelVersion")
-                       utils.log("DEBUG", "Incoming asdcServiceModelVersion: " + asdcServiceModelVersion, isDebugEnabled)
-
-                       String vnfId = execution.getVariable("testVnfId") // for junits
-                       if(isBlank(vnfId)){
-                               vnfId = execution.getVariable("vnfId")
-                               if (isBlank(vnfId)) {
-                                       vnfId = UUID.randomUUID().toString()
-                                       utils.log("DEBUG", "Generated Vnf Id is: " + vnfId, isDebugEnabled)
-                               }
-                       }
-                       execution.setVariable("vnfId", vnfId)                   
-                       
-               }catch(BpmnError b){
-                       utils.log("DEBUG", "Rethrowing MSOWorkflowException", isDebugEnabled)
-                       throw b
-               }catch(Exception e){
-                       utils.log("DEBUG", " Error Occured in DoCreateVnfAndModules PreProcessRequest method!" + e.getMessage(), isDebugEnabled)
-                       exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "Internal Error - Occured in DoCreateVnf PreProcessRequest")
-
-               }
-               utils.log("DEBUG", "*** COMPLETED DoCreateVnfAndModules PreProcessRequest Process ***", isDebugEnabled)
-       }       
-
-       
-       public void queryCatalogDB (Execution execution) {
-               def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
-               execution.setVariable("prefix",Prefix)
-
-               utils.log("DEBUG", " *** STARTED DoCreateVnfAndModules QueryCatalogDB Process *** ", isDebugEnabled)
-               try {
-                       //Get Vnf Info
-                       String vnfModelInfo = execution.getVariable("vnfModelInfo")
-                       String vnfModelCustomizationUuid = jsonUtil.getJsonValueForKey(vnfModelInfo, "modelCustomizationId")
-                       utils.log("DEBUG", "querying Catalog DB by vnfModelCustomizationUuid: " + vnfModelCustomizationUuid)
-                       String catalogDbEndpoint = execution.getVariable("URN_mso_catalog_db_endpoint")
-                       
-                       JSONArray vnfs = cutils.getAllVnfsByVnfModelCustomizationUuid(catalogDbEndpoint, 
-                                                       vnfModelCustomizationUuid)
-                       utils.log("DEBUG", "obtained VNF list")
-                       // Only one match here
-                       JSONObject vnf = vnfs[0]
-                       JSONArray vfModules = vnf.getJSONArray("vfModules")
-                       JSONArray addOnModules = new JSONArray()
-                       
-                       // Set up base Vf Module info
-                       for (int i = 0; i < vfModules.length(); i++) {
-                               utils.log("DEBUG", "handling VF Module ")
-                               JSONObject vfModule = vfModules[i]
-                               String isBase = jsonUtil.getJsonValueForKey(vfModule, "isBase")
-                               if (isBase.equals("true")) {
-                                       JSONObject baseVfModuleModelInfoObject = vfModule.getJSONObject("modelInfo")
-                                       String baseVfModuleModelInfo = baseVfModuleModelInfoObject.toString()
-                                       execution.setVariable("baseVfModuleModelInfo", baseVfModuleModelInfo)
-                                       String baseVfModuleLabel = jsonUtil.getJsonValueForKey(vfModule, "vfModuleLabel")
-                                       execution.setVariable("baseVfModuleLabel", baseVfModuleLabel)
-                                       String basePersonaModelId = jsonUtil.getJsonValueForKey(baseVfModuleModelInfoObject, "modelInvariantId")
-                                       execution.setVariable("basePersonaModelId", basePersonaModelId)                                 
-                               }
-                               else {
-                                       addOnModules.add(vfModules[i])
-                               }                       
-                       }
-                       
-                       execution.setVariable("addOnModules", addOnModules)
-                       execution.setVariable("addOnModulesToDeploy", addOnModules.length())
-                       execution.setVariable("addOnModulesDeployed", 0)                        
-                       
-               }catch(Exception ex) {
-                       utils.log("DEBUG", "Error Occured in DoCreateVnfAndModules QueryCatalogDB Process " + ex.getMessage(), isDebugEnabled)
-                       exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "Internal Error - Occured in DoCreateVnfAndModules QueryCatalogDB Process")
-               }
-               
-               // Generate vfModuleId for base VF Module
-               def baseVfModuleId = UUID.randomUUID().toString()
-               execution.setVariable("baseVfModuleId", baseVfModuleId)
-               utils.log("DEBUG", "*** COMPLETED CreateVnfInfra PrepareCreateGenericVnf Process ***", isDebugEnabled)
-       }
-       
-       public void preProcessAddOnModule(Execution execution){
-               def isDebugLogEnabled = execution.getVariable("isDebugLogEnabled")
-               execution.setVariable("prefix", Prefix)
-               logDebug(" ======== STARTED preProcessAddOnModule ======== ", isDebugLogEnabled)
-               
-               try {                   
-                       JSONArray addOnModules = (JSONArray) execution.getVariable("addOnModules")
-                       int addOnIndex = (int) execution.getVariable("addOnModulesDeployed")
-                       
-                       JSONObject addOnModule = addOnModules[addOnIndex]
-                       
-                       def newVfModuleId = UUID.randomUUID().toString()
-                       execution.setVariable("addOnVfModuleId", newVfModuleId)
-                       
-                       execution.setVariable("instancesOfThisModelDeployed", 0)
-                       
-                       JSONObject addOnVfModuleModelInfoObject = jsonUtil.getJsonValueForKey(addOnModule, "modelInfo")
-                       String addOnVfModuleModelInfo = addOnVfModuleModelInfoObject.toString()
-                       execution.setVariable("addOnVfModuleModelInfo", addOnVfModuleModelInfo)
-                       String addOnVfModuleLabel = jsonUtil.getJsonValueForKey(addOnModule, "vfModuleLabel")
-                       execution.setVariable("addOnVfModuleLabel", addOnVfModuleLabel)
-                       String addOnPersonaModelId = jsonUtil.getJsonValueForKey(addOnVfModuleModelInfoObject, "modelInvariantId")
-                       execution.setVariable("addOnPersonaModelId", addOnPersonaModelId)
-                       String addOnInitialCount = jsonUtil.getJsonValueForKey(addOnModule, "initialCount")
-                       execution.setVariable("initialCount", addOnInitialCount)
-                                       
-               
-               }catch(Exception e){
-                       utils.log("ERROR", "Exception Occured Processing preProcessAddOnModule. Exception is:\n" + e, isDebugLogEnabled)
-                       exceptionUtil.buildAndThrowWorkflowException(execution, 1002, "Error Occurred during preProcessAddOnModule Method:\n" + e.getMessage())
-               }
-               logDebug("======== COMPLETED preProcessSDNCAssignRequest ======== ", isDebugLogEnabled)
-       }
-       
-       public void validateAddOnModule(Execution execution){
-               def isDebugLogEnabled = execution.getVariable("isDebugLogEnabled")
-               execution.setVariable("prefix", Prefix)
-               logDebug(" ======== STARTED validateAddOnModule ======== ", isDebugLogEnabled)
-               
-               try {
-                       int instancesOfThisModuleDeployed = execution.getVariable("instancesOfThisModuleDeployed")
-                       execution.setVariable("instancesOfThisModuleDeployed", instancesOfThisModuleDeployed + 1)
-               }catch(Exception e){
-                       utils.log("ERROR", "Exception Occured Processing preProcessAddOnModule. Exception is:\n" + e, isDebugLogEnabled)
-                       exceptionUtil.buildAndThrowWorkflowException(execution, 1002, "Error Occurred during preProcessAddOnModule Method:\n" + e.getMessage())
-               }
-               logDebug("======== COMPLETED preProcessSDNCAssignRequest ======== ", isDebugLogEnabled)
-       }
-       
-       public void finishProcessingInitialCountDeployment(Execution execution){
-               def isDebugLogEnabled = execution.getVariable("isDebugLogEnabled")
-               execution.setVariable("prefix", Prefix)
-               logDebug(" ======== STARTED finishProcessingInitialCountDeployment ======== ", isDebugLogEnabled)
-               
-               try {
-                       int addOnModulesDeployed = execution.getVariable("addOnModulesDeployed")
-                       execution.setVariable("addOnModulesDeployed", addOnModulesDeployed + 1)                 
-               }catch(Exception e){
-                       utils.log("ERROR", "Exception Occured Processing preProcessAddOnModule. Exception is:\n" + e, isDebugLogEnabled)
-                       exceptionUtil.buildAndThrowWorkflowException(execution, 1002, "Error Occurred during preProcessAddOnModule Method:\n" + e.getMessage())
-               }
-               logDebug("======== COMPLETED preProcessSDNCAssignRequest ======== ", isDebugLogEnabled)
-       }
-       
-       
-       
-}
+/*-\r
+ * ============LICENSE_START=======================================================\r
+ * OPENECOMP - MSO\r
+ * ================================================================================\r
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.\r
+ * ================================================================================\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ * \r
+ *      http://www.apache.org/licenses/LICENSE-2.0\r
+ * \r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ * ============LICENSE_END=========================================================\r
+ */\r
+package org.openecomp.mso.bpmn.infrastructure.scripts\r
+\r
+import java.util.UUID;\r
+\r
+import org.json.JSONObject;\r
+import org.json.JSONArray;\r
+\r
+import org.camunda.bpm.engine.delegate.BpmnError\r
+import org.camunda.bpm.engine.runtime.Execution;\r
+\r
+import static org.apache.commons.lang3.StringUtils.*;\r
+\r
+import org.openecomp.mso.bpmn.core.json.JsonUtils\r
+import org.openecomp.mso.bpmn.common.scripts.AbstractServiceTaskProcessor\r
+import org.openecomp.mso.bpmn.common.scripts.CatalogDbUtils\r
+import org.openecomp.mso.bpmn.common.scripts.ExceptionUtil\r
+import org.openecomp.mso.bpmn.common.scripts.VidUtils\r
+import org.openecomp.mso.bpmn.core.RollbackData\r
+import org.openecomp.mso.bpmn.core.WorkflowException\r
+\r
+\r
+\r
+/**\r
+* This class supports the macro VID Flow\r
+* with the creation of a generic vnf and related VF modules.\r
+*/\r
+class DoCreateVnfAndModules extends AbstractServiceTaskProcessor {\r
+\r
+   String Prefix="DCVAM_"\r
+   ExceptionUtil exceptionUtil = new ExceptionUtil()\r
+   JsonUtils jsonUtil = new JsonUtils()\r
+   VidUtils vidUtils = new VidUtils(this)\r
+   CatalogDbUtils cutils = new CatalogDbUtils()\r
+\r
+   /**\r
+       * This method gets and validates the incoming\r
+       * request.\r
+       *\r
+       * @param - execution\r
+       */\r
+   public void preProcessRequest(Execution execution) {\r
+          def isDebugEnabled = execution.getVariable("isDebugLogEnabled")\r
+          execution.setVariable("prefix",Prefix)\r
+          utils.log("DEBUG", " *** STARTED DoCreateVnfAndModules PreProcessRequest Process*** ", isDebugEnabled)\r
+\r
+          try{\r
+                  // Get Variables\r
+                  \r
+                  \r
+                  String cloudConfiguration = execution.getVariable("cloudConfiguration")\r
+                  String vnfModelInfo = execution.getVariable("vnfModelInfo")\r
+                  \r
+                  String requestId = execution.getVariable("requestId")\r
+                       execution.setVariable("mso-request-id", requestId)\r
+                  utils.log("DEBUG", "Incoming Request Id is: " + requestId, isDebugEnabled)\r
+\r
+                  String serviceInstanceId = execution.getVariable("serviceInstanceId")\r
+                  utils.log("DEBUG", "Incoming Service Instance Id is: " + serviceInstanceId, isDebugEnabled)\r
+\r
+                  String vnfType = execution.getVariable("vnfType")\r
+                  utils.log("DEBUG", "Incoming Vnf Type is: " + vnfType, isDebugEnabled)\r
+\r
+                  String vnfName = execution.getVariable("vnfName")\r
+                  execution.setVariable("CREVI_vnfName", vnfName)\r
+                  utils.log("DEBUG", "Incoming Vnf Name is: " + vnfName, isDebugEnabled)\r
+\r
+                  String productFamilyId = execution.getVariable("productFamilyId")\r
+                  utils.log("DEBUG", "Incoming Product Family Id is: " + productFamilyId, isDebugEnabled)\r
+\r
+                  String source = "VID"\r
+                  execution.setVariable("source", source)\r
+                  utils.log("DEBUG", "Incoming Source is: " + source, isDebugEnabled)\r
+\r
+                  String disableRollback = execution.getVariable("disableRollback")\r
+                  utils.log("DEBUG", "Incoming Disable Rollback is: " + disableRollback, isDebugEnabled)\r
+                  \r
+                  String asdcServiceModelVersion = execution.getVariable("asdcServiceModelVersion")\r
+                  utils.log("DEBUG", "Incoming asdcServiceModelVersion: " + asdcServiceModelVersion, isDebugEnabled)\r
+\r
+                  String vnfId = execution.getVariable("testVnfId") // for junits\r
+                  if(isBlank(vnfId)){\r
+                          vnfId = execution.getVariable("vnfId")\r
+                          if (isBlank(vnfId)) {\r
+                                  vnfId = UUID.randomUUID().toString()\r
+                                  utils.log("DEBUG", "Generated Vnf Id is: " + vnfId, isDebugEnabled)\r
+                          }\r
+                  }\r
+                  execution.setVariable("vnfId", vnfId)\r
+                  \r
+                  def rollbackData = execution.getVariable("RollbackData")\r
+                  if (rollbackData == null) {\r
+                          rollbackData = new RollbackData()\r
+                  }\r
+                  \r
+                  execution.setVariable("numOfCreatedAddOnModules", 0)\r
+                  \r
+                  rollbackData.put("VNFANDMODULES", "numOfCreatedAddOnModules", 0)\r
+                  execution.setVariable("RollbackData", rollbackData)\r
+                  \r
+          }catch(BpmnError b){\r
+                  utils.log("DEBUG", "Rethrowing MSOWorkflowException", isDebugEnabled)\r
+                  throw b\r
+          }catch(Exception e){\r
+                  utils.log("DEBUG", " Error Occured in DoCreateVnfAndModules PreProcessRequest method!" + e.getMessage(), isDebugEnabled)\r
+                  exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "Internal Error - Occured in DoCreateVnf PreProcessRequest")\r
+\r
+          }\r
+          utils.log("DEBUG", "*** COMPLETED DoCreateVnfAndModules PreProcessRequest Process ***", isDebugEnabled)\r
+   }\r
+\r
+   \r
+   public void queryCatalogDB (Execution execution) {\r
+          def isDebugEnabled=execution.getVariable("isDebugLogEnabled")\r
+          execution.setVariable("prefix",Prefix)\r
+\r
+          utils.log("DEBUG", " *** STARTED DoCreateVnfAndModules QueryCatalogDB Process *** ", isDebugEnabled)\r
+          try {\r
+                  //Get Vnf Info\r
+                  String vnfModelInfo = execution.getVariable("vnfModelInfo")\r
+                  String vnfModelCustomizationUuid = jsonUtil.getJsonValueForKey(vnfModelInfo, "modelCustomizationId")\r
+                  utils.log("DEBUG", "querying Catalog DB by vnfModelCustomizationUuid: " + vnfModelCustomizationUuid)\r
+                  String catalogDbEndpoint = execution.getVariable("URN_mso_catalog_db_endpoint")\r
+                  \r
+                  JSONArray vnfs = cutils.getAllVnfsByVnfModelCustomizationUuid(catalogDbEndpoint,\r
+                                                  vnfModelCustomizationUuid)\r
+                  utils.log("DEBUG", "obtained VNF list")\r
+                  // Only one match here\r
+                  JSONObject vnf = vnfs[0]\r
+                  JSONArray vfModules = vnf.getJSONArray("vfModules")\r
+                  JSONArray addOnModules = new JSONArray()\r
+                  \r
+                  // Set up base Vf Module info\r
+                  for (int i = 0; i < vfModules.length(); i++) {\r
+                          utils.log("DEBUG", "handling VF Module ")\r
+                          JSONObject vfModule = vfModules[i]\r
+                          String isBase = jsonUtil.getJsonValueForKey(vfModule, "isBase")\r
+                          if (isBase.equals("true")) {\r
+                                  JSONObject baseVfModuleModelInfoObject = vfModule.getJSONObject("modelInfo")\r
+                                  String baseVfModuleModelInfo = baseVfModuleModelInfoObject.toString()\r
+                                  execution.setVariable("baseVfModuleModelInfo", baseVfModuleModelInfo)\r
+                                  String baseVfModuleLabel = jsonUtil.getJsonValueForKey(vfModule, "vfModuleLabel")\r
+                                  execution.setVariable("baseVfModuleLabel", baseVfModuleLabel)\r
+                                  String basePersonaModelId = jsonUtil.getJsonValueForKey(baseVfModuleModelInfoObject, "modelInvariantId")\r
+                                  execution.setVariable("basePersonaModelId", basePersonaModelId)\r
+                          }\r
+                          else {\r
+                                  addOnModules.add(vfModules[i])\r
+                          }\r
+                  }\r
+                  \r
+                  execution.setVariable("addOnModules", addOnModules)\r
+                  execution.setVariable("addOnModulesToDeploy", addOnModules.length())\r
+                  execution.setVariable("addOnModulesDeployed", 0)\r
+                  \r
+          }catch(Exception ex) {\r
+                  utils.log("DEBUG", "Error Occured in DoCreateVnfAndModules QueryCatalogDB Process " + ex.getMessage(), isDebugEnabled)\r
+                  exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "Internal Error - Occured in DoCreateVnfAndModules QueryCatalogDB Process")\r
+          }\r
+          \r
+          // Generate vfModuleId for base VF Module\r
+          def baseVfModuleId = UUID.randomUUID().toString()\r
+          execution.setVariable("baseVfModuleId", baseVfModuleId)\r
+          utils.log("DEBUG", "*** COMPLETED CreateVnfInfra PrepareCreateGenericVnf Process ***", isDebugEnabled)\r
+   }\r
+   \r
+   public void preProcessAddOnModule(Execution execution){\r
+          def isDebugLogEnabled = execution.getVariable("isDebugLogEnabled")\r
+          execution.setVariable("prefix", Prefix)\r
+          logDebug(" ======== STARTED preProcessAddOnModule ======== ", isDebugLogEnabled)\r
+          \r
+          try {\r
+                  JSONArray addOnModules = (JSONArray) execution.getVariable("addOnModules")\r
+                  int addOnIndex = (int) execution.getVariable("addOnModulesDeployed")\r
+                  \r
+                  JSONObject addOnModule = addOnModules[addOnIndex]\r
+                  \r
+                  def newVfModuleId = UUID.randomUUID().toString()\r
+                  execution.setVariable("addOnVfModuleId", newVfModuleId)\r
+                  \r
+                  execution.setVariable("instancesOfThisModelDeployed", 0)\r
+                  \r
+                  JSONObject addOnVfModuleModelInfoObject = jsonUtil.getJsonValueForKey(addOnModule, "modelInfo")\r
+                  String addOnVfModuleModelInfo = addOnVfModuleModelInfoObject.toString()\r
+                  execution.setVariable("addOnVfModuleModelInfo", addOnVfModuleModelInfo)\r
+                  String addOnVfModuleLabel = jsonUtil.getJsonValueForKey(addOnModule, "vfModuleLabel")\r
+                  execution.setVariable("addOnVfModuleLabel", addOnVfModuleLabel)\r
+                  String addOnPersonaModelId = jsonUtil.getJsonValueForKey(addOnVfModuleModelInfoObject, "modelInvariantId")\r
+                  execution.setVariable("addOnPersonaModelId", addOnPersonaModelId)\r
+                  String addOnInitialCount = jsonUtil.getJsonValueForKey(addOnModule, "initialCount")\r
+                  execution.setVariable("initialCount", addOnInitialCount)\r
+                                  \r
+          \r
+          }catch(Exception e){\r
+                  utils.log("ERROR", "Exception Occured Processing preProcessAddOnModule. Exception is:\n" + e, isDebugLogEnabled)\r
+                  exceptionUtil.buildAndThrowWorkflowException(execution, 1002, "Error Occurred during preProcessAddOnModule Method:\n" + e.getMessage())\r
+          }\r
+          logDebug("======== COMPLETED preProcessSDNCAssignRequest ======== ", isDebugLogEnabled)\r
+   }\r
+   \r
+   public void validateBaseModule(Execution execution){\r
+          def isDebugLogEnabled = execution.getVariable("isDebugLogEnabled")\r
+          execution.setVariable("prefix", Prefix)\r
+          logDebug(" ======== STARTED validateBaseModule ======== ", isDebugLogEnabled)\r
+          \r
+          try {\r
+                  def baseRollbackData = execution.getVariable("DCVAM_baseRollbackData")\r
+                  def rollbackData = execution.getVariable("RollbackData")\r
+                  \r
+                  def baseModuleMap = baseRollbackData.get("VFMODULE")\r
+                  baseModuleMap.each{ k, v -> rollbackData.put("VFMODULE_BASE", "${k}","${v}") }\r
+                  execution.setVariable("RollbackData", rollbackData)\r
+                  \r
+          }catch(Exception e){\r
+                  utils.log("ERROR", "Exception Occured Processing validateBaseModule. Exception is:\n" + e, isDebugLogEnabled)\r
+                  exceptionUtil.buildAndThrowWorkflowException(execution, 1002, "Error Occurred during validateBaseModule Method:\n" + e.getMessage())\r
+          }\r
+          logDebug("======== COMPLETED validateBaseModule ======== ", isDebugLogEnabled)\r
+   }\r
+   \r
+   public void validateAddOnModule(Execution execution){\r
+          def isDebugLogEnabled = execution.getVariable("isDebugLogEnabled")\r
+          execution.setVariable("prefix", Prefix)\r
+          logDebug(" ======== STARTED validateAddOnModule ======== ", isDebugLogEnabled)\r
+          \r
+          try {\r
+                  int instancesOfThisModuleDeployed = execution.getVariable("instancesOfThisModuleDeployed")\r
+                  int numOfCreatedAddOnModules = execution.getVariable("numOfCreatedAddOnModules")\r
+                  def addOnRollbackData = execution.getVariable("DCVAM_addOnRollbackData")\r
+                  def rollbackData = execution.getVariable("RollbackData")\r
+                  \r
+                  def addOnModuleMap = addOnRollbackData.get("VFMODULE")\r
+                  numOfCreatedAddOnModules = numOfCreatedAddOnModules + 1\r
+                  addOnModuleMap.each{ k, v -> rollbackData.put("VFMODULE_ADDON_" + numOfCreatedAddOnModules, "${k}","${v}") }\r
+                  \r
+                  execution.setVariable("DCVAM_addOnRollbackData", null)\r
+                  \r
+                  execution.setVariable("instancesOfThisModuleDeployed", instancesOfThisModuleDeployed + 1)\r
+                  \r
+                  execution.setVariable("numOfCreatedAddOnModules", numOfCreatedAddOnModules)\r
+                  rollbackData.put("VNFANDMODULES", "numOfCreatedAddOnModules", numOfCreatedAddOnModules)\r
+                  execution.setVariable("RollbackData", rollbackData)\r
+          }catch(Exception e){\r
+                  utils.log("ERROR", "Exception Occured Processing preProcessAddOnModule. Exception is:\n" + e, isDebugLogEnabled)\r
+                  exceptionUtil.buildAndThrowWorkflowException(execution, 1002, "Error Occurred during preProcessAddOnModule Method:\n" + e.getMessage())\r
+          }\r
+          logDebug("======== COMPLETED preProcessSDNCAssignRequest ======== ", isDebugLogEnabled)\r
+   }\r
+   \r
+   public void finishProcessingInitialCountDeployment(Execution execution){\r
+          def isDebugLogEnabled = execution.getVariable("isDebugLogEnabled")\r
+          execution.setVariable("prefix", Prefix)\r
+          logDebug(" ======== STARTED finishProcessingInitialCountDeployment ======== ", isDebugLogEnabled)\r
+          \r
+          try {\r
+                  int addOnModulesDeployed = execution.getVariable("addOnModulesDeployed")\r
+                  execution.setVariable("addOnModulesDeployed", addOnModulesDeployed + 1)\r
+          }catch(Exception e){\r
+                  utils.log("ERROR", "Exception Occured Processing preProcessAddOnModule. Exception is:\n" + e, isDebugLogEnabled)\r
+                  exceptionUtil.buildAndThrowWorkflowException(execution, 1002, "Error Occurred during preProcessAddOnModule Method:\n" + e.getMessage())\r
+          }\r
+          logDebug("======== COMPLETED preProcessSDNCAssignRequest ======== ", isDebugLogEnabled)\r
+   }\r
+   \r
+   \r
+   \r
+}\r