public class KnowledgeRuntimeAdapter extends Object implements KnowledgeRuntime
| Modifier and Type | Field and Description |
|---|---|
org.kie.internal.runtime.KnowledgeRuntime |
delegate |
| Constructor and Description |
|---|
KnowledgeRuntimeAdapter(org.kie.internal.runtime.KnowledgeRuntime delegate) |
| Modifier and Type | Method and Description |
|---|---|
void |
abortProcessInstance(long processInstanceId)
Aborts the process instance with the given id.
|
void |
addEventListener(AgendaEventListener listener)
Add an event listener.
|
void |
addEventListener(ProcessEventListener listener)
Add a process event listener.
|
void |
addEventListener(WorkingMemoryEventListener listener)
Add an event listener.
|
ProcessInstance |
createProcessInstance(String processId,
Map<String,Object> parameters)
Creates a new process instance (but does not yet start it).
|
boolean |
equals(Object obj) |
Agenda |
getAgenda()
Returns a reference to this session's
Agenda. |
Collection<AgendaEventListener> |
getAgendaEventListeners()
Returns all event listeners.
|
Calendars |
getCalendars() |
Map<String,Channel> |
getChannels() |
String |
getEntryPointId()
Returns the String Id of this entry point
|
Environment |
getEnvironment() |
long |
getFactCount()
Returns the total number of facts currently in this entry point
|
FactHandle |
getFactHandle(Object object)
Returns the fact handle associated with the given object.
|
<T extends FactHandle> |
getFactHandles()
Returns all
FactHandles from the current session. |
<T extends FactHandle> |
getFactHandles(ObjectFilter filter)
Returns all
FactHandles from the current session for which the facts are accepted by
the given filter. |
Object |
getGlobal(String identifier) |
Globals |
getGlobals() |
KnowledgeBase |
getKnowledgeBase()
Returns the KnowledgeBase reference from which this stateful session was created.
|
Object |
getObject(FactHandle factHandle)
Returns the object associated with the given FactHandle.
|
Collection<Object> |
getObjects()
Returns all facts from the current session as a Collection.
|
Collection<Object> |
getObjects(ObjectFilter filter)
Returns all facts from the current session that are accepted by the given
ObjectFilter. |
Collection<ProcessEventListener> |
getProcessEventListeners()
Returns all event listeners.
|
ProcessInstance |
getProcessInstance(long processInstanceId)
Returns the process instance with the given id.
|
ProcessInstance |
getProcessInstance(long processInstanceId,
boolean readonly)
Returns the process instance with the given id.
|
Collection<ProcessInstance> |
getProcessInstances()
Returns a collection of currently active process instances.
|
QueryResults |
getQueryResults(String query,
Object... arguments)
Retrieve the QueryResults of the specified query and arguments
|
<T extends SessionClock> |
getSessionClock()
Returns the session clock instance assigned to this session
|
KnowledgeSessionConfiguration |
getSessionConfiguration() |
WorkingMemoryEntryPoint |
getWorkingMemoryEntryPoint(String name)
Returns the WorkingMemoryEntryPoint instance associated with the given name.
|
Collection<? extends WorkingMemoryEntryPoint> |
getWorkingMemoryEntryPoints()
Returns a collection of all available working memory entry points
for this session.
|
Collection<WorkingMemoryEventListener> |
getWorkingMemoryEventListeners()
Returns all event listeners.
|
WorkItemManager |
getWorkItemManager()
Returns the
WorkItemManager related to this session. |
void |
halt()
Request the engine to stop firing rules.
|
int |
hashCode() |
FactHandle |
insert(Object object)
Inserts a new fact into this entry point
|
LiveQuery |
openLiveQuery(String query,
Object[] arguments,
ViewChangedEventListener listener) |
void |
registerChannel(String name,
Channel channel) |
void |
registerExitPoint(String name,
ExitPoint exitPoint) |
void |
removeEventListener(AgendaEventListener listener)
Remove an event listener.
|
void |
removeEventListener(ProcessEventListener listener)
Remove a process event listener.
|
void |
removeEventListener(WorkingMemoryEventListener listener)
Remove an event listener.
|
void |
retract(FactHandle handle)
Retracts the fact for which the given FactHandle was assigned.
|
void |
setGlobal(String identifier,
Object value)
Sets a global value on the internal collection
|
void |
signalEvent(String type,
Object event)
Signals the engine that an event has occurred.
|
void |
signalEvent(String type,
Object event,
long processInstanceId)
Signals the process instance that an event has occurred.
|
ProcessInstance |
startProcess(String processId)
Start a new process instance.
|
ProcessInstance |
startProcess(String processId,
Map<String,Object> parameters)
Start a new process instance.
|
ProcessInstance |
startProcessInstance(long processInstanceId)
Starts the given process instance (which was created by using createProcesInstance
but not yet started).
|
void |
unregisterChannel(String name) |
void |
unregisterExitPoint(String name) |
void |
update(FactHandle handle,
Object object)
Updates the fact for which the given FactHandle was assigned with the new
fact set as the second parameter in this method.
|
public KnowledgeRuntimeAdapter(org.kie.internal.runtime.KnowledgeRuntime delegate)
public <T extends SessionClock> T getSessionClock()
KnowledgeRuntimegetSessionClock in interface KnowledgeRuntimepublic void setGlobal(String identifier, Object value)
KnowledgeRuntimesetGlobal in interface KnowledgeRuntimeidentifier - the global identifiervalue - the value assigned to the global identifierpublic Object getGlobal(String identifier)
getGlobal in interface KnowledgeRuntimepublic Globals getGlobals()
getGlobals in interface KnowledgeRuntimepublic Calendars getCalendars()
getCalendars in interface KnowledgeRuntimepublic Environment getEnvironment()
getEnvironment in interface KnowledgeRuntimepublic KnowledgeBase getKnowledgeBase()
KnowledgeRuntimegetKnowledgeBase in interface KnowledgeRuntimepublic void registerExitPoint(String name, ExitPoint exitPoint)
registerExitPoint in interface KnowledgeRuntimepublic void unregisterExitPoint(String name)
unregisterExitPoint in interface KnowledgeRuntimepublic void registerChannel(String name, Channel channel)
registerChannel in interface KnowledgeRuntimepublic void unregisterChannel(String name)
unregisterChannel in interface KnowledgeRuntimepublic Map<String,Channel> getChannels()
getChannels in interface KnowledgeRuntimepublic KnowledgeSessionConfiguration getSessionConfiguration()
getSessionConfiguration in interface KnowledgeRuntimepublic void addEventListener(ProcessEventListener listener)
ProcessEventManageraddEventListener in interface ProcessEventManagerlistener - the listener to add.public void removeEventListener(ProcessEventListener listener)
ProcessEventManagerremoveEventListener in interface ProcessEventManagerlistener - the listener to removepublic Collection<ProcessEventListener> getProcessEventListeners()
ProcessEventManagergetProcessEventListeners in interface ProcessEventManagerpublic ProcessInstance startProcess(String processId)
ProcessRuntimestartProcess in interface ProcessRuntimeprocessId - The id of the process that should be startedProcessInstance that represents the instance of the process that was startedpublic ProcessInstance startProcess(String processId, Map<String,Object> parameters)
ProcessRuntimestartProcess in interface ProcessRuntimeprocessId - the id of the process that should be startedparameters - the process variables that should be set when starting the process instanceProcessInstance that represents the instance of the process that was startedpublic ProcessInstance createProcessInstance(String processId, Map<String,Object> parameters)
ProcessRuntimecreateProcessInstance in interface ProcessRuntimeprocessId - the id of the process that should be startedparameters - the process variables that should be set when creating the process instanceProcessInstance that represents the instance of the process that was created (but not yet started)public ProcessInstance startProcessInstance(long processInstanceId)
ProcessRuntimestartProcessInstance in interface ProcessRuntimeprocessInstanceId - the id of the process instance that needs to be startedProcessInstance that represents the instance of the process that was startedpublic void signalEvent(String type, Object event)
ProcessRuntimesignalEvent in interface ProcessRuntimetype - the type of eventevent - the data associated with this eventpublic void signalEvent(String type, Object event, long processInstanceId)
ProcessRuntimesignalEvent in interface ProcessRuntimetype - the type of eventevent - the data associated with this eventprocessInstanceId - the id of the process instance that should be signaledpublic Collection<ProcessInstance> getProcessInstances()
ProcessRuntimegetProcessInstances in interface ProcessRuntimepublic ProcessInstance getProcessInstance(long processInstanceId)
ProcessRuntimenull.getProcessInstance in interface ProcessRuntimenull if it cannot be foundpublic ProcessInstance getProcessInstance(long processInstanceId, boolean readonly)
ProcessRuntimenull.getProcessInstance in interface ProcessRuntimereadonly - if this is true and when using persistence, this process instance
will not be tracked and updated by the enginenull if it cannot be foundpublic void abortProcessInstance(long processInstanceId)
ProcessRuntimeIllegalArgumentException.abortProcessInstance in interface ProcessRuntimepublic WorkItemManager getWorkItemManager()
ProcessRuntimeWorkItemManager related to this session. This can be used to
register new WorkItemHandlers or to complete (or abort) WorkItems.getWorkItemManager in interface ProcessRuntimeWorkItemManager related to this sessionpublic void halt()
WorkingMemoryRequest the engine to stop firing rules. If the engine is currently firing a rule, it will finish executing this rule's consequence before stopping.
This method will not remove active activations from the Agenda.
In case the application later wants to continue firing rules from the point where it stopped,
it should just call org.drools.core.runtime.StatefulKnowledgeSession.fireAllRules() or
org.drools.core.runtime.StatefulKnowledgeSession.fireUntilHalt() again.
halt in interface WorkingMemorypublic Agenda getAgenda()
WorkingMemoryAgenda.getAgenda in interface WorkingMemorypublic WorkingMemoryEntryPoint getWorkingMemoryEntryPoint(String name)
WorkingMemorygetWorkingMemoryEntryPoint in interface WorkingMemorypublic Collection<? extends WorkingMemoryEntryPoint> getWorkingMemoryEntryPoints()
WorkingMemorygetWorkingMemoryEntryPoints in interface WorkingMemorypublic QueryResults getQueryResults(String query, Object... arguments)
WorkingMemorygetQueryResults in interface WorkingMemoryquery - The name of the query.arguments - The arguments used for the querypublic LiveQuery openLiveQuery(String query, Object[] arguments, ViewChangedEventListener listener)
openLiveQuery in interface WorkingMemorypublic String getEntryPointId()
WorkingMemoryEntryPointgetEntryPointId in interface WorkingMemoryEntryPointpublic FactHandle insert(Object object)
WorkingMemoryEntryPointinsert in interface WorkingMemoryEntryPointobject - the fact to be insertedpublic void retract(FactHandle handle)
WorkingMemoryEntryPointretract in interface WorkingMemoryEntryPointhandle - the handle whose fact is to be retracted.public void update(FactHandle handle, Object object)
WorkingMemoryEntryPointupdate in interface WorkingMemoryEntryPointhandle - the FactHandle for the fact to be updated.object - the new value for the fact being updated.public FactHandle getFactHandle(Object object)
WorkingMemoryEntryPointgetFactHandle in interface WorkingMemoryEntryPointobject - the fact for which the fact handle will be returned.KnowledgeBaseConfigurationpublic Object getObject(FactHandle factHandle)
WorkingMemoryEntryPointgetObject in interface WorkingMemoryEntryPointpublic Collection<Object> getObjects()
WorkingMemoryEntryPointReturns all facts from the current session as a Collection.
This class is not a general-purpose Collection implementation! While this class implements the Collection interface, it intentionally violates Collection general contract, which mandates the use of the equals method when comparing objects.
Instead the approach used when comparing objects with the contains(Object) method is dependent on the WorkingMemory configuration, where it can be configured for Identity or for Equality.
getObjects in interface WorkingMemoryEntryPointpublic Collection<Object> getObjects(ObjectFilter filter)
WorkingMemoryEntryPointObjectFilter.getObjects in interface WorkingMemoryEntryPointfilter - the filter to be applied to the returned collection of facts.public <T extends FactHandle> Collection<T> getFactHandles()
WorkingMemoryEntryPointFactHandles from the current session.getFactHandles in interface WorkingMemoryEntryPointpublic <T extends FactHandle> Collection<T> getFactHandles(ObjectFilter filter)
WorkingMemoryEntryPointFactHandles from the current session for which the facts are accepted by
the given filter.getFactHandles in interface WorkingMemoryEntryPointfilter - the filter to be applied to the returned collection of FactHandles.public long getFactCount()
WorkingMemoryEntryPointgetFactCount in interface WorkingMemoryEntryPointpublic void addEventListener(WorkingMemoryEventListener listener)
WorkingMemoryEventManageraddEventListener in interface WorkingMemoryEventManagerlistener - The listener to add.public void removeEventListener(WorkingMemoryEventListener listener)
WorkingMemoryEventManagerremoveEventListener in interface WorkingMemoryEventManagerlistener - The listener to remove.public Collection<WorkingMemoryEventListener> getWorkingMemoryEventListeners()
WorkingMemoryEventManagergetWorkingMemoryEventListeners in interface WorkingMemoryEventManagerpublic void addEventListener(AgendaEventListener listener)
WorkingMemoryEventManageraddEventListener in interface WorkingMemoryEventManagerlistener - The listener to add.public void removeEventListener(AgendaEventListener listener)
WorkingMemoryEventManagerremoveEventListener in interface WorkingMemoryEventManagerlistener - The listener to remove.public Collection<AgendaEventListener> getAgendaEventListeners()
WorkingMemoryEventManagergetAgendaEventListeners in interface WorkingMemoryEventManagerCopyright © 2001–2016 JBoss by Red Hat. All rights reserved.