1 appDS2.controller('droolsController', function($scope, $modal, $routeParams, DroolsService, modalService) {
3 $scope.resultsString = "";
4 $scope.postDroolsBean={
9 $scope.filenameFromUrl = $routeParams.filename;
10 if($scope.filenameFromUrl!='' && $scope.filenameFromUrl!='0')
11 $scope.postDroolsBean.droolsFile = $scope.filenameFromUrl
12 $scope.execute = function(postDroolsBean) {
13 if($scope.postDroolsBean.droolsFile=='' ||$scope.postDroolsBean.className=='' || $scope.postDroolsBean.selectedRules=='' ){
14 modalService.errorPopUp ("Required fields cannot be empty");
17 var uuu = "post_drools/execute";
18 var postData={postDroolsBean:postDroolsBean};
19 DroolsService.executeDrools(postData).then(function(data){
20 $scope.resultsString=data.resultsString;
21 modalService.successPopUp($scope.resultsString);
23 modalService.errorPopUp (error);
28 appDS2.controller('droolsListController', function($scope, $modal, DroolsService, modalService) {
30 $scope.resultsString = "";
31 $scope.postDroolsBean="";
33 $scope.getDroolsList = function(){
34 DroolsService.getDroolsList().then(function(data){
36 $scope.tableData = JSON.parse(j.data);
39 modalService.errorPopUp (error);
43 $scope.buildTable = function(){
44 for(x in $scope.tableData){
45 if($scope.tableData[x].active_yn=='Y')
46 $scope.tableData[x].active_yn=true;
48 $scope.tableData[x].active_yn=false;