[jboss-jira] [JBoss JIRA] Commented: (JBRULES-2398) Rule not fired when using 'in (0)' condition and another rule with condition ' == null' exists
Jaroslaw Wosik (JIRA)
jira-events at lists.jboss.org
Wed Jan 6 02:56:30 EST 2010
[ https://jira.jboss.org/jira/browse/JBRULES-2398?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12502394#action_12502394 ]
Jaroslaw Wosik commented on JBRULES-2398:
-----------------------------------------
Please also note that this is different than trying to fire for a null Fact, which is impossible.
According to https://jira.jboss.org/jira/browse/JBRULES-209 it is possible to compare Fact's property with null.
Found quite similiar case that was fixed: https://jira.jboss.org/jira/browse/JBRULES-213
> Rule not fired when using 'in (0)' condition and another rule with condition ' == null' exists
> ----------------------------------------------------------------------------------------------
>
> Key: JBRULES-2398
> URL: https://jira.jboss.org/jira/browse/JBRULES-2398
> Project: Drools
> Issue Type: Bug
> Security Level: Public(Everyone can see)
> Components: drools-compiler (expert)
> Affects Versions: 5.0.1.FINAL
> Environment: Windows Xp Pro, Java 1.5.07
> Reporter: Jaroslaw Wosik
> Assignee: Mark Proctor
> Attachments: test_case.zip
>
>
> When following package is used:
> package BROKEN_TEST;
> import pl.wosik.conversion.BrokenTest.Holder;
> rule "_12"
>
> salience 3
> activation-group "BROKEN"
> when
> $a : Holder(value in (0))
> then
> System.out.println("setting 0");
> $a.setOutcome("setting 0");
> end
> rule "_13"
>
> salience 2
> activation-group "BROKEN"
> when
> $a : Holder(value in (1))
> then
> System.out.println("setting 1");
> $a.setOutcome("setting 1");
> end
> rule "_22"
>
> salience 1
> activation-group "BROKEN"
> when
> $a : Holder(value == null)
> then
> System.out.println("setting null");
> $a.setOutcome("setting null");
> end
> Rule "_12" will not be fired even when Holder.value is 0 because some strange interference between it's and rule _22's condition (note that _22 won't be fired as expected).
> When "Holder(value in (0))" is changed into "Holder(value == 0)" or "Holder(value in (0,9))" or the whole rule_22 is removed rule _12 will be fired.
> This issue is important as such seemingly strange "in (0)" condition can be generated from a decision table (as was in my case).
> I will attach a self-contained Test Case.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list