I didn't make it to define my facts in the js file can any one help me here is a simple example and i keep getting : invalid class
var nools = require ('nools');
var ruleFilePath = __dirname + "/rules/helloworld-v1.nools";
var flow = nools.compile(ruleFilePath,
{ name : "hello" ,
//class should be available to the rules
define : {House : House },
scope: {
test: test,
test2:test2
}
});
var userid=10;
var boxid=101;
var zwave = 14;
var Trucker1 = new Trucker(userid, boxid, zwave);
var session1 = flow.getSession(Trucker1)
session1.match();
var Trucker = function(userid, boxid, zwave){
this.userid = userid;
this.boxid = boxid;
this.zwave = zwave;
}
function test () {
// body...
console.log("function test1 executed");
}
function test2 () {
// body...
console.log("test2 executed ");
}