Package org.drools.core.base
Class WrappedStatefulKnowledgeSessionForRHS
- java.lang.Object
-
- org.drools.core.base.WrappedStatefulKnowledgeSessionForRHS
-
- All Implemented Interfaces:
Externalizable
,Serializable
,EventSupport
,InternalWorkingMemory
,InternalWorkingMemoryActions
,WorkingMemory
,WorkingMemoryEntryPoint
,WorkingMemoryEventManager
,org.kie.api.event.kiebase.KieBaseEventManager
,org.kie.api.event.KieRuntimeEventManager
,org.kie.api.event.process.ProcessEventManager
,org.kie.api.event.rule.RuleRuntimeEventManager
,org.kie.api.runtime.CommandExecutor
,org.kie.api.runtime.KieRuntime
,org.kie.api.runtime.KieSession
,org.kie.api.runtime.process.ProcessRuntime
,org.kie.api.runtime.process.StatefulProcessSession
,org.kie.api.runtime.rule.EntryPoint
,org.kie.api.runtime.rule.RuleRuntime
,org.kie.api.runtime.rule.StatefulRuleSession
public class WrappedStatefulKnowledgeSessionForRHS extends Object implements org.kie.api.runtime.KieSession, InternalWorkingMemoryActions, EventSupport, org.kie.api.runtime.KieRuntime, Externalizable
Wrapper of StatefulKnowledgeSessionImpl so to intercept call from RHS internal Drools execution and proxy or delegate method call as appropriate.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected StatefulKnowledgeSessionImpl
delegate
-
Constructor Summary
Constructors Constructor Description WrappedStatefulKnowledgeSessionForRHS()
This should be used just by deserialization.WrappedStatefulKnowledgeSessionForRHS(WorkingMemory workingMemory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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.kiebase.KieBaseEventListener listener)
void
addEventListener(org.kie.api.event.process.ProcessEventListener listener)
void
addEventListener(org.kie.api.event.rule.AgendaEventListener listener)
Add an event listener.void
addEventListener(org.kie.api.event.rule.RuleRuntimeEventListener listener)
Add an event listener.void
addEventListener(org.kie.internal.event.rule.RuleEventListener listener)
void
addPropagation(PropagationEntry propagationEntry)
void
cancelActivation(Activation activation, boolean declarativeAgenda)
void
clearActivationGroup(String group)
Clears the Activation Group, cancellings all its Activationsvoid
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 Activationsvoid
closeLiveQuery(InternalFactHandle factHandle)
org.kie.api.runtime.process.ProcessInstance
createProcessInstance(String processId, Map<String,Object> parameters)
org.kie.api.runtime.process.ProcessInstance
createProcessInstance(String processId, org.kie.internal.process.CorrelationKey correlationKey, 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, 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
delete(org.kie.api.runtime.rule.FactHandle handle, 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>
Tdon(Activation activation, K core, Class<T> trait, boolean b, org.kie.api.internal.runtime.beliefs.Mode[] modes)
<T,K>
Tdon(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.boolean
equals(Object obj)
<T> T
execute(org.kie.api.command.Command<T> command)
void
executeQueuedActions()
int
fireAllRules()
Fire all items on the agenda until empty.int
fireAllRules(int fireLimit)
Fire all items on the agenda until empty or at most 'fireLimit' rules have firedint
fireAllRules(org.kie.api.runtime.rule.AgendaFilter agendaFilter)
Fire all items on the agenda until empty, using the given AgendaFilerint
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 firedvoid
fireUntilHalt()
void
fireUntilHalt(org.kie.api.runtime.rule.AgendaFilter agendaFilter)
void
flushPropagations()
Iterator<? extends PropagationEntry>
getActionsIterator()
Map.Entry[]
getActivationParameters(long activationId)
Map
getActivationParameters(Activation activation)
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 memoryEntryPointId
getEntryPoint()
org.kie.api.runtime.rule.EntryPoint
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 theFactHandle
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>
Collection<T>getFactHandles()
<T extends org.kie.api.runtime.rule.FactHandle>
Collection<T>getFactHandles(org.kie.api.runtime.ObjectFilter filter)
Object
getGlobal(String identifier)
Retrieve a specific instance of global data by identifierGlobalResolver
getGlobalResolver()
Returns the current GlobalResolverorg.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 theRuleBase
for this working memory.InternalKnowledgeRuntime
getKnowledgeRuntime()
long
getLastIdleTimestamp()
Lock
getLock()
org.kie.api.logger.KieRuntimeLogger
getLogger()
long
getNextPropagationIdCounter()
NodeMemories
getNodeMemories()
<T extends Memory>
TgetNodeMemory(MemoryFactory<T> node)
Object
getObject(org.kie.api.runtime.rule.FactHandle handle)
Retrieve the object associated with aFactHandle
.Collection<? extends Object>
getObjects()
Collection<? extends Object>
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(long id)
Returns the process instance with the given id.org.kie.api.runtime.process.ProcessInstance
getProcessInstance(long id, boolean readOnly)
org.kie.api.runtime.process.ProcessInstance
getProcessInstance(Object id)
org.kie.api.runtime.process.ProcessInstance
getProcessInstance(org.kie.internal.process.CorrelationKey correlationKey)
Collection<org.kie.api.runtime.process.ProcessInstance>
getProcessInstances()
Returns the list of process instances of this working memory.InternalProcessRuntime
getProcessRuntime()
long
getPropagationIdCounter()
org.kie.api.runtime.rule.QueryResults
getQueryResults(String queryName, Object... arguments)
Retrieve the QueryResults of the specified query and argumentsRuleEventListenerSupport
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 sessionSessionConfiguration
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 joblong
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 id)
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 executingint
hashCode()
void
initInitialFact(InternalKnowledgeBase kBase, MarshallerReaderContext context)
org.kie.api.runtime.rule.FactHandle
insert(Object object)
org.kie.api.runtime.rule.FactHandle
insert(Object object, boolean dynamic)
Insert a fact registering JavaBeanPropertyChangeListeners
on the Object to automatically triggerupdate
calls ifdynamic
istrue
.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()
boolean
isAlive()
boolean
isSequential()
Iterator<InternalFactHandle>
iterateFactHandles()
Returns an Iterator for the FactHandles in the Working Memory.Iterator<InternalFactHandle>
iterateFactHandles(org.kie.api.runtime.ObjectFilter filter)
Returns an Iterator for the Objects in the Working Memory.List
iterateNonDefaultEntryPointObjectsToList()
Iterator<?>
iterateObjects()
Returns an Iterator for the Objects in the Working Memory.Iterator<?>
iterateObjects(org.kie.api.runtime.ObjectFilter filter)
Returns an Iterator for the Objects in the Working Memory.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.kiebase.KieBaseEventListener listener)
void
removeEventListener(org.kie.api.event.process.ProcessEventListener listener)
void
removeEventListener(org.kie.api.event.rule.AgendaEventListener listener)
Remove an event listener.void
removeEventListener(org.kie.api.event.rule.RuleRuntimeEventListener listener)
Remove an event listener.void
removeEventListener(org.kie.internal.event.rule.RuleEventListener listener)
void
removeGlobal(String identifier)
void
reset()
void
reset(int 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 AgendaGroupvoid
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
setIdentifier(long id)
void
setLogger(org.kie.api.logger.KieRuntimeLogger logger)
void
setRuleRuntimeEventSupport(RuleRuntimeEventSupport workingMemoryEventSupport)
<T,K,X extends TraitableBean>
Thing<K>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, Map<String,Object> parameters)
Starts a new process instance for the process with the given id.org.kie.api.runtime.process.ProcessInstance
startProcess(String processId, Map<String,Object> parameters, org.kie.api.runtime.rule.AgendaFilter agendaFilter)
org.kie.api.runtime.process.ProcessInstance
startProcess(String processId, org.kie.api.runtime.rule.AgendaFilter agendaFilter)
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
startProcessFromNodeIds(String processId, Map<String,Object> params, String... nodeIds)
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 handle, Object object, String... modifiedProperties)
void
update(org.kie.api.runtime.rule.FactHandle handle, Object object, BitMask mask, Class<?> modifiedClass, Activation activation)
void
updateEntryPointsCache()
void
updateTraits(InternalFactHandle h, BitMask mask, Class<?> modifiedClass, Activation activation)
void
writeExternal(ObjectOutput out)
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.drools.core.common.InternalWorkingMemory
createKnowledgeHelper, createKnowledgeHelper, getPropagationList, getStoreForClass, onResume, onSuspend
-
Methods inherited from interface org.drools.core.WorkingMemoryEntryPoint
getRuleUnit, setRuleUnit
-
-
-
-
Field Detail
-
delegate
protected StatefulKnowledgeSessionImpl delegate
-
-
Constructor Detail
-
WrappedStatefulKnowledgeSessionForRHS
public WrappedStatefulKnowledgeSessionForRHS(WorkingMemory workingMemory)
-
WrappedStatefulKnowledgeSessionForRHS
public WrappedStatefulKnowledgeSessionForRHS()
This should be used just by deserialization. Please avoid using this empty constructor in your code.
-
-
Method Detail
-
readExternal
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
- Specified by:
readExternal
in interfaceExternalizable
- Throws:
IOException
ClassNotFoundException
-
writeExternal
public void writeExternal(ObjectOutput out) throws IOException
- Specified by:
writeExternal
in interfaceExternalizable
- Throws:
IOException
-
getQueryResults
public org.kie.api.runtime.rule.QueryResults getQueryResults(String queryName, Object... arguments)
Description copied from interface:WorkingMemory
Retrieve the QueryResults of the specified query and arguments- Specified by:
getQueryResults
in interfaceorg.kie.api.runtime.rule.RuleRuntime
- Specified by:
getQueryResults
in interfaceWorkingMemory
- Parameters:
queryName
- The name of the query.arguments
- The arguments used for the query- Returns:
- The QueryResults of the specified query. If no results match the query it is empty.
-
getLogger
public org.kie.api.logger.KieRuntimeLogger getLogger()
- Specified by:
getLogger
in interfaceorg.kie.api.event.KieRuntimeEventManager
-
setLogger
public void setLogger(org.kie.api.logger.KieRuntimeLogger logger)
-
getKieRuntime
public <T> T getKieRuntime(Class<T> cls)
- Specified by:
getKieRuntime
in interfaceorg.kie.api.runtime.KieSession
-
createRuntimeService
public <T> T createRuntimeService(Class<T> cls)
-
getEntryPointMap
public Map<String,WorkingMemoryEntryPoint> getEntryPointMap()
-
addEventListener
public void addEventListener(org.kie.api.event.process.ProcessEventListener listener)
- Specified by:
addEventListener
in interfaceorg.kie.api.event.process.ProcessEventManager
-
getProcessEventListeners
public Collection<org.kie.api.event.process.ProcessEventListener> getProcessEventListeners()
- Specified by:
getProcessEventListeners
in interfaceorg.kie.api.event.process.ProcessEventManager
-
removeEventListener
public void removeEventListener(org.kie.api.event.process.ProcessEventListener listener)
- Specified by:
removeEventListener
in interfaceorg.kie.api.event.process.ProcessEventManager
-
getKieBase
public org.kie.api.KieBase getKieBase()
- Specified by:
getKieBase
in interfaceorg.kie.api.runtime.KieRuntime
-
isAlive
public boolean isAlive()
-
destroy
public void destroy()
- Specified by:
destroy
in interfaceorg.kie.api.runtime.KieSession
-
update
public void update(org.kie.api.runtime.rule.FactHandle factHandle)
-
abortProcessInstance
public void abortProcessInstance(long id)
- Specified by:
abortProcessInstance
in interfaceorg.kie.api.runtime.process.ProcessRuntime
-
signalEvent
public void signalEvent(String type, Object event)
- Specified by:
signalEvent
in interfaceorg.kie.api.runtime.process.ProcessRuntime
-
signalEvent
public void signalEvent(String type, Object event, long processInstanceId)
- Specified by:
signalEvent
in interfaceorg.kie.api.runtime.process.ProcessRuntime
-
getGlobals
public org.kie.api.runtime.Globals getGlobals()
- Specified by:
getGlobals
in interfaceorg.kie.api.runtime.KieRuntime
-
execute
public <T> T execute(org.kie.api.command.Command<T> command)
- Specified by:
execute
in interfaceorg.kie.api.runtime.CommandExecutor
-
initInitialFact
public void initInitialFact(InternalKnowledgeBase kBase, MarshallerReaderContext context)
-
openLiveQuery
public org.kie.api.runtime.rule.LiveQuery openLiveQuery(String query, Object[] arguments, org.kie.api.runtime.rule.ViewChangedEventListener listener)
- Specified by:
openLiveQuery
in interfaceorg.kie.api.runtime.rule.RuleRuntime
-
reset
public void reset(int handleId, long handleCounter, long propagationCounter)
-
addEventListener
public void addEventListener(org.kie.internal.event.rule.RuleEventListener listener)
-
removeEventListener
public void removeEventListener(org.kie.internal.event.rule.RuleEventListener listener)
-
getId
public int getId()
- Specified by:
getId
in interfaceorg.kie.api.runtime.KieSession
-
fireUntilHalt
public void fireUntilHalt()
- Specified by:
fireUntilHalt
in interfaceorg.kie.api.runtime.rule.StatefulRuleSession
-
fireUntilHalt
public void fireUntilHalt(org.kie.api.runtime.rule.AgendaFilter agendaFilter)
- Specified by:
fireUntilHalt
in interfaceorg.kie.api.runtime.rule.StatefulRuleSession
-
executeQueuedActions
public void executeQueuedActions()
-
getRuleRuntimeEventSupport
public RuleRuntimeEventSupport getRuleRuntimeEventSupport()
- Specified by:
getRuleRuntimeEventSupport
in interfaceEventSupport
-
getRuleEventSupport
public RuleEventListenerSupport getRuleEventSupport()
- Specified by:
getRuleEventSupport
in interfaceEventSupport
-
getAgendaEventSupport
public AgendaEventSupport getAgendaEventSupport()
- Specified by:
getAgendaEventSupport
in interfaceEventSupport
-
getPropagationIdCounter
public long getPropagationIdCounter()
-
createProcessInstance
public org.kie.api.runtime.process.ProcessInstance createProcessInstance(String processId, Map<String,Object> parameters)
- Specified by:
createProcessInstance
in interfaceorg.kie.api.runtime.process.ProcessRuntime
-
startProcessInstance
public org.kie.api.runtime.process.ProcessInstance startProcessInstance(long processInstanceId)
- Specified by:
startProcessInstance
in interfaceorg.kie.api.runtime.process.ProcessRuntime
-
createProcessInstance
public org.kie.api.runtime.process.ProcessInstance createProcessInstance(String processId, org.kie.internal.process.CorrelationKey correlationKey, Map<String,Object> parameters)
-
getProcessInstance
public org.kie.api.runtime.process.ProcessInstance getProcessInstance(org.kie.internal.process.CorrelationKey correlationKey)
-
getWorkingMemoryEntryPoints
public Map<String,WorkingMemoryEntryPoint> getWorkingMemoryEntryPoints()
-
getLastIdleTimestamp
public long getLastIdleTimestamp()
-
getActivationParameters
public Map.Entry[] getActivationParameters(long activationId)
-
startProcess
public org.kie.api.runtime.process.ProcessInstance startProcess(String processId, org.kie.internal.process.CorrelationKey correlationKey, Map<String,Object> parameters)
-
registerChannel
public void registerChannel(String name, org.kie.api.runtime.Channel channel)
- Specified by:
registerChannel
in interfaceorg.kie.api.runtime.KieRuntime
-
unregisterChannel
public void unregisterChannel(String name)
- Specified by:
unregisterChannel
in interfaceorg.kie.api.runtime.KieRuntime
-
setEndOperationListener
public void setEndOperationListener(EndOperationListener listener)
-
iterateObjectsToList
public List iterateObjectsToList()
-
iterateNonDefaultEntryPointObjectsToList
public List iterateNonDefaultEntryPointObjectsToList()
-
getActivationParameters
public Map getActivationParameters(Activation activation)
-
addEventListener
public void addEventListener(org.kie.api.event.kiebase.KieBaseEventListener listener)
- Specified by:
addEventListener
in interfaceorg.kie.api.event.kiebase.KieBaseEventManager
-
insert
public org.kie.api.runtime.rule.FactHandle insert(Object object)
- Specified by:
insert
in interfaceorg.kie.api.runtime.rule.EntryPoint
-
submit
public void submit(org.kie.api.runtime.KieSession.AtomicAction action)
- Specified by:
submit
in interfaceorg.kie.api.runtime.KieSession
-
removeEventListener
public void removeEventListener(org.kie.api.event.kiebase.KieBaseEventListener listener)
- Specified by:
removeEventListener
in interfaceorg.kie.api.event.kiebase.KieBaseEventManager
-
addEventListener
public void addEventListener(org.kie.api.event.rule.RuleRuntimeEventListener listener)
Description copied from interface:WorkingMemoryEventManager
Add an event listener.- Specified by:
addEventListener
in interfaceorg.kie.api.event.rule.RuleRuntimeEventManager
- Specified by:
addEventListener
in interfaceWorkingMemoryEventManager
- Parameters:
listener
- The listener to add.
-
getKieBaseEventListeners
public Collection<org.kie.api.event.kiebase.KieBaseEventListener> getKieBaseEventListeners()
- Specified by:
getKieBaseEventListeners
in interfaceorg.kie.api.event.kiebase.KieBaseEventManager
-
insert
public org.kie.api.runtime.rule.FactHandle insert(Object object, boolean dynamic)
Description copied from interface:WorkingMemoryEntryPoint
Insert a fact registering JavaBeanPropertyChangeListeners
on the Object to automatically triggerupdate
calls ifdynamic
istrue
.- Specified by:
insert
in interfaceWorkingMemoryEntryPoint
- Parameters:
object
- The fact object.dynamic
- true if Drools should add JavaBeanPropertyChangeListeners
to the object.- Returns:
- The new fact-handle associated with the object.
-
update
public void update(org.kie.api.runtime.rule.FactHandle handle, Object object, BitMask mask, Class<?> modifiedClass, Activation activation)
- Specified by:
update
in interfaceInternalWorkingMemoryActions
- Specified by:
update
in interfaceWorkingMemoryEntryPoint
-
removeEventListener
public void removeEventListener(org.kie.api.event.rule.RuleRuntimeEventListener listener)
Description copied from interface:WorkingMemoryEventManager
Remove an event listener.- Specified by:
removeEventListener
in interfaceorg.kie.api.event.rule.RuleRuntimeEventManager
- Specified by:
removeEventListener
in interfaceWorkingMemoryEventManager
- Parameters:
listener
- The listener to remove.
-
delete
public void delete(org.kie.api.runtime.rule.FactHandle factHandle, RuleImpl rule, TerminalNode terminalNode, org.kie.api.runtime.rule.FactHandle.State fhState)
- Specified by:
delete
in interfaceWorkingMemoryEntryPoint
-
delete
public void delete(org.kie.api.runtime.rule.FactHandle handle, RuleImpl rule, TerminalNode terminalNode)
- Specified by:
delete
in interfaceWorkingMemoryEntryPoint
-
insert
public org.kie.api.runtime.rule.FactHandle insert(Object object, boolean dynamic, RuleImpl rule, TerminalNode terminalNode)
- Specified by:
insert
in interfaceInternalWorkingMemoryActions
-
insertAsync
public org.kie.api.runtime.rule.FactHandle insertAsync(Object object)
- Specified by:
insertAsync
in interfaceInternalWorkingMemoryActions
-
getRuleRuntimeEventListeners
public Collection<org.kie.api.event.rule.RuleRuntimeEventListener> getRuleRuntimeEventListeners()
Description copied from interface:WorkingMemoryEventManager
Returns all event listeners.- Specified by:
getRuleRuntimeEventListeners
in interfaceEventSupport
- Specified by:
getRuleRuntimeEventListeners
in interfaceorg.kie.api.event.rule.RuleRuntimeEventManager
- Specified by:
getRuleRuntimeEventListeners
in interfaceWorkingMemoryEventManager
- Returns:
- listeners The listeners.
-
addEventListener
public void addEventListener(org.kie.api.event.rule.AgendaEventListener listener)
Description copied from interface:WorkingMemoryEventManager
Add an event listener.- Specified by:
addEventListener
in interfaceorg.kie.api.event.rule.RuleRuntimeEventManager
- Specified by:
addEventListener
in interfaceWorkingMemoryEventManager
- Parameters:
listener
- The listener to add.
-
getEntryPointId
public String getEntryPointId()
- Specified by:
getEntryPointId
in interfaceorg.kie.api.runtime.rule.EntryPoint
-
retract
public void retract(org.kie.api.runtime.rule.FactHandle handle)
- Specified by:
retract
in interfaceorg.kie.api.runtime.rule.EntryPoint
-
getTruthMaintenanceSystem
public TruthMaintenanceSystem getTruthMaintenanceSystem()
- Specified by:
getTruthMaintenanceSystem
in interfaceWorkingMemoryEntryPoint
-
getAgenda
public InternalAgenda getAgenda()
Description copied from interface:WorkingMemory
Returns the Agenda for this WorkingMemory. While the WorkingMemory interface is considered public, the Agenda interface is more subject to change.- Specified by:
getAgenda
in interfaceInternalWorkingMemory
- Specified by:
getAgenda
in interfaceorg.kie.api.runtime.rule.RuleRuntime
- Specified by:
getAgenda
in interfaceWorkingMemory
- Returns:
- the Agenda
-
getIdentifier
public long getIdentifier()
- Specified by:
getIdentifier
in interfaceInternalWorkingMemory
- Specified by:
getIdentifier
in interfaceorg.kie.api.runtime.KieSession
-
setIdentifier
public void setIdentifier(long id)
- Specified by:
setIdentifier
in interfaceInternalWorkingMemory
-
getInternalWorkingMemory
public InternalWorkingMemory getInternalWorkingMemory()
- Specified by:
getInternalWorkingMemory
in interfaceWorkingMemoryEntryPoint
-
setRuleRuntimeEventSupport
public void setRuleRuntimeEventSupport(RuleRuntimeEventSupport workingMemoryEventSupport)
- Specified by:
setRuleRuntimeEventSupport
in interfaceInternalWorkingMemory
-
removeEventListener
public void removeEventListener(org.kie.api.event.rule.AgendaEventListener listener)
Description copied from interface:WorkingMemoryEventManager
Remove an event listener.- Specified by:
removeEventListener
in interfaceorg.kie.api.event.rule.RuleRuntimeEventManager
- Specified by:
removeEventListener
in interfaceWorkingMemoryEventManager
- Parameters:
listener
- The listener to remove.
-
updateTraits
public void updateTraits(InternalFactHandle h, BitMask mask, Class<?> modifiedClass, Activation activation)
- Specified by:
updateTraits
in interfaceInternalWorkingMemoryActions
-
update
public void update(org.kie.api.runtime.rule.FactHandle handle, Object object)
- Specified by:
update
in interfaceorg.kie.api.runtime.rule.EntryPoint
-
update
public void update(org.kie.api.runtime.rule.FactHandle handle, Object object, String... modifiedProperties)
- Specified by:
update
in interfaceorg.kie.api.runtime.rule.EntryPoint
-
setAgendaEventSupport
public void setAgendaEventSupport(AgendaEventSupport agendaEventSupport)
- Specified by:
setAgendaEventSupport
in interfaceInternalWorkingMemory
-
setGlobal
public void setGlobal(String identifier, Object value)
Description copied from interface:WorkingMemory
Set a specific instance as a global in this working memory. Null values will return doing nothing. The global identifier and its type must be declared in the drl.- Specified by:
setGlobal
in interfaceorg.kie.api.runtime.KieRuntime
- Specified by:
setGlobal
in interfaceWorkingMemory
- Parameters:
identifier
- the identifier under which to populate the datavalue
- the global value, cannot be null
-
reset
public void reset()
- Specified by:
reset
in interfaceWorkingMemoryEntryPoint
-
shed
public <T,K,X extends TraitableBean> Thing<K> shed(Activation activation, TraitableBean<K,X> core, Class<T> trait)
- Specified by:
shed
in interfaceInternalWorkingMemoryActions
-
getNodeMemory
public <T extends Memory> T getNodeMemory(MemoryFactory<T> node)
- Specified by:
getNodeMemory
in interfaceInternalWorkingMemory
-
getHandleFactory
public FactHandleFactory getHandleFactory()
- Specified by:
getHandleFactory
in interfaceWorkingMemoryEntryPoint
-
getAgendaEventListeners
public Collection<org.kie.api.event.rule.AgendaEventListener> getAgendaEventListeners()
Description copied from interface:WorkingMemoryEventManager
Returns all event listeners.- Specified by:
getAgendaEventListeners
in interfaceEventSupport
- Specified by:
getAgendaEventListeners
in interfaceorg.kie.api.event.rule.RuleRuntimeEventManager
- Specified by:
getAgendaEventListeners
in interfaceWorkingMemoryEventManager
- Returns:
- listeners The listeners.
-
clearNodeMemory
public void clearNodeMemory(MemoryFactory node)
- Specified by:
clearNodeMemory
in interfaceInternalWorkingMemory
-
don
public <T,K> T don(Activation activation, K core, Collection<Class<? extends Thing>> traits, boolean b, org.kie.api.internal.runtime.beliefs.Mode[] modes)
- Specified by:
don
in interfaceInternalWorkingMemoryActions
-
getNodeMemories
public NodeMemories getNodeMemories()
- Specified by:
getNodeMemories
in interfaceInternalWorkingMemory
-
getNextPropagationIdCounter
public long getNextPropagationIdCounter()
- Specified by:
getNextPropagationIdCounter
in interfaceInternalWorkingMemory
-
getObjectStore
public ObjectStore getObjectStore()
- Specified by:
getObjectStore
in interfaceInternalWorkingMemory
- Specified by:
getObjectStore
in interfaceWorkingMemoryEntryPoint
-
don
public <T,K> T don(Activation activation, K core, Class<T> trait, boolean b, org.kie.api.internal.runtime.beliefs.Mode[] modes)
- Specified by:
don
in interfaceInternalWorkingMemoryActions
-
queueWorkingMemoryAction
public void queueWorkingMemoryAction(WorkingMemoryAction action)
- Specified by:
queueWorkingMemoryAction
in interfaceInternalWorkingMemory
-
delete
public void delete(org.kie.api.runtime.rule.FactHandle handle)
- Specified by:
delete
in interfaceorg.kie.api.runtime.rule.EntryPoint
-
dispose
public void dispose()
Description copied from interface:WorkingMemoryEntryPoint
Internal method called by the engine when the session is being disposed, so that the entry point can proceed with the necessary clean ups.- Specified by:
dispose
in interfaceorg.kie.api.runtime.KieSession
- Specified by:
dispose
in interfaceWorkingMemoryEntryPoint
-
getFactHandleFactory
public FactHandleFactory getFactHandleFactory()
- Specified by:
getFactHandleFactory
in interfaceInternalWorkingMemory
-
getGlobal
public Object getGlobal(String identifier)
Description copied from interface:WorkingMemory
Retrieve a specific instance of global data by identifier- Specified by:
getGlobal
in interfaceorg.kie.api.runtime.KieRuntime
- Specified by:
getGlobal
in interfaceWorkingMemory
- Returns:
- application data or null if nothing is set under this identifier
-
getEntryPoint
public EntryPointId getEntryPoint()
- Specified by:
getEntryPoint
in interfaceInternalWorkingMemory
- Specified by:
getEntryPoint
in interfaceWorkingMemoryEntryPoint
-
getEntryPointNode
public EntryPointNode getEntryPointNode()
- Specified by:
getEntryPointNode
in interfaceInternalWorkingMemory
- Specified by:
getEntryPointNode
in interfaceWorkingMemoryEntryPoint
-
getEntryPoint
public org.kie.api.runtime.rule.EntryPoint getEntryPoint(String name)
- Specified by:
getEntryPoint
in interfaceInternalWorkingMemory
- Specified by:
getEntryPoint
in interfaceorg.kie.api.runtime.rule.RuleRuntime
-
delete
public void delete(org.kie.api.runtime.rule.FactHandle handle, org.kie.api.runtime.rule.FactHandle.State fhState)
- Specified by:
delete
in interfaceorg.kie.api.runtime.rule.EntryPoint
-
getEnvironment
public org.kie.api.runtime.Environment getEnvironment()
- Specified by:
getEnvironment
in interfaceorg.kie.api.runtime.KieRuntime
- Specified by:
getEnvironment
in interfaceWorkingMemory
-
setGlobalResolver
public void setGlobalResolver(GlobalResolver globalResolver)
Description copied from interface:WorkingMemory
Sets the GlobalResolver instance to be used when resolving globals, replaces the current GlobalResolver. Typcicaly a delegating GlobalResolver is created that first gets a reference to the current GlobalResolver, for delegating- Specified by:
setGlobalResolver
in interfaceWorkingMemory
-
getFactHandleByIdentity
public org.kie.api.runtime.rule.FactHandle getFactHandleByIdentity(Object object)
Description copied from interface:InternalWorkingMemory
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.- Specified by:
getFactHandleByIdentity
in interfaceInternalWorkingMemory
- Specified by:
getFactHandleByIdentity
in interfaceWorkingMemory
- Specified by:
getFactHandleByIdentity
in interfaceWorkingMemoryEntryPoint
- Returns:
- null if fact handle not found
-
getGlobalResolver
public GlobalResolver getGlobalResolver()
Description copied from interface:WorkingMemory
Returns the current GlobalResolver- Specified by:
getGlobalResolver
in interfaceWorkingMemory
- Returns:
-
getKnowledgeBase
public InternalKnowledgeBase getKnowledgeBase()
Description copied from interface:WorkingMemory
Retrieve theRuleBase
for this working memory.- Specified by:
getKnowledgeBase
in interfaceWorkingMemory
- Specified by:
getKnowledgeBase
in interfaceWorkingMemoryEntryPoint
- Returns:
- The
RuleBase
.
-
getLock
public Lock getLock()
- Specified by:
getLock
in interfaceInternalWorkingMemory
-
isSequential
public boolean isSequential()
- Specified by:
isSequential
in interfaceInternalWorkingMemory
-
fireAllRules
public int fireAllRules()
Description copied from interface:WorkingMemory
Fire all items on the agenda until empty.- Specified by:
fireAllRules
in interfaceorg.kie.api.runtime.rule.StatefulRuleSession
- Specified by:
fireAllRules
in interfaceWorkingMemory
-
getObjectTypeConfigurationRegistry
public ObjectTypeConfigurationRegistry getObjectTypeConfigurationRegistry()
- Specified by:
getObjectTypeConfigurationRegistry
in interfaceInternalWorkingMemory
- Specified by:
getObjectTypeConfigurationRegistry
in interfaceWorkingMemoryEntryPoint
-
getInitialFactHandle
public InternalFactHandle getInitialFactHandle()
- Specified by:
getInitialFactHandle
in interfaceInternalWorkingMemory
-
fireAllRules
public int fireAllRules(org.kie.api.runtime.rule.AgendaFilter agendaFilter)
Description copied from interface:WorkingMemory
Fire all items on the agenda until empty, using the given AgendaFiler- Specified by:
fireAllRules
in interfaceorg.kie.api.runtime.rule.StatefulRuleSession
- Specified by:
fireAllRules
in interfaceWorkingMemory
-
getCalendars
public org.kie.api.runtime.Calendars getCalendars()
- Specified by:
getCalendars
in interfaceInternalWorkingMemory
- Specified by:
getCalendars
in interfaceorg.kie.api.runtime.KieRuntime
-
getTimerService
public TimerService getTimerService()
Description copied from interface:InternalWorkingMemory
Returns the TimerService instance (session clock) for this session.- Specified by:
getTimerService
in interfaceInternalWorkingMemory
- Returns:
-
fireAllRules
public int fireAllRules(int fireLimit)
Description copied from interface:WorkingMemory
Fire all items on the agenda until empty or at most 'fireLimit' rules have fired- Specified by:
fireAllRules
in interfaceorg.kie.api.runtime.rule.StatefulRuleSession
- Specified by:
fireAllRules
in interfaceWorkingMemory
-
getKnowledgeRuntime
public InternalKnowledgeRuntime getKnowledgeRuntime()
- Specified by:
getKnowledgeRuntime
in interfaceInternalWorkingMemory
-
fireAllRules
public int fireAllRules(org.kie.api.runtime.rule.AgendaFilter agendaFilter, int fireLimit)
Description copied from interface:WorkingMemory
Fire all items on the agenda using the given AgendaFiler until empty or at most 'fireLimit' rules have fired- Specified by:
fireAllRules
in interfaceorg.kie.api.runtime.rule.StatefulRuleSession
- Specified by:
fireAllRules
in interfaceWorkingMemory
-
getChannels
public Map<String,org.kie.api.runtime.Channel> getChannels()
Description copied from interface:InternalWorkingMemory
Returns a map of channel Id->Channel of all channels in this working memory- Specified by:
getChannels
in interfaceInternalWorkingMemory
- Specified by:
getChannels
in interfaceorg.kie.api.runtime.KieRuntime
- Returns:
-
getEntryPoints
public Collection<? extends org.kie.api.runtime.rule.EntryPoint> getEntryPoints()
- Specified by:
getEntryPoints
in interfaceInternalWorkingMemory
- Specified by:
getEntryPoints
in interfaceorg.kie.api.runtime.rule.RuleRuntime
-
getObject
public Object getObject(org.kie.api.runtime.rule.FactHandle handle)
Description copied from interface:WorkingMemory
Retrieve the object associated with aFactHandle
.- Specified by:
getObject
in interfaceorg.kie.api.runtime.rule.EntryPoint
- Specified by:
getObject
in interfaceWorkingMemory
- Parameters:
handle
- The fact handle.- Returns:
- The associated object.
-
getSessionConfiguration
public SessionConfiguration getSessionConfiguration()
- Specified by:
getSessionConfiguration
in interfaceInternalWorkingMemory
- Specified by:
getSessionConfiguration
in interfaceorg.kie.api.runtime.KieRuntime
-
getObjects
public Collection<? extends Object> getObjects()
- Specified by:
getObjects
in interfaceorg.kie.api.runtime.rule.EntryPoint
-
startBatchExecution
public void startBatchExecution()
- Specified by:
startBatchExecution
in interfaceInternalWorkingMemory
-
endBatchExecution
public void endBatchExecution()
- Specified by:
endBatchExecution
in interfaceInternalWorkingMemory
-
startOperation
public void startOperation()
Description copied from interface:InternalWorkingMemory
This method must be called before starting any new work in the engine, like inserting a new fact or firing a new rule. It will reset the engine idle time counter. This method must be extremely light to avoid contentions when called by multiple threads/entry-points- Specified by:
startOperation
in interfaceInternalWorkingMemory
-
getFactHandle
public org.kie.api.runtime.rule.FactHandle getFactHandle(Object object)
Description copied from interface:WorkingMemory
Retrieve theFactHandle
associated with an Object.- Specified by:
getFactHandle
in interfaceorg.kie.api.runtime.rule.EntryPoint
- Specified by:
getFactHandle
in interfaceWorkingMemory
- Parameters:
object
- The object.- Returns:
- The associated fact handle.
-
iterateObjects
public Iterator<?> iterateObjects()
Description copied from interface:WorkingMemory
Returns an Iterator for the Objects in the Working Memory. This Iterator is not thread safe. This means that any working memory actions during iteration may invalidate the iterator.- Specified by:
iterateObjects
in interfaceWorkingMemory
- Returns:
- the Iterator
-
endOperation
public void endOperation()
Description copied from interface:InternalWorkingMemory
This method must be called after finishing any work in the engine, like inserting a new fact or firing a new rule. It will reset the engine idle time counter. This method must be extremely light to avoid contentions when called by multiple threads/entry-points- Specified by:
endOperation
in interfaceInternalWorkingMemory
-
iterateObjects
public Iterator<?> iterateObjects(org.kie.api.runtime.ObjectFilter filter)
Description copied from interface:WorkingMemory
Returns an Iterator for the Objects in the Working Memory. This Iterator will filter out any objects that the ObjectFilter does not accept. This Iterator is not thread safe. This means that any working memory actions during iteration may invalidate the iterator.- Specified by:
iterateObjects
in interfaceWorkingMemory
- Returns:
- the Iterator
-
getObjects
public Collection<? extends Object> getObjects(org.kie.api.runtime.ObjectFilter filter)
- Specified by:
getObjects
in interfaceorg.kie.api.runtime.rule.EntryPoint
-
getIdleTime
public long getIdleTime()
Description copied from interface:InternalWorkingMemory
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. This method is not synchronised and might return an approximate value.- Specified by:
getIdleTime
in interfaceInternalWorkingMemory
- Returns:
-
getFactHandles
public <T extends org.kie.api.runtime.rule.FactHandle> Collection<T> getFactHandles()
- Specified by:
getFactHandles
in interfaceorg.kie.api.runtime.rule.EntryPoint
-
getTimeToNextJob
public long getTimeToNextJob()
Description copied from interface:InternalWorkingMemory
Returns the number of time units (usually ms) to the next scheduled job- Specified by:
getTimeToNextJob
in interfaceInternalWorkingMemory
- Returns:
- the number of time units until the next scheduled job or -1 if there is no job scheduled
-
iterateFactHandles
public Iterator<InternalFactHandle> iterateFactHandles()
Description copied from interface:WorkingMemory
Returns an Iterator for the FactHandles in the Working Memory. This Iterator is not thread safe. This means that any working memory actions during iteration may invalidate the iterator.- Specified by:
iterateFactHandles
in interfaceWorkingMemory
- Returns:
- the Iterator
-
getFactHandles
public <T extends org.kie.api.runtime.rule.FactHandle> Collection<T> getFactHandles(org.kie.api.runtime.ObjectFilter filter)
- Specified by:
getFactHandles
in interfaceorg.kie.api.runtime.rule.EntryPoint
-
updateEntryPointsCache
public void updateEntryPointsCache()
- Specified by:
updateEntryPointsCache
in interfaceInternalWorkingMemory
-
prepareToFireActivation
public void prepareToFireActivation()
Description copied from interface:InternalWorkingMemory
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.- Specified by:
prepareToFireActivation
in interfaceInternalWorkingMemory
-
iterateFactHandles
public Iterator<InternalFactHandle> iterateFactHandles(org.kie.api.runtime.ObjectFilter filter)
Description copied from interface:WorkingMemory
Returns an Iterator for the Objects in the Working Memory. This Iterator will filter out any objects that the ObjectFilter does not accept. This Iterator is not thread safe. This means that any working memory actions during iteration may invalidate the iterator.- Specified by:
iterateFactHandles
in interfaceWorkingMemory
- Returns:
- the Iterator
-
getFactCount
public long getFactCount()
- Specified by:
getFactCount
in interfaceorg.kie.api.runtime.rule.EntryPoint
-
activationFired
public void activationFired()
Description copied from interface:InternalWorkingMemory
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.- Specified by:
activationFired
in interfaceInternalWorkingMemory
-
getTotalFactCount
public long getTotalFactCount()
Description copied from interface:InternalWorkingMemory
Returns the total number of facts in the working memory, i.e., counting all facts from all entry points. This is an approximate value and may not be accurate due to the concurrent nature of the entry points.- Specified by:
getTotalFactCount
in interfaceInternalWorkingMemory
- Returns:
-
setFocus
public void setFocus(String focus)
Description copied from interface:WorkingMemory
Set the focus to the specified AgendaGroup- Specified by:
setFocus
in interfaceWorkingMemory
-
getProcessRuntime
public InternalProcessRuntime getProcessRuntime()
- Specified by:
getProcessRuntime
in interfaceInternalWorkingMemory
-
internalGetProcessRuntime
public InternalProcessRuntime internalGetProcessRuntime()
- Specified by:
internalGetProcessRuntime
in interfaceInternalWorkingMemory
-
closeLiveQuery
public void closeLiveQuery(InternalFactHandle factHandle)
- Specified by:
closeLiveQuery
in interfaceInternalWorkingMemory
-
addPropagation
public void addPropagation(PropagationEntry propagationEntry)
- Specified by:
addPropagation
in interfaceInternalWorkingMemory
-
flushPropagations
public void flushPropagations()
- Specified by:
flushPropagations
in interfaceInternalWorkingMemory
-
activate
public void activate()
- Specified by:
activate
in interfaceInternalWorkingMemory
-
deactivate
public void deactivate()
- Specified by:
deactivate
in interfaceInternalWorkingMemory
-
tryDeactivate
public boolean tryDeactivate()
- Specified by:
tryDeactivate
in interfaceInternalWorkingMemory
-
setAsyncExceptionHandler
public void setAsyncExceptionHandler(AsyncExceptionHandler handler)
Description copied from interface:WorkingMemory
Sets the AsyncExceptionHandler to handle exceptions thrown by the Agenda Scheduler used for duration rules.- Specified by:
setAsyncExceptionHandler
in interfaceWorkingMemory
-
getActionsIterator
public Iterator<? extends PropagationEntry> getActionsIterator()
- Specified by:
getActionsIterator
in interfaceInternalWorkingMemory
-
removeGlobal
public void removeGlobal(String identifier)
- Specified by:
removeGlobal
in interfaceInternalWorkingMemory
-
notifyWaitOnRest
public void notifyWaitOnRest()
- Specified by:
notifyWaitOnRest
in interfaceInternalWorkingMemory
-
cancelActivation
public void cancelActivation(Activation activation, boolean declarativeAgenda)
- Specified by:
cancelActivation
in interfaceInternalWorkingMemory
-
clearAgenda
public void clearAgenda()
Description copied from interface:WorkingMemory
Clear the Agenda. Iterates over each AgendaGroup cancalling all Activations.- Specified by:
clearAgenda
in interfaceWorkingMemory
-
clearAgendaGroup
public void clearAgendaGroup(String group)
Description copied from interface:WorkingMemory
Clear the Agenda Group, cancelling all its Activations.- Specified by:
clearAgendaGroup
in interfaceWorkingMemory
-
clearActivationGroup
public void clearActivationGroup(String group)
Description copied from interface:WorkingMemory
Clears the Activation Group, cancellings all its Activations- Specified by:
clearActivationGroup
in interfaceWorkingMemory
-
clearRuleFlowGroup
public void clearRuleFlowGroup(String group)
Description copied from interface:WorkingMemory
Clears the RuleFlow group, cancelling all its Activations- Specified by:
clearRuleFlowGroup
in interfaceWorkingMemory
-
startProcess
public org.kie.api.runtime.process.ProcessInstance startProcess(String processId)
Description copied from interface:WorkingMemory
Starts a new process instance for the process with the given id.- Specified by:
startProcess
in interfaceorg.kie.api.runtime.process.ProcessRuntime
- Specified by:
startProcess
in interfaceWorkingMemory
-
startProcess
public org.kie.api.runtime.process.ProcessInstance startProcess(String processId, Map<String,Object> parameters)
Description copied from interface:WorkingMemory
Starts a new process instance for the process with the given id.- Specified by:
startProcess
in interfaceorg.kie.api.runtime.process.ProcessRuntime
- Specified by:
startProcess
in interfaceWorkingMemory
-
startProcess
public org.kie.api.runtime.process.ProcessInstance startProcess(String processId, org.kie.api.runtime.rule.AgendaFilter agendaFilter)
- Specified by:
startProcess
in interfaceorg.kie.api.runtime.process.ProcessRuntime
-
startProcess
public org.kie.api.runtime.process.ProcessInstance startProcess(String processId, Map<String,Object> parameters, org.kie.api.runtime.rule.AgendaFilter agendaFilter)
- Specified by:
startProcess
in interfaceorg.kie.api.runtime.process.ProcessRuntime
-
getProcessInstances
public Collection<org.kie.api.runtime.process.ProcessInstance> getProcessInstances()
Description copied from interface:WorkingMemory
Returns the list of process instances of this working memory. This list is unmodifiable.- Specified by:
getProcessInstances
in interfaceorg.kie.api.runtime.process.ProcessRuntime
- Specified by:
getProcessInstances
in interfaceWorkingMemory
- Returns:
- the list of process instances
-
getProcessInstance
public org.kie.api.runtime.process.ProcessInstance getProcessInstance(Object id)
-
getProcessInstance
public org.kie.api.runtime.process.ProcessInstance getProcessInstance(long id)
Description copied from interface:WorkingMemory
Returns the process instance with the given id.- Specified by:
getProcessInstance
in interfaceorg.kie.api.runtime.process.ProcessRuntime
- Specified by:
getProcessInstance
in interfaceWorkingMemory
- Returns:
- the process instance with the given id
-
getProcessInstance
public org.kie.api.runtime.process.ProcessInstance getProcessInstance(long id, boolean readOnly)
- Specified by:
getProcessInstance
in interfaceorg.kie.api.runtime.process.ProcessRuntime
- Specified by:
getProcessInstance
in interfaceWorkingMemory
-
getWorkItemManager
public org.kie.api.runtime.process.WorkItemManager getWorkItemManager()
- Specified by:
getWorkItemManager
in interfaceorg.kie.api.runtime.process.ProcessRuntime
- Specified by:
getWorkItemManager
in interfaceWorkingMemory
-
halt
public void halt()
Description copied from interface:WorkingMemory
Stops rule firing after the current rule finishes executing- Specified by:
halt
in interfaceorg.kie.api.runtime.rule.RuleRuntime
- Specified by:
halt
in interfaceWorkingMemory
-
getWorkingMemoryEntryPoint
public WorkingMemoryEntryPoint getWorkingMemoryEntryPoint(String id)
Description copied from interface:WorkingMemory
Returns the interface instance for a given entry point, so that the application can manage entry-point-scoped facts.- Specified by:
getWorkingMemoryEntryPoint
in interfaceWorkingMemory
- Specified by:
getWorkingMemoryEntryPoint
in interfaceWorkingMemoryEntryPoint
- Parameters:
id
- the id of the entry point, as defined in the rules file
-
getSessionClock
public org.kie.api.time.SessionClock getSessionClock()
Description copied from interface:WorkingMemory
Returns the session clock instance associated with this session- Specified by:
getSessionClock
in interfaceorg.kie.api.runtime.KieRuntime
- Specified by:
getSessionClock
in interfaceWorkingMemory
- Returns:
-
-