org.drools
Interface StatelessSession

All Superinterfaces:
RuleBaseEventManager, WorkingMemoryEventManager
All Known Subinterfaces:
InternalStatelessSession
All Known Implementing Classes:
ReteooStatelessSession

public interface StatelessSession
extends WorkingMemoryEventManager

This represents a working memory session where state is not kept between invocations. This is typically used for "decision services" where the rules are provided all the data in one hit, and a conclusion reached by the engine. (there is no accumulation of facts/knowledge - each invocation is on a fresh session). Each created StatelessSession can be call execute() any number of times, in a stateless manner however the GlobalResolver, unless set each time, is shared between each execute() method call. Care should be used when using the async versions of the methods, consult the javadoc for the specific information.


Method Summary
 void asyncExecute(Collection collection)
          This will assert the object List (as SEPARATE facts) in the background.
 void asyncExecute(Object object)
          This will assert the object in the background.
 void asyncExecute(Object[] array)
          This will assert the object array (as SEPARATE facts) in the background.
 void execute(Collection collection)
          Insert a List of facts, an fire the rules, returning when finished.
 void execute(Object object)
          Insert a single fact, an fire the rules, returning when finished.
 void execute(Object[] array)
          Insert an array of facts, an fire the rules, returning when finished.
 StatelessSessionResult executeWithResults(Collection collection)
          Similar to the normal execute method, but this will return "results".
 StatelessSessionResult executeWithResults(Object object)
          Similar to the normal execute method, but this will return "results".
 StatelessSessionResult executeWithResults(Object[] array)
          Similar to the normal execute method, but this will return "results".
 void setAgendaFilter(AgendaFilter agendaFilter)
           
 void setGlobal(String identifer, Object value)
          Sets a global value
 void setGlobalExporter(GlobalExporter globalExporter)
          Used to specify a global exporting strategy so that global variables can be available to StatelessSessionResults.
 void setGlobalResolver(GlobalResolver globalResolver)
          Delegate used to resolve any global names not found in the global map.
 
Methods inherited from interface org.drools.WorkingMemoryEventManager
addEventListener, addEventListener, getAgendaEventListeners, getWorkingMemoryEventListeners, removeEventListener, removeEventListener
 
Methods inherited from interface org.drools.RuleBaseEventManager
addEventListener, getRuleBaseEventListeners, removeEventListener
 

Method Detail

setAgendaFilter

void setAgendaFilter(AgendaFilter agendaFilter)

setGlobalResolver

void setGlobalResolver(GlobalResolver globalResolver)
Delegate used to resolve any global names not found in the global map.

Parameters:
globalResolver -

setGlobal

void setGlobal(String identifer,
               Object value)
Sets a global value

Parameters:
identifer -
value -

setGlobalExporter

void setGlobalExporter(GlobalExporter globalExporter)
Used to specify a global exporting strategy so that global variables can be available to StatelessSessionResults. If this is not set, then StatelessSessionResult will have no globals.

Parameters:
globalExporter - The GlobalExporter instance

execute

void execute(Object object)
Insert a single fact, an fire the rules, returning when finished.


execute

void execute(Object[] array)
Insert an array of facts, an fire the rules, returning when finished. This will assert the list of facts as SEPARATE facts to the engine (NOT an array).


execute

void execute(Collection collection)
Insert a List of facts, an fire the rules, returning when finished. This will assert the list of facts as SEPARATE facts to the engine (NOT as a List).


asyncExecute

void asyncExecute(Object object)
This will assert the object in the background. This is "send and forget" execution.


asyncExecute

void asyncExecute(Object[] array)
This will assert the object array (as SEPARATE facts) in the background. This is "send and forget" execution.


asyncExecute

void asyncExecute(Collection collection)
This will assert the object List (as SEPARATE facts) in the background. This is "send and forget" execution.


executeWithResults

StatelessSessionResult executeWithResults(Object object)
Similar to the normal execute method, but this will return "results".


executeWithResults

StatelessSessionResult executeWithResults(Object[] array)
Similar to the normal execute method, but this will return "results".


executeWithResults

StatelessSessionResult executeWithResults(Collection collection)
Similar to the normal execute method, but this will return "results".



Copyright © 2001-2013 JBoss Inc.. All Rights Reserved.