[rules-users] Calling a function from When part

RulesUsers agrawalmanisha26 at gmail.com
Fri Aug 3 01:14:55 EDT 2012


Hi Davide,

Thanks for the prompt reply, 
Now i have changed my requirement a bit, to make it much simpler


function boolean foo(List list){
//do some action on the list & set true false accordingly.
system.out.println("foo ");
return true/false;
}

rule "one"
no-loop
salience -1
   when
      //condition 1
   then
        system.out.println("one in");
      //populate a list
       system.out.println("one out");
end

rule "two"
salience -2
   when
      eval(foo(pass the list that we populated in the above rule))
   then
      system.out.println("two in");
       //do some action
      system.out.println("two out");
end



O/P we are getting: -
foo
one in
foo
foo
one out
two in
two out


Expected O/P
one in
one out
foo
two in
two out


Please suggest a way to do the same.

Regards,
Sam



--
View this message in context: http://drools.46999.n3.nabble.com/Calling-a-function-from-When-part-tp4018987p4019007.html
Sent from the Drools: User forum mailing list archive at Nabble.com.


More information about the rules-users mailing list