An entry-point is an abstract channel through where facts are inserted into the engine.
Drools 5 supports multiple entry-points into a single StatefulKnowledgeBase
: the default, anonymous entry-point, as well as as many user declared entry points the application requires.
To get a reference to an entry point, just request the session:
StatefulKnowledgeSession session = kbase.newStatelessKnowledgeSession(); ... WorkingMemoryEntryPoint entrypoint = session.getWorkingMemoryEntryPoint("my entry point");
Once a reference to an entry point is acquired, the application can insert, update and retract facts to/from that entry-point as usual:
... FactHandle factHandle = entrypoint.insert( fact ); ... entrypoint.update( factHandle, newFact ); ... entrypoint.retract( factHandle ); ...