scope.GetRunnables = function() {
console.log ("Dashboard GetRunnables");
- AppCall.get ("afm-main", "runnables", {/*query*/}, function(response) {
+ AppCall.get ("afm-main", "runnables", {/*query*/}, function(jresp, errcode) {
// update debug UI zone
scope.request = "/api/afm-main/runnable";
- scope.response = response.data;
- scope.errcode = response.status;
-
- if (response.status !== 200) {
- console.log ("Hoop GetRunnable failed");
- return;
- }
-
- // Check this is a valid response from Binder
- if (response.data.jtype != "afb-reply") {
+ scope.response = jresp.response;
+ scope.errcode = jresp.request.status;
+
+ // Check if this is a response from AGL application framework binder
+ if (jresp.jtype !== "afb-reply") {
Notification.error ({message: "Invalid Respond to /opa/afm-main/runnable response.data="+response.data, delay: 5000});
return;
}
+
+ // Check for success
+ if (jresp.request.status !== "success") {
+ Notification.error ({message: "afm-main/runnable" + jresp.request.info, delay: 5000});
+ return;
+ }
+
// loop on runnable application to prepare for display
var appliIDs=[];
- var runnables = response.data.response.runnables;
+ var runnables = jresp.response.runnables;
for (var idx=0; idx < runnables.length; idx ++) {
appliIDs[idx] = runnables [idx].id;
scope.appliStore [runnables [idx].id] = runnables [idx];