Bug 1039579 - Problem with ReteOO and "before" in CEP mode.
Summary: Problem with ReteOO and "before" in CEP mode.
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: JBoss BRMS Platform 6
Classification: Retired
Component: BRE
Version: 6.0.0
Hardware: Unspecified
OS: Unspecified
medium
high
Target Milestone: ER6
: 6.0.0
Assignee: Mario Fusco
QA Contact: Tomas Schlosser
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-12-09 14:03 UTC by Richard Bourner
Modified: 2014-08-06 20:18 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-08-06 20:18:11 UTC
Type: Bug


Attachments (Terms of Use)
Eclipse Maven project demonstrating the problem. (25.69 KB, application/zip)
2013-12-09 14:03 UTC, Richard Bourner
no flags Details

Description Richard Bourner 2013-12-09 14:03:13 UTC
Created attachment 834340 [details]
Eclipse Maven project demonstrating the problem.

Description of problem:
When we use the ReteOO mode and a rule with a "before" condition, the rule execution is not triggered during the fireAllRules but with a little delay (timer ?).
The problem doesn't happen in PHREAK mode.

Version-Release number of selected component (if applicable):
6.0.0.CR5
The same problem happens with the 6.0.0.Final community version.

How reproducible:
Launch the JUnit test in the attached Eclipse project.


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 2 Richard Bourner 2013-12-09 14:13:41 UTC
It seems like a timer is created for rules with temporal operator, even if the "search interval" is in the past.

Class "org.drools.core.reteoo.builder.PatternBuilder" line 228:
    private void checkDelaying(final BuildContext context, final Constraint constraint) {
        if ( constraint instanceof IntervalProviderConstraint ) {
            // variable constraints always require a single declaration
            Declaration target = constraint.getRequiredDeclarations()[0];
            if ( target.isPatternDeclaration() && target.getPattern().getObjectType().isEvent() ) {
                long uplimit = ((IntervalProviderConstraint) constraint).getInterval().getUpperBound();
                // only makes sense to add the new timer if the uplimit is not infinity (Long.MAX_VALUE)
                if( uplimit < Long.MAX_VALUE ) {

In the unit test, uplimit = -1 (condition = this before[1ms, 10s] sf1)

Comment 4 Tomas Schlosser 2014-01-06 10:09:11 UTC
Verified with BRMS 6.0.1-redhat-2


Note You need to log in before you can comment on or make changes to this bug.