1 appDS2.factory('DroolsService', function ($http, $q) {
3 getDroolsList: function() {
4 return $http.get('getDrools')
5 .then(function(response) {
7 if (typeof response.data === 'object') {
10 return $q.reject(response.data);
13 }, function(response) {
14 // something went wrong
15 return $q.reject(response.data);
19 getDroolDetails: function(selectedFile) {
20 return $http.get('getDroolDetails'+'?selectedFile=' + selectedFile )
21 .then(function(response) {
22 if (typeof response.data === 'object') {
25 return $q.reject(response.data);
28 }, function(response) {
29 // something went wrong
30 return $q.reject(response.data);
33 executeDrools:function(droolsData) {
36 url: "post_drools/execute",
38 }).then(function(response) {
39 console.log(response);
40 if (response.status == 200) {
43 return $q.reject(response.data);
47 }, function(response) {
48 // something went wrong
49 return $q.reject(response.data);