Hi! I&#39;m new here and a have a doubt about rules and functions in Drools.<br><br>I have this rule:<br><br>rule &quot;ProductDescription validation&quot;<br>    when<br>        $listing : Listing( $description:productDescription != null )<br>
        eval( $description.getTitle() != null )<br>        eval( hasForbiddenWordsSet( wordsSet, $description.getTitle() ) )<br>    then<br>        System.out.println(&quot;ERROR!&quot;);<br>end<br><br>And this function:<br>
<br>function boolean hasForbiddenWordsSet(Set wordsSet, String value) {<br>#do something useful here<br>}<br clear="all"><br><br>And everything works fine. But now I want that function &quot;hasForbiddenWordsSet&quot; return a String. For example to print at &quot;then&quot;.<br>
I tried something like this:<br><br>rule &quot;ProductDescription validation&quot;<br>
    when<br>
        $listing : Listing( $description:productDescription != null )<br>
        eval( $description.getTitle() != null )<br>
        $word : hasForbiddenWordsSet( wordsSet, $description.getTitle() )<br>
    then<br>
        System.out.println(&quot;ERROR: &quot; + word);<br>
end<br>
<br>function String hasForbiddenWordsSet(Set wordsSet, String value) {<br>
#do something useful here<br>
}<br><br>But it doesn&#39;t work, tried some other things and still no success.<br><br>Could someone help me?<br clear="all"><br>Thanks in advance.<br><br>-- <br>Leandro Carvalho<br>