Package org.drools.mvel.evaluators
Class MetByEvaluatorDefinition
- java.lang.Object
-
- org.drools.mvel.evaluators.MetByEvaluatorDefinition
-
- All Implemented Interfaces:
Externalizable,Serializable,org.drools.compiler.rule.builder.EvaluatorDefinition,org.kie.api.runtime.rule.EvaluatorDefinition
public class MetByEvaluatorDefinition extends Object implements org.drools.compiler.rule.builder.EvaluatorDefinition
The implementation of the
metbyevaluator definition.The
metbyevaluator correlates two events and matches when the current event's start timestamp happens at the same time as the correlated event's end timestamp.Lets look at an example:
$eventA : EventA( this metby $eventB )
The previous pattern will match if and only if the $eventA starts at the same time $eventB finishes. In other words:
abs( $eventA.startTimestamp - $eventB.endTimestamp ) == 0
The
metbyevaluator accepts one optional parameter. If it is defined, it determines the maximum distance between the end timestamp of the correlated event and the start timestamp of the current event in order for the operator to match. Example:$eventA : EventA( this metby[ 5s ] $eventB )
Will match if and only if:abs( $eventA.startTimestamp - $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:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classMetByEvaluatorDefinition.MetByEvaluatorImplements the 'metby' evaluator itself
-
Field Summary
Fields Modifier and Type Field Description static org.drools.drl.parser.impl.OperatorMET_BYprotected static StringmetByOpstatic org.drools.drl.parser.impl.OperatorNOT_MET_BY
-
Constructor Summary
Constructors Constructor Description MetByEvaluatorDefinition()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.drools.core.rule.accessor.EvaluatorgetEvaluator(org.drools.core.base.ValueType type, String operatorId, boolean isNegated, String parameterText)org.drools.core.rule.accessor.EvaluatorgetEvaluator(org.drools.core.base.ValueType type, String operatorId, boolean isNegated, String parameterText, org.drools.compiler.rule.builder.EvaluatorDefinition.Target left, org.drools.compiler.rule.builder.EvaluatorDefinition.Target right)org.drools.core.rule.accessor.EvaluatorgetEvaluator(org.drools.core.base.ValueType type, org.drools.drl.parser.impl.Operator operator)org.drools.core.rule.accessor.EvaluatorgetEvaluator(org.drools.core.base.ValueType type, org.drools.drl.parser.impl.Operator operator, String parameterText)String[]getEvaluatorIds()org.drools.compiler.rule.builder.EvaluatorDefinition.TargetgetTarget()booleanisNegatable()voidreadExternal(ObjectInput in)booleansupportsType(org.drools.core.base.ValueType type)voidwriteExternal(ObjectOutput out)
-
-
-
Field Detail
-
metByOp
protected static final String metByOp
-
MET_BY
public static org.drools.drl.parser.impl.Operator MET_BY
-
NOT_MET_BY
public static org.drools.drl.parser.impl.Operator NOT_MET_BY
-
-
Method Detail
-
readExternal
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
- Specified by:
readExternalin interfaceExternalizable- Throws:
IOExceptionClassNotFoundException
-
writeExternal
public void writeExternal(ObjectOutput out) throws IOException
- Specified by:
writeExternalin interfaceExternalizable- Throws:
IOException
-
getEvaluator
public org.drools.core.rule.accessor.Evaluator getEvaluator(org.drools.core.base.ValueType type, org.drools.drl.parser.impl.Operator operator)- Specified by:
getEvaluatorin interfaceorg.drools.compiler.rule.builder.EvaluatorDefinition
-
getEvaluator
public org.drools.core.rule.accessor.Evaluator getEvaluator(org.drools.core.base.ValueType type, org.drools.drl.parser.impl.Operator operator, String parameterText)- Specified by:
getEvaluatorin interfaceorg.drools.compiler.rule.builder.EvaluatorDefinition
-
getEvaluator
public org.drools.core.rule.accessor.Evaluator getEvaluator(org.drools.core.base.ValueType type, String operatorId, boolean isNegated, String parameterText)- Specified by:
getEvaluatorin interfaceorg.drools.compiler.rule.builder.EvaluatorDefinition
-
getEvaluator
public org.drools.core.rule.accessor.Evaluator getEvaluator(org.drools.core.base.ValueType type, String operatorId, boolean isNegated, String parameterText, org.drools.compiler.rule.builder.EvaluatorDefinition.Target left, org.drools.compiler.rule.builder.EvaluatorDefinition.Target right)- Specified by:
getEvaluatorin interfaceorg.drools.compiler.rule.builder.EvaluatorDefinition
-
getEvaluatorIds
public String[] getEvaluatorIds()
- Specified by:
getEvaluatorIdsin interfaceorg.drools.compiler.rule.builder.EvaluatorDefinition
-
isNegatable
public boolean isNegatable()
- Specified by:
isNegatablein interfaceorg.drools.compiler.rule.builder.EvaluatorDefinition
-
getTarget
public org.drools.compiler.rule.builder.EvaluatorDefinition.Target getTarget()
- Specified by:
getTargetin interfaceorg.drools.compiler.rule.builder.EvaluatorDefinition
-
supportsType
public boolean supportsType(org.drools.core.base.ValueType type)
- Specified by:
supportsTypein interfaceorg.drools.compiler.rule.builder.EvaluatorDefinition
-
-