It seems I am unable to insert a new fact from within a drl function. I tried this:
////////////////////////
package com.sample
declare Dummy
end
function void init() {
insert(new Dummy()); // Doesn't compile
}
rule "init"
salience 999
when
then
init();
insert(new Dummy()); // Compiles
end
////////////////////////
Is the above supposed to work?