[jboss-jira] [JBoss JIRA] (DROOLS-731) In a catch22 using a NOT constraint in rules shared by multiple facts
Bill Tuminaro (JIRA)
issues at jboss.org
Fri Feb 27 12:59:49 EST 2015
Bill Tuminaro created DROOLS-731:
------------------------------------
Summary: In a catch22 using a NOT constraint in rules shared by multiple facts
Key: DROOLS-731
URL: https://issues.jboss.org/browse/DROOLS-731
Project: Drools
Issue Type: Feature Request
Components: core engine
Affects Versions: 6.1.0.Final, 6.0.1.Final
Environment: Custom application that completely wraps Drools Fusion written as an OSGI application hosted on Websphere Liberty profile.
Reporter: Bill Tuminaro
Assignee: Mario Fusco
I have a reproducer for these related issues.
We have encountered a couple of issues (Exceptions) when using a NOT constraint in rules that have facts associated with them when we call upgradeToVersion() or kSession.delete(). The catch22 is that one version of the NOT constraint avoids one Exception while causing another. Reproducing the issue requires 2 rules sharing the same NOT constraint. I have narrowed the issue(s) down to 2 very simple rules that use the org.drools.compiler.FactA class.
Here are the 2 rules used:
static final String ruleDrl = "package org.some.test\n" +
"import org.drools.compiler.FactA\n" +
"declare FactA\n" +
"@role(event)" +
"end\n" +
"rule \"R200_0\" when\n" +
// " $FactA : FactA ($FactA_field2 : field2 == 111002)\n" + // version A: using this version causes a NPE when calling ksession.delete()
" not FactA($FactA_field2 == 111002, this after $FactA)\n" +
" not FactA(field2 == 105742, this after $FactA)\n" + // Version B: using this version causes the IllegalArgumentException: Cannot remove a sink,
// when the list of sinks is null on the updateToVersion() call
"then\n" +
"end\n";
static final String ruleDrl2 = "package org.some.test\n" +
"import org.drools.compiler.FactA\n" +
"declare FactA\n" +
"@role(event)" +
"end\n" +
"rule \"R1437_0\" when\n" +
" $FactA : FactA ($FactA_field2 : field2 == 105742)\n" +
" not FactA($FactA_field2 == 105742, this after $FactA)\n" + // version A:
// " not FactA(field2 == 105742, this after $FactA)\n" + // Version B:
"then\n" +
"end\n";
--
This message was sent by Atlassian JIRA
(v6.3.11#6341)
More information about the jboss-jira
mailing list