Both of the techniques you propose should work. Here's what salience
looks like.
(defrule rule-3 (declare (salience 1)) (foo) =>)
(defrule rule-1 (declare (salience 3)) (foo) =>)
(defrule rule-2 (declare (salience 2)) (foo) =>)
(watch rules)
(assert (foo))
(run)
FIRE 1 rule-1 f-0
FIRE 2 rule-2 f-0
FIRE 3 rule-3 f-0
I think Yingjie Wang wrote:
>
> Hi,
>
> I got a problem with the execution order of rules in Jess. It looks
> simple. If I have three rules, I want the second rule to execute after the
> first one and before the last one. The three rules have different
> patterns, which can be matched in the sequence of the real order in
> the jess program. I declared SALIENCE number, but it doesn't force them in
> order. I also tried to assert a fact in the actions of the previous rule,
> then put it in the pattern of the current rule, it doesn't work correctly
> either. I really appreciate your help.
> Thanks!
>
> Yingjie Wang
>
---------------------------------------------------------
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]
---------------------------------------------------------------------