History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: DROOLS-430
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Mark Proctor
Reporter: Sascha Coenen
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
drools-legacy

xor-group directive seems to be ignored

Created: 06/Nov/05 08:36 AM   Updated: 07/Nov/05 03:29 PM
Component/s: None
Affects Version/s: None
Fix Version/s: 2.5

Time Tracking:
Not Specified

File Attachments: 1. XML File rules.xml (0.9 kb)

Environment:
Windows XP

java version "1.5.0_04"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_04-b05)
Java HotSpot(TM) Client VM (build 1.5.0_04-b05, mixed mode)


 Description  « Hide
I used the jsr-94 API to create a StatelessRuleSession, registered the rule.xml file which I attached and fed in the strings "hello" and "world" as in-params.

Although I declared the two rules within the attached file to belong to the same xor-group, both rules get fired upon execution:

output of my test-application:

[java] Starting Application
[java] URL for rule file file:///C:\dev\projects\rule-test/meta/rules.xml
[java] Service provider created
[java] Ruleset registered
[java] rule sesssion created
[java] Rule ONE fired.
[java] Rule TWO fired.

To my understanding, only rule ONE should be fired because both rules belong to the same XOR-group. Maybe I'm missing something but I also ran tests using the xor-group attribute in combination with other attributes like salience, no-loop etc. but couldn't produce the desired effect of mutually exclusive rules.



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Matthias Gommeringer - 07/Nov/05 05:21 AM
I'm having the same problem and looked at the source code in method "org.drools.io.RuleHandler.startRule()":
It seems to be a copy/paste bug in line 159 where the "ruleDesc" value is used to initialize the XorGroup of the java "rule" object.

Mark Proctor - 07/Nov/05 06:10 AM
Yes it is a copy and poaste bug, doh! - will be fixed in the 2.5 beta release in a the next week or so.

Mark Proctor - 07/Nov/05 03:29 PM
Fixed bad cut and paste.