[rules-users] Drools templates header arguments

Peter Troelsen peter.j.troelsen at gmail.com
Mon Nov 25 11:07:55 EST 2013


Thanks guys.. :)


2013/11/25 Wolfgang Laun <wolfgang.laun at gmail.com>

> If performance is an issue, make sure that the rule doesn't fire repeatedly
> or creates some overhead, due to large sizes of Bill.lines and multiple
> occurrences of args(0) and args(1) in ascending line order.
>
> -W
>
> On 25/11/2013, petert <peter.j.troelsen at gmail.com> wrote:
> > I am working on a project, using templates to generate all my rules. I
> have
> > one problem though, I wanna parse my arguments to the template as a
> > ArrayList, and do somthing like this:
> >
> > template header
> >
> >  ruleId
> >  args
> >
> > package dk.prks
> > import com.poc.entity.Bill;
> > import com.poc.entity.BillLine;
> > import com.poc.entity.Description;
> > import java.util.ArrayList;
> >
> > template "01"
> >
> >
> > rule "@{ruleId}_@{row.rowNumber}"
> >   dialect "mvel"
> >     when
> >       $bill : Bill ($line : lines) and
> >       BillLine( service == @{args.get(0)}, $lineNr : lineNr) from $line
> and
> >       BillLine( service == @{args.get(1)}, lineNr < $lineNr) from $line
> >
> >     then
> >       $bill.setColor(1);
> >
> > end
> >
> > end template
> > However, this is not possible. Furthermore I want to stretch that
> > performance is an issue, and i want the generated file to only contain
> the
> > values from the list, and not make any look ups in the array when running
> > my
> > rules
> >
> >
> >
> > --
> > View this message in context:
> >
> http://drools.46999.n3.nabble.com/Drools-templates-header-arguments-tp4026908.html
> > Sent from the Drools: User forum mailing list archive at Nabble.com.
> > _______________________________________________
> > rules-users mailing list
> > rules-users at lists.jboss.org
> > https://lists.jboss.org/mailman/listinfo/rules-users
> >
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20131125/be517d89/attachment.html 


More information about the rules-users mailing list