Rules are supposed to be declarative in nature. You should never need to add control statements, neither to the LHS ("when"), nor to the RHS ("then"), although, the RHS being a java code block allows you to do it... but it is usually code smell...

   Think about what you are doing and check if you are not trying to use drools as a scripting language...

   Following may help:

http://markproctor.blogspot.com/2007/03/writing-better-rules.html

   []s
   Edson
 

2007/5/23, Rajesh.Sachin10 <rajesh_sachin10@yahoo.co.in >:

We can write the Java functions in [then] condition of the dsl file.

Is it possible to write JAVA functions / JAVA kind of coding in the [when]
condition of dsl file?


eg: [when] for(int i = 0; i < 3; i++) {  System.out.println(i);  }
      [then] Log "{message}"
--
View this message in context: http://www.nabble.com/Writing-JAVA-functions-in--when--condition-of-the-dsl-file-tf3806720.html#a10773355
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



--
  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