Package org.drools.mvel.evaluators
Class IncludesEvaluatorDefinition
- java.lang.Object
-
- org.drools.mvel.evaluators.IncludesEvaluatorDefinition
-
- All Implemented Interfaces:
java.io.Externalizable,java.io.Serializable,org.drools.compiler.rule.builder.EvaluatorDefinition,org.kie.api.runtime.rule.EvaluatorDefinition
public class IncludesEvaluatorDefinition extends java.lang.Object implements org.drools.compiler.rule.builder.EvaluatorDefinitionThe implementation of the
includesevaluator definition.The
includesevaluator correlates two events and matches when the event being correlated happens during the current event. It is the symmetrical opposite ofduringevaluator.Lets look at an example:
$eventA : EventA( this includes $eventB )
The previous pattern will match if and only if the $eventB starts after $eventA starts and finishes before $eventA finishes. In other words:
$eventA.startTimestamp < $eventB.startTimestamp <= $eventB.endTimestamp < $eventA.endTimestamp
The
includesoperator accepts 1, 2 or 4 optional parameters as follow:- If one value is defined, this will be the maximum distance between the start timestamp of both event and the maximum distance between the end timestamp of both events in order to operator match. Example:
$eventA : EventA( this includes[ 5s ] $eventB )
Will match if and only if:0 < $eventB.startTimestamp - $eventA.startTimestamp <= 5s && 0 < $eventA.endTimestamp - $eventB.endTimestamp <= 5s
- If two values are defined, the first value will be the minimum distance between the timestamps of both events, while the second value will be the maximum distance between the timestamps of both events. Example:
$eventA : EventA( this includes[ 5s, 10s ] $eventB )
Will match if and only if:5s <= $eventB.startTimestamp - $eventA.startTimestamp <= 10s && 5s <= $eventA.endTimestamp - $eventB.endTimestamp <= 10s
- If four values are defined, the first two values will be the minimum and maximum distances between the start timestamp of both events, while the last two values will be the minimum and maximum distances between the end timestamp of both events. Example:
$eventA : EventA( this includes[ 2s, 6s, 4s, 10s ] $eventB )
Will match if and only if:2s <= $eventB.startTimestamp - $eventA.startTimestamp <= 6s && 4s <= $eventA.endTimestamp - $eventB.endTimestamp <= 10s
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classIncludesEvaluatorDefinition.IncludesEvaluatorImplements the 'includes' evaluator itself
-
Field Summary
Fields Modifier and Type Field Description static org.drools.drl.parser.impl.OperatorINCLUDESstatic org.drools.drl.parser.impl.OperatorINCLUDES_NOTstatic java.lang.StringincludesOp
-
Constructor Summary
Constructors Constructor Description IncludesEvaluatorDefinition()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.drools.base.rule.accessor.EvaluatorgetEvaluator(org.drools.base.base.ValueType type, java.lang.String operatorId, boolean isNegated, java.lang.String parameterText)org.drools.base.rule.accessor.EvaluatorgetEvaluator(org.drools.base.base.ValueType type, java.lang.String operatorId, boolean isNegated, java.lang.String parameterText, org.drools.compiler.rule.builder.EvaluatorDefinition.Target left, org.drools.compiler.rule.builder.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, java.lang.String parameterText)java.lang.String[]getEvaluatorIds()org.drools.compiler.rule.builder.EvaluatorDefinition.TargetgetTarget()booleanisNegatable()voidreadExternal(java.io.ObjectInput in)booleansupportsType(org.drools.base.base.ValueType type)voidwriteExternal(java.io.ObjectOutput out)
-
-
-
Method Detail
-
readExternal
public void readExternal(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundException- Specified by:
readExternalin interfacejava.io.Externalizable- Throws:
java.io.IOExceptionjava.lang.ClassNotFoundException
-
writeExternal
public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException- Specified by:
writeExternalin interfacejava.io.Externalizable- Throws:
java.io.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 interfaceorg.drools.compiler.rule.builder.EvaluatorDefinition
-
getEvaluator
public org.drools.base.rule.accessor.Evaluator getEvaluator(org.drools.base.base.ValueType type, org.drools.drl.parser.impl.Operator operator, java.lang.String parameterText)- Specified by:
getEvaluatorin interfaceorg.drools.compiler.rule.builder.EvaluatorDefinition
-
getEvaluator
public org.drools.base.rule.accessor.Evaluator getEvaluator(org.drools.base.base.ValueType type, java.lang.String operatorId, boolean isNegated, java.lang.String parameterText)- Specified by:
getEvaluatorin interfaceorg.drools.compiler.rule.builder.EvaluatorDefinition
-
getEvaluator
public org.drools.base.rule.accessor.Evaluator getEvaluator(org.drools.base.base.ValueType type, java.lang.String operatorId, boolean isNegated, java.lang.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 java.lang.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.base.base.ValueType type)
- Specified by:
supportsTypein interfaceorg.drools.compiler.rule.builder.EvaluatorDefinition
-
-