Hide Forgot
Date of First Response: 2010-03-04 15:10:11 Help Desk Ticket Reference: https://enterprise.redhat.com/issue-tracker/522653 securitylevel_name: Public Currently it is not possible to have wild card imports in package configuration imported types text box. Code imposes this hard restriction: http://anonsvn.jboss.org/repos/labs/labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/guvnor/server/rules/SuggestionCompletionLoader.java specifically: private void populateModelInfo(final PackageDescr pkgDescr, final List jars) { ... if ( className.endsWith( "*" ) ) { this.errors.add( "Unable to introspect model for wild card imports (" + className + "). Please explicitly import each fact type you require." ); } else { resolver.addImport( className ); final Class clazz = loadClass( className,jars ); ... It would be better to allow wild card imports or have an option to enable/disable it in the package configuration unless there is some hard limit which I do not know of.
Link: Added: This issue depends GUVNOR-513
Approved for 5.0.2 if done by due date.
DRL rules already supports import *, so this is a purely GUI issue. My impression is that this may not be a good idea, as the GUI needs to be eager and loads all type up for drop downs. This may make the GUI very inefficient. This is different to the import on demand in Java. In the import on demand case, java can be lazy and only resolves and loads classes that are needed during compiling. Having said that, we may still support import * if there is a valid use case and this support improves usability. As far as I know, the "Imported types" list is automatically populated with class types when a jar is uploaded. In this case, use does not need to edit the imported types manually, thus he/she does not need to use a import * which may save his/her time. Is there any other use cases when users may need to use import *?
ok, spoke with Jervis about this - we would like to know a bit more about what the underlying requirement is for this. The reason is that .* imports don't work well with the GUI - what if there are 1000 classes in that package ? Guvnor/GUI has to load up information for 1000 classes, even if they are not all needed (obviously this is fine for the compiler which can be lazy). Or, is this indicative of another problem - ie there is no easy gui to bulk add/update imports (ie you update a jar, you would like to be able to import all classes in a given package name, etc). So if we know, then we can pick best approach. import x.* could be doable - but would have to find and put an upper limit on the number of classes lest the UI become unresponsive (eg if someone accidentally imports far to many classes).
The reason why user raised this issue is because https://jira.jboss.org/jira/browse/BRMS-228. With BRMS-228, they have to manually import types, which is boring and time consuming. This is the only scenario when a user need to use import *. With BRMS-228 being fixed already, I think we can safely close this jira now.
It's still here in: http://anonsvn.jboss.org/repos/labs/labs/jbossrules/soa_tags/BRMS-5.0.2-CR1/drools-compiler/src/main/java/org/drools/guvnor/server/rules/SuggestionCompletionLoader.java
The Resolution for this jira is "Wont fix". This is because there is no use cases that a user need to import types manually. See my previous comments.
Close this for now. But feel free to reopen if you want this jira to be treated differently.
Temporarily reopening to add release notes stats.
Release Notes Docs Status: Added: Not Required Writer: Added: dlesage