]
Mark Proctor closed JBRULES-1085.
---------------------------------
Resolution: Done
I'll assume this was a bug in 4.0 and is now fixed.
Rule fires before calling fireAllRules
--------------------------------------
Key: JBRULES-1085
URL:
http://jira.jboss.com/jira/browse/JBRULES-1085
Project: JBoss Rules
Issue Type: Bug
Security Level: Public(Everyone can see)
Affects Versions: 4.0.0.GA
Reporter: Markus Reitz
Assigned To: Mark Proctor
Fix For: 4.0.1
Modifying the main method of the program fragment used in (
http://jira.jboss.com/jira/browse/JBRULES-1079 ) to
public static void main(String ... args) {
try {
DroolsTest test=new DroolsTest(new File(args[0]));
SpecialString first42 =new SpecialString("42");
SpecialString second42=new SpecialString("42");
System.out.println("Inserting ...");
test.getSession().insert(new SpecialString("World"));
test.getSession().insert(first42);
test.getSession().insert(second42);
System.out.println("Done.");
System.out.println("Firing rules ...");
test.getSession().fireAllRules();
System.out.println("Done.");
}
catch (Exception ex) {
ex.printStackTrace();
}
}
and using the rule
package test
rule "Strange rule"
when
not(exists(x : SpecialString() and
forall(y : SpecialString(this!=x)
SpecialString(this==y, text=="Universe"))))
then
System.out.println("Condition satisfied");
end
leads to the following output:
Condition satisfied
Inserting ...
Done.
Firing rules ...
Condition satisfied
Done.
The Drools Engine fires the rule before the method fireAllRules() is called in the main
method. As a result,
System.out.println("Condition satisfied");
is executed twice.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: