AT&T 1712 and 1802 release code
[so.git] / bpmn / MSOCommonBPMN / src / main / groovy / org / openecomp / mso / bpmn / common / scripts / CreateAAIVfModule.groovy
index 5c72c33..41036e7 100644 (file)
@@ -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.RollbackData\r
 import org.openecomp.mso.bpmn.core.WorkflowException\r
 import org.openecomp.mso.rest.APIResponse\r
@@ -30,7 +30,7 @@ public class CreateAAIVfModule extends AbstractServiceTaskProcessor{
        \r
        def Prefix="CAAIVfMod_"\r
        ExceptionUtil exceptionUtil = new ExceptionUtil()\r
-       public void initProcessVariables(Execution execution) {\r
+       public void initProcessVariables(DelegateExecution execution) {\r
                execution.setVariable("prefix",Prefix)\r
                execution.setVariable("CAAIVfMod_vnfId",null)\r
                execution.setVariable("CAAIVfMod_vnfName",null)\r
@@ -73,8 +73,8 @@ public class CreateAAIVfModule extends AbstractServiceTaskProcessor{
        }       \r
        \r
        // parse the incoming CREATE_VF_MODULE request and store the Generic VNF\r
-       // and VF Module data in the flow Execution\r
-       public void preProcessRequest(Execution execution) {\r
+       // and VF Module data in the flow DelegateExecution\r
+       public void preProcessRequest(DelegateExecution execution) {\r
                def isDebugEnabled=execution.getVariable("isDebugLogEnabled")\r
                initProcessVariables(execution)\r
 \r
@@ -180,7 +180,7 @@ public class CreateAAIVfModule extends AbstractServiceTaskProcessor{
        \r
        // send a GET request to AA&I to retrieve the Generic VNF/VF Module information based on a Vnf Name\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 endPoint = execution.getVariable("URN_aai_endpoint") + execution.getVariable("CAAIVfMod_genericVnfGetEndpoint")\r
 \r
@@ -209,7 +209,7 @@ public class CreateAAIVfModule extends AbstractServiceTaskProcessor{
        \r
        // process the result from queryAAIForGenericVnf()\r
        // note: this method is primarily for logging as the actual decision logic is embedded in the bpmn flow \r
-       public void processAAIGenericVnfQuery(Execution execution) {\r
+       public void processAAIGenericVnfQuery(DelegateExecution execution) {\r
                def isDebugEnabled=execution.getVariable("isDebugLogEnabled")\r
                def result = execution.getVariable("CAAIVfMod_queryGenericVnfResponse")\r
                \r
@@ -236,7 +236,7 @@ public class CreateAAIVfModule extends AbstractServiceTaskProcessor{
 \r
        // construct and send a PUT request to A&AI to create a new Generic VNF\r
        // note: to get here, the vnf-id in the original CREATE_VF_MODULE request was absent or ""\r
-       public void createGenericVnf(Execution execution) {\r
+       public void createGenericVnf(DelegateExecution execution) {\r
                def isDebugEnabled=execution.getVariable("isDebugLogEnabled")\r
                // TBD - is this how we want to generate the Id for the new Generic VNF?\r
                def newVnfId = UUID.randomUUID().toString()\r
@@ -287,7 +287,7 @@ public class CreateAAIVfModule extends AbstractServiceTaskProcessor{
        }\r
 \r
        // construct and send a PUT request to A&AI to create a Base or Add-on VF Module\r
-       public void createVfModule(Execution execution, Boolean isBaseModule) {\r
+       public void createVfModule(DelegateExecution execution, Boolean isBaseModule) {\r
                def isDebugEnabled=execution.getVariable("isDebugLogEnabled")\r
                // TBD - is this how we want to generate the Id for the new (Base) VF Module?\r
                \r
@@ -402,7 +402,7 @@ public class CreateAAIVfModule extends AbstractServiceTaskProcessor{
        // parses the output from the result from queryAAIForGenericVnf() to determine if the vf-module-name\r
        // requested for an Add-on VF Module does not already exist for the specified Generic VNF\r
        // also retrieves VNF name from AAI response for existing VNF\r
-       public void parseForAddOnModule(Execution execution) {\r
+       public void parseForAddOnModule(DelegateExecution execution) {\r
                def isDebugEnabled=execution.getVariable("isDebugLogEnabled")\r
                def xml = execution.getVariable("CAAIVfMod_queryGenericVnfResponse")\r
                def vnfNameFromAAI = utils.getNodeText1(xml, "vnf-name")\r
@@ -439,7 +439,7 @@ public class CreateAAIVfModule extends AbstractServiceTaskProcessor{
        // parses the output from the result from queryAAIForGenericVnf() to determine if the vf-module-name\r
        // requested for an Add-on VF Module does not already exist for the specified Generic VNF; \r
        // also retrieves VNF name from AAI response for existing VNF\r
-       public void parseForBaseModule(Execution execution) {\r
+       public void parseForBaseModule(DelegateExecution execution) {\r
                def isDebugEnabled=execution.getVariable("isDebugLogEnabled")\r
                def xml = execution.getVariable("CAAIVfMod_queryGenericVnfResponse")\r
                def vnfNameFromAAI = utils.getNodeText1(xml, "vnf-name")\r
@@ -491,7 +491,7 @@ public class CreateAAIVfModule extends AbstractServiceTaskProcessor{
        }\r
        \r
        // generates a WorkflowException when the A&AI query returns a response code other than 200 or 404\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
@@ -508,7 +508,7 @@ public class CreateAAIVfModule extends AbstractServiceTaskProcessor{
        //              - the requested Generic VNF does not exist but vnf-id != null\r
        //              - the A&AI VF Module PUT returns a response code other than 200 or 201\r
        //              - the requested VF Module already exists for the Generic VNF\r
-       public void handleCreateVfModuleFailure(Execution execution) {\r
+       public void handleCreateVfModuleFailure(DelegateExecution execution) {\r
                def isDebugEnabled=execution.getVariable("isDebugLogEnabled")\r
                \r
                def errorCode\r
@@ -563,7 +563,7 @@ public class CreateAAIVfModule extends AbstractServiceTaskProcessor{
         *      main CreateVfModule flow.\r
         * @param execution the execution\r
         */\r
-       public void rollback(Execution execution) {\r
+       public void rollback(DelegateExecution execution) {\r
                def method = getClass().getSimpleName() + ".rollback(" +\r
                        "execution=" + execution.getId() +\r
                        ")"\r