public class StatefulKnowledgeSessionImpl extends AbstractRuntime implements org.kie.internal.runtime.StatefulKnowledgeSession, WorkingMemoryEntryPoint, InternalKnowledgeRuntime, org.kie.api.runtime.KieSession, org.kie.api.event.KieRuntimeEventManager, InternalWorkingMemoryActions, EventSupport, org.kie.internal.event.rule.RuleEventManager, org.kie.api.event.process.ProcessEventManager, org.kie.internal.process.CorrelationAwareProcessRuntime, Externalizable
| Modifier and Type | Class and Description |
|---|---|
static class |
StatefulKnowledgeSessionImpl.AbstractImmutableCollection |
static class |
StatefulKnowledgeSessionImpl.DummyInternalProcessRuntime |
static class |
StatefulKnowledgeSessionImpl.GlobalsAdapter |
static class |
StatefulKnowledgeSessionImpl.ObjectStoreWrapper |
static class |
StatefulKnowledgeSessionImpl.PartitionAwareWorkingMemoryReteExpireAction |
static class |
StatefulKnowledgeSessionImpl.WorkingMemoryReteAssertAction |
static class |
StatefulKnowledgeSessionImpl.WorkingMemoryReteExpireAction |
logger| Constructor and Description |
|---|
StatefulKnowledgeSessionImpl() |
StatefulKnowledgeSessionImpl(long id,
InternalKnowledgeBase kBase) |
StatefulKnowledgeSessionImpl(long id,
InternalKnowledgeBase kBase,
boolean initInitFactHandle,
SessionConfiguration config,
org.kie.api.runtime.Environment environment) |
StatefulKnowledgeSessionImpl(long id,
InternalKnowledgeBase kBase,
FactHandleFactory handleFactory,
long propagationContext,
SessionConfiguration config,
InternalAgenda agenda,
org.kie.api.runtime.Environment environment) |
| Modifier and Type | Method and Description |
|---|---|
void |
abortProcessInstance(long id) |
void |
activate() |
void |
activationFired()
This method is called by the agenda right after an activation was fired
to allow the working memory to resume any activities blocked during
activation firing.
|
void |
addEventListener(org.kie.api.event.rule.AgendaEventListener listener)
Add an event listener.
|
void |
addEventListener(org.kie.api.event.kiebase.KieBaseEventListener listener) |
void |
addEventListener(org.kie.api.event.process.ProcessEventListener listener) |
void |
addEventListener(org.kie.internal.event.rule.RuleEventListener listener) |
void |
addEventListener(org.kie.api.event.rule.RuleRuntimeEventListener listener)
Add an event listener.
|
void |
addPropagation(PropagationEntry propagationEntry) |
void |
bindRuleBase(InternalWorkingMemory workingMemory,
InternalKnowledgeBase kBase,
InternalAgenda agenda,
boolean initInitFactHandle) |
void |
cancelActivation(Activation activation,
boolean declarativeAgenda) |
protected void |
checkAlive() |
void |
clearActivationGroup(String group)
Clears the Activation Group, cancellings all its Activations
|
void |
clearAgenda()
Clear the Agenda.
|
void |
clearAgendaGroup(String group)
Clear the Agenda Group, cancelling all its Activations.
|
void |
clearNodeMemory(MemoryFactory node) |
void |
clearRuleFlowGroup(String group)
Clears the RuleFlow group, cancelling all its Activations
|
void |
closeLiveQuery(InternalFactHandle factHandle) |
protected InternalWorkingMemoryEntryPoint |
createDefaultEntryPoint() |
org.kie.api.runtime.process.ProcessInstance |
createProcessInstance(String processId,
org.kie.internal.process.CorrelationKey correlationKey,
Map<String,Object> parameters) |
org.kie.api.runtime.process.ProcessInstance |
createProcessInstance(String processId,
Map<String,Object> parameters) |
<T> T |
createRuntimeService(Class<T> cls) |
void |
deactivate() |
void |
delete(org.kie.api.runtime.rule.FactHandle handle) |
void |
delete(org.kie.api.runtime.rule.FactHandle handle,
org.kie.api.runtime.rule.FactHandle.State fhState) |
void |
delete(org.kie.api.runtime.rule.FactHandle factHandle,
RuleImpl rule,
TerminalNode terminalNode) |
void |
delete(org.kie.api.runtime.rule.FactHandle factHandle,
RuleImpl rule,
TerminalNode terminalNode,
org.kie.api.runtime.rule.FactHandle.State fhState) |
void |
destroy() |
void |
dispose()
Internal method called by the engine when the session is being disposed, so that the entry point
can proceed with the necessary clean ups.
|
<T,K> T |
don(Activation activation,
K core,
Class<T> trait,
boolean b,
org.kie.api.internal.runtime.beliefs.Mode[] modes) |
<T,K> T |
don(Activation activation,
K core,
Collection<Class<? extends Thing>> traits,
boolean b,
org.kie.api.internal.runtime.beliefs.Mode[] modes) |
void |
endBatchExecution() |
void |
endOperation()
This method must be called after finishing any work in the engine,
like inserting a new fact or firing a new rule.
|
protected BaseNode[] |
evalQuery(String queryName,
DroolsQuery queryObject,
InternalFactHandle handle,
PropagationContext pCtx,
boolean isCalledFromRHS) |
<T> T |
execute(org.kie.api.command.Command<T> command) |
void |
executeQueuedActions() |
int |
fireAllRules()
Fire all items on the agenda until empty.
|
int |
fireAllRules(org.kie.api.runtime.rule.AgendaFilter agendaFilter)
Fire all items on the agenda until empty, using the given AgendaFiler
|
int |
fireAllRules(org.kie.api.runtime.rule.AgendaFilter agendaFilter,
int fireLimit)
Fire all items on the agenda using the given AgendaFiler
until empty or at most 'fireLimit' rules have fired
|
int |
fireAllRules(int fireLimit)
Fire all items on the agenda until empty or at most 'fireLimit' rules have fired
|
void |
fireUntilHalt()
Keeps firing activations until a halt is called.
|
void |
fireUntilHalt(org.kie.api.runtime.rule.AgendaFilter agendaFilter)
Keeps firing activations until a halt is called.
|
void |
flushPropagations() |
Iterator<? extends PropagationEntry> |
getActionsIterator() |
Map |
getActivationParameters(Activation activation) |
Map.Entry[] |
getActivationParameters(long activationId) |
InternalAgenda |
getAgenda()
Returns the Agenda for this WorkingMemory.
|
Collection<org.kie.api.event.rule.AgendaEventListener> |
getAgendaEventListeners()
Returns all event listeners.
|
AgendaEventSupport |
getAgendaEventSupport() |
org.kie.api.runtime.Calendars |
getCalendars() |
Map<String,org.kie.api.runtime.Channel> |
getChannels()
Returns a map of channel Id->Channel of all channels in
this working memory
|
EntryPointId |
getEntryPoint() |
WorkingMemoryEntryPoint |
getEntryPoint(String name) |
String |
getEntryPointId() |
Map<String,WorkingMemoryEntryPoint> |
getEntryPointMap() |
EntryPointNode |
getEntryPointNode() |
Collection<? extends org.kie.api.runtime.rule.EntryPoint> |
getEntryPoints() |
org.kie.api.runtime.Environment |
getEnvironment() |
long |
getFactCount() |
org.kie.api.runtime.rule.FactHandle |
getFactHandle(Object object)
Retrieve the
FactHandle associated with an Object. |
org.kie.api.runtime.rule.FactHandle |
getFactHandleByIdentity(Object object)
Looks for the fact handle associated to the given object
by looking up the object IDENTITY (==), even if rule base
is configured to AssertBehavior.EQUALITY.
|
FactHandleFactory |
getFactHandleFactory() |
<T extends org.kie.api.runtime.rule.FactHandle> |
getFactHandles() |
<T extends org.kie.api.runtime.rule.FactHandle> |
getFactHandles(org.kie.api.runtime.ObjectFilter filter) |
Object |
getGlobal(String identifier)
Retrieve a specific instance of global data by identifier
|
GlobalResolver |
getGlobalResolver()
Returns the current GlobalResolver
|
org.kie.api.runtime.Globals |
getGlobals() |
FactHandleFactory |
getHandleFactory() |
int |
getId() |
long |
getIdentifier() |
long |
getIdleTime()
Returns the number of time units (usually ms) that the engine is idle
according to the session clock or -1 if it is not idle.
|
InternalFactHandle |
getInitialFactHandle() |
InternalWorkingMemory |
getInternalWorkingMemory() |
org.kie.api.KieBase |
getKieBase() |
Collection<org.kie.api.event.kiebase.KieBaseEventListener> |
getKieBaseEventListeners() |
<T> T |
getKieRuntime(Class<T> cls) |
InternalKnowledgeBase |
getKnowledgeBase()
Retrieve the
RuleBase for this working memory. |
InternalKnowledgeRuntime |
getKnowledgeRuntime() |
long |
getLastIdleTimestamp() |
Lock |
getLock() |
long |
getNextPropagationIdCounter() |
NodeMemories |
getNodeMemories() |
<T extends Memory> |
getNodeMemory(MemoryFactory<T> node)
Retrieve the
JoinMemory for a particular
JoinNode. |
Object |
getObject(org.kie.api.runtime.rule.FactHandle handle)
Returns the fact Object for the given
FactHandle. |
Collection<?> |
getObjects() |
Collection<?> |
getObjects(org.kie.api.runtime.ObjectFilter filter) |
ObjectStore |
getObjectStore() |
ObjectTypeConfigurationRegistry |
getObjectTypeConfigurationRegistry() |
Collection<org.kie.api.event.process.ProcessEventListener> |
getProcessEventListeners() |
org.kie.api.runtime.process.ProcessInstance |
getProcessInstance(org.kie.internal.process.CorrelationKey correlationKey) |
org.kie.api.runtime.process.ProcessInstance |
getProcessInstance(long processInstanceId)
Returns the process instance with the given id.
|
org.kie.api.runtime.process.ProcessInstance |
getProcessInstance(long processInstanceId,
boolean readOnly) |
Collection<org.kie.api.runtime.process.ProcessInstance> |
getProcessInstances()
Returns the list of process instances of this working memory.
|
InternalProcessRuntime |
getProcessRuntime() |
long |
getPropagationIdCounter() |
PropagationList |
getPropagationList() |
QueryResultsImpl |
getQueryResults(String queryName,
Object... arguments)
Retrieve the QueryResults of the specified query and arguments
|
QueryResultsImpl |
getQueryResultsFromRHS(String queryName,
Object... arguments)
(This shall NOT be exposed on public API)
|
RuleEventListenerSupport |
getRuleEventSupport() |
Collection<org.kie.api.event.rule.RuleRuntimeEventListener> |
getRuleRuntimeEventListeners()
Returns all event listeners.
|
RuleRuntimeEventSupport |
getRuleRuntimeEventSupport() |
org.kie.api.time.SessionClock |
getSessionClock()
Returns the session clock instance associated with this session
|
SessionConfiguration |
getSessionConfiguration() |
TimerService |
getTimerService()
Returns the TimerService instance (session clock) for this
session.
|
long |
getTimeToNextJob()
Returns the number of time units (usually ms) to
the next scheduled job
|
long |
getTotalFactCount()
Returns the total number of facts in the working memory, i.e., counting
all facts from all entry points.
|
TruthMaintenanceSystem |
getTruthMaintenanceSystem() |
WorkingMemoryEntryPoint |
getWorkingMemoryEntryPoint(String name)
Returns the interface instance for a given entry point, so
that the application can manage entry-point-scoped facts.
|
Map<String,WorkingMemoryEntryPoint> |
getWorkingMemoryEntryPoints() |
org.kie.api.runtime.process.WorkItemManager |
getWorkItemManager() |
void |
halt()
Stops rule firing after the current rule finishes executing
|
void |
init(SessionConfiguration config,
org.kie.api.runtime.Environment environment) |
protected void |
initDefaultEntryPoint() |
InternalFactHandle |
initInitialFact(InternalKnowledgeBase kBase,
InternalWorkingMemoryEntryPoint entryPoint,
EntryPointId epId,
MarshallerReaderContext context) |
InternalFactHandle |
initInitialFact(InternalKnowledgeBase kBase,
MarshallerReaderContext context) |
void |
initMBeans(String containerId,
String kbaseName,
String ksessionName) |
org.kie.api.runtime.rule.FactHandle |
insert(Object object) |
org.kie.api.runtime.rule.FactHandle |
insert(Object object,
boolean dynamic)
Insert a fact registering JavaBean
PropertyChangeListeners
on the Object to automatically trigger update calls
if dynamic is true. |
org.kie.api.runtime.rule.FactHandle |
insert(Object object,
boolean dynamic,
RuleImpl rule,
TerminalNode terminalNode) |
org.kie.api.runtime.rule.FactHandle |
insertAsync(Object object) |
InternalProcessRuntime |
internalGetProcessRuntime() |
protected QueryResultsImpl |
internalGetQueryResult(boolean calledFromRHS,
String queryName,
Object... arguments) |
boolean |
isAlive() |
boolean |
isSequential() |
Iterator<InternalFactHandle> |
iterateFactHandles()
This class is not thread safe, changes to the working memory during
iteration may give unexpected results
|
Iterator<InternalFactHandle> |
iterateFactHandles(org.kie.api.runtime.ObjectFilter filter)
This class is not thread safe, changes to the working memory during
iteration may give unexpected results
|
List |
iterateNonDefaultEntryPointObjectsToList() |
Iterator |
iterateObjects()
This class is not thread safe, changes to the working memory during
iteration may give unexpected results
|
Iterator |
iterateObjects(org.kie.api.runtime.ObjectFilter filter)
This class is not thread safe, changes to the working memory during
iteration may give unexpected results
|
List |
iterateObjectsToList() |
void |
notifyWaitOnRest() |
org.kie.api.runtime.rule.LiveQuery |
openLiveQuery(String query,
Object[] arguments,
org.kie.api.runtime.rule.ViewChangedEventListener listener) |
void |
prepareToFireActivation()
This method is called by the agenda before firing a new activation
to ensure the working memory is in a safe state to fire the activation.
|
void |
queueWorkingMemoryAction(WorkingMemoryAction action) |
void |
readExternal(ObjectInput in) |
void |
registerChannel(String name,
org.kie.api.runtime.Channel channel) |
void |
removeEventListener(org.kie.api.event.rule.AgendaEventListener listener)
Remove an event listener.
|
void |
removeEventListener(org.kie.api.event.kiebase.KieBaseEventListener listener) |
void |
removeEventListener(org.kie.api.event.process.ProcessEventListener listener) |
void |
removeEventListener(org.kie.internal.event.rule.RuleEventListener listener) |
void |
removeEventListener(org.kie.api.event.rule.RuleRuntimeEventListener listener)
Remove an event listener.
|
void |
removeGlobal(String identifier) |
void |
reset() |
void |
reset(long handleId,
long handleCounter,
long propagationCounter) |
void |
retract(org.kie.api.runtime.rule.FactHandle handle) |
void |
setAgendaEventSupport(AgendaEventSupport agendaEventSupport) |
void |
setAsyncExceptionHandler(AsyncExceptionHandler handler)
Sets the AsyncExceptionHandler to handle exceptions thrown by the Agenda
Scheduler used for duration rules.
|
void |
setEndOperationListener(EndOperationListener listener) |
void |
setFocus(String focus)
Set the focus to the specified AgendaGroup
|
void |
setGlobal(String identifier,
Object value)
Set a specific instance as a global in this working memory.
|
void |
setGlobalResolver(GlobalResolver globalResolver)
Sets the GlobalResolver instance to be used when resolving globals, replaces the current GlobalResolver.
|
void |
setHandleFactory(FactHandleFactory handleFactory) |
void |
setIdentifier(long id) |
void |
setInitialFactHandle(InternalFactHandle initialFactHandle) |
void |
setRuleEventListenerSupport(RuleEventListenerSupport ruleEventListenerSupport) |
void |
setRuleRuntimeEventSupport(RuleRuntimeEventSupport ruleRuntimeEventSupport) |
StatefulKnowledgeSessionImpl |
setStateless(boolean stateless) |
<T,K,X extends TraitableBean> |
shed(Activation activation,
TraitableBean<K,X> core,
Class<T> trait) |
void |
signalEvent(String type,
Object event) |
void |
signalEvent(String type,
Object event,
long processInstanceId) |
void |
startBatchExecution() |
void |
startOperation()
This method must be called before starting any new work in the engine,
like inserting a new fact or firing a new rule.
|
org.kie.api.runtime.process.ProcessInstance |
startProcess(String processId)
Starts a new process instance for the process with the given id.
|
org.kie.api.runtime.process.ProcessInstance |
startProcess(String processId,
org.kie.internal.process.CorrelationKey correlationKey,
Map<String,Object> parameters) |
org.kie.api.runtime.process.ProcessInstance |
startProcess(String processId,
Map<String,Object> parameters)
Starts a new process instance for the process with the given id.
|
org.kie.api.runtime.process.ProcessInstance |
startProcessInstance(long processInstanceId) |
void |
submit(org.kie.api.runtime.KieSession.AtomicAction action) |
String |
toString() |
boolean |
tryDeactivate() |
void |
unregisterChannel(String name) |
void |
update(org.kie.api.runtime.rule.FactHandle factHandle) |
void |
update(org.kie.api.runtime.rule.FactHandle handle,
Object object) |
void |
update(org.kie.api.runtime.rule.FactHandle factHandle,
Object object,
BitMask mask,
Class<?> modifiedClass,
Activation activation)
modify is implemented as half way retract / assert due to the truth
maintenance issues.
|
void |
update(org.kie.api.runtime.rule.FactHandle handle,
Object object,
String... modifiedProperties) |
void |
updateEntryPointsCache() |
void |
updateTraits(InternalFactHandle h,
BitMask mask,
Class<?> modifiedClass,
Activation activation) |
void |
writeExternal(ObjectOutput out) |
getLogger, setLoggerclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitcreateKnowledgeHelper, createKnowledgeHelper, onResume, onSuspendgetRuleUnit, setRuleUnitpublic static final String ERRORMSG
public static final String DEFAULT_RULE_UNIT
public byte[] bytes
protected Long id
protected NodeMemories nodeMemories
JoinNodes.protected InternalWorkingMemoryEntryPoint defaultEntryPoint
protected GlobalResolver globalResolver
protected org.kie.api.runtime.Calendars calendars
protected RuleRuntimeEventSupport ruleRuntimeEventSupport
protected RuleEventListenerSupport ruleEventListenerSupport
protected AgendaEventSupport agendaEventSupport
protected List<org.kie.api.event.kiebase.KieBaseEventListener> kieBaseEventListeners
protected transient InternalKnowledgeBase kBase
RuleBase with which this memory is associated.protected FactHandleFactory handleFactory
protected InternalAgenda agenda
protected ReentrantLock lock
protected AtomicLong propagationIdCounter
protected Map<String,WorkingMemoryEntryPoint> entryPoints
protected InternalFactHandle initialFactHandle
protected PropagationContextFactory pctxFactory
protected SessionConfiguration config
public static final StatefulKnowledgeSessionImpl.DummyInternalProcessRuntime DUMMY_PROCESS_RUNTIME
public StatefulKnowledgeSessionImpl()
public StatefulKnowledgeSessionImpl(long id,
InternalKnowledgeBase kBase)
public StatefulKnowledgeSessionImpl(long id,
InternalKnowledgeBase kBase,
boolean initInitFactHandle,
SessionConfiguration config,
org.kie.api.runtime.Environment environment)
public StatefulKnowledgeSessionImpl(long id,
InternalKnowledgeBase kBase,
FactHandleFactory handleFactory,
long propagationContext,
SessionConfiguration config,
InternalAgenda agenda,
org.kie.api.runtime.Environment environment)
public StatefulKnowledgeSessionImpl setStateless(boolean stateless)
public void init(SessionConfiguration config, org.kie.api.runtime.Environment environment)
public void bindRuleBase(InternalWorkingMemory workingMemory, InternalKnowledgeBase kBase, InternalAgenda agenda, boolean initInitFactHandle)
public TruthMaintenanceSystem getTruthMaintenanceSystem()
getTruthMaintenanceSystem in interface WorkingMemoryEntryPointpublic FactHandleFactory getHandleFactory()
getHandleFactory in interface WorkingMemoryEntryPointpublic void setHandleFactory(FactHandleFactory handleFactory)
public <T> T getKieRuntime(Class<T> cls)
getKieRuntime in interface org.kie.api.runtime.KieSessionpublic <T> T createRuntimeService(Class<T> cls)
public WorkingMemoryEntryPoint getEntryPoint(String name)
getEntryPoint in interface InternalWorkingMemorygetEntryPoint in interface org.kie.api.runtime.rule.RuleRuntimepublic Collection<? extends org.kie.api.runtime.rule.EntryPoint> getEntryPoints()
getEntryPoints in interface InternalWorkingMemorygetEntryPoints in interface org.kie.api.runtime.rule.RuleRuntimepublic Map<String,WorkingMemoryEntryPoint> getEntryPointMap()
public Collection<org.kie.api.event.rule.RuleRuntimeEventListener> getRuleRuntimeEventListeners()
WorkingMemoryEventManagergetRuleRuntimeEventListeners in interface EventSupportgetRuleRuntimeEventListeners in interface WorkingMemoryEventManagergetRuleRuntimeEventListeners in interface org.kie.api.event.rule.RuleRuntimeEventManagerpublic Collection<org.kie.api.event.rule.AgendaEventListener> getAgendaEventListeners()
WorkingMemoryEventManagergetAgendaEventListeners in interface EventSupportgetAgendaEventListeners in interface WorkingMemoryEventManagergetAgendaEventListeners in interface org.kie.api.event.rule.RuleRuntimeEventManagerpublic InternalProcessRuntime getProcessRuntime()
getProcessRuntime in interface InternalKnowledgeRuntimegetProcessRuntime in interface InternalWorkingMemorypublic InternalProcessRuntime internalGetProcessRuntime()
internalGetProcessRuntime in interface InternalWorkingMemorypublic void addEventListener(org.kie.api.event.process.ProcessEventListener listener)
addEventListener in interface org.kie.api.event.process.ProcessEventManagerpublic Collection<org.kie.api.event.process.ProcessEventListener> getProcessEventListeners()
getProcessEventListeners in interface org.kie.api.event.process.ProcessEventManagerpublic void removeEventListener(org.kie.api.event.process.ProcessEventListener listener)
removeEventListener in interface org.kie.api.event.process.ProcessEventManagerpublic org.kie.api.KieBase getKieBase()
getKieBase in interface org.kie.api.runtime.KieRuntimegetKieBase in interface org.kie.internal.runtime.StatefulKnowledgeSessionpublic void dispose()
WorkingMemoryEntryPointdispose in interface WorkingMemoryEntryPointdispose in interface org.kie.api.runtime.KieSessionpublic boolean isAlive()
public void destroy()
destroy in interface org.kie.api.runtime.KieSessionpublic void update(org.kie.api.runtime.rule.FactHandle factHandle)
public void abortProcessInstance(long id)
abortProcessInstance in interface org.kie.api.runtime.process.ProcessRuntimepublic void signalEvent(String type, Object event)
signalEvent in interface org.kie.api.runtime.process.ProcessRuntimepublic void signalEvent(String type, Object event, long processInstanceId)
signalEvent in interface org.kie.api.runtime.process.ProcessRuntimepublic org.kie.api.runtime.Globals getGlobals()
getGlobals in interface org.kie.api.runtime.KieRuntimepublic <T extends org.kie.api.runtime.rule.FactHandle> Collection<T> getFactHandles()
getFactHandles in interface org.kie.api.runtime.rule.EntryPointpublic <T extends org.kie.api.runtime.rule.FactHandle> Collection<T> getFactHandles(org.kie.api.runtime.ObjectFilter filter)
getFactHandles in interface org.kie.api.runtime.rule.EntryPointpublic Collection<?> getObjects()
getObjects in interface org.kie.api.runtime.rule.EntryPointpublic Collection<?> getObjects(org.kie.api.runtime.ObjectFilter filter)
getObjects in interface org.kie.api.runtime.rule.EntryPointpublic <T> T execute(org.kie.api.command.Command<T> command)
execute in interface org.kie.api.runtime.CommandExecutorpublic InternalFactHandle initInitialFact(InternalKnowledgeBase kBase, MarshallerReaderContext context)
public InternalFactHandle initInitialFact(InternalKnowledgeBase kBase, InternalWorkingMemoryEntryPoint entryPoint, EntryPointId epId, MarshallerReaderContext context)
public String getEntryPointId()
getEntryPointId in interface org.kie.api.runtime.rule.EntryPointpublic QueryResultsImpl getQueryResultsFromRHS(String queryName, Object... arguments)
public QueryResultsImpl getQueryResults(String queryName, Object... arguments)
WorkingMemorygetQueryResults in interface WorkingMemorygetQueryResults in interface org.kie.api.runtime.rule.RuleRuntimequeryName - The name of the query.arguments - The arguments used for the queryprotected QueryResultsImpl internalGetQueryResult(boolean calledFromRHS, String queryName, Object... arguments)
public org.kie.api.runtime.rule.LiveQuery openLiveQuery(String query, Object[] arguments, org.kie.api.runtime.rule.ViewChangedEventListener listener)
openLiveQuery in interface org.kie.api.runtime.rule.RuleRuntimeprotected BaseNode[] evalQuery(String queryName, DroolsQuery queryObject, InternalFactHandle handle, PropagationContext pCtx, boolean isCalledFromRHS)
public void closeLiveQuery(InternalFactHandle factHandle)
closeLiveQuery in interface InternalWorkingMemorypublic EntryPointId getEntryPoint()
getEntryPoint in interface InternalWorkingMemorygetEntryPoint in interface WorkingMemoryEntryPointpublic InternalWorkingMemory getInternalWorkingMemory()
getInternalWorkingMemory in interface WorkingMemoryEntryPointpublic void writeExternal(ObjectOutput out) throws IOException
writeExternal in interface ExternalizableIOExceptionpublic void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
readExternal in interface ExternalizableIOExceptionClassNotFoundExceptionpublic void updateEntryPointsCache()
updateEntryPointsCache in interface InternalWorkingMemoryprotected void initDefaultEntryPoint()
protected InternalWorkingMemoryEntryPoint createDefaultEntryPoint()
public SessionConfiguration getSessionConfiguration()
getSessionConfiguration in interface InternalWorkingMemorygetSessionConfiguration in interface org.kie.api.runtime.KieRuntimepublic void reset()
reset in interface WorkingMemoryEntryPointpublic void reset(long handleId,
long handleCounter,
long propagationCounter)
public void setRuleRuntimeEventSupport(RuleRuntimeEventSupport ruleRuntimeEventSupport)
setRuleRuntimeEventSupport in interface InternalWorkingMemorypublic void setAgendaEventSupport(AgendaEventSupport agendaEventSupport)
setAgendaEventSupport in interface InternalWorkingMemorypublic boolean isSequential()
isSequential in interface InternalWorkingMemorypublic void addEventListener(org.kie.api.event.rule.RuleRuntimeEventListener listener)
WorkingMemoryEventManageraddEventListener in interface WorkingMemoryEventManageraddEventListener in interface org.kie.api.event.rule.RuleRuntimeEventManagerlistener - The listener to add.public void removeEventListener(org.kie.api.event.rule.RuleRuntimeEventListener listener)
WorkingMemoryEventManagerremoveEventListener in interface WorkingMemoryEventManagerremoveEventListener in interface org.kie.api.event.rule.RuleRuntimeEventManagerlistener - The listener to remove.public void addEventListener(org.kie.api.event.rule.AgendaEventListener listener)
WorkingMemoryEventManageraddEventListener in interface WorkingMemoryEventManageraddEventListener in interface org.kie.api.event.rule.RuleRuntimeEventManagerlistener - The listener to add.public void removeEventListener(org.kie.api.event.rule.AgendaEventListener listener)
WorkingMemoryEventManagerremoveEventListener in interface WorkingMemoryEventManagerremoveEventListener in interface org.kie.api.event.rule.RuleRuntimeEventManagerlistener - The listener to remove.public void addEventListener(org.kie.api.event.kiebase.KieBaseEventListener listener)
addEventListener in interface org.kie.api.event.kiebase.KieBaseEventManagerpublic Collection<org.kie.api.event.kiebase.KieBaseEventListener> getKieBaseEventListeners()
getKieBaseEventListeners in interface org.kie.api.event.kiebase.KieBaseEventManagerpublic void removeEventListener(org.kie.api.event.kiebase.KieBaseEventListener listener)
removeEventListener in interface org.kie.api.event.kiebase.KieBaseEventManagerpublic RuleEventListenerSupport getRuleEventSupport()
getRuleEventSupport in interface EventSupportpublic void setRuleEventListenerSupport(RuleEventListenerSupport ruleEventListenerSupport)
public void addEventListener(org.kie.internal.event.rule.RuleEventListener listener)
addEventListener in interface org.kie.internal.event.rule.RuleEventManagerpublic void removeEventListener(org.kie.internal.event.rule.RuleEventListener listener)
removeEventListener in interface org.kie.internal.event.rule.RuleEventManagerpublic FactHandleFactory getFactHandleFactory()
getFactHandleFactory in interface InternalWorkingMemorypublic void setGlobal(String identifier, Object value)
WorkingMemorysetGlobal in interface WorkingMemorysetGlobal in interface org.kie.api.runtime.KieRuntimeidentifier - the identifier under which to populate the datavalue - the global value, cannot be nullpublic void removeGlobal(String identifier)
removeGlobal in interface InternalWorkingMemorypublic void setGlobalResolver(GlobalResolver globalResolver)
WorkingMemorysetGlobalResolver in interface WorkingMemorypublic GlobalResolver getGlobalResolver()
WorkingMemorygetGlobalResolver in interface WorkingMemorypublic org.kie.api.runtime.Calendars getCalendars()
getCalendars in interface InternalWorkingMemorygetCalendars in interface org.kie.api.runtime.KieRuntimepublic int getId()
getId in interface org.kie.api.runtime.KieSessionpublic long getIdentifier()
getIdentifier in interface InternalWorkingMemorygetIdentifier in interface org.kie.api.runtime.KieSessionpublic void setIdentifier(long id)
setIdentifier in interface InternalKnowledgeRuntimesetIdentifier in interface InternalWorkingMemoryprotected void checkAlive()
public Object getGlobal(String identifier)
WorkingMemorygetGlobal in interface WorkingMemorygetGlobal in interface org.kie.api.runtime.KieRuntimepublic org.kie.api.runtime.Environment getEnvironment()
getEnvironment in interface WorkingMemorygetEnvironment in interface org.kie.api.runtime.KieRuntimepublic InternalAgenda getAgenda()
WorkingMemorygetAgenda in interface InternalWorkingMemorygetAgenda in interface WorkingMemorygetAgenda in interface org.kie.api.runtime.rule.RuleRuntimepublic void clearAgenda()
WorkingMemoryclearAgenda in interface WorkingMemorypublic void clearAgendaGroup(String group)
WorkingMemoryclearAgendaGroup in interface WorkingMemorypublic void clearActivationGroup(String group)
WorkingMemoryclearActivationGroup in interface WorkingMemorypublic void clearRuleFlowGroup(String group)
WorkingMemoryclearRuleFlowGroup in interface WorkingMemorypublic InternalKnowledgeBase getKnowledgeBase()
WorkingMemoryRuleBase for this working memory.getKnowledgeBase in interface WorkingMemorygetKnowledgeBase in interface WorkingMemoryEntryPointRuleBase.public void halt()
WorkingMemoryhalt in interface WorkingMemoryhalt in interface org.kie.api.runtime.rule.RuleRuntimepublic int fireAllRules()
WorkingMemoryfireAllRules in interface WorkingMemoryfireAllRules in interface org.kie.api.runtime.rule.StatefulRuleSessionpublic int fireAllRules(int fireLimit)
WorkingMemoryfireAllRules in interface WorkingMemoryfireAllRules in interface org.kie.api.runtime.rule.StatefulRuleSessionpublic int fireAllRules(org.kie.api.runtime.rule.AgendaFilter agendaFilter)
WorkingMemoryfireAllRules in interface WorkingMemoryfireAllRules in interface org.kie.api.runtime.rule.StatefulRuleSessionpublic int fireAllRules(org.kie.api.runtime.rule.AgendaFilter agendaFilter,
int fireLimit)
WorkingMemoryfireAllRules in interface WorkingMemoryfireAllRules in interface org.kie.api.runtime.rule.StatefulRuleSessionpublic void fireUntilHalt()
fireUntilHalt in interface org.kie.api.runtime.rule.StatefulRuleSessionIllegalStateException - if this method is called when running in sequential modepublic void fireUntilHalt(org.kie.api.runtime.rule.AgendaFilter agendaFilter)
fireUntilHalt in interface org.kie.api.runtime.rule.StatefulRuleSessionagendaFilter - filters the activations that may fireIllegalStateException - if this method is called when running in sequential modepublic Object getObject(org.kie.api.runtime.rule.FactHandle handle)
FactHandle. It
actually attempts to return the value from the handle, before retrieving
it from objects map.getObject in interface WorkingMemorygetObject in interface org.kie.api.runtime.rule.EntryPointhandle - The FactHandle reference for the
Object lookupWorkingMemorypublic ObjectStore getObjectStore()
getObjectStore in interface InternalWorkingMemorygetObjectStore in interface WorkingMemoryEntryPointpublic org.kie.api.runtime.rule.FactHandle getFactHandle(Object object)
WorkingMemoryFactHandle associated with an Object.getFactHandle in interface WorkingMemorygetFactHandle in interface org.kie.api.runtime.rule.EntryPointobject - The object.WorkingMemorypublic org.kie.api.runtime.rule.FactHandle getFactHandleByIdentity(Object object)
InternalWorkingMemorygetFactHandleByIdentity in interface InternalWorkingMemorygetFactHandleByIdentity in interface WorkingMemorygetFactHandleByIdentity in interface WorkingMemoryEntryPointWorkingMemorypublic Iterator iterateObjects()
iterateObjects in interface WorkingMemorypublic Iterator iterateObjects(org.kie.api.runtime.ObjectFilter filter)
iterateObjects in interface WorkingMemorypublic Iterator<InternalFactHandle> iterateFactHandles()
iterateFactHandles in interface WorkingMemorypublic Iterator<InternalFactHandle> iterateFactHandles(org.kie.api.runtime.ObjectFilter filter)
iterateFactHandles in interface WorkingMemorypublic void setFocus(String focus)
WorkingMemorysetFocus in interface WorkingMemorypublic org.kie.api.runtime.rule.FactHandle insertAsync(Object object)
insertAsync in interface InternalWorkingMemoryActionspublic org.kie.api.runtime.rule.FactHandle insert(Object object)
insert in interface org.kie.api.runtime.rule.EntryPointWorkingMemorypublic org.kie.api.runtime.rule.FactHandle insert(Object object, boolean dynamic)
WorkingMemoryEntryPointPropertyChangeListeners
on the Object to automatically trigger update calls
if dynamic is true.insert in interface WorkingMemoryEntryPointobject - The fact object.dynamic - true if Drools should add JavaBean
PropertyChangeListeners to the object.public void submit(org.kie.api.runtime.KieSession.AtomicAction action)
submit in interface org.kie.api.runtime.KieSessionpublic void updateTraits(InternalFactHandle h, BitMask mask, Class<?> modifiedClass, Activation activation)
updateTraits in interface InternalWorkingMemoryActionspublic <T,K,X extends TraitableBean> Thing<K> shed(Activation activation, TraitableBean<K,X> core, Class<T> trait)
shed in interface InternalWorkingMemoryActionspublic <T,K> T don(Activation activation, K core, Collection<Class<? extends Thing>> traits, boolean b, org.kie.api.internal.runtime.beliefs.Mode[] modes)
don in interface InternalWorkingMemoryActionspublic <T,K> T don(Activation activation, K core, Class<T> trait, boolean b, org.kie.api.internal.runtime.beliefs.Mode[] modes)
don in interface InternalWorkingMemoryActionspublic org.kie.api.runtime.rule.FactHandle insert(Object object, boolean dynamic, RuleImpl rule, TerminalNode terminalNode)
insert in interface InternalWorkingMemoryActionspublic void retract(org.kie.api.runtime.rule.FactHandle handle)
retract in interface org.kie.api.runtime.rule.EntryPointpublic void delete(org.kie.api.runtime.rule.FactHandle handle)
delete in interface org.kie.api.runtime.rule.EntryPointpublic void delete(org.kie.api.runtime.rule.FactHandle handle,
org.kie.api.runtime.rule.FactHandle.State fhState)
delete in interface org.kie.api.runtime.rule.EntryPointpublic void delete(org.kie.api.runtime.rule.FactHandle factHandle,
RuleImpl rule,
TerminalNode terminalNode)
delete in interface WorkingMemoryEntryPointpublic void delete(org.kie.api.runtime.rule.FactHandle factHandle,
RuleImpl rule,
TerminalNode terminalNode,
org.kie.api.runtime.rule.FactHandle.State fhState)
delete in interface WorkingMemoryEntryPointpublic EntryPointNode getEntryPointNode()
getEntryPointNode in interface InternalWorkingMemorygetEntryPointNode in interface WorkingMemoryEntryPointpublic void update(org.kie.api.runtime.rule.FactHandle handle,
Object object)
update in interface org.kie.api.runtime.rule.EntryPointpublic void update(org.kie.api.runtime.rule.FactHandle handle,
Object object,
String... modifiedProperties)
update in interface org.kie.api.runtime.rule.EntryPointpublic void update(org.kie.api.runtime.rule.FactHandle factHandle,
Object object,
BitMask mask,
Class<?> modifiedClass,
Activation activation)
update in interface InternalWorkingMemoryActionsupdate in interface WorkingMemoryEntryPointWorkingMemorypublic void executeQueuedActions()
executeQueuedActions in interface InternalKnowledgeRuntimepublic void queueWorkingMemoryAction(WorkingMemoryAction action)
queueWorkingMemoryAction in interface InternalKnowledgeRuntimequeueWorkingMemoryAction in interface InternalWorkingMemorypublic <T extends Memory> T getNodeMemory(MemoryFactory<T> node)
JoinMemory for a particular
JoinNode.getNodeMemory in interface InternalWorkingMemorynode - The JoinNode key.public void clearNodeMemory(MemoryFactory node)
clearNodeMemory in interface InternalWorkingMemorypublic NodeMemories getNodeMemories()
getNodeMemories in interface InternalWorkingMemorypublic RuleRuntimeEventSupport getRuleRuntimeEventSupport()
getRuleRuntimeEventSupport in interface EventSupportpublic AgendaEventSupport getAgendaEventSupport()
getAgendaEventSupport in interface EventSupportpublic void setAsyncExceptionHandler(AsyncExceptionHandler handler)
setAsyncExceptionHandler in interface WorkingMemorypublic long getNextPropagationIdCounter()
getNextPropagationIdCounter in interface InternalWorkingMemorypublic long getPropagationIdCounter()
public Lock getLock()
getLock in interface InternalWorkingMemorypublic org.kie.api.runtime.process.ProcessInstance startProcess(String processId)
WorkingMemorystartProcess in interface WorkingMemorystartProcess in interface org.kie.api.runtime.process.ProcessRuntimepublic org.kie.api.runtime.process.ProcessInstance startProcess(String processId, Map<String,Object> parameters)
WorkingMemorystartProcess in interface WorkingMemorystartProcess in interface org.kie.api.runtime.process.ProcessRuntimepublic org.kie.api.runtime.process.ProcessInstance createProcessInstance(String processId, Map<String,Object> parameters)
createProcessInstance in interface org.kie.api.runtime.process.ProcessRuntimepublic org.kie.api.runtime.process.ProcessInstance startProcessInstance(long processInstanceId)
startProcessInstance in interface org.kie.api.runtime.process.ProcessRuntimepublic Collection<org.kie.api.runtime.process.ProcessInstance> getProcessInstances()
WorkingMemorygetProcessInstances in interface WorkingMemorygetProcessInstances in interface org.kie.api.runtime.process.ProcessRuntimepublic org.kie.api.runtime.process.ProcessInstance getProcessInstance(long processInstanceId)
WorkingMemorygetProcessInstance in interface WorkingMemorygetProcessInstance in interface org.kie.api.runtime.process.ProcessRuntimepublic org.kie.api.runtime.process.ProcessInstance startProcess(String processId, org.kie.internal.process.CorrelationKey correlationKey, Map<String,Object> parameters)
startProcess in interface org.kie.internal.process.CorrelationAwareProcessRuntimepublic org.kie.api.runtime.process.ProcessInstance createProcessInstance(String processId, org.kie.internal.process.CorrelationKey correlationKey, Map<String,Object> parameters)
createProcessInstance in interface org.kie.internal.process.CorrelationAwareProcessRuntimepublic org.kie.api.runtime.process.ProcessInstance getProcessInstance(org.kie.internal.process.CorrelationKey correlationKey)
getProcessInstance in interface org.kie.internal.process.CorrelationAwareProcessRuntimepublic org.kie.api.runtime.process.ProcessInstance getProcessInstance(long processInstanceId,
boolean readOnly)
getProcessInstance in interface WorkingMemorygetProcessInstance in interface org.kie.api.runtime.process.ProcessRuntimepublic org.kie.api.runtime.process.WorkItemManager getWorkItemManager()
getWorkItemManager in interface WorkingMemorygetWorkItemManager in interface org.kie.api.runtime.process.ProcessRuntimepublic WorkingMemoryEntryPoint getWorkingMemoryEntryPoint(String name)
WorkingMemorygetWorkingMemoryEntryPoint in interface WorkingMemorygetWorkingMemoryEntryPoint in interface WorkingMemoryEntryPointname - the id of the entry point, as defined in the rules filepublic Map<String,WorkingMemoryEntryPoint> getWorkingMemoryEntryPoints()
public ObjectTypeConfigurationRegistry getObjectTypeConfigurationRegistry()
getObjectTypeConfigurationRegistry in interface InternalWorkingMemorygetObjectTypeConfigurationRegistry in interface WorkingMemoryEntryPointpublic InternalFactHandle getInitialFactHandle()
getInitialFactHandle in interface InternalWorkingMemorypublic void setInitialFactHandle(InternalFactHandle initialFactHandle)
public TimerService getTimerService()
InternalWorkingMemorygetTimerService in interface InternalKnowledgeRuntimegetTimerService in interface InternalWorkingMemorypublic org.kie.api.time.SessionClock getSessionClock()
WorkingMemorygetSessionClock in interface WorkingMemorygetSessionClock in interface org.kie.api.runtime.KieRuntimepublic void startBatchExecution()
startBatchExecution in interface InternalWorkingMemorypublic void endBatchExecution()
endBatchExecution in interface InternalWorkingMemorypublic InternalKnowledgeRuntime getKnowledgeRuntime()
getKnowledgeRuntime in interface InternalWorkingMemorypublic void registerChannel(String name, org.kie.api.runtime.Channel channel)
registerChannel in interface org.kie.api.runtime.KieRuntimepublic void unregisterChannel(String name)
unregisterChannel in interface org.kie.api.runtime.KieRuntimepublic Map<String,org.kie.api.runtime.Channel> getChannels()
InternalWorkingMemorygetChannels in interface InternalWorkingMemorygetChannels in interface org.kie.api.runtime.KieRuntimepublic long getFactCount()
getFactCount in interface org.kie.api.runtime.rule.EntryPointpublic long getTotalFactCount()
InternalWorkingMemorygetTotalFactCount in interface InternalWorkingMemorypublic void startOperation()
startOperation in interface InternalKnowledgeRuntimestartOperation in interface InternalWorkingMemorypublic void setEndOperationListener(EndOperationListener listener)
setEndOperationListener in interface InternalKnowledgeRuntimepublic void endOperation()
endOperation in interface InternalKnowledgeRuntimeendOperation in interface InternalWorkingMemorypublic long getIdleTime()
getIdleTime in interface InternalWorkingMemorypublic long getLastIdleTimestamp()
getLastIdleTimestamp in interface InternalKnowledgeRuntimepublic void prepareToFireActivation()
InternalWorkingMemoryprepareToFireActivation in interface InternalWorkingMemorypublic void activationFired()
InternalWorkingMemoryactivationFired in interface InternalWorkingMemorypublic long getTimeToNextJob()
getTimeToNextJob in interface InternalWorkingMemorypublic void addPropagation(PropagationEntry propagationEntry)
addPropagation in interface InternalWorkingMemorypublic void flushPropagations()
flushPropagations in interface InternalWorkingMemorypublic void notifyWaitOnRest()
notifyWaitOnRest in interface InternalWorkingMemorypublic Iterator<? extends PropagationEntry> getActionsIterator()
getActionsIterator in interface InternalWorkingMemorypublic void activate()
activate in interface InternalWorkingMemorypublic void deactivate()
deactivate in interface InternalWorkingMemorypublic boolean tryDeactivate()
tryDeactivate in interface InternalWorkingMemorypublic void cancelActivation(Activation activation, boolean declarativeAgenda)
cancelActivation in interface InternalWorkingMemorypublic PropagationList getPropagationList()
getPropagationList in interface InternalWorkingMemorypublic List iterateObjectsToList()
public List iterateNonDefaultEntryPointObjectsToList()
public Map.Entry[] getActivationParameters(long activationId)
public Map getActivationParameters(Activation activation)
Copyright © 2001–2019 JBoss by Red Hat. All rights reserved.