Yes, you're right.
Then, you have two options:
a) wait for the cleaning task to become active:

(defrule retract-them-all
   (cleaning-time)
   ?x <- (MappingName)
   =>
   (rectract ?x))

b) Create a function to do it and invoke it when needed:

(defquery get-them-all
    ?f <- (MappingName))

(deffunction retract-them-all ()
    (bind ?result (run-query* get-them-all))
    (while (?result next)
       (retract (?result get f)) ) )


Cheers,

Henrique


Wolfgang Laun wrote:
> On Mon, Feb 9, 2009 at 3:51 PM, Henrique Lopes Cardoso <[email protected]
> <mailto:[email protected]>> wrote:
>
>     How about::
>
>     (defrule retract-them-all
>        ?x <- (MappingName)
>        =>
>        (rectract ?x))
>
>
> Basically, yes, that'll do it - but then these facts won't stay around
> long enough for any useful purpose.
> -W
>  
>
>
>     Cheers,
>
>     Henrique
>
>
>     nikita shah wrote:
>     > I want to remove all facts beloging to one particular template.
>     > How can this be done ?
>     >
>     > For eg:
>     > (deftemplate MappingName (slot mappingName))
>     >
>     > Some rule fires and I want to remove all the facts belonging to
>     MappingName
>     > template.
>     >
>     >
>
>
>
>     --------------------------------------------------------------------
>     To unsubscribe, send the words 'unsubscribe jess-users
>     [email protected] <mailto:[email protected]>'
>     in the BODY of a message to [email protected]
>     <mailto:[email protected]>, NOT to the list
>     (use your own address!) List problems? Notify
>     [email protected] <mailto:[email protected]>.
>     --------------------------------------------------------------------
>
>

-- 
----- - - - - -  -  -  -  -  -   -   -
Henrique Lopes Cardoso
DEI/FEUP
Rua Dr. Roberto Frias | 4200-465 Porto
PORTUGAL
(+351)225081400 ext.1315
[email protected] | www.fe.up.pt/~hlc
----- - - - - -  -  -  -  -  -   -   -



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