java - how to use accumulate for multiple operation and collection -
i using below rule 2 collection list.
rule "base" when $pricelineitem : pricelineitem( $grade : grade , $style : style ,$prefix : prefix , baseprice == null ) end rule "check-multiple instance-on-cover-type" extends "base" when accumulate ( $basepriceupchargeconfig : basepriceupchargeconfig( prefix contains $prefix, style contains $style, $basecovertype : basecovertype ) , $c : coverupchargeconfig( basecovertype contains $basecovertype.get(0), gradeorder contains $grade, prefix contains $prefix, style contains $style ); $collectlist : collectlist($c) ) accumulate ( $basepriceupchargeconfig : basepriceupchargeconfig( prefix contains $prefix, style contains $style, $basecovertype : basecovertype ) , $c : coverupchargeconfig( basecovertype contains $basecovertype.get(0), gradeorder contains $grade, prefix contains $prefix, style contains $style ); $collectlist1 : collectlist($basepriceupchargeconfig) ) system.out.println($collectlist); system.out.println($collectlist1); end
i want list of coverupchargeconfig , basepriceupchargeconfig object in consequence.
for each basepriceupchargeconfig; there multiple or 1 coverupchargeconfig object. if there 1 one between both object; want use in part of rule.
if there 1 multiple match between basepriceupchargeconfig --> coverupchargeconfig ; want know number of coverupchargeconfig object.
i able in above way using 2 accumulate.
please help. thanks
you can collect 2 lists in same accumulate ce - didn't see difference in 2 accumulates pairing basepriceupchargeconfig , coverupchargeconfig.
rule "check-multiple instance-on-cover-type" extends "base" when accumulate ( $b: basepriceupchargeconfig( prefix contains $prefix, style contains $style, $basecovertype : basecovertype ) , $c : coverupchargeconfig( basecovertype contains $basecovertype.get(0), gradeorder contains $grade, prefix contains $prefix, style contains $style ); $collectlist1 : collectlist($b) $collectlist : collectlist($c) )
Comments
Post a Comment