public interface EntryPoint
An entry-point is an abstract channel through where facts are inserted into the engine.
KIE 6 supports multiple entry-points into a single KieBase
: 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:
KieSession session = kbase.newStatelessKieSession(); ... WorkingMemoryEntryPoint entrypoint = session.getEntryPoint("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 ); ...
Modifier and Type | Method and Description |
---|---|
void |
delete(FactHandle handle)
Retracts the fact for which the given FactHandle was assigned
regardless if it has been explicitly or logically inserted.
|
void |
delete(FactHandle handle,
FactHandle.State fhState)
Retracts the fact for which the given FactHandle was assigned.
|
String |
getEntryPointId() |
long |
getFactCount() |
FactHandle |
getFactHandle(Object object)
Returns the fact handle associated with the given object.
|
<T extends FactHandle> |
getFactHandles() |
<T extends FactHandle> |
getFactHandles(ObjectFilter filter) |
Object |
getObject(FactHandle factHandle) |
Collection<? extends Object> |
getObjects()
This class is not a general-purpose Collection
implementation!
|
Collection<? extends Object> |
getObjects(ObjectFilter filter) |
FactHandle |
insert(Object object)
Inserts a new fact into this entry point
|
void |
retract(FactHandle handle)
Deprecated.
|
void |
update(FactHandle handle,
Object object)
Updates the fact for which the given FactHandle was assigned with the new
fact set as the second parameter in this method.
|
void |
update(FactHandle handle,
Object object,
String... modifiedProperties)
Updates the fact for which the given FactHandle was assigned with the new
fact set as the second parameter in this method, also specifying the set of
properties that have been modified.
|
String getEntryPointId()
FactHandle insert(Object object)
object
- the fact to be insertedvoid retract(FactHandle handle)
delete(FactHandle)
handle
- the handle whose fact is to be retracted.void delete(FactHandle handle)
handle
- the handle whose fact is to be retracted.void delete(FactHandle handle, FactHandle.State fhState)
handle
- the handle whose fact is to be retracted.fhState
- defines how the handle has to be retracted:
as an explicitly inserted fact (STATED), from the
Truth Maintenance System (LOGICAL), or both (ALL)void update(FactHandle handle, Object object)
handle
- the FactHandle for the fact to be updated.object
- the new value for the fact being updated.void update(FactHandle handle, Object object, String... modifiedProperties)
handle
- the FactHandle for the fact to be updated.object
- the new value for the fact being updated.modifiedProperties
- the list of the names of the object's properties modified by this update.FactHandle getFactHandle(Object object)
KieBase
(either IDENTITY or EQUALITY).object
- the fact for which the fact handle will be returned.KieBaseConfiguration
Object getObject(FactHandle factHandle)
Collection<? extends Object> getObjects()
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.
Collection<? extends Object> getObjects(ObjectFilter filter)
filter
- the filter to be applied to the returned collection of facts.ObjectFilter
.<T extends FactHandle> Collection<T> getFactHandles()
FactHandle
s from the current session.<T extends FactHandle> Collection<T> getFactHandles(ObjectFilter filter)
filter
- the filter to be applied to the returned collection of FactHandle
s.FactHandle
s from the current session for which the facts are accepted by
the given filter.long getFactCount()
Copyright © 2001–2020 JBoss by Red Hat. All rights reserved.