[jboss-jira] [JBoss JIRA] (JBRULES-2696) KnowledgeBaseDefinitionParser Should Always Create KnowledgeBaseOptionsConfiguration

Geoffrey De Smet (JIRA) jira-events at lists.jboss.org
Wed Feb 1 05:26:34 EST 2012


     [ https://issues.jboss.org/browse/JBRULES-2696?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Geoffrey De Smet updated JBRULES-2696:
--------------------------------------

    Fix Version/s: 5.4.0.Beta3
                       (was: 5.4.0.Beta2)

    
> KnowledgeBaseDefinitionParser Should Always Create KnowledgeBaseOptionsConfiguration
> ------------------------------------------------------------------------------------
>
>                 Key: JBRULES-2696
>                 URL: https://issues.jboss.org/browse/JBRULES-2696
>             Project: Drools
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>          Components: All
>    Affects Versions: 5.1.1.FINAL
>         Environment: N/A
>            Reporter: Anatoly Polinsky
>            Assignee: Mauricio Salatino
>              Labels: drools-spring, drools_configuration, spring
>             Fix For: 5.4.0.Beta3
>
>   Original Estimate: 1 hour
>  Remaining Estimate: 1 hour
>
> KnowledgeBaseOptionsConfiguration:
>  * <p>
>  * This class will automatically load default values from a number of places, accumulating properties from each location.
>  * This list of locations, in given priority is:
>  * System properties, home directory, working directory, META-INF/ of optionally provided classLoader
>  * META-INF/ of Thread.currentThread().getContextClassLoader() and META-INF/ of  ClassLoader.getSystemClassLoader()
>  * </p>
> Since this properties are only read when "RuleBaseConfiguration" ( KnowledgeBaseOptionsConfiguration implementor ) is constructed, this does not apply/work in case KnowledgeBase is defined via Spring without a <drools:configuration> due to the current sequence of events in "KnowledgeBaseDefinitionParser":
>         Element kbaseConf = DomUtils.getChildElementByTagName(element, "configuration");
>         if ( kbaseConf != null ) {
>             BeanDefinitionBuilder rbaseConfBuilder = BeanDefinitionBuilder.rootBeanDefinition( RuleBaseConfiguration.class );
>             // ... ... ...
>             factory.addPropertyValue( "conf", rbaseConfBuilder.getBeanDefinition() );
>         }
> To fix it, RuleBaseConfiguration ( which implements KnowledgeBaseOptionsConfiguration ) should be created even though "<drools:configuration>" was not provided ( kbaseConf == null ):
>         Element kbaseConf = DomUtils.getChildElementByTagName(element, "configuration");
>         BeanDefinitionBuilder rbaseConfBuilder = BeanDefinitionBuilder.rootBeanDefinition( RuleBaseConfiguration.class );
>         if ( kbaseConf != null ) {
>             // ... ... ...
>         }
>         factory.addPropertyValue( "conf", rbaseConfBuilder.getBeanDefinition() );
> Thank you,
> /Anatoly

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the jboss-jira mailing list