[rules-users] Drools and JBoss Seam proxies

Wolfgang Laun wolfgang.laun at gmail.com
Mon Feb 28 10:00:44 EST 2011


But casting does not really change the class?

Besides, if
   class Proxy extends Pojo
you can still write your rules using Pojo and its fields, even if the
actual object is of type Proxy.

-W

On 28 February 2011 15:34, Tihomir Surdilovic <tsurdilo at redhat.com> wrote:
> When you request components from Seam container, Seam wires those
> objects with interceptors completely wrapping it into a proxy. So yes,
> what you get is a proxy which has a different class signature than what
> the import statements define in your DRL. However since Seam uses Cglib
> to create these proxies, they end up being subclasses of the concrete
> class, and you should be able to simply cast them back before inserting
> into the WM.
>
> Hope this helps.
>
> Thanks.
> Tihomir
>
> On 2/27/11 2:52 AM, sherlock wrote:
>> Hi,
>>
>> a newbie question.
>>
>> I am asserting references to JBoss Seam beans (SFSB) as Drools facts and
>> it looks that the rule engine does not recognize them as instances of
>> the original bean POJO class - it looks that it sees the JBoss Seam proxies.
>>
>> When I use an intermediate non-Seam enabled wrapper POJO class which
>> wraps the Seam bean everything works, but now there will be an
>> additional need to maintain set of wrapper classes and in addition DRL
>> conditions code is cluttered with statements to access the JBoss Seam
>> beans...
>>
>> Surely I am missing something, but I cannot find out so far. Googling
>> didn't seem to find anything helpful.
>>
>> The environment is: Seam 2.2.0.GA, Drools 5.1.1
>>
>> Thank you in advance!
>>
>> sherlock
>> _______________________________________________
>> rules-users mailing list
>> rules-users at lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/rules-users
>>
>
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>



More information about the rules-users mailing list