Package org.drools.ruleunits.api
Interface RuleUnitInstance<T extends RuleUnitData>
-
- Type Parameters:
T
- TheRuleUnitData
for which this rule unit is generated.
- All Superinterfaces:
AutoCloseable
public interface RuleUnitInstance<T extends RuleUnitData> extends AutoCloseable
An instance of aRuleUnit
working on the data contained in a specificRuleUnitData
.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
close()
Releases all resources used by this RuleUnitInstance, setting it up for garbage collection.QueryResults
executeQuery(String query, Object... arguments)
Executes the query with the given name on this instance, using the given set of argumentsint
fire()
Trigger the pattern matching algorithm on all the facts contained in theDataSource
s of theRuleUnitData
used by this RuleUnitInstance and fires all the rules activated by them.<T extends SessionClock>
TgetClock()
T
ruleUnitData()
The instance ofRuleUnitData
containing the data used by this RuleUnitInstance.RuleUnit<T>
unit()
TheRuleUnit
from which this RuleUnitInstance has been created.
-
-
-
Method Detail
-
ruleUnitData
T ruleUnitData()
The instance ofRuleUnitData
containing the data used by this RuleUnitInstance.
-
fire
int fire()
Trigger the pattern matching algorithm on all the facts contained in theDataSource
s of theRuleUnitData
used by this RuleUnitInstance and fires all the rules activated by them.- Returns:
- The number of fired rules.
-
executeQuery
QueryResults executeQuery(String query, Object... arguments)
Executes the query with the given name on this instance, using the given set of arguments- Parameters:
query
- The name of the query to be executedarguments
- The arguments to be passed to the query- Returns:
- TODO this should return a
QueryResults
-
getClock
<T extends SessionClock> T getClock()
- Returns:
- the session clock instance used by this RuleUnitInstance
-
close
void close()
Releases all resources used by this RuleUnitInstance, setting it up for garbage collection. This method must always be called after finishing using the RuleUnitInstance, or the engine will not free the memory it uses.- Specified by:
close
in interfaceAutoCloseable
-
-