As I understand it, when we use
insert or
retract etc in a consequence, this is a shorthand for referencing methods of these names from an object called drools, which the documentation says is of type KnowledgeHelper.
I want to do some inserts in a function. I'm guessing I need to reference the drools object, as the insert doesn't work by itself (and I've not seen anything saying this magic drools macro stuff applies to functions). I want to do something like:
function void blah( Thing a )
{
drools.insert( a );
}
but how do I get the drools object? I can't see any obvious references to KnowledgeHelper in the current JavaDocs. Google gives some matches, but all for notably older version (4.x for example). So I guess the documentation hasn't kept track with the codebase (eg renames to Kie for many things with 6.x). Can anyone give me the magic runes that let my methods invoke insert, retract, modify etc as if in a consequence section?
Thanks
Borris