Hi again,
Following the wiki, I tried to implement fully the example "saveToDatabase" in the DSL:
then {
saveToDatabase(m, function(err){
next(new Error("Something went BOOM!"));
});
I have added in the main node.js code then I manage the session the function saveToDatabase(facts, engine, next) {...} but when executing I've got the following error :
[ReferenceError: saveToDatabase is not defined]
Did I forget anything ?
As a workaround I emit an event:
emit("saved", m);
But in the case I'd like to read data from the database to get parameters for the rule, I guess the good pattern is really to call an async action.
Thanks !
matt