Bug 1039586

Summary: Temporal constraints with timers do not use 'this' as expected
Product: [Retired] JBoss BRMS Platform 6 Reporter: Richard Bourner <rbourner>
Component: BREAssignee: Mario Fusco <mfusco>
Status: CLOSED CURRENTRELEASE QA Contact: Tomas Schlosser <tschloss>
Severity: high Docs Contact:
Priority: high    
Version: 6.0.0CC: mfusco, rbourner, rrajasek, rzhang
Target Milestone: ER 7   
Target Release: 6.0.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-08-06 20:18:42 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Attachments:
Description Flags
Eclipse Maven project demonstrating the problem none

Description Richard Bourner 2013-12-09 14:46:00 UTC
Description of problem:
With ReteOO and a rule with a temporal condition creating a timer (eg after), the timer is created only if the first member of the condition is 'this'.
If 'this' is mapped to a local variable or the condition is reversed (using "ev before this" for example), the timer is not created and the condition doesn't seem to evaluate.

The code causing this is in org.drools.core.rule.Declaration:
    public boolean isPatternDeclaration() {
        return ( this.pattern != null && this.pattern.getDeclaration() == this ) || this.getIdentifier().equals( "this" ) ;
    } 

This may not be a problem because we are in a negative CE, but it looks like one because it works with the other rule.

Version-Release number of selected component (if applicable):
6.0.0.CR5

How reproducible:
Use the JUnit test in the Maven project attached.

Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 1 Richard Bourner 2013-12-09 14:46:42 UTC
Created attachment 834348 [details]
Eclipse Maven project demonstrating the problem

Comment 3 Edson Tirelli 2013-12-09 16:16:04 UTC
Setting the priority to medium as this is the same as 5.3, and ReteOO is the legacy algorithm.

Comment 5 Tomas Schlosser 2014-01-09 07:32:54 UTC
Verified with BRMS 6.0.1-redhat-2