[rules-users] Getting Latest Matching Fact

Wolfgang Laun wolfgang.laun at gmail.com
Sun Aug 26 15:17:15 EDT 2012


On 26 August 2012 21:00, salt <writemesaltworth at gmail.com> wrote:

> Hi Laune,
>
> Please find the java method below..
>
> Apart from such trivial omissions as method name, parameter list and
result type...
-W


> int statusApass=0;
> int statusBpass=0;
>
>             for(int i = 0;i<policy.getList().size();i++)
>             {
>
>
> if(policy.getList().get(i).getChar().equals("A")||policy.getList().get(i).getChar().equals("B"))
>                 {
>
> System.out.println("STEP`1"+policy.getList().get(i).getChar());
>
>                         if(policy.getList().get(i).getChar().equals("A"))
>                                 {
>                                 statusApass =1;
>                                         for(int j=0;j<=i;j++)
>                                 {
>
>  if(policy.getList().get(j).getChar().equals("AA"))
>                                        {
>                                              statusApass=0;
>                                        }
>                                 }
>                                 }
>                         else
> if(policy.getList().get(i).getChar().equals("B"))
>                                 {
>                                 statusBpass=1;
>                                         for(int z=0;z<=i;z++)
>                                 {
>
>  if(policy.getList().get(z).getChar().equals("BB"))
>                                        {
>                                                statusBpass=0;
>                                        }
>                                 }
>                                 }
>
>                 }
>
>                 if(statusApass==1||statusBpass==1)
>                         {
>
>
> System.out.println("policy"+policy.getList().get(i).getQty()+","+"policy"+policy.getList().get(i).getChar());
>                                 break;
>                         }
>             }
>
>
> Thanks
> Salt
>
>
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/Getting-Latest-Matching-Fact-tp4019345p4019396.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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20120826/d8691296/attachment.html 


More information about the rules-users mailing list