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 <<a href="mailto:yamilbracho@hotmail.com">yamilbracho@hotmail.com</a>> wrote:<br>><br>> Hi<br>> I have this rule in my drl file :<br>><br>
> rule "cuentaOrigen Numerico 20 digitos y Modulo 11"<br>> when<br>> $detalle : ArchivoDetalleBean( msg=<br>> eval(!ValidationUtils.validarNumeroCuenta(cuentaOrigen)) );<br>> then<br>> errorList.add(new ErrorPlugInBean(1, msg));<br>
> end<br>><br>> I would like to get the "msg" String var and use it in the "then" clasuse<br>> validarNumeroCuenta() ia a method that return a string<br>><br>> How can I do that ?<br>
><br>> TIA<br>> Yamil<br>> --<br>> 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>
> Sent from the Drools - User 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">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>><br><br>