Package org.kie.api.builder.model
Interface KieSessionModel
public interface KieSessionModel
KieSessionModel is a model allowing to programmatically define a KieSession
- See Also:
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionaddCalendar(String name, String type) Add a calendar to this KieSessionModelReturns the BeliefSystemType of this KieSessionModelReturns all the calendars set on this KieSessionModelReturns all the ChannelModels defined for this KieSessionModelReturns the ClockType of this KieSessionModelReturns the name of the ConsoleLogger if anyReturns the FileLoggerModel registered on this KieSessionModel if anyReturns the KieBaseModel which this KieSessionModel belongs toReturns all the ListenerModels defined for this KieSessionModelgetName()Returns the name of the KieSession defined by this KieSessionModelgetScope()Returns the CDI scope of this KieSessionModelgetType()Returns the type of this KieSessionModelReturns all the WorkItemHandlerModels defined for this KieSessionModelbooleanbooleanReturns true if this KieSessionModel is the default onebooleanReturns true if this KieSessionModel has direct firing enabled seebooleannewChannelModel(String name, String type) Creates a new ChannelModel of the given type (i.e.newListenerModel(String type, ListenerModel.Kind kind) Creates a new ListenerModel of the given type (i.e.newWorkItemHandlerModel(String name, String type) Creates a new WorkItemHandlerModel of the given type (i.e.setAccumulateNullPropagation(boolean accumulateNullPropagation) setBeliefSystem(BeliefSystemTypeOption beliefSystem) Sets the BeliefSystem for this KieSessionModel.setClockType(ClockTypeOption clockType) Sets the ClockType for this KieSessionModel.setConsoleLogger(String consoleLogger) Sets a ConsoleLogger with the given namesetDefault(boolean isDefault) Sets the KieSession generated from this KieSessionModel as the default one, i.e.setDirectFiring(boolean isDefault) Sets direct firing on this KieSessionsetFileLogger(String fileName) Sets a non-threaded FileLogger with the given name and 30 seconds of logging intervalsetFileLogger(String fileName, int interval, boolean threaded) Sets a FileLogger with the given name, threaded behavior and logging intervalSets the CDI scope for this KieSessionModel Default is jakarta.enterprise.context.ApplicationScopedsetThreadSafe(boolean threadSafe) Sets the type for this KieSessionModel.
-
Method Details
-
getName
String getName()Returns the name of the KieSession defined by this KieSessionModel -
getType
KieSessionModel.KieSessionType getType()Returns the type of this KieSessionModel -
setType
Sets the type for this KieSessionModel. Default is STATEFUL -
getClockType
ClockTypeOption getClockType()Returns the ClockType of this KieSessionModel -
setClockType
Sets the ClockType for this KieSessionModel. Default is realtime -
getBeliefSystem
BeliefSystemTypeOption getBeliefSystem()Returns the BeliefSystemType of this KieSessionModel -
setBeliefSystem
Sets the BeliefSystem for this KieSessionModel. Default is simple -
newListenerModel
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
List<ListenerModel> getListenerModels()Returns all the ListenerModels defined for this KieSessionModel -
newWorkItemHandlerModel
Creates a new WorkItemHandlerModel of the given type (i.e. the name of the class implementing it) and add it to this KieSessionModel -
getWorkItemHandlerModels
List<WorkItemHandlerModel> getWorkItemHandlerModels()Returns all the WorkItemHandlerModels defined for this KieSessionModel -
newChannelModel
Creates a new ChannelModel of the given type (i.e. the name of the class implementing it) and add it to this KieSessionModel -
getChannelModels
List<ChannelModel> getChannelModels()Returns all the ChannelModels defined for this KieSessionModel -
setScope
Sets the CDI scope for this KieSessionModel Default is jakarta.enterprise.context.ApplicationScoped -
getScope
String getScope()Returns the CDI scope of this KieSessionModel -
getConsoleLogger
String getConsoleLogger()Returns the name of the ConsoleLogger if any -
setConsoleLogger
Sets a ConsoleLogger with the given name -
getFileLogger
FileLoggerModel getFileLogger()Returns the FileLoggerModel registered on this KieSessionModel if any -
setFileLogger
Sets a non-threaded FileLogger with the given name and 30 seconds of logging interval -
setFileLogger
Sets a FileLogger with the given name, threaded behavior and logging interval -
addCalendar
Add a calendar to this KieSessionModel- Parameters:
name- The calendar nametype- The class implementing the calendar
-
getCalendars
Returns all the calendars set on this KieSessionModel -
isDefault
boolean isDefault()Returns true if this KieSessionModel is the default one -
setDefault
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
Sets direct firing on this KieSession -
getKieBaseModel
KieBaseModel getKieBaseModel()Returns the KieBaseModel which this KieSessionModel belongs to -
isThreadSafe
boolean isThreadSafe() -
setThreadSafe
-
isAccumulateNullPropagation
boolean isAccumulateNullPropagation() -
setAccumulateNullPropagation
-