Package org.drools.mvel.evaluators
Class MeetsEvaluatorDefinition
java.lang.Object
org.drools.mvel.evaluators.MeetsEvaluatorDefinition
- All Implemented Interfaces:
Externalizable,Serializable,EvaluatorDefinition,EvaluatorDefinition
The implementation of the meets evaluator definition.
The meets evaluator correlates two events and matches when the current event's
end timestamp happens at the same time as the correlated event's start timestamp.
Lets look at an example:
$eventA : EventA( this meets $eventB )
The previous pattern will match if and only if the $eventA finishes at the same time $eventB starts. In other words:
abs( $eventB.startTimestamp - $eventA.endTimestamp ) == 0
The meets evaluator accepts one optional parameter. If it is defined, it determines
the maximum distance between the end timestamp of current event and the start timestamp of the correlated
event in order for the operator to match. Example:
$eventA : EventA( this meets[ 5s ] $eventB )Will match if and only if:
abs( $eventB.startTimestamp - $eventA.endTimestamp) <= 5s
NOTE: it makes no sense to use a negative interval value for the parameter and the engine will raise an exception if that happens.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classImplements the 'meets' evaluator itselfNested classes/interfaces inherited from interface org.drools.compiler.rule.builder.EvaluatorDefinition
EvaluatorDefinition.Target -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.drools.base.rule.accessor.EvaluatorgetEvaluator(org.drools.base.base.ValueType type, String operatorId, boolean isNegated, String parameterText) org.drools.base.rule.accessor.EvaluatorgetEvaluator(org.drools.base.base.ValueType type, String operatorId, boolean isNegated, String parameterText, EvaluatorDefinition.Target left, EvaluatorDefinition.Target right) org.drools.base.rule.accessor.EvaluatorgetEvaluator(org.drools.base.base.ValueType type, org.drools.drl.parser.impl.Operator operator) org.drools.base.rule.accessor.EvaluatorgetEvaluator(org.drools.base.base.ValueType type, org.drools.drl.parser.impl.Operator operator, String parameterText) String[]booleanvoidbooleansupportsType(org.drools.base.base.ValueType type) void
-
Field Details
-
meetsOp
-
MEETS
public static final org.drools.drl.parser.impl.Operator MEETS -
MEETS_NOT
public static final org.drools.drl.parser.impl.Operator MEETS_NOT
-
-
Constructor Details
-
MeetsEvaluatorDefinition
public MeetsEvaluatorDefinition()
-
-
Method Details
-
readExternal
- Specified by:
readExternalin interfaceExternalizable- Throws:
IOExceptionClassNotFoundException
-
writeExternal
- Specified by:
writeExternalin interfaceExternalizable- Throws:
IOException
-
getEvaluator
public org.drools.base.rule.accessor.Evaluator getEvaluator(org.drools.base.base.ValueType type, org.drools.drl.parser.impl.Operator operator) - Specified by:
getEvaluatorin interfaceEvaluatorDefinition
-
getEvaluator
public org.drools.base.rule.accessor.Evaluator getEvaluator(org.drools.base.base.ValueType type, org.drools.drl.parser.impl.Operator operator, String parameterText) - Specified by:
getEvaluatorin interfaceEvaluatorDefinition
-
getEvaluator
public org.drools.base.rule.accessor.Evaluator getEvaluator(org.drools.base.base.ValueType type, String operatorId, boolean isNegated, String parameterText) - Specified by:
getEvaluatorin interfaceEvaluatorDefinition
-
getEvaluator
public org.drools.base.rule.accessor.Evaluator getEvaluator(org.drools.base.base.ValueType type, String operatorId, boolean isNegated, String parameterText, EvaluatorDefinition.Target left, EvaluatorDefinition.Target right) - Specified by:
getEvaluatorin interfaceEvaluatorDefinition
-
getEvaluatorIds
- Specified by:
getEvaluatorIdsin interfaceEvaluatorDefinition
-
isNegatable
public boolean isNegatable()- Specified by:
isNegatablein interfaceEvaluatorDefinition
-
getTarget
- Specified by:
getTargetin interfaceEvaluatorDefinition
-
supportsType
public boolean supportsType(org.drools.base.base.ValueType type) - Specified by:
supportsTypein interfaceEvaluatorDefinition
-