Merge "Reorder modifiers"
[so.git] / bpmn / MSOCommonBPMN / src / main / groovy / org / openecomp / mso / bpmn / common / scripts / PrepareUpdateAAIVfModule.groovy
index f30692c..bbdaab1 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
@@ -21,7 +21,7 @@
 package org.openecomp.mso.bpmn.common.scripts\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.openecomp.mso.bpmn.core.WorkflowException\r
 import org.openecomp.mso.rest.APIResponse\r
 import org.openecomp.mso.rest.RESTClient\r
@@ -31,12 +31,13 @@ import org.springframework.web.util.UriUtils
 public class PrepareUpdateAAIVfModule extends VfModuleBase {\r
        \r
        ExceptionUtil exceptionUtil = new ExceptionUtil()\r
+       private MsoUtils utils = new MsoUtils()\r
        /**\r
         * Initialize the flow's variables.\r
         * \r
         * @param execution The flow's execution instance.\r
         */\r
-       public void initProcessVariables(Execution execution) {\r
+       public void initProcessVariables(DelegateExecution execution) {\r
                execution.setVariable('prefix', 'PUAAIVfMod_')\r
                execution.setVariable('PUAAIVfMod_vnfId', null)\r
                execution.setVariable('PUAAIVfMod_vfModuleId', null)\r
@@ -57,7 +58,7 @@ public class PrepareUpdateAAIVfModule extends VfModuleBase {
         * \r
         * @param execution The flow's execution instance.\r
         */\r
-       public void preProcessRequest(Execution execution) {\r
+       public void preProcessRequest(DelegateExecution execution) {\r
                def method = getClass().getSimpleName() + '.preProcessRequest(' +\r
                        'execution=' + execution.getId() +\r
                        ')'\r
@@ -95,7 +96,7 @@ public class PrepareUpdateAAIVfModule extends VfModuleBase {
         * \r
         * @param execution The flow's execution instance.\r
         */\r
-       public void getGenericVnf(Execution execution) {\r
+       public void getGenericVnf(DelegateExecution execution) {\r
                def method = getClass().getSimpleName() + '.getGenericVnf(' +\r
                        'execution=' + execution.getId() +\r
                        ')'\r
@@ -116,7 +117,7 @@ public class PrepareUpdateAAIVfModule extends VfModuleBase {
                        try {\r
                                RESTConfig config = new RESTConfig(endPoint);\r
                                def responseData = ''\r
-                               def aaiRequestId = UUID.randomUUID().toString()\r
+                               String aaiRequestId = utils.getRequestID()\r
                                RESTClient client = new RESTClient(config).\r
                                        addHeader('X-TransactionId', aaiRequestId).\r
                                        addHeader('X-FromAppId', 'MSO').\r
@@ -161,7 +162,7 @@ public class PrepareUpdateAAIVfModule extends VfModuleBase {
         * \r
         * @param execution The flow's execution instance.\r
         */\r
-       public void validateVfModule(Execution execution) {\r
+       public void validateVfModule(DelegateExecution execution) {\r
                def method = getClass().getSimpleName() + '.validateVfModule(' +\r
                        'execution=' + execution.getId() +\r
                        ')'\r
@@ -211,7 +212,7 @@ public class PrepareUpdateAAIVfModule extends VfModuleBase {
         * \r
         * @param execution The flow's execution instance.\r
         */\r
-       public void updateVfModule(Execution execution) {\r
+       public void updateVfModule(DelegateExecution execution) {\r
                def method = getClass().getSimpleName() + '.updateVfModule(' +\r
                        'execution=' + execution.getId() +\r
                        ')'\r
@@ -255,7 +256,7 @@ public class PrepareUpdateAAIVfModule extends VfModuleBase {
                        try {\r
                                RESTConfig config = new RESTConfig(endPoint);\r
                                def responseData = ''\r
-                               def aaiRequestId = UUID.randomUUID().toString()\r
+                def aaiRequestId = utils.getRequestID()\r
                                RESTClient client = new RESTClient(config).\r
                                        addHeader('X-TransactionId', aaiRequestId).\r
                                        addHeader('X-FromAppId', 'MSO').\r
@@ -308,7 +309,7 @@ public class PrepareUpdateAAIVfModule extends VfModuleBase {
         * \r
         * @param execution The flow's execution instance.\r
         */\r
-       public void handleVnfNotFound(Execution execution) {\r
+       public void handleVnfNotFound(DelegateExecution execution) {\r
                def method = getClass().getSimpleName() + '.handleVnfNotFound(' +\r
                        'execution=' + execution.getId() +\r
                        ')'\r
@@ -331,7 +332,7 @@ public class PrepareUpdateAAIVfModule extends VfModuleBase {
         * \r
         * @param execution The flow's execution instance.\r
         */\r
-       public void handleVfModuleValidationError(Execution execution) {\r
+       public void handleVfModuleValidationError(DelegateExecution execution) {\r
                def method = getClass().getSimpleName() + '.handleVfModuleValidationError(' +\r
                        'execution=' + execution.getId() +\r
                        ')'\r
@@ -354,7 +355,7 @@ public class PrepareUpdateAAIVfModule extends VfModuleBase {
         * \r
         * @param execution The flow's execution instance.\r
         */\r
-       public void handleUpdateVfModuleFailure(Execution execution) {\r
+       public void handleUpdateVfModuleFailure(DelegateExecution execution) {\r
                def method = getClass().getSimpleName() + '.handleUpdateVfModuleFailure(' +\r
                        'execution=' + execution.getId() +\r
                        ')'\r