You cannot assign a value to a bound variable. $c is <i>bound to </i>the field name of a PassThrough fact object.<br><br>Assigning values to regular variables can only be done in the consequence, e.g.,<br><br>then<br> String s = hello("r");<br>
...<br>end<br><br>You can use the modify statement (in the consequence) to change a field of some fact object.<br><br>-W<br><br><div class="gmail_quote">On 21 October 2011 11:46, rahulkrishnan <span dir="ltr"><<a href="mailto:rahulkrishnan8@gmail.com">rahulkrishnan8@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hi<br>
<br>
1.i have a rule like this<br>
rule "Function Call"<br>
dialect "mvel"<br>
when<br>
PassThrough( $c : name)<br>
eval(($c = hello("rahul"))!=null)<br>
then<br>
System.out.println($c);<br>
<br>
end<br>
in this my function will return the string as capital and am entering to<br>
the consequence part but the $c is printed as null. am not getting what is<br>
happend.<br>
<br>
And if i want to assign the result of function call to a String declared as<br>
(String s) how can it be done<br>
<font color="#888888"><br>
<br>
--<br>
View this message in context: <a href="http://drools.46999.n3.nabble.com/using-variables-in-eval-tp3440419p3440419.html" target="_blank">http://drools.46999.n3.nabble.com/using-variables-in-eval-tp3440419p3440419.html</a><br>
Sent from the Drools: User forum mailing list archive at Nabble.com.<br>
_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
</font></blockquote></div><br>