Hi,

I am facing problems in iterating a list in guvnor.

I tried the following code and it worked.

import java.util.ArrayList;
rule createValidationReport
dialect 'java'
when
ClaimRegistration($ailmentList : ailmentListFromScreen)
then
for(String ailment : (ArrayList<String>) $ailmentList){
        System.out.println("ailment  "+ailment);
}
System.out.println("then");
end


But my requirement is to iterate the list in the when block and process
something based on the data in the list.

It should be something like 

import java.util.ArrayList;
rule createValidationReport
dialect 'java'
when

ClaimRegistration($ailmentList : ailmentListFromScreen)
for(String ailment : (ArrayList<String>) $ailmentList){
        System.out.println("ailment  "+ailment);
        // My condition needs to be evaluated here
}
then

System.out.println("then");

end


Need help on this issue. Is this possible in Drools? 
kindly advice.

Regards,
Dinesh

-- 
View this message in context: 
http://drools-java-rules-engine.46999.n3.nabble.com/How-to-Iterate-list-in-drools-tp1008987p1008987.html
Sent from the Drools - User mailing list archive at Nabble.com.
_______________________________________________
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users

Reply via email to