|
jBPM distribution 6.0.0.Alpha9 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.droolsjbpm.services.impl.helpers.StatefulKnowledgeSessionDelegate
public class StatefulKnowledgeSessionDelegate
| Constructor Summary | |
|---|---|
StatefulKnowledgeSessionDelegate(String name,
KieSession ksession,
SessionManager sessionManager)
|
|
| Method Summary | ||
|---|---|---|
void |
abortProcessInstance(long l)
Aborts the process instance with the given id. |
|
void |
addEventListener(AgendaEventListener al)
Add an event listener. |
|
void |
addEventListener(ProcessEventListener pl)
Add a process event listener. |
|
void |
addEventListener(WorkingMemoryEventListener wl)
Add an event listener. |
|
ProcessInstance |
createProcessInstance(String string,
Map<String,Object> map)
Creates a new process instance (but does not yet start it). |
|
void |
delete(FactHandle fh)
Retracts the fact for which the given FactHandle was assigned. |
|
void |
dispose()
Releases all the current session resources, setting up the session for garbage collection. |
|
|
execute(Command<T> cmnd)
Execute the command and return a ExecutionResults for the results of the Command. |
|
int |
fireAllRules()
Fire all Matches on the Agenda. |
|
int |
fireAllRules(AgendaFilter af)
Fire all Matches on the Agenda |
|
int |
fireAllRules(AgendaFilter af,
int i)
Fire all Matches on the Agenda |
|
int |
fireAllRules(int i)
Fire Matches on the Agenda up to the given maximum number of Matches, before returning the control to the application. |
|
void |
fireUntilHalt()
Keeps firing Matches until a halt is called. |
|
void |
fireUntilHalt(AgendaFilter af)
Keeps firing Matches until a halt is called. |
|
Agenda |
getAgenda()
Returns a reference to this session's Agenda. |
|
Collection<AgendaEventListener> |
getAgendaEventListeners()
Returns all event listeners. |
|
Calendars |
getCalendars()
|
|
Map<String,Channel> |
getChannels()
|
|
SessionEntryPoint |
getEntryPoint(String string)
Returns the WorkingMemoryEntryPoint instance associated with the given name. |
|
String |
getEntryPointId()
Returns the String Id of this entry point |
|
Collection<? extends SessionEntryPoint> |
getEntryPoints()
Returns a collection of all available working memory entry points for this session. |
|
Environment |
getEnvironment()
|
|
long |
getFactCount()
Returns the total number of facts currently in this entry point |
|
FactHandle |
getFactHandle(Object o)
Returns the fact handle associated with the given object. |
|
|
getFactHandles()
Returns all FactHandles from the current session. |
|
|
getFactHandles(ObjectFilter of)
Returns all FactHandles from the current session for which the facts are accepted by
the given filter. |
|
Object |
getGlobal(String string)
|
|
Globals |
getGlobals()
|
|
int |
getId()
|
|
KieBase |
getKieBase()
Returns the KieBase reference from which this stateful session was created. |
|
KieSession |
getKsession()
|
|
Object |
getObject(FactHandle fh)
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 of)
Returns all facts from the current session that are accepted by the given ObjectFilter. |
|
Collection<ProcessEventListener> |
getProcessEventListeners()
Returns all event listeners. |
|
ProcessInstance |
getProcessInstance(long l)
Returns the process instance with the given id. |
|
ProcessInstance |
getProcessInstance(long l,
boolean b)
Returns the process instance with the given id. |
|
Collection<ProcessInstance> |
getProcessInstances()
Returns a collection of currently active process instances. |
|
QueryResults |
getQueryResults(String string,
Object... os)
Retrieve the QueryResults of the specified query and arguments |
|
|
getSessionClock()
Returns the session clock instance assigned to this session |
|
KieSessionConfiguration |
getSessionConfiguration()
|
|
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. |
|
FactHandle |
insert(Object o)
Inserts a new fact into this entry point |
|
LiveQuery |
openLiveQuery(String string,
Object[] os,
ViewChangedEventListener vl)
|
|
void |
registerChannel(String string,
Channel chnl)
|
|
void |
removeEventListener(AgendaEventListener al)
Remove an event listener. |
|
void |
removeEventListener(ProcessEventListener pl)
Remove a process event listener. |
|
void |
removeEventListener(WorkingMemoryEventListener wl)
Remove an event listener. |
|
void |
retract(FactHandle fh)
Retracts the fact for which the given FactHandle was assigned. |
|
void |
setGlobal(String string,
Object o)
Sets a global value on the internal collection |
|
void |
setKsession(org.kie.runtime.StatefulKnowledgeSession ksession)
|
|
void |
signalEvent(String string,
Object o)
Signals the engine that an event has occurred. |
|
void |
signalEvent(String string,
Object o,
long l)
Signals the process instance that an event has occurred. |
|
ProcessInstance |
startProcess(String string)
Start a new process instance. |
|
ProcessInstance |
startProcess(String string,
Map<String,Object> map)
Start a new process instance. |
|
ProcessInstance |
startProcessInstance(long l)
Starts the given process instance (which was created by using createProcesInstance but not yet started). |
|
void |
unregisterChannel(String string)
|
|
void |
update(FactHandle fh,
Object o)
Updates the fact for which the given FactHandle was assigned with the new fact set as the second parameter in this method. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public StatefulKnowledgeSessionDelegate(String name,
KieSession ksession,
SessionManager sessionManager)
| Method Detail |
|---|
public KieSession getKsession()
public void setKsession(org.kie.runtime.StatefulKnowledgeSession ksession)
public int getId()
getId in interface KieSessionpublic void dispose()
KieSession
dispose in interface KieSessionpublic <T extends SessionClock> T getSessionClock()
KieRuntime
getSessionClock in interface KieRuntime
public void setGlobal(String string,
Object o)
KieRuntime
setGlobal in interface KieRuntimestring - the global identifiero - the value assigned to the global identifierpublic Object getGlobal(String string)
getGlobal in interface KieRuntimepublic Globals getGlobals()
getGlobals in interface KieRuntimepublic Calendars getCalendars()
getCalendars in interface KieRuntimepublic Environment getEnvironment()
getEnvironment in interface KieRuntimepublic KieBase getKieBase()
KieRuntime
getKieBase in interface KieRuntime
public void registerChannel(String string,
Channel chnl)
registerChannel in interface KieRuntimepublic void unregisterChannel(String string)
unregisterChannel in interface KieRuntimepublic Map<String,Channel> getChannels()
getChannels in interface KieRuntimepublic KieSessionConfiguration getSessionConfiguration()
getSessionConfiguration in interface KieRuntimepublic void halt()
SessionRequest 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 Matches from the Agenda.
In case the application later wants to continue firing rules from the point where it stopped,
it should just call org.kie.runtime.StatefulKnowledgeSession.fireAllRules() or
org.kie.runtime.StatefulKnowledgeSession.fireUntilHalt() again.
halt in interface Sessionpublic Agenda getAgenda()
SessionAgenda.
getAgenda in interface Sessionpublic SessionEntryPoint getEntryPoint(String string)
Session
getEntryPoint in interface Sessionpublic Collection<? extends SessionEntryPoint> getEntryPoints()
Session
getEntryPoints in interface Session
public QueryResults getQueryResults(String string,
Object... os)
Session
getQueryResults in interface Sessionstring - The name of the query.os - The arguments used for the query
public LiveQuery openLiveQuery(String string,
Object[] os,
ViewChangedEventListener vl)
openLiveQuery in interface Sessionpublic void addEventListener(ProcessEventListener pl)
ProcessEventManager
addEventListener in interface ProcessEventManagerpl - the listener to add.public void removeEventListener(ProcessEventListener pl)
ProcessEventManager
removeEventListener in interface ProcessEventManagerpl - the listener to removepublic Collection<ProcessEventListener> getProcessEventListeners()
ProcessEventManager
getProcessEventListeners in interface ProcessEventManagerpublic void addEventListener(WorkingMemoryEventListener wl)
WorkingMemoryEventManager
addEventListener in interface WorkingMemoryEventManagerwl - The listener to add.public void removeEventListener(WorkingMemoryEventListener wl)
WorkingMemoryEventManager
removeEventListener in interface WorkingMemoryEventManagerwl - The listener to remove.public Collection<WorkingMemoryEventListener> getWorkingMemoryEventListeners()
WorkingMemoryEventManager
getWorkingMemoryEventListeners in interface WorkingMemoryEventManagerpublic void addEventListener(AgendaEventListener al)
WorkingMemoryEventManager
addEventListener in interface WorkingMemoryEventManageral - The listener to add.public void removeEventListener(AgendaEventListener al)
WorkingMemoryEventManager
removeEventListener in interface WorkingMemoryEventManageral - The listener to remove.public Collection<AgendaEventListener> getAgendaEventListeners()
WorkingMemoryEventManager
getAgendaEventListeners in interface WorkingMemoryEventManagerpublic <T> T execute(Command<T> cmnd)
CommandExecutor
execute in interface CommandExecutorpublic ProcessInstance startProcess(String string)
ProcessRuntime
startProcess in interface ProcessRuntimestring - The id of the process that should be started
ProcessInstance that represents the instance of the process that was started
public ProcessInstance startProcess(String string,
Map<String,Object> map)
ProcessRuntime
startProcess in interface ProcessRuntimestring - the id of the process that should be startedmap - the process variables that should be set when starting the process instance
ProcessInstance that represents the instance of the process that was started
public ProcessInstance createProcessInstance(String string,
Map<String,Object> map)
ProcessRuntime
createProcessInstance in interface ProcessRuntimestring - the id of the process that should be startedmap - the process variables that should be set when creating the process instance
ProcessInstance that represents the instance of the process that was created (but not yet started)public ProcessInstance startProcessInstance(long l)
ProcessRuntime
startProcessInstance in interface ProcessRuntimel - the id of the process instance that needs to be started
ProcessInstance that represents the instance of the process that was started
public void signalEvent(String string,
Object o)
ProcessRuntime
signalEvent in interface ProcessRuntimestring - the type of evento - the data associated with this event
public void signalEvent(String string,
Object o,
long l)
ProcessRuntime
signalEvent in interface ProcessRuntimestring - the type of evento - the data associated with this eventl - the id of the process instance that should be signaledpublic Collection<ProcessInstance> getProcessInstances()
ProcessRuntime
getProcessInstances in interface ProcessRuntimepublic ProcessInstance getProcessInstance(long l)
ProcessRuntimenull.
getProcessInstance in interface ProcessRuntimenull if it cannot be found
public ProcessInstance getProcessInstance(long l,
boolean b)
ProcessRuntimenull.
getProcessInstance in interface ProcessRuntimeb - if this is true and when using persistence, this process instance
will not be tracked and updated by the engine
null if it cannot be foundpublic void abortProcessInstance(long l)
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 String getEntryPointId()
SessionEntryPoint
getEntryPointId in interface SessionEntryPointpublic FactHandle insert(Object o)
SessionEntryPoint
insert in interface SessionEntryPointo - the fact to be inserted
public void retract(FactHandle fh)
SessionEntryPoint
retract in interface SessionEntryPointfh - the handle whose fact is to be retracted.public void delete(FactHandle fh)
SessionEntryPoint
delete in interface SessionEntryPointfh - the handle whose fact is to be retracted.
public void update(FactHandle fh,
Object o)
SessionEntryPoint
update in interface SessionEntryPointfh - the FactHandle for the fact to be updated.o - the new value for the fact being updated.public FactHandle getFactHandle(Object o)
SessionEntryPoint
getFactHandle in interface SessionEntryPointo - the fact for which the fact handle will be returned.
KnowledgeBaseConfigurationpublic Object getObject(FactHandle fh)
SessionEntryPoint
getObject in interface SessionEntryPointpublic Collection<Object> getObjects()
SessionEntryPointReturns 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 SessionEntryPointpublic Collection<Object> getObjects(ObjectFilter of)
SessionEntryPointObjectFilter.
getObjects in interface SessionEntryPointof - the filter to be applied to the returned collection of facts.
public <T extends FactHandle> Collection<T> getFactHandles()
SessionEntryPointFactHandles from the current session.
getFactHandles in interface SessionEntryPointpublic <T extends FactHandle> Collection<T> getFactHandles(ObjectFilter of)
SessionEntryPointFactHandles from the current session for which the facts are accepted by
the given filter.
getFactHandles in interface SessionEntryPointof - the filter to be applied to the returned collection of FactHandles.
public long getFactCount()
SessionEntryPoint
getFactCount in interface SessionEntryPointpublic int fireAllRules()
StatefulRuleSession
fireAllRules in interface StatefulRuleSessionpublic int fireAllRules(int i)
StatefulRuleSessionfireAllRules() again.
fireAllRules in interface StatefulRuleSessioni - the maximum number of rules that should be fired
public int fireAllRules(AgendaFilter af)
StatefulRuleSession
fireAllRules in interface StatefulRuleSessionaf - filters the Matches that may fire
public int fireAllRules(AgendaFilter af,
int i)
StatefulRuleSession
fireAllRules in interface StatefulRuleSessionaf - filters the Matches that may firei - the maximum number of rules that should be fired
public void fireUntilHalt()
StatefulRuleSession
fireUntilHalt in interface StatefulRuleSessionpublic void fireUntilHalt(AgendaFilter af)
StatefulRuleSession
fireUntilHalt in interface StatefulRuleSessionaf - filters the Matches that may fire
|
jBPM distribution 6.0.0.Alpha9 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||