public interface IRule
The key method to implement is
createEvaluation(IItemCollection, IPreferenceValueProvider, IResultValueProvider)
.
getId()
must return an id that is unique for each implementation and
getName()
should return a human readable name.
Rule instances may be reused for multiple evaluations with different input data so it is strongly recommended that implementations be stateless.
Modifier and Type | Method and Description |
---|---|
java.util.concurrent.RunnableFuture<IResult> |
createEvaluation(IItemCollection items,
IPreferenceValueProvider preferenceValueProvider,
IResultValueProvider dependencyResults)
Gets a future representing the result of the evaluation of this rule.
|
java.util.Collection<TypedPreference<?>> |
getConfigurationAttributes()
Gets information about which attributes may be configured during rule evaluation.
|
java.lang.String |
getId() |
java.lang.String |
getName() |
java.util.Map<java.lang.String,RulesToolkit.EventAvailability> |
getRequiredEvents() |
java.util.Collection<TypedResult<?>> |
getResults()
Gets information about which results may be part of an
IResult instance. |
java.lang.String |
getTopic() |
java.lang.String getId()
java.lang.String getTopic()
null
java.lang.String getName()
java.util.Map<java.lang.String,RulesToolkit.EventAvailability> getRequiredEvents()
RulesToolkit.EventAvailability
this rule
requires for that event typejava.util.concurrent.RunnableFuture<IResult> createEvaluation(IItemCollection items, IPreferenceValueProvider preferenceValueProvider, IResultValueProvider dependencyResults)
items
- items to evaluatepreferenceValueProvider
- Provider of configuration values used for evaluation. The attributes that will be
asked for from the provider should be provided by
getConfigurationAttributes()
.dependencyResults
- Provider of results from rules evaluated prior to this rule and which this rule
explicitly depends on via a DependsOn
annotation. The attributes that will
be asked for from the provider will be provided by each dependant rule, e.g. via
public static constants.java.util.Collection<TypedPreference<?>> getConfigurationAttributes()
java.util.Collection<TypedResult<?>> getResults()
IResult
instance.