Hi all!
We have the problem that the following rule never fires:
rule "test-rule"
agenda-group "evaluation"
salience 100
when
$cue : AnalysisCue() from entry-point "LowLevelCueStream"
not(AnalysisCue(this after[0ms,2500ms] $cue) from entry-point "LowLevelCueStream")
then
logger.debug("... some message ..");
end
We found out that the problem is the combination of the negation with the conditional element “not” and the temporal constraint “[0ms,2500ms]”. Using the temporal operator “this after $cue” without a temporal constraint works correct in its semantics.
Interestingly, when adding a constraint (cueType == 1) to the type in the negative pattern the rule begins to work. The rule would look like as follows:
rule "test-rule"
agenda-group "evaluation"
salience 100
when
$cue : AnalysisCue() from entry-point "LowLevelCueStream"
not(AnalysisCue(cueType == 1, this after[0ms,2500ms] $cue) from entry-point "LowLevelCueStream")
then
logger.debug("... some message ..");
end
unfortunately the rule then fires with a delay of 4 to 5 seconds. The second parameter of the temporal constraint influences the delay.
When changing the first parameter of the temporal constraint to a value greater than 0 the rule works as expected! The constraint would then look like as follows: “[1ms, 2500ms]”. Whereas in our case, we want to evaluate the time window from 0 – 2500ms.
Our system works in the stream mode and we could reproduce this behaviour with the versions 5.3.1 and 5.4.0 Beta 1.
Can anybody confirm if this is a bug in Drools, or did I overlook here something?
Best regards,
Wolfgang Weiss