Hi Howard,
Yep, I see why this happens. Thanks. We'll get it straightened out!
On Aug 1, 2007, at 1:47 PM, Greenblatt, Howard wrote:
Hi there,
In our system we sometimes need to reload a rules file that may
contain deftemplates. This could happen for example if a rule
changes and needs to be redefined in the system. We reload the
rules file with the updated rule. Since deftemplates cannot be
redefined (without clearing out the rules engine first), we don't
allow them to be modified; however they still may be in the file.
I have seen the jess src code (jess70p1 - Deftemplate.java – line
155 “equals” method) where you check to see if a new deftemplate
object matches an existing one of the same name. If they are
identical there is no error. This works fine except where the
deftemplate extends another deftemplate. It appears that the parent
id of the extended deftemplate is different even though the parent
template is identical.
This error can be duplicated in a single script. Consider the
following:
(deftemplate t1
(slot s1))
(deftemplate t2 extends t1
(slot s2))
;
; redefining t1 is no problem
;
(deftemplate t1
(slot s1))
;
; redefining t2 causes an error where you cannot redefine
; the template even though it is exactly the same.
;
(deftemplate t2 extends t1
(slot s2))
I believe what is happening is that when t1 is redefined and added
to the m_deftemplates TreeMap (Defmodule,java – line 125
“addDeftemplate” method) it is assigned a new id which does not
match the id of t1 (as a parent) when template t2 is redefined.
Thanks,
- Howard
---------------------------------------------------------
Ernest Friedman-Hill
Advanced Software Research Phone: (925) 294-2154
Sandia National Labs FAX: (925) 294-2234
PO Box 969, MS 9012 [EMAIL PROTECTED]
Livermore, CA 94550 http://www.jessrules.com
--------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]'
in the BODY of a message to [EMAIL PROTECTED], NOT to the list
(use your own address!) List problems? Notify [EMAIL PROTECTED]
--------------------------------------------------------------------