]
Mark Proctor commented on JBRULES-3063:
---------------------------------------
Rule replacement is allowed and an important part of a dynamic rule engine. I believe what
we do is disallow it from the same resource (should double check that) i.e. a drl that
repeats the rule twice is an error. If you load a later resource it will overwrite the
previous.
Thinking about this some more. We should probably add a "getWarnings" as well as
getErrors. Rule overwriting would come with a warning.
We might even find a way build warning filters, a composite set of warnings to fail on,
but user defineable.
Drools should not allow set two rules with the same name for the same
package
-----------------------------------------------------------------------------
Key: JBRULES-3063
URL:
https://issues.jboss.org/browse/JBRULES-3063
Project: Drools
Issue Type: Feature Request
Security Level: Public(Everyone can see)
Components: drools-compiler
Affects Versions: 5.1.1.FINAL
Reporter: Alessandro Lazarotti
Assignee: Tihomir Surdilovic
Priority: Minor
Fix For: FUTURE
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/JB...
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.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: