* Copyright 2010 JBoss Inc
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
An entry-point is an abstract channel through where facts are inserted into the engine.
Drools 5 supports multiple entry-points into a single
default, anonymous entry-point, as well as as many user declared entry points the application
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 ); ...
objectthe fact for which the fact handle will be returned.
Returns all facts from the current session as a Collection.
This class is not a general-purpose Collection implementation! While this class implements the Collection interface, it intentionally violates Collection general contract, which mandates the use of the equals method when comparing objects.
Instead the approach used when comparing objects with the contains(Object) method is dependent on the WorkingMemory configuration, where it can be configured for Identity or for Equality.