Package org.jeasy.rules.api
Class RulesEngineParameters
java.lang.Object
org.jeasy.rules.api.RulesEngineParameters
Parameters of a rules engine.
- When parameters are used with a
DefaultRulesEngine
, they are applied on all registered rules. - When parameters are used with a
InferenceRulesEngine
, they are applied on candidate rules in each iteration.
- Author:
- Mahmoud Ben Hassine ([email protected])
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
Default rule priority threshold. -
Constructor Summary
ConstructorsConstructorDescriptionCreate a newRulesEngineParameters
with default values.RulesEngineParameters
(boolean skipOnFirstAppliedRule, boolean skipOnFirstFailedRule, boolean skipOnFirstNonTriggeredRule, int priorityThreshold, boolean failsOnException) Create a newRulesEngineParameters
. -
Method Summary
Modifier and TypeMethodDescriptionfailsOnException
(boolean failsOnException) int
static boolean
hasOptionalParameterAnnotation
(Class<?> methodAnnotation) boolean
boolean
boolean
boolean
priorityThreshold
(int priorityThreshold) void
setFailsOnException
(boolean failsOnException) static void
setOptionalParameterAnnotation
(Class<?> optionalParameterAnnotation) void
setPriorityThreshold
(int priorityThreshold) void
setSkipOnFirstAppliedRule
(boolean skipOnFirstAppliedRule) void
setSkipOnFirstFailedRule
(boolean skipOnFirstFailedRule) void
setSkipOnFirstNonTriggeredRule
(boolean skipOnFirstNonTriggeredRule) skipOnFirstAppliedRule
(boolean skipOnFirstAppliedRule) skipOnFirstFailedRule
(boolean skipOnFirstFailedRule) skipOnFirstNonTriggeredRule
(boolean skipOnFirstNonTriggeredRule) toString()
-
Field Details
-
DEFAULT_RULE_PRIORITY_THRESHOLD
public static final int DEFAULT_RULE_PRIORITY_THRESHOLDDefault rule priority threshold.- See Also:
-
-
Constructor Details
-
RulesEngineParameters
public RulesEngineParameters()Create a newRulesEngineParameters
with default values. -
RulesEngineParameters
public RulesEngineParameters(boolean skipOnFirstAppliedRule, boolean skipOnFirstFailedRule, boolean skipOnFirstNonTriggeredRule, int priorityThreshold, boolean failsOnException) Create a newRulesEngineParameters
.- Parameters:
skipOnFirstAppliedRule
- parameter to skip next applicable rules on first applied rule.skipOnFirstFailedRule
- parameter to skip next applicable rules on first failed rule.skipOnFirstNonTriggeredRule
- parameter to skip next applicable rules on first non triggered rule.priorityThreshold
- threshold after which rules should be skipped.
-
-
Method Details
-
getPriorityThreshold
public int getPriorityThreshold() -
setPriorityThreshold
public void setPriorityThreshold(int priorityThreshold) -
priorityThreshold
-
isSkipOnFirstAppliedRule
public boolean isSkipOnFirstAppliedRule() -
setSkipOnFirstAppliedRule
public void setSkipOnFirstAppliedRule(boolean skipOnFirstAppliedRule) -
skipOnFirstAppliedRule
-
isSkipOnFirstNonTriggeredRule
public boolean isSkipOnFirstNonTriggeredRule() -
setSkipOnFirstNonTriggeredRule
public void setSkipOnFirstNonTriggeredRule(boolean skipOnFirstNonTriggeredRule) -
skipOnFirstNonTriggeredRule
-
isSkipOnFirstFailedRule
public boolean isSkipOnFirstFailedRule() -
setSkipOnFirstFailedRule
public void setSkipOnFirstFailedRule(boolean skipOnFirstFailedRule) -
isFailsOnException
public boolean isFailsOnException() -
setFailsOnException
public void setFailsOnException(boolean failsOnException) -
skipOnFirstFailedRule
-
failsOnException
-
hasOptionalParameterAnnotation
-
setOptionalParameterAnnotation
-
toString
-