Bug 724753 (BRMS-596) - Drools should not allow set two rules with the same name for the same package
Summary: Drools should not allow set two rules with the same name for the same package
Keywords:
Status: CLOSED UPSTREAM
Alias: BRMS-596
Product: JBoss Enterprise BRMS Platform 5
Classification: JBoss
Component: BRE (Expert, Fusion)
Version: 5.1.0 GA
Hardware: Unspecified
OS: Unspecified
medium
unspecified
Target Milestone: ---
: BRMS 5.3.0.GA
Assignee: Nobody
QA Contact: Marek Baluch
URL: http://jira.jboss.org/jira/browse/BRM...
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-06-02 02:09 UTC by Alessandro Lazarotti
Modified: 2025-02-10 03:13 UTC (History)
1 user (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2025-02-10 03:13:59 UTC
Type: Feature Request
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 788582 0 unspecified CLOSED Write documentation for getting build results from KnowledgeBuilder by their severity 2025-02-10 03:15:05 UTC
Red Hat Issue Tracker BRMS-596 0 Minor Closed Drools should not allow set two rules with the same name for the same package 2016-05-25 06:01:06 UTC
Red Hat Issue Tracker JBRULES-3063 0 Minor Closed Drools should not allow set two rules with the same name for the same package 2016-05-25 06:01:06 UTC

Internal Links: 788582

Description Alessandro Lazarotti 2011-06-02 02:09:38 UTC
Help Desk Ticket Reference: https://c.na7.visual.force.com/apex/Case_View?id=500A0000007BHi5&sfdc.override=1
securitylevel_name: Public

Drools should not allow set two rules with the same name for the same package

As expected, Drools does not allow us to define two rules with the same name in a same DRL file.
But if there are two rules with the same name, in the same package, but in separate files, no exception or warning is issued, just one rule overrides the other in silence.

From documentation:
"A rule must have a name, unique within its rule package. If a rule is defined twice in a single DRL, an error will appear when one loads it. If a DRL that includes a rule name already in the package is added, the previous rule is repalced."[1]

[1] http://docs.redhat.com/docs/en-US/JBoss_Enterprise_SOA_Platform/5/html/JBoss_Rules_5_Reference_Guide/chap-language_reference.html#sect-rule

Different behavior for a similar action is not good. Both should alert user about a rule name repeated.
For large projects using a lot of DRL files can be hard to track mistakes occurred by rules override . It is really necessary provide an ERROR message for this.

Comment 1 Alessandro Lazarotti 2011-06-02 02:12:23 UTC
Link: Added: This issue Cloned to BRMS-597


Comment 2 Rick Wagner 2011-08-25 16:27:53 UTC
Customer is watching BZs, but issue is not a show-stopper.  GSS calls this 'medium'.

Comment 3 Jiri Svitak 2012-02-06 16:49:41 UTC
https://issues.jboss.org/browse/JBRULES-3063 was already fixed by Edson Tirelli, so changing assignee and changing status to MODIFIED.

Comment 4 Ryan Zhang 2012-02-15 09:13:08 UTC
Please verify the issue on 5.3 ER4.

Comment 5 Jiri Svitak 2012-02-21 10:00:37 UTC
Verified in 5.3 ER4.

Comment 6 lcarlon 2012-05-03 03:05:09 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
JBoss BRMS does not allow multiple rules with the same name in a package. When a second rule with the same name as another rule is added to a package it replaces the original rule, however, JBoss BRMS did not warn the user this was occurring. This has been resolved by adding warnings with 'INFO', 'WARN', and 'ERROR'. When configured with the ERROR severity for rule and function replacement, package compilation will fail.

Comment 8 kylin 2013-05-15 01:25:51 UTC
As [1] hints the issue is fixed in drools 5.3.0.Final, but I test via BRMS 5.3.0 the issue still existed

[1] https://issues.jboss.org/browse/JBRULES-3063

Comment 9 Edson Tirelli 2013-05-15 14:52:59 UTC
Can you please clarify how you tested? By default, BRMS does allow rule replacement... it will only raise errors when the engine is configured to raise errors for rule duplication.

Comment 16 Red Hat Bugzilla 2025-02-10 03:13:59 UTC
This product has been discontinued or is no longer tracked in Red Hat Bugzilla.


Note You need to log in before you can comment on or make changes to this bug.