Only (clear) and jess.Rete.clear() can remove Deftemplates. There's no
way to remove them one by one.


I think Horacio Blanco wrote:
[Charset iso-8859-1 unsupported, filtering to ASCII...]
> Hi,
> 
> I am trying to remove a Deftemplate previously defined using rete.addDeftemplate(). 
>I followed the same steps to successfully remove a Defmodule: 
> 
> 1. Obtain a list of the modules 
> 
> Iterator iterator = rete.listModules();
>  
> 2. Iterate over the list until I find the module I want to remove, and remove it 
>using iterator.remove().
> 
> while (iterator.hasNext()) {
>     String module = (String)iterator.next();
>     if (module.equals(moduleToRemove)) {
>       // Remove module
>       iterator.remove();
>       break;
>     }
> }
> 
> When I try to follow the same steps to remove a Deftemplate:
> 
> Iterator iterator = rete.listDeftemplates();
> while (iterator.hasNext()) {
>     Deftemplate template = (Deftemplate)iterator.next();
>     if (templateToRemove.equals(template.getName()) {
>        // Remove template
>        iterator.remove();
>        break;
>     }
> }
> 
> The template is not removed. Executing the function (list-deftemplates) reports that 
>the template is still there.
> 
> Am I following the correct procedure to remove a Deftemplate? Is there any other way 
>to remove a Deftemplate?
> 
> Thanks in advance for your help, and BTW great work :)
> 
> Regards,
> Horacio



---------------------------------------------------------
Ernest Friedman-Hill  
Distributed Systems Research        Phone: (925) 294-2154
Sandia National Labs                FAX:   (925) 294-2234
Org. 8920, MS 9012                  [EMAIL PROTECTED]
PO Box 969                  http://herzberg.ca.sandia.gov
Livermore, CA 94550

--------------------------------------------------------------------
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]
--------------------------------------------------------------------

Reply via email to