[jboss-jira] [JBoss JIRA] Commented: (JBRULES-1085) Rule fires before calling fireAllRules
Markus Reitz (JIRA)
jira-events at lists.jboss.org
Thu Aug 16 15:46:01 EDT 2007
[ http://jira.jboss.com/jira/browse/JBRULES-1085?page=comments#action_12372620 ]
Markus Reitz commented on JBRULES-1085:
---------------------------------------
I have a self-contained test which demonstrates the problem in 4.0GA. Do I have to reopen the issue to be able to attach the file?
> 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: 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