com.hammurapi.reasoning.spi
Annotation Type Infer
@Target(value=METHOD)
@Retention(value=RUNTIME)
public @interface Infer
This annotation indicates that method is an inference method.
Rule methods can return facts and post facts (conclusions). Reasoning engine
needs to know types of rule outputs. From rule class introspection
the rule system knows about rule method return type, but it doesn't know
about types posted through post().
Also, return type might not be enough, as returned instances may implement
interfaces which other rules are interested in, but which are not declared
in the rule return type.
Annotation parameter allows rules to inform the inference system about posted types.
For methods without fact types information
provided through annotation parameter, the rule system uses method return type.
- Author:
- Pavel
value
public abstract Class<?>[] value
- Returns:
- Conclusion types posted by this method.
- Default:
- {}
priority
public abstract int priority
- Returns:
- Inference method priority. Methods with higher priority value get invoked before methods with lower priority value.
Inference method can invoke consume() method from InferenceContext to "consume" source fact(s) and prevent invocation
of subsequent inference methods.
- Default:
- 0