[jboss-jira] [JBoss JIRA] Commented: (JBRULES-813) Two opposing rules get fired
Edson Tirelli (JIRA)
jira-events at lists.jboss.org
Mon May 7 16:54:52 EDT 2007
[ http://jira.jboss.com/jira/browse/JBRULES-813?page=comments#action_12361693 ]
Edson Tirelli commented on JBRULES-813:
---------------------------------------
Erel,
I was not able to reproduce the problem with latest trunk version (revision #11718). I'm using the following rules:
======================
package org.drools;
global java.util.List results;
rule rule1
when
not Cheese( type == Cheese.STILTON )
then
results.add( "rule1" );
end
rule rule2
when
exists Cheese( type == Cheese.STILTON )
then
results.add( "rule2" );
end
======================
This is my test case:
======================
public void testNodeSharingNotExists() throws Exception {
final PackageBuilder builder = new PackageBuilder();
builder.addPackageFromDrl( new InputStreamReader( getClass().getResourceAsStream( "test_nodeSharingNotExists.drl" ) ) );
final Package pkg = builder.getPackage();
final RuleBase ruleBase = getRuleBase();
ruleBase.addPackage( pkg );
final WorkingMemory workingMemory = ruleBase.newStatefulSession();
final List list = new ArrayList();
workingMemory.setGlobal( "results",
list );
workingMemory.fireAllRules();
assertEquals( 1,
list.size() );
assertEquals( "rule1",
list.get( 0 ) );
workingMemory.assertObject( new Cheese( "stilton", 10 ) );
workingMemory.fireAllRules();
assertEquals( 2,
list.size() );
assertEquals( "rule2",
list.get( 1 ) );
}
======================
Can you plz verify if the problem is still happening for you with latest trunk revision and if it is, can you provide an executable contained test case?
Thank you,
Edson
> Two opposing rules get fired
> ----------------------------
>
> Key: JBRULES-813
> URL: http://jira.jboss.com/jira/browse/JBRULES-813
> Project: JBoss Rules
> Issue Type: Bug
> Security Level: Public(Everyone can see)
> Affects Versions: 3.1-m1
> Reporter: erel sagi
> Assigned To: Edson Tirelli
>
> When using the following two rules with an empty working memory both rules get fired:
>
> ===================================
> rule rule1
> when
> not Person(gender == Consts.Unknown)
> then
> System.out.println("rule1");
> end
> rule rule2
> when
> exists Person(gender == Consts.Unknown)
> then
> System.out.println("rule2");
> end
> ===================================
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list