[rules-users] How handle exception thrown while looping in DRL file

Wolfgang Laun wolfgang.laun at gmail.com
Tue Jul 17 06:26:19 EDT 2012


Add an if statement testing for a List element being null, e.g.,

   for( Integer agentList: $a.getAgentList()) {
        if( agentList != null ){
           System.out.println("--sam====="+agentList);
       } else {
          System.out.println( "null element in list" );
      }
    }

-W


On 17/07/2012, ashwindrool <ashwin.khandelwal86 at gmail.com> wrote:
> Yes Mike,
>
> I am getting expected output but after completion of loop it throws error
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/How-handle-exception-thrown-while-looping-in-DRL-file-tp4018727p4018733.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
>


More information about the rules-users mailing list