There is no way to do what you want. Evaluation of CEs happens at<br>one time, and executing the Consequence is done anytime later.<br><br>Just call validarNumeroCuenta again in the consequence. If it<br>is very costly, you might consider implementing a <a href="http://en.wikipedia.org/wiki/Memoization">memoization</a><br>
technique.<br><br>-W<br><br>On Fri, Feb 5, 2010 at 9:07 PM, YamilBracho &lt;<a href="mailto:yamilbracho@hotmail.com">yamilbracho@hotmail.com</a>&gt; wrote:<br>&gt;<br>&gt; Hi<br>&gt; I have this rule in my drl file :<br>&gt;<br>
&gt; rule &quot;cuentaOrigen Numerico 20 digitos y Modulo 11&quot;<br>&gt;   when<br>&gt;     $detalle : ArchivoDetalleBean( msg=<br>&gt; eval(!ValidationUtils.validarNumeroCuenta(cuentaOrigen)) );<br>&gt;   then<br>&gt;     errorList.add(new ErrorPlugInBean(1, msg));<br>
&gt; end<br>&gt;<br>&gt; I would like to get the &quot;msg&quot; String var and use it in the &quot;then&quot; clasuse<br>&gt; validarNumeroCuenta() ia a method that return a string<br>&gt;<br>&gt; How can I do that ?<br>
&gt;<br>&gt; TIA<br>&gt; Yamil<br>&gt; --<br>&gt; View this message in context: <a href="http://n3.nabble.com/Get-a-value-in-when-clause-and-use-it-in-then-clasuse-tp185076p189285.html">http://n3.nabble.com/Get-a-value-in-when-clause-and-use-it-in-then-clasuse-tp185076p189285.html</a><br>
&gt; Sent from the Drools - User mailing list archive at Nabble.com.<br>&gt; _______________________________________________<br>&gt; rules-users mailing list<br>&gt; <a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
&gt; <a href="https://lists.jboss.org/mailman/listinfo/rules-users">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>&gt;<br><br>