Thank you Ernest..but in my application i am just allowing the user to enter rules and facts into the engine. I cannot provide him the functionality of adding deffunction(since it would be inconsistant with the application) .
My question is , whether the engine process rules even if there are no facts being inserted into the engine which may fire the rules. If yes, then we can write predicates in such a way that they will be true after some time and the rule fires without any facts being inserted. but if no, then i will have to add and retract facts on a periodic basis. Any suggestions? Regards, Mrinal On 5/29/07, Ernest Friedman-Hill <[EMAIL PROTECTED]> wrote:
On May 29, 2007, at 12:48 PM, Mrinal Khanvilkar wrote: > Hi, > > Is there a way to generate a rule and firing it periodically? > for e.g. > There's a discussion of something like this in the FAQ, under "How do I make Jess run forever?": http://herzberg.ca.sandia.gov/jess/FAQ.shtml#Q9 But I think what I'd recommend is to use the "implement" function to create a Runnable that calls a deffunction, and then use the Runnable with a java.util.Timer to have it called periodically. > (defrule rule1 > > fire after every time t > > => > > someactions) > > the predicates in this case is only going to be the time interval > for which the rule is being fired. > > thanks, > Mrinal --------------------------------------------------------- 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] --------------------------------------------------------------------
