Quantcast

Nested class, BRL and Java (error)

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Nested class, BRL and Java (error)

TonyN
Hi,

I have nested classes in the domain model and I imported these nested classes in order to use them in the guided editor.  Things are ok except when one of the rule required a custom java function, then I would get an error at 'build' package time (the error is 'not able to resolve TcItem$Dataset').   I think the compiler didn't like the '$' in the list of imported statements.  But if I don't import these nested classes, I won't be able to use them in the guided editor.  

I am new to Drools so I think there must be a way to be able to use nested class (w/ '$') and custom java functions together.

Please advise.

I am using Guvnor 5.2 final.

Thanks.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: [rules-users] Nested class, BRL and Java (error)

manstis
Hi,

This was a bug, but has been fixed for 5.4.0.Final.

The only workaround is to move the enumerations to their own class, rather than nest in another Class.

https://bugzilla.redhat.com/show_bug.cgi?id=724629

With kind regards,

Mike

On 23 April 2012 14:12, TonyN <[hidden email]> wrote:
Hi,

I have nested classes in the domain model and I imported these nested
classes in order to use them in the guided editor.  Things are ok except
when one of the rule required a custom java function, then I would get an
error at 'build' package time (the error is 'not able to resolve
TcItem$Dataset').   I think the compiler didn't like the '$' in the list of
imported statements.  But if I don't import these nested classes, I won't be
able to use them in the guided editor.

I am new to Drools so I think there must be a way to be able to use nested
class (w/ '$') and custom java functions together.

Please advise.

I am using Guvnor 5.2 final.

Thanks.

--
View this message in context: http://drools.46999.n3.nabble.com/Nested-class-BRL-and-Java-error-tp3932432p3932432.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
_______________________________________________
rules-users mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/rules-users


_______________________________________________
rules-users mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/rules-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: [rules-users] Nested class, BRL and Java (error)

laune
In reply to this post by TonyN
To import a class B nested in class x.y.A, you'd use
   import x.y.A.B

(Actually, '$' is legal in Java names, so there must be another reason
for not being able to resolve a name.)

-W



On 23/04/2012, TonyN <[hidden email]> wrote:

> Hi,
>
> I have nested classes in the domain model and I imported these nested
> classes in order to use them in the guided editor.  Things are ok except
> when one of the rule required a custom java function, then I would get an
> error at 'build' package time (the error is 'not able to resolve
> TcItem$Dataset').   I think the compiler didn't like the '$' in the list of
> imported statements.  But if I don't import these nested classes, I won't be
> able to use them in the guided editor.
>
> I am new to Drools so I think there must be a way to be able to use nested
> class (w/ '$') and custom java functions together.
>
> Please advise.
>
> I am using Guvnor 5.2 final.
>
> Thanks.
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/Nested-class-BRL-and-Java-error-tp3932432p3932432.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> _______________________________________________
> rules-users mailing list
> [hidden email]
> https://lists.jboss.org/mailman/listinfo/rules-users
>
_______________________________________________
rules-users mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/rules-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: [rules-users] Nested class, BRL and Java (error)

TonyN
In reply to this post by manstis
Hi,

I downloaded the Guvnor 5.4.0 CR1 and problem is still there (I am assuming the fix is in this CR release too?).  I would like to send this image to show one of class in the domain model that contains nested classes.  

TcItem contains Dataset contains NamedReferences



Thx
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: [rules-users] Nested class, BRL and Java (error)

manstis
Nope, I meant 5.4.0.Final - as I typed :)

Can you create a JIRA (https://issues.jboss.org/browse/GUVNOR) and attach a repository export demonstrating the problem.

I can take a look to check it's working as you require with (what will become) 5.4.0.Final.

Otherwise, it'll be a bug and need fixing anyway.

With kind regards,

Mike

On 23 April 2012 17:34, TonyN <[hidden email]> wrote:
Hi,

I downloaded the Guvnor 5.4.0 CR1 and problem is still there (I am assuming
the fix is in this CR release too?).  I would like to send this image to
show one of class in the domain model that contains nested classes.

TcItem contains Dataset contains NamedReferences

http://drools.46999.n3.nabble.com/file/n3932980/complexType_TcItem.jpg

Thx

--
View this message in context: http://drools.46999.n3.nabble.com/Nested-class-BRL-and-Java-error-tp3932432p3932980.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
_______________________________________________
rules-users mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/rules-users


_______________________________________________
rules-users mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/rules-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: [rules-users] Nested class, BRL and Java (error)

TonyN
Thanks Mike...will do!
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: [rules-users] Nested class, BRL and Java (error)

TonyN
In reply to this post by manstis
JIRA ticket opened (GUVNOR-1873)...

Thx
Loading...