Getting error using agenda-groups. What am i doing wrong?

61 views
Skip to first unread message

cbrady321

unread,
Oct 28, 2014, 10:52:17 AM10/28/14
to no...@googlegroups.com
I am not sure what I am doing wrong.  Something I am doing is causing an error with agenda groups. 
Application throws:

/node_modules/nools/lib/agenda.js:107
           
while (this.getFocusedAgenda().isEmpty() && this.getFocused() !==
                                           
^
TypeError: Cannot call method 'isEmpty' of undefined

Skipping over the gory details; I am setting up the session like:
  var session = flow.getSession();
 
// register event tracing handlers
 
(calls to session.on(...));

 
// setup AGENDA GROUPS
 
if(typeof job.groups !== "undefined"){
   
var arr = job.application.rules.groups.reverse();
   
for(var key in arr) {
      session
.focus(arr[key]);
   
}
 
}

 
// load and assert FACTS as type Generic
 
var nt = session.flow.getDefined('Generic');
 
(CODE TO RETYPE FACTs TO GENERIC)
 
(calls to session.assert(fact))

 
// Invoke rules engine and store results
  session
.match().then(function () { ... });



Reply all
Reply to author
Forward
0 new messages