rule "Reorder alert when item expires"
salience 10
when
$item : ImsItemRecords ()
then
if ( ! (new Date()).before
($item.getExpireDate()))
{
SysAlert alert = new SysAlert("过期 - "
+ $item.getItemName(), "补充库存", "很高", "新到", new Date(), null);
SysRecommendation recommendation1 = new SysRecommendation (alert, "补充库存", "购买" +
$item.getAmount() + $item.getUnit() + $item.getItemName(), "仓库管理人员",
"立即");
...
HashSet recommendations = new HashSet();
recommendations.add(recommendation1);
...
alert.setSysRecommendations(recommendations);
insert (alert);
}
end