<div dir="ltr">Wolfgang,<div><br></div><div>Thanks for the explanation. It helps.</div><div><br></div><div>regards</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Nov 29, 2013 at 6:00 AM, Wolfgang Laun <span dir="ltr"><<a href="mailto:wolfgang.laun@gmail.com" target="_blank">wolfgang.laun@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On 28/11/2013, Tales Costa <<a href="mailto:tales@ibiseng.com">tales@ibiseng.com</a>> wrote:<br>
> Hi,<br>
><br>
> I am new to Drools and Optaplanner and have built a first model and<br>
> succeeded running with java score calculation. Now am struggling trying to<br>
> use rules for score.<br>
><br>
> Have read "Drools Expert User Guide" and looked through Optaplanner<br>
> examples but am still confused. Main difficult is discovering what can do<br>
> and canīt do with java dialect within the "when" and "then" blocks. Are<br>
> there tutorial and/or other references I could look into for more<br>
> information on this ?<br>
<br>
</div></div>The rules are actually quite simple.<br>
<br>
LHS: Any boolean expression is valid, with the shortcuts for accessing<br>
members. If the parser misbehaves, try eval() - there it's pure Java.<br>
<br>
RHS: Java code, as in any method, plus the "macros" defined in Expert.<br>
<br>
That said, some things should not be done:<br>
* Never use side effects in LHS expressions that modifies anything<br>
in working memory.<br>
* Don't write long "then" parts; calling static methods is preferred.<br>
<br>
-W<br>
<br>
<br>
<br>
<br>
<br>
><br>
> regards<br>
><br>
> Tales<br>
><br>
<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>
</blockquote></div><br></div>