AT&T 1712 and 1802 release code
[so.git] / bpmn / MSOCommonBPMN / src / main / groovy / org / openecomp / mso / bpmn / common / scripts / DeleteAAIVfModule.groovy
index aaac86c..54e3da5 100644 (file)
@@ -1,6 +1,6 @@
 /*-\r
  * ============LICENSE_START=======================================================\r
- * OPENECOMP - MSO\r
+ * ONAP - SO\r
  * ================================================================================\r
  * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.\r
  * ================================================================================\r
@@ -19,7 +19,7 @@
  */\r
 \r
 package org.openecomp.mso.bpmn.common.scripts\r
-import org.camunda.bpm.engine.runtime.Execution\r
+import org.camunda.bpm.engine.delegate.DelegateExecution\r
 import org.openecomp.mso.bpmn.core.WorkflowException\r
 import org.openecomp.mso.rest.APIResponse\r
 import org.openecomp.mso.rest.RESTClient;\r
@@ -31,7 +31,7 @@ public class DeleteAAIVfModule extends AbstractServiceTaskProcessor{
        def Prefix="DAAIVfMod_"\r
        ExceptionUtil exceptionUtil = new ExceptionUtil()\r
     private MsoUtils utils = new MsoUtils()\r
-       public void initProcessVariables(Execution execution) {\r
+       public void initProcessVariables(DelegateExecution execution) {\r
                execution.setVariable("prefix",Prefix)\r
                execution.setVariable("DAAIVfMod_vnfId",null)\r
                execution.setVariable("DAAIVfMod_vnfName",null)\r
@@ -56,8 +56,8 @@ public class DeleteAAIVfModule extends AbstractServiceTaskProcessor{
        }\r
        \r
        // parse the incoming DELETE_VF_MODULE request and store the Generic Vnf\r
-       // and Vf Module Ids in the flow Execution\r
-       public void preProcessRequest(Execution execution) {\r
+       // and Vf Module Ids in the flow DelegateExecution\r
+       public void preProcessRequest(DelegateExecution execution) {\r
                def isDebugEnabled=execution.getVariable("isDebugLogEnabled")\r
                def xml = execution.getVariable("DeleteAAIVfModuleRequest")\r
                utils.logAudit("DeleteAAIVfModule Request: " + xml)\r
@@ -79,7 +79,7 @@ public class DeleteAAIVfModule extends AbstractServiceTaskProcessor{
        \r
        // send a GET request to AA&I to retrieve the Generic Vnf/Vf Module information based on a Vnf Id\r
        // expect a 200 response with the information in the response body or a 404 if the Generic Vnf does not exist\r
-       public void queryAAIForGenericVnf(Execution execution) {\r
+       public void queryAAIForGenericVnf(DelegateExecution execution) {\r
                def isDebugEnabled=execution.getVariable("isDebugLogEnabled")\r
                def delModuleId = execution.getVariable("DAAIVfMod_vfModuleId")\r
                def endPoint = execution.getVariable("URN_aai_endpoint") + execution.getVariable("DAAIVfMod_genericVnfEndpoint") + "?depth=1"\r
@@ -117,7 +117,7 @@ public class DeleteAAIVfModule extends AbstractServiceTaskProcessor{
        \r
        // construct and send a DELETE request to A&AI to delete a Generic Vnf\r
        // note: to get here, all the modules associated with the Generic Vnf must already be deleted\r
-       public void deleteGenericVnf(Execution execution) {\r
+       public void deleteGenericVnf(DelegateExecution execution) {\r
                def isDebugEnabled=execution.getVariable("isDebugLogEnabled")\r
                def aaiRequestId = utils.getRequestID()\r
                def endPoint = execution.getVariable("URN_aai_endpoint") + execution.getVariable("DAAIVfMod_genericVnfEndpoint") +\r
@@ -150,7 +150,7 @@ public class DeleteAAIVfModule extends AbstractServiceTaskProcessor{
        }\r
 \r
        // construct and send a DELETE request to A&AI to delete the Base or Add-on Vf Module\r
-       public void deleteVfModule(Execution execution) {\r
+       public void deleteVfModule(DelegateExecution execution) {\r
                def isDebugEnabled=execution.getVariable("isDebugLogEnabled")\r
                def endPoint = execution.getVariable("URN_aai_endpoint") + execution.getVariable("DAAIVfMod_vfModuleEndpoint") +\r
                        "/?resource-version=" + execution.getVariable("DAAIVfMod_vfModRsrcVer")\r
@@ -189,7 +189,7 @@ public class DeleteAAIVfModule extends AbstractServiceTaskProcessor{
        // parses the output from the result from queryAAIForGenericVnf() to determine if the Vf Module\r
        // to be deleted exists for the specified Generic Vnf and if it is the Base Module,\r
        // there are no Add-on Modules present\r
-       public void parseForVfModule(Execution execution) {\r
+       public void parseForVfModule(DelegateExecution execution) {\r
                def isDebugEnabled=execution.getVariable("isDebugLogEnabled")\r
                def xml = execution.getVariable("DAAIVfMod_queryGenericVnfResponse")\r
                utils.logAudit("DeleteAAIVfModule - queryGenericVnfResponse" + xml)\r
@@ -270,7 +270,7 @@ public class DeleteAAIVfModule extends AbstractServiceTaskProcessor{
        // parses the output from the result from queryAAIForGenericVnf() to determine if the Vf Module\r
        // to be deleted exists for the specified Generic Vnf and if it is the Base Module,\r
        // there are no Add-on Modules present\r
-       public void parseForResourceVersion(Execution execution) {\r
+       public void parseForResourceVersion(DelegateExecution execution) {\r
                def isDebugEnabled=execution.getVariable("isDebugLogEnabled")\r
                def xml = execution.getVariable("DAAIVfMod_queryGenericVnfResponse")\r
                utils.logAudit("DeleteAAIVfModule - queryGenericVnfResponse" + xml)\r
@@ -281,7 +281,7 @@ public class DeleteAAIVfModule extends AbstractServiceTaskProcessor{
        \r
        \r
        // generates a WorkflowException if the A&AI query returns a response code other than 200\r
-       public void handleAAIQueryFailure(Execution execution) {\r
+       public void handleAAIQueryFailure(DelegateExecution execution) {\r
                def isDebugEnabled=execution.getVariable("isDebugLogEnabled")\r
                \r
                utils.log("ERROR", "Error occurred attempting to query AAI, Response Code " +\r
@@ -300,7 +300,7 @@ public class DeleteAAIVfModule extends AbstractServiceTaskProcessor{
        //              - the A&AI Vf Module DELETE returns a response code other than 200\r
        //              - the Vf Module is a Base Module that is not the last Vf Module\r
        //              - the Vf Module does not exist for the Generic Vnf\r
-       public void handleDeleteVfModuleFailure(Execution execution) {\r
+       public void handleDeleteVfModuleFailure(DelegateExecution execution) {\r
                def isDebugEnabled=execution.getVariable("isDebugLogEnabled")\r
                \r
                def errorCode = 2000\r
@@ -341,7 +341,7 @@ public class DeleteAAIVfModule extends AbstractServiceTaskProcessor{
 \r
        // generates a WorkflowException if\r
        //              - the A&AI Generic Vnf DELETE returns a response code other than 200\r
-       public void handleDeleteGenericVnfFailure(Execution execution) {\r
+       public void handleDeleteGenericVnfFailure(DelegateExecution execution) {\r
                def isDebugEnabled=execution.getVariable("isDebugLogEnabled")\r
                utils.log("ERROR", "AAI error occurred deleting the Generic Vnf: "\r
                        + execution.getVariable("DAAIVfMod_deleteGenericVnfResponse"), isDebugEnabled)\r