Если кого -то называют Бобом, они выигрывают < /li>
Если никто не назван Бобом, самый старый человек выигрывает < /li>
< /ol>
, что у меня есть; < /p>
< /ol>
Код: Выделить всё
rule "Bob wins"
when
$winner : Person(name == "Bob")
then
$winner.setWinner(true);
update($winner);
end
rule "Oldest person wins"
salience -10 // Runs only if there is no Bob
when
not Person(name == "Bob")
$winner : Person() from accumulate(
Person($age : age),
max($age)
)
then
$winner.setWinner(true);
update($winner);
end
Подробнее здесь: https://stackoverflow.com/questions/795 ... -condition
Мобильная версия