[rules-users] retract the items from accumulate

niraj manandhar regniraj at gmail.com
Mon Jan 26 01:14:06 EST 2009


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20090126/e5be7ab9/attachment.html 


More information about the rules-users mailing list