1 appDS2.controller('adminClosedLoopController', ['$scope','$http','$q','$log',function ($scope, $http,$q, $log){
2 $scope.camunda_cockpit_url = '';
3 var deferred = $q.defer();
6 url: "get_camunda_cockpit_link",
7 }).success( function(res) {
8 // if the returned response is error HTML page in string format
9 if(res.link_defined=='false'){
10 $log.error('Retrieval of camunda cockpit link failed. Please make sure the variable "camunda_cockpit_url" is defined in the system.properties file.');
11 deferred.reject(status);
14 else if(res.camunda_cockpit_link!=null & res.camunda_cockpit_link!= '') {
15 $scope.camunda_cockpit_url = res.camunda_cockpit_link;
16 deferred.resolve(res);
17 // if the defined url is empty;
19 $log.error('Please ensure the variable "camunda_cockpit_url" is properly defined in system.properties file (i.e., neither null nor empty).');
20 deferred.reject(status);
23 }).error( function(status) {
24 $log.error('get_camunda_cockpit_link RestAPI call failed.');
25 deferred.reject(status);
27 return deferred.promise;