Class StartedByEvaluatorDefinition

java.lang.Object
org.drools.mvel.evaluators.StartedByEvaluatorDefinition
All Implemented Interfaces:
Externalizable, Serializable, EvaluatorDefinition, EvaluatorDefinition

public class StartedByEvaluatorDefinition extends Object implements EvaluatorDefinition

The implementation of the startedby evaluator definition.

The startedby evaluator correlates two events and matches when the correlating event's end timestamp happens before the current event's end timestamp, but both start timestamps occur at the same time.

Lets look at an example:

$eventA : EventA( this startedby $eventB )

The previous pattern will match if and only if the $eventB finishes before $eventA finishes and starts at the same time $eventB starts. In other words:

 
 $eventA.startTimestamp == $eventB.startTimestamp &&
 $eventA.endTimestamp > $eventB.endTimestamp 
 

The startedby evaluator accepts one optional parameter. If it is defined, it determines the maximum distance between the start timestamp of both events in order for the operator to match. Example:

$eventA : EventA( this startedby[ 5s ] $eventB )
Will match if and only if:
 
 abs( $eventA.startTimestamp - $eventB.startTimestamp ) <= 5s &&
 $eventA.endTimestamp > $eventB.endTimestamp 
 

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: