[jboss-jira] [JBoss JIRA] (JBRULES-3254) disjunction with string == does not compile anymore
Edson Tirelli (Commented) (JIRA)
jira-events at lists.jboss.org
Mon Oct 17 12:38:45 EDT 2011
[ https://issues.jboss.org/browse/JBRULES-3254?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12635228#comment-12635228 ]
Edson Tirelli commented on JBRULES-3254:
----------------------------------------
Jean-Marc,
Both me and Mario tested this and it is working fine for us in master. Test case I used:
@Test
public void testExpressionConstraints4() {
String drl = "package org.drools\n" +
"rule R1\n" +
" dialect \"mvel\"\n" +
" when\n" +
" Mailbox( owneremail == 'bob at mail' || owneremail == 'john at mail' )\n" +
" then\n" +
"end\n" +
"rule R2\n" +
" dialect \"mvel\"\n" +
" when\n" +
" Mailbox( ( owneremail == 'bob at mail' ) || ( owneremail == 'john at mail' ) )\n" +
" then\n" +
"end\n";
KnowledgeBase kbase = loadKnowledgeBaseFromString( drl );
StatefulKnowledgeSession ksession = kbase.newStatefulKnowledgeSession();
ksession.insert(new Mailbox("foo at mail"));
int rules = ksession.fireAllRules();
Assert.assertEquals( 0, rules );
ksession.insert(new Mailbox("john at mail"));
rules = ksession.fireAllRules();
Assert.assertEquals( 2, rules );
}
Can you please double check that you got all the proper jars in the classpath?
Thanks
> disjunction with string == does not compile anymore
> -----------------------------------------------------
>
> Key: JBRULES-3254
> URL: https://issues.jboss.org/browse/JBRULES-3254
> Project: Drools
> Issue Type: Bug
> Security Level: Public(Everyone can see)
> Affects Versions: FUTURE
> Reporter: Jean-Marc Vanel
> Assignee: Mario Fusco
>
> Such expressions in LHS do not compile anymore :
> C( f == "a" || f == "b" )
>
> ==> compiler says : Predicate ' f == "a" || f == "b" ' must be a Boolean expression
> Note that this does not work any more :
> C( ( f == "a" ) || ( f == "b" ) )
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list