|
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 FactHandle s from the current session. |
|
|
getFactHandles(ObjectFilter of)
Returns all FactHandle s 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 KieSession
public void dispose()
KieSession
dispose
in interface KieSession
public <T extends SessionClock> T getSessionClock()
KieRuntime
getSessionClock
in interface KieRuntime
public void setGlobal(String string, Object o)
KieRuntime
setGlobal
in interface KieRuntime
string
- the global identifiero
- the value assigned to the global identifierpublic Object getGlobal(String string)
getGlobal
in interface KieRuntime
public Globals getGlobals()
getGlobals
in interface KieRuntime
public Calendars getCalendars()
getCalendars
in interface KieRuntime
public Environment getEnvironment()
getEnvironment
in interface KieRuntime
public KieBase getKieBase()
KieRuntime
getKieBase
in interface KieRuntime
public void registerChannel(String string, Channel chnl)
registerChannel
in interface KieRuntime
public void unregisterChannel(String string)
unregisterChannel
in interface KieRuntime
public Map<String,Channel> getChannels()
getChannels
in interface KieRuntime
public KieSessionConfiguration getSessionConfiguration()
getSessionConfiguration
in interface KieRuntime
public void halt()
Session
Request 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 Session
public Agenda getAgenda()
Session
Agenda
.
getAgenda
in interface Session
public SessionEntryPoint getEntryPoint(String string)
Session
getEntryPoint
in interface Session
public Collection<? extends SessionEntryPoint> getEntryPoints()
Session
getEntryPoints
in interface Session
public QueryResults getQueryResults(String string, Object... os)
Session
getQueryResults
in interface Session
string
- The name of the query.os
- The arguments used for the query
public LiveQuery openLiveQuery(String string, Object[] os, ViewChangedEventListener vl)
openLiveQuery
in interface Session
public void addEventListener(ProcessEventListener pl)
ProcessEventManager
addEventListener
in interface ProcessEventManager
pl
- the listener to add.public void removeEventListener(ProcessEventListener pl)
ProcessEventManager
removeEventListener
in interface ProcessEventManager
pl
- the listener to removepublic Collection<ProcessEventListener> getProcessEventListeners()
ProcessEventManager
getProcessEventListeners
in interface ProcessEventManager
public void addEventListener(WorkingMemoryEventListener wl)
WorkingMemoryEventManager
addEventListener
in interface WorkingMemoryEventManager
wl
- The listener to add.public void removeEventListener(WorkingMemoryEventListener wl)
WorkingMemoryEventManager
removeEventListener
in interface WorkingMemoryEventManager
wl
- The listener to remove.public Collection<WorkingMemoryEventListener> getWorkingMemoryEventListeners()
WorkingMemoryEventManager
getWorkingMemoryEventListeners
in interface WorkingMemoryEventManager
public void addEventListener(AgendaEventListener al)
WorkingMemoryEventManager
addEventListener
in interface WorkingMemoryEventManager
al
- The listener to add.public void removeEventListener(AgendaEventListener al)
WorkingMemoryEventManager
removeEventListener
in interface WorkingMemoryEventManager
al
- The listener to remove.public Collection<AgendaEventListener> getAgendaEventListeners()
WorkingMemoryEventManager
getAgendaEventListeners
in interface WorkingMemoryEventManager
public <T> T execute(Command<T> cmnd)
CommandExecutor
execute
in interface CommandExecutor
public ProcessInstance startProcess(String string)
ProcessRuntime
startProcess
in interface ProcessRuntime
string
- The id of the process that should be started
ProcessInstance
that represents the instance of the process that was startedpublic ProcessInstance startProcess(String string, Map<String,Object> map)
ProcessRuntime
startProcess
in interface ProcessRuntime
string
- 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 startedpublic ProcessInstance createProcessInstance(String string, Map<String,Object> map)
ProcessRuntime
createProcessInstance
in interface ProcessRuntime
string
- 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 ProcessRuntime
l
- the id of the process instance that needs to be started
ProcessInstance
that represents the instance of the process that was startedpublic void signalEvent(String string, Object o)
ProcessRuntime
signalEvent
in interface ProcessRuntime
string
- the type of evento
- the data associated with this eventpublic void signalEvent(String string, Object o, long l)
ProcessRuntime
signalEvent
in interface ProcessRuntime
string
- 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 ProcessRuntime
public ProcessInstance getProcessInstance(long l)
ProcessRuntime
null
.
getProcessInstance
in interface ProcessRuntime
null
if it cannot be foundpublic ProcessInstance getProcessInstance(long l, boolean b)
ProcessRuntime
null
.
getProcessInstance
in interface ProcessRuntime
b
- 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)
ProcessRuntime
IllegalArgumentException
.
abortProcessInstance
in interface ProcessRuntime
public WorkItemManager getWorkItemManager()
ProcessRuntime
WorkItemManager
related to this session. This can be used to
register new WorkItemHandler
s or to complete (or abort) WorkItem
s.
getWorkItemManager
in interface ProcessRuntime
WorkItemManager
related to this sessionpublic String getEntryPointId()
SessionEntryPoint
getEntryPointId
in interface SessionEntryPoint
public FactHandle insert(Object o)
SessionEntryPoint
insert
in interface SessionEntryPoint
o
- the fact to be inserted
public void retract(FactHandle fh)
SessionEntryPoint
retract
in interface SessionEntryPoint
fh
- the handle whose fact is to be retracted.public void delete(FactHandle fh)
SessionEntryPoint
delete
in interface SessionEntryPoint
fh
- the handle whose fact is to be retracted.public void update(FactHandle fh, Object o)
SessionEntryPoint
update
in interface SessionEntryPoint
fh
- 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 SessionEntryPoint
o
- the fact for which the fact handle will be returned.
KnowledgeBaseConfiguration
public Object getObject(FactHandle fh)
SessionEntryPoint
getObject
in interface SessionEntryPoint
public Collection<Object> getObjects()
SessionEntryPoint
Returns 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 SessionEntryPoint
public Collection<Object> getObjects(ObjectFilter of)
SessionEntryPoint
ObjectFilter
.
getObjects
in interface SessionEntryPoint
of
- the filter to be applied to the returned collection of facts.
public <T extends FactHandle> Collection<T> getFactHandles()
SessionEntryPoint
FactHandle
s from the current session.
getFactHandles
in interface SessionEntryPoint
public <T extends FactHandle> Collection<T> getFactHandles(ObjectFilter of)
SessionEntryPoint
FactHandle
s from the current session for which the facts are accepted by
the given filter.
getFactHandles
in interface SessionEntryPoint
of
- the filter to be applied to the returned collection of FactHandle
s.
public long getFactCount()
SessionEntryPoint
getFactCount
in interface SessionEntryPoint
public int fireAllRules()
StatefulRuleSession
fireAllRules
in interface StatefulRuleSession
public int fireAllRules(int i)
StatefulRuleSession
fireAllRules()
again.
fireAllRules
in interface StatefulRuleSession
i
- the maximum number of rules that should be fired
public int fireAllRules(AgendaFilter af)
StatefulRuleSession
fireAllRules
in interface StatefulRuleSession
af
- filters the Matches that may fire
public int fireAllRules(AgendaFilter af, int i)
StatefulRuleSession
fireAllRules
in interface StatefulRuleSession
af
- filters the Matches that may firei
- the maximum number of rules that should be fired
public void fireUntilHalt()
StatefulRuleSession
fireUntilHalt
in interface StatefulRuleSession
public void fireUntilHalt(AgendaFilter af)
StatefulRuleSession
fireUntilHalt
in interface StatefulRuleSession
af
- 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 |