Package org.kie.api.builder.model
Interface KieBaseModel
public interface KieBaseModel
KieBaseModel is a model allowing to programmatically define a KieBase
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionaddInclude(String kBaseName) Includes the resources of the KieBase with the given name in this KieBaseModeladdPackage(String pkg) Adds a package (pattern) to the list of the packages defining the set of resources that have to be included in the KieBase.addRuleTemplate(String dtable, String template, int row, int col) Defines a new RuleTemplateModel for this KieBaseModelReturns the BetaRangeIndexOption of this KieBaseModelReturns the DeclarativeAgendaOption of this KieBaseModelReturns the EqualityBehavior of this KieBaseModelReturns the EventProcessingMode of this KieBaseModelReturns all KieBases included by this oneReturns all the KieSessionModel defined in this KieBaseModel mapped by their namesReturns the KieBaseMutabilityOption of this KieBaseModelgetName()Returns the name of the KieBase defined by this KieBaseModelReturns the ordered list of all the package patterns used to define the set of resources that have to be included in the KieBase.Sets the PrototypesOption for this KieBaseModel.Returns the list of all RuleTemplateModels defined for this KieBaseModelgetScope()Returns the CDI scope of this KieBaseModel Default is jakarta.enterprise.context.ApplicationScopedReturns the SequentialOption of this KieBaseModelReturns the session pool configuration of this KieBaseModelbooleanReturns true if this KieBaseModel is the default onenewKieSessionModel(String name) Creates a new KieSessionModel with the given name and adds it to this KieBaseModelremoveInclude(String kBaseName) Remove the inclusion of the KieBase with the given nameremoveKieSessionModel(String qName) Removes the KieSessionModel with the give name from this KieBaseModelremovePackage(String pkg) Removes a package (pattern) from the list of the packages defining the set of resources that have to be included in the KieBase.setBetaRangeIndexOption(BetaRangeIndexOption betaRangeIndexOption) Sets the BetaRangeIndexOption for this KieBaseModel Default is BetaRangeIndexOption.DISABLEDsetDeclarativeAgenda(DeclarativeAgendaOption declarativeAgenda) Sets the DeclarativeAgendaOption for this KieBaseModel Default is DeclarativeAgendaOption.DISABLEDsetDefault(boolean isDefault) Sets the KieBase generated from this KieBaseModel as the default one, i.e.setEqualsBehavior(EqualityBehaviorOption equalsBehaviour) Sets the EqualityBehavior for this KieBaseModel.setEventProcessingMode(EventProcessingOption eventProcessingMode) Sets the EventProcessingOption for this KieBaseModel Default is EventProcessingOption.CLOUDsetMutability(KieBaseMutabilityOption mutability) Sets the KieBaseMutabilityOption for this KieBaseModel.setPrototypes(PrototypesOption prototypes) Returns the PrototypesOption of this KieBaseModelSets the CDI scope for this KieBaseModelsetSequential(SequentialOption sequential) Sets the SequentialOption for this KieBaseModel Default is SequentialOption.NOsetSessionsPool(SessionsPoolOption sessionPool) Sets the SessionPoolOption used by the KieBase to create new sessions Default is SessionPoolOption.NO
-
Method Details
-
newKieSessionModel
Creates a new KieSessionModel with the given name and adds it to this KieBaseModel- Parameters:
name- The name of the new KieSessionModel to be created- Returns:
- The new KieSessionModel
-
removeKieSessionModel
Removes the KieSessionModel with the give name from this KieBaseModel- Parameters:
qName- The name of the KieSessionModel to be removed
-
getKieSessionModels
Map<String,KieSessionModel> getKieSessionModels()Returns all the KieSessionModel defined in this KieBaseModel mapped by their names -
addInclude
Includes the resources of the KieBase with the given name in this KieBaseModel -
removeInclude
Remove the inclusion of the KieBase with the given name -
getName
String getName()Returns the name of the KieBase defined by this KieBaseModel -
getPackages
Returns the ordered list of all the package patterns used to define the set of resources that have to be included in the KieBase. If this list is empty, "*" is assumed by default, meaning that all the resources stored under a folder with the same name of this KieBaseModel will be included in the compiled KieBase regardless of the package they belong to. The list of package patterns is ordered and earlier patterns are applied before later patterns. For example, if you specify "org.foo.*,!org.foo.impl" the second pattern has no effect since all org.foo packages have already been selected by the first pattern. Instead, you should specify "!org.foo.impl,org.foo.*", which will export all org.foo packages except org.foo.impl. -
getIncludes
Returns all KieBases included by this one -
addPackage
Adds a package (pattern) to the list of the packages defining the set of resources that have to be included in the KieBase. -
removePackage
Removes a package (pattern) from the list of the packages defining the set of resources that have to be included in the KieBase. -
getEqualsBehavior
EqualityBehaviorOption getEqualsBehavior()Returns the EqualityBehavior of this KieBaseModel -
setEqualsBehavior
Sets the EqualityBehavior for this KieBaseModel. Default is EqualityBehaviorOption.IDENTITY -
getPrototypes
PrototypesOption getPrototypes()Sets the PrototypesOption for this KieBaseModel. Default is PrototypesOption.DISABLED -
setPrototypes
Returns the PrototypesOption of this KieBaseModel -
getMutability
KieBaseMutabilityOption getMutability()Returns the KieBaseMutabilityOption of this KieBaseModel -
setMutability
Sets the KieBaseMutabilityOption for this KieBaseModel. Default is KieBaseMutabilityOption.ALLOWED -
getSessionsPool
SessionsPoolOption getSessionsPool()Returns the session pool configuration of this KieBaseModel -
setSessionsPool
Sets the SessionPoolOption used by the KieBase to create new sessions Default is SessionPoolOption.NO -
getEventProcessingMode
EventProcessingOption getEventProcessingMode()Returns the EventProcessingMode of this KieBaseModel -
setEventProcessingMode
Sets the EventProcessingOption for this KieBaseModel Default is EventProcessingOption.CLOUD -
getDeclarativeAgenda
DeclarativeAgendaOption getDeclarativeAgenda()Returns the DeclarativeAgendaOption of this KieBaseModel -
setDeclarativeAgenda
Sets the DeclarativeAgendaOption for this KieBaseModel Default is DeclarativeAgendaOption.DISABLED -
getBetaRangeIndexOption
BetaRangeIndexOption getBetaRangeIndexOption()Returns the BetaRangeIndexOption of this KieBaseModel -
setBetaRangeIndexOption
Sets the BetaRangeIndexOption for this KieBaseModel Default is BetaRangeIndexOption.DISABLED -
getSequential
SequentialOption getSequential()Returns the SequentialOption of this KieBaseModel -
setSequential
Sets the SequentialOption for this KieBaseModel Default is SequentialOption.NO -
setScope
Sets the CDI scope for this KieBaseModel -
getScope
String getScope()Returns the CDI scope of this KieBaseModel Default is jakarta.enterprise.context.ApplicationScoped -
getRuleTemplates
List<RuleTemplateModel> getRuleTemplates()Returns the list of all RuleTemplateModels defined for this KieBaseModel -
addRuleTemplate
Defines a new RuleTemplateModel for this KieBaseModel -
isDefault
boolean isDefault()Returns true if this KieBaseModel is the default one -
setDefault
Sets the KieBase generated from this KieBaseModel 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 KieBaseModel is 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 KieBases will be accessible only by name
-