Assuming your "computesomething" method has a signature like:

public boolean computesomething() { .. }

   The shadow proxy will delegate the call to your instance method. So, does not matter if the shadow proxy innerObj is null (since being a lazy proxy it may not have been loaded yet) because the shadow proxy will actually execute your instance computesomething() method.

   Stack trace?


2008/12/9 Trägenap <>

I got some problems with shadowproxy.

I have a couple of instances of class "FirstObj". The objects contains some other objects like "innerObj" and have a method "computesomething", which returns boolean and use the "innerObj" to compute the result.

I try to access this object with the following rule:

rule "doIt"
   $firstobj : FirstObj(computesomething == true)
   // take a break...
   System.out.println("be happy");

I debug the programm and figure out that the innerObj is not null. Instead of my original object "firstobj", there I found a FirstObjShadowProxy which offers a field called "innerObj" which is null.

Isnt it possible to get access to "computed" fields? What is wrong here?


rules-users mailing list

 Edson Tirelli
 JBoss Drools Core Development
 JBoss, a division of Red Hat @