public interface RuleBase extends Externalizable, RuleBaseEventManager
Rule
s.
From a RuleBase
many WorkingMemory
rule
sessions may be instantiated. Additionally, it may be inspected to determine
which Package
s it contains.
WorkingMemory
Modifier and Type | Field and Description |
---|---|
static int |
RETEOO |
Modifier and Type | Method and Description |
---|---|
void |
addPackage(Package pkg) |
void |
addPackages(Package[] pkgs) |
int |
getAdditionsSinceLock()
Returns the number of additive operations applied since the last lock() was obtained
|
Set<String> |
getEntryPointIds() |
org.kie.api.definition.type.FactType |
getFactType(String string)
Returns a declared FactType.
|
Package |
getPackage(String name) |
Package[] |
getPackages() |
int |
getRemovalsSinceLock()
Returns the number of removal operations applied since the last lock() was obtained
|
StatefulSession[] |
getStatefulSessions()
Returns an array of all the referenced StatefulSessions
|
void |
lock()
This locks the current RuleBase and all there referenced StatefulSessions.
|
StatefulSession |
newStatefulSession()
Create a new
WorkingMemory session for this
RuleBase . |
StatefulSession |
newStatefulSession(boolean keepReference) |
StatefulSession |
newStatefulSession(InputStream stream) |
StatefulSession |
newStatefulSession(InputStream stream,
boolean keepReference) |
StatefulSession |
newStatefulSession(InputStream stream,
boolean keepReference,
SessionConfiguration conf) |
StatefulSession |
newStatefulSession(SessionConfiguration config,
org.kie.api.runtime.Environment environment)
Create a new
WorkingMemory session for this
RuleBase . |
StatelessSession |
newStatelessSession() |
void |
removeFunction(String packageName,
String functionName)
Removes a specific function in a specific package.
|
void |
removePackage(String packageName)
Remove the package and all it's rules, functions etc
|
void |
removeProcess(String id)
Removes a process by the process' id
|
void |
removeQuery(String packageName,
String queryName)
Remove a specific Query in a Package
|
void |
removeRule(String packageName,
String ruleName)
Remove a specific Rule in a Package
|
void |
unlock()
Unlocks the RuleBase and all of the referenced StatefulSessions.
|
readExternal, writeExternal
addEventListener, getRuleBaseEventListeners, removeEventListener
static final int RETEOO
StatelessSession newStatelessSession()
StatefulSession newStatefulSession()
WorkingMemory
session for this
RuleBase
. By default the RuleBase retains a
weak reference to returned WorkingMemory.
The created WorkingMemory
uses the default conflict
resolution strategy.
WorkingMemory
.
IMPORTANT: when using the stateful session REMEMBER TO CALL dispose()
when you are done with the session.WorkingMemory
,
org.kie.conflict.DefaultConflictResolver
StatefulSession newStatefulSession(boolean keepReference)
StatefulSession newStatefulSession(InputStream stream)
StatefulSession newStatefulSession(InputStream stream, boolean keepReference)
StatefulSession newStatefulSession(InputStream stream, boolean keepReference, SessionConfiguration conf)
StatefulSession newStatefulSession(SessionConfiguration config, org.kie.api.runtime.Environment environment)
WorkingMemory
session for this
RuleBase
.config
- the session configuration object to use for the
created session.WorkingMemory
.WorkingMemory
,
org.kie.conflict.DefaultConflictResolver
Package[] getPackages()
void addPackages(Package[] pkgs)
void addPackage(Package pkg)
void lock()
void unlock()
int getAdditionsSinceLock()
int getRemovalsSinceLock()
void removePackage(String packageName)
packageName
- void removeRule(String packageName, String ruleName)
packageName
- ruleName
- void removeQuery(String packageName, String queryName)
packageName
- ruleName
- void removeFunction(String packageName, String functionName)
packageName
- functionName
- void removeProcess(String id)
id
- StatefulSession[] getStatefulSessions()
org.kie.api.definition.type.FactType getFactType(String string)
string
- - the name of the declared type (a type defined in the rules).
This would typically be packagename + . + type name.
Eg, if there is a delcared type of name "Driver", and the package name is "com.company".
Then the string you pass in would be "com.company.Driver".Copyright © 2001-2014 JBoss by Red Hat. All Rights Reserved.