Package org.drools.ruleunits.api
Interface RuleUnitInstance<T extends RuleUnitData>
-
- Type Parameters:
T- TheRuleUnitDatafor which this rule unit is generated.
- All Superinterfaces:
AutoCloseable
public interface RuleUnitInstance<T extends RuleUnitData> extends AutoCloseable
An instance of aRuleUnitworking on the data contained in a specificRuleUnitData.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidclose()Releases all resources used by this RuleUnitInstance, setting it up for garbage collection.QueryResultsexecuteQuery(String query, Object... arguments)Executes the query with the given name on this instance, using the given set of argumentsintfire()Trigger the pattern matching algorithm on all the facts contained in theDataSources of theRuleUnitDataused by this RuleUnitInstance and fires all the rules activated by them.<T extends SessionClock>
TgetClock()TruleUnitData()The instance ofRuleUnitDatacontaining the data used by this RuleUnitInstance.RuleUnit<T>unit()TheRuleUnitfrom which this RuleUnitInstance has been created.
-
-
-
Method Detail
-
ruleUnitData
T ruleUnitData()
The instance ofRuleUnitDatacontaining the data used by this RuleUnitInstance.
-
fire
int fire()
Trigger the pattern matching algorithm on all the facts contained in theDataSources of theRuleUnitDataused 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:
closein interfaceAutoCloseable
-
-