[rules-users] Does when order matter?

Edson Tirelli tirelli at post.com
Thu Jul 26 14:53:30 EDT 2007


   Yes. The same way that the order in SQL statements matter. So always
write more constraining patterns first and you will get huge performance
benefits.

   []s
   Edson

2007/7/26, Ronald R. DiFrango <ron.difrango at gmail.com>:
>
> All,
>
> I was wondering [and maybe this has be answered before] ,but does the
> order of the rules in the when clause matter?
>
> For example I have the following:
>
>         rtvHeader : RtvHeader( headerRtvNumber : rtvNumber )
>         repaymentCode : RepaymentCode( actualCode : code, matchApprv !=
> "Y" )
>         lineCharge : HeaderAdditionalCharge( rtvNumber == headerRtvNumber,
> originalRepaymentCode == actualCode )
>
> In my case there is a higher likelihood that I will have more
> RepaymentCodes than RtvHeaders [1 of these guys] and likely less
> HeaderAdditionalCharge objects.  So should the order be more like:
>
>         rtvHeader : RtvHeader( headerRtvNumber : rtvNumber )
>         lineCharge : HeaderAdditionalCharge( rtvNumber == headerRtvNumber,
> originalRepaymentCode : originalRepaymentCode)
>         repaymentCode : RepaymentCode( actualCode ==
> originalRepaymentCode, matchApprv != "Y" )
>
> Or does it not really matter?
>
> Thanks in advance,
>
> Ron
>
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>


-- 
  Edson Tirelli
  Software Engineer - JBoss Rules Core Developer
  Office: +55 11 3529-6000
  Mobile: +55 11 9287-5646
  JBoss, a division of Red Hat @ www.jboss.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20070726/42366d92/attachment.html 


More information about the rules-users mailing list