[rules-users] Salience

huionn huionn at gmail.com
Wed Jan 19 13:17:58 EST 2011


If I have a rule like below:

rule "#1"
when 
$i : Item(type == 1)
then
retract ($i)
// do something...
end

rule "#2"
when 
$i : Item(type == 2)
then
retract ($i)
// do something...
end

// to handle other type of Item
rule "#catch-all"
salience -10
when 
$i : Item()
then
retract ($i)
// do something...
end

As it is known, reliance on salience is bad practice and its order is not
guaranteed (as shown in Sudoku example). 

My question is: what is the simple and good practice to emulate "else" (rule
"#catch-all") without reliance on salience? It seems ruleflow is not
applicable here as well.


Thanks and best regards.
-- 
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Salience-tp2289179p2289179.html
Sent from the Drools - User mailing list archive at Nabble.com.



More information about the rules-users mailing list