[rules-users] Drools Compile Error

Narendra Valada narendra.valada at gmail.com
Fri Feb 29 14:24:57 EST 2008


Hi,

I have attached zip file with test Case and patch for this class:

http://anonsvn.labs.jboss.com/labs/jbossrules/branches/4.0.x/drools-core/src/main/java/org/drools/base/ClassTypeResolver.java

Narendra


On 2/27/08, Mark Proctor <mproctor at codehaus.org> wrote:
>
> Narendra Valada wrote:
>
>
> Hi,
>
> It appears that nested inner classes are not implemented correctly. I am
> getting a compile error even when the rule is rewritten to include the
> import statement :
>
>
> package com.sample
>
> import com.sample.OuterClass.InnerClass.InnerInnerClass;
>
> Yes, most likely we don't have the logic to reflect on inner inner
> classes. See this class to understand how we resolve a string name to a
> Class instance:
>
> http://anonsvn.labs.jboss.com/labs/jbossrules/branches/4.0.x/drools-core/src/main/java/org/drools/base/ClassObjectType.java
>
> Maybe you can make a test case and a patch for us for the 4.0.x branch. I
> guess make it generic enough so that it can work with any numbers of
> nesting. Although I may be concerned on how this might impact reflection
> lookup.
>
>
> rule "Inner Class Test"
>
> when
>
> InnerInnerClass( )
>
> then
>
> System.out.println( "" );
>
>
> end
>
> Narendra
>
>
> On 2/22/08, Narendra Valada <narendra.valada at gmail.com> wrote:
> >
> > Importing the class was the first thing I tried. That did not work
> > either.
> >
> > Thanks,
> >
> > Narendra
> >
> >
> >  On Fri, Feb 22, 2008 at 5:36 PM, Mark Proctor <mproctor at codehaus.org>
> > wrote:
> >
> > > you need to import the inner classes, look at the HelloWorld example
> > > which uses a nested Message object and see how it's imported. Inner classes
> > > definitely work, let me know if inner.inner classes don't.
> > >
> > > Mark
> > > Narendra Valada wrote:
> > >
> > >  Hi,
> > >
> > > I have a rule that looks like this :
> > >
> > >
> > > package com.sample
> > >
> > >
> > > rule "Inner Class Test"
> > >
> > > when
> > >
> > > com.sample.OuterClass.InnerClass.InnerInnerClass( )
> > >
> > > then
> > >
> > > System.out.println( "" );
> > >
> > >
> > > end
> > >
> > > The inner class referenced by this rule is defined like this:
> > >
> > > package com.sample;
> > >
> > > public class OuterClass {
> > >
> > >    public class InnerClass {
> > >
> > >       public class InnerInnerClass { }
> > >
> > >    }
> > >
> > > }
> > >
> > > I am getting an error "Unable to resolve ObjectType '
> > > com.sample.OuterClass.InnerClass.InnerInnerClass'".
> > >
> > > What am I doing wrong? I am using XMLBeans-generated POJOs in my
> > > application and these POJOS contain a lot of deeply nested inner classes and
> > > these are giving me compile-errors in Drools.
> > >
> > > Thanks,
> > >
> > > Narendra
> > >
> > > ------------------------------
> > >
> > > _______________________________________________
> > > rules-users mailing listrules-users at lists.jboss.orghttps://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
> > >
> > >
> >
> ------------------------------
>
> _______________________________________________
> rules-users mailing listrules-users at lists.jboss.orghttps://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
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20080229/0c0d58a6/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ClassTypeResolverPatch.zip
Type: application/zip
Size: 3756 bytes
Desc: not available
Url : http://lists.jboss.org/pipermail/rules-users/attachments/20080229/0c0d58a6/attachment.zip 


More information about the rules-users mailing list