[
https://issues.jboss.org/browse/DROOLS-864?page=com.atlassian.jira.plugin...
]
Mario Fusco commented on DROOLS-864:
------------------------------------
I tried again with the test case I'm pasting below, but I still cannot reproduce your
issue. Note that I also tried to use just 'happy' instead of 'happy ==
true" and I gave a run also to the negative case trying both "happy ==
false" and "!happy". Everything worked as expected.
Please provide a self contained reproducer for this issue or I'll have to flag this
ticket as not reproducible.
{code}
@Test
public void testBooleanFieldOnQuery() {
String str =
"import org.drools.compiler.Person\n" +
"query \"happy persons\"\n" +
" Person(happy == true)\n" +
"end\n";
KieSession ksession = new KieHelper().addContent(str, ResourceType.DRL)
.build()
.newKieSession();
Person p1 = new Person("me");
p1.setHappy( true );
ksession.insert(p1);
Person p2 = new Person("you");
p2.setHappy( true );
ksession.insert(p2);
Person p3 = new Person("he");
p3.setHappy( false );
ksession.insert( p3 );
org.kie.api.runtime.rule.QueryResults results = ksession.getQueryResults(
"happy persons" );
assertEquals( 2, results.size() );
}
{code}
Boolean field is not read correctly by Drools
---------------------------------------------
Key: DROOLS-864
URL:
https://issues.jboss.org/browse/DROOLS-864
Project: Drools
Issue Type: Bug
Components: core engine
Affects Versions: 6.2.0.Final
Reporter: Raffi Khatchadourian
Assignee: Mario Fusco
Priority: Blocker
Recently, I have been upgrading from Drools 4.0.4 to 6.2.0 and I am having trouble with a
boolean field/property in a query. I have a field called selected in the IntentionNode
class (the field used to be called enabled but I renamed it just in case of a conflict
with the keyword). The query returns 22 results, two of which are selected. However, the
query should only return 20 (the ones that are not selected only). If I change the query
to only returned the selected nodes, I get no results.
After reverting back to 4.0.4, everything works. Either this is a regression or there is
some new API or language construct that I am not using in the intended way.
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)