Salience is considered bad form for two reasons: first, because it's considered bad form, in general, to try to force the engine to fire rules in a particular order; and second, it negatively impacts performance. The truth is, though, if it's the most sensible or elegant alternative in a particular application, there's really no reason not to use it.

If you want to not fire any rules in module B until all rules in module A have had a chance to fire, then rather than putting the focus statements into a rule, you probably want to put them into the same code that calls "run" -- i.e.,

(focus A)
(run)
(focus B)
(run)




On Oct 12, 2009, at 3:44 PM, Felix Chan wrote:

Hi,

I have a general question how to control execution using modules.

I have business rules that apply at the country (US) level, and rules that apply at state level. What I would like to do is to apply country-level rules first and then state-level rules second. The state-level rules will overwrite some of the facts that were modified or asserted as a result of the country-level rules.

I do NOT want to have any state-level rules applied before country- level rules have a chance to fire.

I can group all the country-level rules in module COUNTRY and state- level rules in module STATE. I understand that I can put (focus STATE) on the RHS to move from one module to another to control execution flow.

Question: What should I do to ensure that I will switch to the STATE module only after ALL APPLICABLE country-level rules have been applied (fired)?

I can use salience, but the book says that it's bad form. So I am wondering if I should module.

Thanks.

Felix

---------------------------------------------------------
Ernest Friedman-Hill
Informatics & Decision Sciences, Sandia National Laboratories
PO Box 969, MS 9012, 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].
--------------------------------------------------------------------

Reply via email to