<br>when<br> Map( this["type"] == "Point", $x : this["x"] )<br> Map( this["type"] == "Circle", x == $x )<br>then<br>end<br> <br><br><div class="gmail_quote">2009/8/19 André Thieme <span dir="ltr"><<a href="mailto:address.good.until.2009.dec.14@justmail.de">address.good.until.2009.dec.14@justmail.de</a>></span><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Edson Tirelli schrieb:<br>
<div class="im"><br>
> when<br>
> Customer( $custId : id )<br>
> DailyOrders( count[$custId] == 1 )<br>
> then<br>
<br>
</div>Btw, this brings me to a new syntax question for the default Drools rule<br>
syntax. Is this possible:<br>
<br>
when<br>
m:Map()<br>
eval( m.get("type") == "Point", $x : m.get("x") )<br>
...<br>
Circle( x == $x )<br>
then<br>
...<br>
<br>
<br>
or, an alternative which may be clearer:<br>
<br>
when<br>
m:Map()<br>
eval( m.get("type") == "Point" )<br>
$x : m.get("x")<br>
...<br>
then<br>
...<br>
<br>
So, what I would like to have is:<br>
1) looking at all Maps which have the value "Point" under the key "type"<br>
2) of all those Maps: store in a var what value they have under key "x"<br>
3) reuse the var, here $x instead of having an expensive lookup over and<br>
over again.<br>
<br>
Is that possible? Or would I have to write my example above as<br>
...<br>
c:Circle()<br>
eval(c.getX() == m.get("x"))<br>
<div class="im"><br>
<br>
André<br>
--<br>
Lisp is not dead. It’s just the URL that has changed:<br>
<a href="http://clojure.org/" target="_blank">http://clojure.org/</a><br>
_______________________________________________<br>
</div><div><div></div><div class="h5">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>
</div></div></blockquote></div><br><br clear="all"><br>-- <br> Edson Tirelli<br> JBoss Drools Core Development<br> JBoss by Red Hat @ <a href="http://www.jboss.com">www.jboss.com</a><br>