0
我用的紀伊工作臺的6.2引導決策表和我堅持以下情形缺少varibale在Drools中結合引導決策表
我想設置在推廣促銷碼僅當從EligibilityCriteria的促銷碼是對檢查規則中的一些值。像從決策表
//from row number: 1
rule "Row 1 test"
dialect "mvel"
when
$e : EligibilityCriteria($code : PromoCode in ("code1", "code2") , $make : vehMake == "BMW")
then
Promotion p = new Promotion();
p.setPromoId("123");
p.setPromoCode($code);
insertLogical(p);
end
由工作臺生成的代碼如下所示。如果對所產生的不創建變量$代碼引導決策表中的文本框中輸入促銷碼沒有指定值,因爲$代碼失敗代碼不會創建
//from row number: 1
rule "Row 1 test"
dialect "mvel"
when
$e : EligibilityCriteria($make : vehMake == "BMW")
then
Promotion p = new Promotion();
p.setPromoId("123");
p.setPromoCode($code);
insertLogical(p);
end
我只是想以某種方式指示促銷碼規則字段是否爲空或有一定的價值。
p.setPromoCode($ e.getPromoCode()); 總是給我我在EligibilityCriteria中發送的促銷代碼的價值。無論決策表UI上的promocode列是否具有某種價值,它都保持不變。 – AshishW
規則將由營銷人員創建,他們可能會或可能不會輸入promocode值。如果輸入值,那麼代碼將正常工作,因爲在EligibilityCriteria事實中,將根據規則UI上的逗號分隔列表檢查促銷代碼值。但是,如果UI上沒有提供任何值,則不會執行檢查,並且通過EligibilityCriteria發送的任何促銷代碼都被視爲有效。在代碼中,我只想將promocode設置爲有效,只有在UI上檢查某個值時纔有效。 – AshishW
然後你的營銷人員將不得不標記另一個動作列,即選擇將啓動代碼設置爲未選中的代碼,而不是你在規則中顯示的代碼,該規則指示啓動代碼已經檢查值。 – laune