Package org.kie.api.builder.model
Interface KieSessionModel
-
public interface KieSessionModel
KieSessionModel is a model allowing to programmatically define a KieSession- See Also:
KieSession
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
KieSessionModel.KieSessionType
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description KieSessionModel
addCalendar(java.lang.String name, java.lang.String type)
Add a calendar to this KieSessionModelBeliefSystemTypeOption
getBeliefSystem()
Returns the BeliefSystemType of this KieSessionModeljava.util.Map<java.lang.String,java.lang.String>
getCalendars()
Returns all the calendars set on this KieSessionModeljava.util.List<ChannelModel>
getChannelModels()
Returns all the ChannelModels defined for this KieSessionModelClockTypeOption
getClockType()
Returns the ClockType of this KieSessionModeljava.lang.String
getConsoleLogger()
Returns the name of the ConsoleLogger if anyFileLoggerModel
getFileLogger()
Returns the FileLoggerModel registered on this KieSessionModel if anyKieBaseModel
getKieBaseModel()
Returns the KieBaseModel which this KieSessionModel belongs tojava.util.List<ListenerModel>
getListenerModels()
Returns all the ListenerModels defined for this KieSessionModeljava.lang.String
getName()
Returns the name of the KieSession defined by this KieSessionModeljava.lang.String
getScope()
Returns the CDI scope of this KieSessionModelKieSessionModel.KieSessionType
getType()
Returns the type of this KieSessionModeljava.util.List<WorkItemHandlerModel>
getWorkItemHandlerModels()
Returns all the WorkItemHandlerModels defined for this KieSessionModelboolean
isAccumulateNullPropagation()
boolean
isDefault()
Returns true if this KieSessionModel is the default oneboolean
isDirectFiring()
Returns true if this KieSessionModel has direct firing enabled seeboolean
isThreadSafe()
ChannelModel
newChannelModel(java.lang.String name, java.lang.String type)
Creates a new ChannelModel of the given type (i.e. the name of the class implementing it) and add it to this KieSessionModelListenerModel
newListenerModel(java.lang.String type, ListenerModel.Kind kind)
Creates a new ListenerModel of the given type (i.e. the name of the class implementing it) and kind and add it to this KieSessionModelWorkItemHandlerModel
newWorkItemHandlerModel(java.lang.String name, java.lang.String type)
Creates a new WorkItemHandlerModel of the given type (i.e. the name of the class implementing it) and add it to this KieSessionModelKieSessionModel
setAccumulateNullPropagation(boolean accumulateNullPropagation)
KieSessionModel
setBeliefSystem(BeliefSystemTypeOption beliefSystem)
Sets the BeliefSystem for this KieSessionModel.KieSessionModel
setClockType(ClockTypeOption clockType)
Sets the ClockType for this KieSessionModel.KieSessionModel
setConsoleLogger(java.lang.String consoleLogger)
Sets a ConsoleLogger with the given nameKieSessionModel
setDefault(boolean isDefault)
Sets the KieSession generated from this KieSessionModel as the default one, i.e. the one that can be loaded from the KieContainer without having to pass its name.KieSessionModel
setDirectFiring(boolean isDefault)
Sets direct firing on this KieSessionKieSessionModel
setFileLogger(java.lang.String fileName)
Sets a non-threaded FileLogger with the given name and 30 seconds of logging intervalKieSessionModel
setFileLogger(java.lang.String fileName, int interval, boolean threaded)
Sets a FileLogger with the given name, threaded behavior and logging intervalKieSessionModel
setScope(java.lang.String scope)
Sets the CDI scope for this KieSessionModel Default is javax.enterprise.context.ApplicationScopedKieSessionModel
setThreadSafe(boolean threadSafe)
KieSessionModel
setType(KieSessionModel.KieSessionType type)
Sets the type for this KieSessionModel.
-
-
-
Method Detail
-
getName
java.lang.String getName()
Returns the name of the KieSession defined by this KieSessionModel
-
getType
KieSessionModel.KieSessionType getType()
Returns the type of this KieSessionModel
-
setType
KieSessionModel setType(KieSessionModel.KieSessionType type)
Sets the type for this KieSessionModel. Default is STATEFUL
-
getClockType
ClockTypeOption getClockType()
Returns the ClockType of this KieSessionModel
-
setClockType
KieSessionModel setClockType(ClockTypeOption clockType)
Sets the ClockType for this KieSessionModel. Default is realtime
-
getBeliefSystem
BeliefSystemTypeOption getBeliefSystem()
Returns the BeliefSystemType of this KieSessionModel
-
setBeliefSystem
KieSessionModel setBeliefSystem(BeliefSystemTypeOption beliefSystem)
Sets the BeliefSystem for this KieSessionModel. Default is simple
-
newListenerModel
ListenerModel newListenerModel(java.lang.String type, ListenerModel.Kind kind)
Creates a new ListenerModel of the given type (i.e. the name of the class implementing it) and kind and add it to this KieSessionModel
-
getListenerModels
java.util.List<ListenerModel> getListenerModels()
Returns all the ListenerModels defined for this KieSessionModel
-
newWorkItemHandlerModel
WorkItemHandlerModel newWorkItemHandlerModel(java.lang.String name, java.lang.String type)
Creates a new WorkItemHandlerModel of the given type (i.e. the name of the class implementing it) and add it to this KieSessionModel
-
getWorkItemHandlerModels
java.util.List<WorkItemHandlerModel> getWorkItemHandlerModels()
Returns all the WorkItemHandlerModels defined for this KieSessionModel
-
newChannelModel
ChannelModel newChannelModel(java.lang.String name, java.lang.String type)
Creates a new ChannelModel of the given type (i.e. the name of the class implementing it) and add it to this KieSessionModel
-
getChannelModels
java.util.List<ChannelModel> getChannelModels()
Returns all the ChannelModels defined for this KieSessionModel
-
setScope
KieSessionModel setScope(java.lang.String scope)
Sets the CDI scope for this KieSessionModel Default is javax.enterprise.context.ApplicationScoped
-
getScope
java.lang.String getScope()
Returns the CDI scope of this KieSessionModel
-
getConsoleLogger
java.lang.String getConsoleLogger()
Returns the name of the ConsoleLogger if any
-
setConsoleLogger
KieSessionModel setConsoleLogger(java.lang.String consoleLogger)
Sets a ConsoleLogger with the given name
-
getFileLogger
FileLoggerModel getFileLogger()
Returns the FileLoggerModel registered on this KieSessionModel if any
-
setFileLogger
KieSessionModel setFileLogger(java.lang.String fileName)
Sets a non-threaded FileLogger with the given name and 30 seconds of logging interval
-
setFileLogger
KieSessionModel setFileLogger(java.lang.String fileName, int interval, boolean threaded)
Sets a FileLogger with the given name, threaded behavior and logging interval
-
addCalendar
KieSessionModel addCalendar(java.lang.String name, java.lang.String type)
Add a calendar to this KieSessionModel- Parameters:
name
- The calendar nametype
- The class implementing the calendar
-
getCalendars
java.util.Map<java.lang.String,java.lang.String> getCalendars()
Returns all the calendars set on this KieSessionModel
-
isDefault
boolean isDefault()
Returns true if this KieSessionModel is the default one
-
setDefault
KieSessionModel setDefault(boolean isDefault)
Sets the KieSession generated from this KieSessionModel as the default one, i.e. the one that can be loaded from the KieContainer without having to pass its name. Note that only one default KieSessionModel of type STATEFUL and one of type STATELESS are allowed in a given KieContainer so if more than one is found (maybe because a given KieContainer includes many KieModules) a warning is emitted and all the defaults are disabled so all the KieSessions will be accessible only by name
-
isDirectFiring
boolean isDirectFiring()
Returns true if this KieSessionModel has direct firing enabled see
-
setDirectFiring
KieSessionModel setDirectFiring(boolean isDefault)
Sets direct firing on this KieSession
-
getKieBaseModel
KieBaseModel getKieBaseModel()
Returns the KieBaseModel which this KieSessionModel belongs to
-
isThreadSafe
boolean isThreadSafe()
-
setThreadSafe
KieSessionModel setThreadSafe(boolean threadSafe)
-
isAccumulateNullPropagation
boolean isAccumulateNullPropagation()
-
setAccumulateNullPropagation
KieSessionModel setAccumulateNullPropagation(boolean accumulateNullPropagation)
-
-