Hi all!
I tried out Drools 6.0.0.CR3 and I have some difficulties in detecting patterns with rules
containing temporal parameters. I'm using following rule:
rule "detect turn shifts"
agenda-group "evaluation"
salience 100
when
$aae : AudioActivityEvent(value >= 50) from entry-point "LowLevelES"
not(AudioActivityEvent(value < 50, userID == $aae.userID, this after[0, 300ms]
$aae) from entry-point "LowLevelES")
then
logger.info("turn shift START, user ID: " + $aae.getUserID() + ",
" + $aae.toString());
// do something else ...
end
When inserting events following happens:
12:43:05,914 [main ] DEBUG ReteooRuleBase - Starting Engine in
PHREAK mode
12:43:06,225 [main ] INFO SemanticLifter - incoming event:
AudioActivityEvent [userID=1, value=100.0]
12:43:06,295 [main ] INFO SemanticLifter - incoming event:
AudioActivityEvent [userID=1, value=0.0]
12:43:06,344 [main ] INFO SemanticLifter - incoming event:
AudioActivityEvent [userID=1, value=100.0]
12:43:11,096 [main ] INFO SemanticLifter - incoming event:
AudioActivityEvent [userID=1, value=0.0]
12:43:11,100 [main ] INFO SemanticLifter - turn shift START,
user ID: 1, AudioActivityEvent [userID=1, value=100.0]
...
The "turn shift start" should be detected 300ms after the third incoming event
(12:43:06,344) which is not the case here. This rule worked for me when using Drools 5.5.0
and 6.0.0.Beta2 but not with 6.0.0.CR3 - I did not try any other version.
This is my code to insert events:
streamEntryPoint = ksession.getEntryPoint("LowLevelES");
...
streamEntryPoint.insert(lowLevelEvent);
ksession.getAgenda().getAgendaGroup("evaluation").setFocus();
ksession.fireAllRules();
"AudioActivityEvent" is declared as an event with the @role attribute. I also
tried to use the following option: "RuleEngineOption.RETEOO", but with no
difference.
Best regards,
Wolfgang