Merge "return this expression instead of assigning it to the temporary variable"
[vid.git] / vid-app-common / src / main / webapp / app / vid / scripts / services / change-management.service.js
index 45aedd1..6b45a74 100644 (file)
                 });
         };
 
-        this.getSOWorkflows = function (vnfNames) {
-            return $http.get(COMPONENT.GET_SO_WORKFLOWS, {params: {vnfName: vnfNames}})
+        this.getSOWorkflows = function (vnfIDs) {
+            return $http.get(COMPONENT.GET_SO_WORKFLOWS, {params: {vnfModelId: vnfIDs}})
             .success(function (response) {
                 return {data: response};
-            }).catch(function () {
+            }).catch(function (ex) {
+                console.error("Problem when getting workflows from SO API occurred.", ex.stack);
                 return {data: []};
             });
         };
                 });
 
             return deferred.promise;
-        };
-               
+        };             
                this.postChangeManagementNow = function (requestData, vnfName) {
                        var url = COMPONENT.CHANGE_MANAGEMENT_OPERATION_NO_SCHEDULER.replace('@vnfName', vnfName);
             return $http.post(url, requestData)
                     return {data: []};
                 });
         };
+
+        this.postWorkflowsParametersNow = function (serviceInstanceId,vnfInstanceId,workflow_UUID,requestData) {
+            let baseUrl = "workflows-management/{serviceInstanceId}/{vnfInstanceId}/{workflow_UUID}";
+            let url = baseUrl.
+                replace("{serviceInstanceId}",serviceInstanceId).
+                replace("{vnfInstanceId}",vnfInstanceId).
+                replace("{workflow_UUID}",workflow_UUID);
+
+            return $http.post(url, requestData)
+                .success(function (response) {
+                    return {data: response};
+                })
+                .catch(function (err) {
+                    return {data: []};
+                });
+        };
+
     }
 })();