AT&T 1712 and 1802 release code
[so.git] / bpmn / MSOInfrastructureBPMN / src / main / groovy / org / openecomp / mso / bpmn / infrastructure / scripts / CreateVFCNSResource.groovy
index 970a4f7..0279c2c 100644 (file)
@@ -32,7 +32,7 @@ import org.openecomp.mso.rest.APIResponse
 import java.util.UUID;\r
 \r
 import org.camunda.bpm.engine.delegate.BpmnError \r
-import org.camunda.bpm.engine.runtime.Execution\r
+import org.camunda.bpm.engine.delegate.DelegateExecution\r
 import org.apache.commons.lang3.*\r
 import org.apache.commons.codec.binary.Base64;\r
 import org.springframework.web.util.UriUtils \r
@@ -47,20 +47,21 @@ import org.openecomp.mso.rest.APIResponse;
 public class CreateVFCNSResource extends AbstractServiceTaskProcessor {\r
 \r
     String vfcUrl = "/vfc/rest/v1/vfcadapter"\r
-    \r
+            \r
     String host = "http://mso.mso.testlab.openecomp.org:8080"\r
     \r
     ExceptionUtil exceptionUtil = new ExceptionUtil()\r
 \r
     JsonUtils jsonUtil = new JsonUtils()\r
-    \r
-    /**CreateVFCNSResource\r
+\r
+    /**\r
+     * CreateVFCNSResource\r
      * Pre Process the BPMN Flow Request\r
      * Inclouds:\r
      * generate the nsOperationKey\r
      * generate the nsParameters\r
      */\r
-    public void preProcessRequest (Execution execution) {\r
+    public void preProcessRequest (DelegateExecution execution) {\r
           def isDebugEnabled=execution.getVariable("isDebugLogEnabled")\r
        String msg = ""\r
        utils.log("INFO", " *** preProcessRequest() *** ", isDebugEnabled)\r
@@ -117,7 +118,7 @@ public class CreateVFCNSResource extends AbstractServiceTaskProcessor {
     /**\r
      * create NS task\r
      */\r
-    public void createNetworkService(Execution execution) {\r
+    public void createNetworkService(DelegateExecution execution) {\r
         def isDebugEnabled=execution.getVariable("isDebugLogEnabled")\r
         utils.log("INFO"," *****  createNetworkService *****",  isDebugEnabled)\r
         String nsOperationKey = execution.getVariable("nsOperationKey");\r
@@ -144,8 +145,8 @@ public class CreateVFCNSResource extends AbstractServiceTaskProcessor {
     /**\r
      * instantiate NS task\r
      */\r
-    public void instantiateNetworkService(Execution execution) {\r
-        def isDebugEnabled=execution.getVariable("isDebugLogEnabled")\r
+    public void instantiateNetworkService(DelegateExecution execution) {\r
+        def isDebugEnabled= execution.getVariable("isDebugLogEnabled")\r
         utils.log("INFO"," *****  instantiateNetworkService *****",  isDebugEnabled)\r
         String nsOperationKey = execution.getVariable("nsOperationKey");\r
         String nsParameters = execution.getVariable("nsParameters");\r
@@ -173,7 +174,7 @@ public class CreateVFCNSResource extends AbstractServiceTaskProcessor {
     /**\r
      * query NS task\r
      */\r
-    public void queryNSProgress(Execution execution) {\r
+    public void queryNSProgress(DelegateExecution execution) {\r
         def isDebugEnabled=execution.getVariable("isDebugLogEnabled")\r
         utils.log("INFO"," *****  queryNSProgress *****",  isDebugEnabled)\r
         String jobId = execution.getVariable("jobId")\r
@@ -193,8 +194,8 @@ public class CreateVFCNSResource extends AbstractServiceTaskProcessor {
     /**\r
      * delay 5 sec \r
      */\r
-    public void timeDelay(Execution execution) {\r
-        def isDebugEnabled=execution.getVariable("isDebugLogEnabled")\r
+    public void timeDelay(DelegateExecution execution) {\r
+        def isDebugEnabled= execution.getVariable("isDebugLogEnabled")\r
         try {\r
             Thread.sleep(5000);\r
         } catch(InterruptedException e) {           \r
@@ -205,7 +206,7 @@ public class CreateVFCNSResource extends AbstractServiceTaskProcessor {
     /**\r
      * finish NS task\r
      */\r
-    public void addNSRelationship(Execution execution) {\r
+    public void addNSRelationship(DelegateExecution execution) {\r
         def isDebugEnabled=execution.getVariable("isDebugLogEnabled")\r
         utils.log("INFO"," ***** addNSRelationship *****",  isDebugEnabled)\r
         String nsInstanceId = execution.getVariable("nsInstanceId")\r
@@ -241,7 +242,7 @@ public class CreateVFCNSResource extends AbstractServiceTaskProcessor {
         utils.log("INFO"," *****Exit addNSRelationship *****",  isDebugEnabled)\r
     }\r
     \r
-    public APIResponse executeAAIPutCall(Execution execution, String url, String payload){\r
+    public APIResponse executeAAIPutCall(DelegateExecution execution, String url, String payload){\r
         def isDebugEnabled = execution.getVariable("isDebugLogEnabled")\r
         utils.log("INFO", " ======== Started Execute AAI Put Process ======== ",  isDebugEnabled) \r
         APIResponse apiResponse = null\r
@@ -265,13 +266,13 @@ public class CreateVFCNSResource extends AbstractServiceTaskProcessor {
         }\r
         return apiResponse\r
     }\r
-    \r
+\r
     /**\r
      * post request\r
      * url: the url of the request\r
      * requestBody: the body of the request\r
      */\r
-    private APIResponse postRequest(Execution execution, String url, String requestBody){\r
+    private APIResponse postRequest(DelegateExecution execution, String url, String requestBody){\r
         def isDebugEnabled = execution.getVariable("isDebugLogEnabled")\r
         utils.log("INFO"," ***** Started Execute VFC adapter Post Process *****",  isDebugEnabled)\r
         utils.log("INFO","url:"+url +"\nrequestBody:"+ requestBody,  isDebugEnabled)\r