[jboss-jira] [JBoss JIRA] Created: (JBRULES-3211) Rules fires on incorrect condition

Tommy Odom (JIRA) jira-events at lists.jboss.org
Fri Sep 16 23:13:26 EDT 2011


Rules fires on incorrect condition
----------------------------------

                 Key: JBRULES-3211
                 URL: https://issues.jboss.org/browse/JBRULES-3211
             Project: Drools
          Issue Type: Bug
      Security Level: Public (Everyone can see)
          Components: drools-core  (expert)
    Affects Versions: 5.2.0.Final
            Reporter: Tommy Odom
            Assignee: Mark Proctor


We are running into some issues after upgrading to Drools 5.2.0 from Drools 5.1.1.  Our rules are no longer executing correctly. The wrong rule fires due to the constraints of a previous rule.  I wrote a standalone test that replicates the problem and I've tested with 5.3.0-SNAPSHOT and the tests fail there as well.

Forgive me if what I state is incorrect but I figured I'd try to relay some of what I observed in debugging.  It appears that the difference between 5.1.1 and 5.2.0 comes from the handling of the constraints.  In 5.1.1, the constraints were created as PredicateConstraints but in 5.2.0 they are being created as LiteralConstraints.  As such, in 5.1.1 in the CompositeObjectSinkAdapter adds the new sinks as otherSinks but in 5.2.0 they are registered as FieldIndexes.  However, the index value on all of the MVELClassFieldReader instances is 0 so both "engine.engineType.id" and "engine.id" are mapped to the same FieldIndex.

I haven't had time yet to dig into the code to understand the difference between a PredicateConstraint and a LiteralConstraint so I'm not sure if there's something I could be doing differently to avoid this problem.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the jboss-jira mailing list