Package org.kie.api
Interface KieBase
-
- All Superinterfaces:
KieBaseEventManager
public interface KieBase extends KieBaseEventManager
The KieBase is a repository of all the application's knowledge definitions. It will contain rules, processes, functions, type models. The KieBase itself does not contain runtime data, instead sessions are created from the KieBase in which data can be inserted and process instances started.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Set<String>getEntryPointIds()Returns the set of the entry points declared and/or used in this kie baseFactTypegetFactType(String packageName, String typeName)Returns a reference to theFactTypeidentified by the given package and type names.KiePackagegetKiePackage(String packageName)Returns a reference to theKiePackageidentified by the given name.Collection<KiePackage>getKiePackages()Returns a collection of theKiePackages that exist in thisKieBase.Collection<? extends KieSession>getKieSessions()Returns a collection of theKieSessions that exist in thisKieBase.ProcessgetProcess(String processId)Returns a reference to theProcessidentified by the given processIdCollection<Process>getProcesses()QuerygetQuery(String packageName, String queryName)Returns a reference to theQueryidentified by the given package and query names.RulegetRule(String packageName, String ruleName)Returns a reference to theRuleidentified by the given package and rule names.KieSessionnewKieSession()Creates a newKieSessionusing the default session configuration.KieSessionnewKieSession(KieSessionConfiguration conf, Environment environment)Creates a newKieSessionusing the given session configuration and/or environment.KieSessionsPoolnewKieSessionsPool(int initialSize)Creates a newKieSessionsPoolstoring the sessions created from this KieBase.StatelessKieSessionnewStatelessKieSession()Creates a newStatelessKieSessionusing the default session configuration.StatelessKieSessionnewStatelessKieSession(KieSessionConfiguration conf)Creates a newStatelessKieSessionusing the given session configuration.voidremoveFunction(String packageName, String functionName)Removes a function from the specified package.voidremoveKiePackage(String packageName)Removes aKiePackageand all the definitions it contains from theKieBasevoidremoveProcess(String processId)Removes a process.voidremoveQuery(String packageName, String queryName)Removes a query from the specified package.voidremoveRule(String packageName, String ruleName)Removes a rule from the specified package.-
Methods inherited from interface org.kie.api.event.kiebase.KieBaseEventManager
addEventListener, getKieBaseEventListeners, removeEventListener
-
-
-
-
Method Detail
-
getKiePackages
Collection<KiePackage> getKiePackages()
Returns a collection of theKiePackages that exist in thisKieBase.- Returns:
- an immutable collection of the packages
-
getKiePackage
KiePackage getKiePackage(String packageName)
Returns a reference to theKiePackageidentified by the given name.- Parameters:
packageName- the name of theKiePackageto return- Returns:
- the
KiePackageidentified by the the given name or null if package not found.
-
removeKiePackage
void removeKiePackage(String packageName)
Removes aKiePackageand all the definitions it contains from theKieBase- Parameters:
packageName- the name of theKiePackageto remove
-
getRule
Rule getRule(String packageName, String ruleName)
Returns a reference to theRuleidentified by the given package and rule names.- Parameters:
packageName- the package name to which the rule belongs toruleName- the name of the rule- Returns:
- the
Ruleobject or null if not found
-
removeRule
void removeRule(String packageName, String ruleName)
Removes a rule from the specified package.- Parameters:
packageName- the package name to which the rule belongs toruleName- the name of the rule
-
getQuery
Query getQuery(String packageName, String queryName)
Returns a reference to theQueryidentified by the given package and query names.- Parameters:
packageName- the package name to which the query belongs toqueryName- the name of the query- Returns:
- the
Queryobject or null if not found.
-
removeQuery
void removeQuery(String packageName, String queryName)
Removes a query from the specified package.- Parameters:
packageName- the package name to which the query belongs toqueryName- the name of the query
-
removeFunction
void removeFunction(String packageName, String functionName)
Removes a function from the specified package.- Parameters:
packageName- the package name to which the function belongs tofunctionName- the name of the function
-
getFactType
FactType getFactType(String packageName, String typeName)
Returns a reference to theFactTypeidentified by the given package and type names.- Parameters:
packageName- the name of the package the fact belongs totypeName- the name of the type- Returns:
- the
FactTypeidentified by the parameters or null if not found.
-
getProcess
Process getProcess(String processId)
Returns a reference to theProcessidentified by the given processId- Parameters:
processId- the id of the process- Returns:
- the
Processidentified by the given processId or null if process not found.
-
removeProcess
void removeProcess(String processId)
Removes a process.- Parameters:
processId- the id of the process
-
getProcesses
Collection<Process> getProcesses()
- Returns:
- an immutable collection of the processes
-
newKieSession
KieSession newKieSession(KieSessionConfiguration conf, Environment environment)
Creates a newKieSessionusing the given session configuration and/or environment. Either one can be null and it will use a default. Don't forget toKieSession.dispose()session when you are done.- Parameters:
conf- session configurationenvironment- environment- Returns:
- created
KieSession
-
newKieSession
KieSession newKieSession()
Creates a newKieSessionusing the default session configuration. Don't forget toKieSession.dispose()session when you are done.- Returns:
- created
KieSession
-
newKieSessionsPool
KieSessionsPool newKieSessionsPool(int initialSize)
Creates a newKieSessionsPoolstoring the sessions created from this KieBase. Don't forget toKieSessionsPool.shutdown()the pool when you are done.- Parameters:
initialSize- the initial size of sessions in the pool- Returns:
- created
KieSessionsPool
-
getKieSessions
Collection<? extends KieSession> getKieSessions()
Returns a collection of theKieSessions that exist in thisKieBase. Be careful as sessions are not thread-safe and could be in use elsewhere.- Returns:
- a Collection of
KieSessions
-
newStatelessKieSession
StatelessKieSession newStatelessKieSession(KieSessionConfiguration conf)
Creates a newStatelessKieSessionusing the given session configuration. You do not need to callKieSession.dispose()on this.- Parameters:
conf- session configuration- Returns:
- created
StatelessKieSession
-
newStatelessKieSession
StatelessKieSession newStatelessKieSession()
Creates a newStatelessKieSessionusing the default session configuration. You do not need to call @{link #dispose()} on this.- Returns:
- created
StatelessKieSession
-
-