Class FinishesEvaluatorDefinition
- All Implemented Interfaces:
Externalizable,Serializable,EvaluatorDefinition,EvaluatorDefinition
The implementation of the finishes evaluator definition.
The finishes evaluator correlates two events and matches when the current event's
start timestamp happens after the correlated event's start timestamp, but both end timestamps occur at
the same time.
Lets look at an example:
$eventA : EventA( this finishes $eventB )
The previous pattern will match if and only if the $eventA starts after $eventB starts and finishes at the same time $eventB finishes. In other words:
$eventB.startTimestamp < $eventA.startTimestamp && $eventA.endTimestamp == $eventB.endTimestamp
The finishes evaluator accepts one optional parameter. If it is defined, it determines
the maximum distance between the end timestamp of both events in order for the operator to match. Example:
$eventA : EventA( this finishes[ 5s ] $eventB )Will match if and only if:
$eventB.startTimestamp < $eventA.startTimestamp && abs( $eventA.endTimestamp - $eventB.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 'finishes' evaluator itselfNested classes/interfaces inherited from interface org.drools.compiler.rule.builder.EvaluatorDefinition
EvaluatorDefinition.Target -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final org.drools.drl.parser.impl.Operatorstatic final org.drools.drl.parser.impl.Operatorprotected static final String -
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
-
finishesOp
-
FINISHES
public static final org.drools.drl.parser.impl.Operator FINISHES -
FINISHES_NOT
public static final org.drools.drl.parser.impl.Operator FINISHES_NOT
-
-
Constructor Details
-
FinishesEvaluatorDefinition
public FinishesEvaluatorDefinition()
-
-
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
-