<div><br></div> Geoffrey is correct. Java erasure makes it impossible to match objects based on generic types. It is also a best practice anyway to not use general purpose collections as your business entities in your business model. Best to use a properly defined business entity and then the generics issue is not really an issue.<div>
<br></div><div> Edson<br><br><div class="gmail_quote">2011/10/17 Geoffrey De Smet <span dir="ltr"><<a href="mailto:ge0ffrey.spam@gmail.com">ge0ffrey.spam@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<u></u>
<div text="#000000" bgcolor="#ffffff">
Java's generics are implemented by erasure,<br>
which implies that there no information available at runtime that a
instance of a List is of a certain generic type, for example Boost.<br>
So I don't think this is possible.<br>
<br>
Note that some things do work in erasure IIRC, like the generic type
of a defined field in a class is available at runtime:<br>
public class Foo {<br>
private List<Bar> list;<br>
}<br>
but that's not useful in this case :)<br>
<br>
Op 17-10-11 11:30, Martin A schreef:
<blockquote type="cite"><div><div></div><div class="h5">Hello,
<div><br>
</div>
<div>In my rules file I'd like to set something like this:</div>
<div><br>
</div>
<div>
<div>rule "mayThrowDice"</div>
<div> when</div>
<div> $user : User($gp : gameplay)</div>
<div> $gameplay(this == $gp)</div>
<div> then</div>
<div> exists List<Boost>() {</div>
<div> ..... some business logic</div>
<div> }</div>
<div>end</div>
</div>
<div><br>
</div>
<div>But it looks like there is no generics support. How can I
make sure there is a List of type Boost inserted into the
session?</div>
<div><br>
</div>
<div>Thank you,</div>
<div>Martin</div>
</div></div><pre><fieldset></fieldset>
_______________________________________________
rules-users mailing list
<a href="mailto:rules-users@lists.jboss.org" target="_blank">rules-users@lists.jboss.org</a>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a>
</pre>
</blockquote><font color="#888888">
<br>
<pre cols="72">--
With kind regards,
Geoffrey De Smet</pre>
</font></div>
<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>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br> Edson Tirelli<br> JBoss Drools Core Development<br> JBoss by Red Hat @ <a href="http://www.jboss.com">www.jboss.com</a><br>
</div>