Uploaded image for project: 'JBRULES'
  1. JBRULES
  2. JBRULES-1337

'or' with predicate/return val/inline eval with property issue

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: 4.0.3
    • Fix Version/s: 4.0.4, 5.0.0.M1
    • Component/s: None
    • Labels:
      None

      Description

      Hi,

      I have following rule that should never fire, but it does

      package com.sample
      import com.sample.DroolsTest.*;
      rule "ruleThatShouldNeverFire"
      when
      Message( eval("somethingDifferent".equals(message)) ) # this should never match
      SomeBeanA( ) or SomeBeanB( )
      then
      System.out.println( drools.getRule().getName() + " fired and shouldn't" );
      end

      stateful ruleSession with following insertions:
      Message message = new Message();
      message.setMessage( "Hello World" );
      workingMemory.insert( message );
      workingMemory.insert( new SomeBeanA() );
      workingMemory.insert( new SomeBeanB() );

      It behaves the same way if we use predicates or retun values:
      #Message( msg : message -> ("somethingDifferent".equals (msg)) ) # this should never match
      #Message( message == ("somethingDifferent".equals (message)) ) # this should never match

      It looks like the AlphaNode is missing from the Rete network.

      Tested with Drools 4.0.3. Java build 1.5.0_11-b03.

      Thank you for your time.
      Regards,
      Michal

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  tirelli Edson Tirelli
                  Reporter:
                  michalbali Michal Bali
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  0 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: