Re: [rules-users] How to handle generics in Drools?

2011-11-17 Thread Wolfgang Laun
llection > of a type like List in a rule? > > Thank you in advance for your help, > Adrigan > > > > > -- > View this message in context: > http://drools.46999.n3.nabble.com/rules-users-How-to-handle-generics-in-Drools-tp3427723p3517186.html > Sent from the

Re: [rules-users] How to handle generics in Drools?

2011-11-17 Thread Welsh, Armand
n think of the command's implementation. Regards, Armand -Original Message- From: rules-users-boun...@lists.jboss.org [mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Adrigan Sent: Thursday, November 17, 2011 1:56 PM To: rules-users@lists.jboss.org Subject: Re: [rules-users] How to han

Re: [rules-users] How to handle generics in Drools?

2011-11-17 Thread Adrigan
ols.46999.n3.nabble.com/rules-users-How-to-handle-generics-in-Drools-tp3427723p3517186.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listi

Re: [rules-users] How to handle generics in Drools?

2011-10-17 Thread Edson Tirelli
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

Re: [rules-users] How to handle generics in Drools?

2011-10-17 Thread Martin A
Thanks for the prompt response! Best regards, Martin 2011/10/17 Geoffrey De Smet > ** > Java's generics are implemented by erasure, > which implies that there no information available at runtime that a > instance of a List is of a certain generic type, for example Boost. > So I don't think this

Re: [rules-users] How to handle generics in Drools?

2011-10-17 Thread Geoffrey De Smet
Java's generics are implemented by erasure, which implies that there no information available at runtime that a instance of a List is of a certain generic type, for example Boost. So I don't think this is possible. Note that some things do work in erasure IIRC, like the generic type of a defin

Re: [rules-users] How to handle generics in Drools?

2011-10-17 Thread Wolfgang Laun
2011/10/17 Martin A : > Hello, > In my rules file I'd like to set something like this: > rule "mayThrowDice" >     when >         $user : User($gp : gameplay) >         $gameplay(this == $gp) >     then >         exists List() { >             . some business logic >         } This looks weird:

[rules-users] How to handle generics in Drools?

2011-10-17 Thread Martin A
Hello, In my rules file I'd like to set something like this: rule "mayThrowDice" when $user : User($gp : gameplay) $gameplay(this == $gp) then exists List() { . some business logic } end But it looks like there is no generics support. How c