2009/1/26 niraj manandhar
<regniraj@gmail.com>
Can i retract the objects from accumulate function
rule "Brand base free Item "
salience 10
when
brand_total:Number(doubleValue >=1500)
from accumulate ( sa:SLS_SALES_DTLS(
PK!=null,
PK.ITEM_ID.BRAND_CD.BRAND_CD=="N00"
) , init ( double single_total=0; ),
action (single_total=single_total+(sa.getTRN_QTY()*
sa.getPK().getITEM_ID().getSALES_TO_BASE_CONV()
// I want to retract the sa over here
);
),
result (single_total ) );
then
double item_discounted=brand_total.doubleValue()/ 1500;
System.out.println("The discount given qty "+item_discounted+" multiplied slot 10");
double item_left=brand_total.doubleValue()%1500;
if(item_left>=1)
{
doit(item_left,"N00");
}
end
_______________________________________________
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users