[rules-users] 'or' with predicate/return val/inline eval with property issue?

Edson Tirelli tirelli at post.com
Wed Nov 21 06:41:47 EST 2007


   Michal,

   Yes, it is a bug. Interesting that it only occurs with an alpha
constraint with embedded semantic code AND if you have the "or" CE in the
sequence... :(
   I will track it down and fix it. May I ask you please to open a JIRA for
it?

   Thank you,
     Edson

2007/11/21, Michal Bali <michalbali at yahoo.ie>:
>
> 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.
>
> Any ideas if this is a bug or am I doing something wrong?
>
> Thanks.
> Regards,
> Michal
>
> Send instant messages to your online friends http://uk.messenger.yahoo.com
>
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>


-- 
  Edson Tirelli
  JBoss Drools Core Development
  Office: +55 11 3529-6000
  Mobile: +55 11 9287-5646
  JBoss, a division of Red Hat @ www.jboss.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20071121/26d71f16/attachment.html 


More information about the rules-users mailing list