aboutsummaryrefslogtreecommitdiffstats
path: root/vid-app-common/src/main/webapp
diff options
context:
space:
mode:
authorBartosz Gardziejewski <bartosz.gardziejewski@nokia.com>2019-03-25 10:07:38 +0100
committerBartosz Gardziejewski <bartosz.gardziejewski@nokia.com>2019-04-01 15:58:25 +0200
commit30794f9184dc2220a557ba5610a434c2a2bac801 (patch)
tree31831476e0bbee7f9cd85ff20b30723c456905fd /vid-app-common/src/main/webapp
parent92c875958080d6e3039952b3ea3f8deab704ea51 (diff)
Sending workflow data from UI to SO
Change-Id: I39c78584c61eb317d4eaf2861ece810c1b60ab01 Issue-ID: VID-401 Signed-off-by: Bartosz Gardziejewski <bartosz.gardziejewski@nokia.com>
Diffstat (limited to 'vid-app-common/src/main/webapp')
-rw-r--r--vid-app-common/src/main/webapp/app/vid/scripts/modals/new-change-management/new-change-management.controller.js29
-rw-r--r--vid-app-common/src/main/webapp/app/vid/scripts/services/change-management.service.js17
2 files changed, 46 insertions, 0 deletions
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-change-management/new-change-management.controller.js b/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-change-management/new-change-management.controller.js
index a071a58de..f8202fbf2 100644
--- a/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-change-management/new-change-management.controller.js
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-change-management/new-change-management.controller.js
@@ -380,6 +380,26 @@
});
return JSON.stringify(result);
}
+
+ function getWorkflowParametersFromForm() {
+ let workflowParameters =
+ {requestDetails:{
+ cloudConfiguration:{},
+ requestParameters:{userParams:[{}]}
+ }};
+ workflowParameters.requestDetails.cloudConfiguration = vm.changeManagement.vnfNames[0].cloudConfiguration;
+
+ let parameters = vm.getRemoteWorkFlowParameters(vm.changeManagement.workflow);
+ let i = 1;
+ parameters.forEach((parameter)=>{
+ let inputField = document.getElementById('so-workflow-parameter-'+i);
+ i++;
+ workflowParameters.requestDetails.requestParameters.userParams[0][parameter.name]=inputField.value;
+ });
+
+ return workflowParameters;
+ }
+
vm.openModal = function () {
if(vm.hasScheduler) { //scheduling supported
$scope.widgetParameter = ""; // needed by the scheduler?
@@ -406,6 +426,15 @@
var vnfName = vm.changeManagement.vnfNames[0].name;
changeManagementService.postChangeManagementNow(dataToSo, vnfName);
}
+
+ let workflowParameters = getWorkflowParametersFromForm();
+ if(workflowParameters){
+ let servieInstanceId = vm.changeManagement.vnfNames[0]['service-instance-node'][0].properties['service-instance-id'];
+ let vnfInstanceId = vm.changeManagement.vnfNames[0].id;
+ let workflow_UUID = vm.changeManagement.fromVNFVersion;
+
+ changeManagementService.postWorkflowsParametersNow(servieInstanceId,vnfInstanceId,workflow_UUID,workflowParameters);
+ }
}
};
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/services/change-management.service.js b/vid-app-common/src/main/webapp/app/vid/scripts/services/change-management.service.js
index 4b45b891d..e545aadb1 100644
--- a/vid-app-common/src/main/webapp/app/vid/scripts/services/change-management.service.js
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/services/change-management.service.js
@@ -142,5 +142,22 @@
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: []};
+ });
+ };
+
}
})();