diff options
author | Wojciech Sliwka <wojciech.sliwka@nokia.com> | 2019-04-02 08:57:15 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2019-04-02 08:57:15 +0000 |
commit | 56d27d6651babd9223ee8e3a3deddda9d702dcd1 (patch) | |
tree | f763b0edabcadd734707f51e47d2d7ad27b4046c /vid-app-common/src/main/webapp/app | |
parent | 99f537f2af25e2810ff39077d3d49fadff6272ff (diff) | |
parent | 30794f9184dc2220a557ba5610a434c2a2bac801 (diff) |
Merge "Sending workflow data from UI to SO"
Diffstat (limited to 'vid-app-common/src/main/webapp/app')
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: []}; + }); + }; + } })(); |