0
的順序,我目前正在學習的Drools和讀的書Mastering JBoss Drools 6是什麼讓這個規則集
在第4章的例子開始時說明了所使用的delete
關鍵字。這是一個例子:
rule "Init current date"
when
then
insert(new Date());
end
rule "Expire coupons"
when
$now: Date()
$cp: Coupon(validUntil before $now)
then
delete($cp);
end
rule "Execute coupon"
when
$o: Order()
$cp: Coupon(order == $o)
then
System.out.println(" We have a coupon for this order!");
end
現在我的問題是:爲什麼是比「過期優惠券」的規則後解僱了「執行優惠券」的規則。據我所知,規則的順序是非確定性的,所以我在考慮在執行其他兩條規則之前可以觸發「執行優惠券」規則