I think erich.oliphant wrote: [Charset iso-8859-1 unsupported, filtering to ASCII...] > Hi, > I have an interesting situation. I've a set of business rules we developed > that were currently using 'normally'. Defrules, toss in facts/definstances > and run. These rules update some domain objects when they fire. > > We now have a situation where we need to use a subset of the same rules in a > different context. 1) the caller only needs to know if a rule fired, so > different RHS behavior 2) the caller needs to be able to specify which rules > should be evaluated. So currently the .clp has say rule1 - rule20. In this > scenario the caller needs to add some facts, and only have say rule2 and rule7 > evaluated against the facts, and the caller only needs to know if their LHS' > matched at all, not have the RHS action take place. > > Any ideas? Since this seems to of course fly in the face of the standard > usage pattern, I am having some difficulty.
Since you don't want the rules to fire, one thing you can do is just call Rete.listActivations() and iterate over all the Activation objects, looking at each one to find out if the rules of interest are active. If you're using multiple modules, then you'll need to check each module separately. Now, this assumes there are no multi-step operations -- i.e., it's not the case that a rule fires, and asserts a fact, which activates another rule, and you're interested in that second rule. If that's the case, then the premise about the rules not firing is flawed. --------------------------------------------------------- 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://herzberg.ca.sandia.gov -------------------------------------------------------------------- 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] --------------------------------------------------------------------
