Rule conflict in Jess rule engine

283 views Asked by At

I use Jess rule engine and i have some rules which change some slot values as a conclusion.This is achieved with two different ways: 1.with Jess modify (e.g.=>modify fact) 2.with a jess function (e.g. => change(slotvalue)) The problem is when two rules change the same slotvalue. I use Jess salience for this and it works ok only for type 1=>modify fact. When i have a rule with the function,the rule is excecuted every time.How can i solve this?

Here is the code:

1)if person is student=>(modify ?fact( fredo 2))
2) if day is Wednesday=>(modify ?fact ( fredo (discount (fact-slot-value ?fact fredo) 50))) 3)if time >5 =>(modify ?fact( fredo 5))

if a person is student,day is wednsesday and time >5 then all rules are fired and fredo slot value will be 5 because this rule fired last. How can i solve priority issues in this case (e.g to fire only the second rule); is it possible; Thanks for your reply.

0

There are 0 answers