aboutsummaryrefslogtreecommitdiffstats
path: root/usecaseui-common/src/main/webapp/app/fusionapp/drools/services
diff options
context:
space:
mode:
Diffstat (limited to 'usecaseui-common/src/main/webapp/app/fusionapp/drools/services')
-rw-r--r--usecaseui-common/src/main/webapp/app/fusionapp/drools/services/droolsService.js57
1 files changed, 57 insertions, 0 deletions
diff --git a/usecaseui-common/src/main/webapp/app/fusionapp/drools/services/droolsService.js b/usecaseui-common/src/main/webapp/app/fusionapp/drools/services/droolsService.js
new file mode 100644
index 00000000..3b4ba3eb
--- /dev/null
+++ b/usecaseui-common/src/main/webapp/app/fusionapp/drools/services/droolsService.js
@@ -0,0 +1,57 @@
+app.factory('droolsService', function ($http, $q) {
+ return {
+ getDrools: function() {
+ return $http.get('getDrools')
+ .then(function(response) {
+ if (typeof response.data === 'object') {
+ return response.data;
+ } else {
+ return $q.reject(response.data);
+ }
+
+ }, function(response) {
+ // something went wrong
+ return $q.reject(response.data);
+ });
+ },
+
+ getDroolDetails: function(selectedFile) {
+ return $http.get('getDroolDetails'+'?selectedFile=' + selectedFile )
+ .then(function(response) {
+ if (typeof response.data === 'object') {
+ return response.data;
+ } else {
+ return $q.reject(response.data);
+ }
+
+ }, function(response) {
+ // something went wrong
+ return $q.reject(response.data);
+ });
+ },
+
+ getRole: function(roleId) {
+
+ return $http.get('get_role?role_id=' + roleId)
+ .then(function(response) {
+ if (typeof response.data === 'object') {
+ return response.data;
+ } else {
+ return $q.reject(response.data);
+ }
+
+ }, function(response) {
+ // something went wrong
+ return $q.reject(response.data);
+ });
+ },
+
+ getSelectedFile: function() {
+ return this.selectedFile;
+ },
+
+ setSelectedFile: function(_selectedFile) {
+ this.selectedFile = _selectedFile;
+ }
+ };
+}); \ No newline at end of file