[rules-users] why inject the kagent: drools-spring api

mmjose26 mmjose26 at yahoo.com.mx
Wed Feb 16 15:44:48 EST 2011


Hi!
I'm new using spring-drools api, and I have some doubts about api
implementation:

I review the source code of KnowledgeAgentDefinitionParser, I don't
understand why we need to inject the kagent into any stateless sessions.

and this code:
// inject the kagent into any stateless sessions (why?)

for ( String beanName : parserContext.getRegistry().getBeanDefinitionNames()
) {...}
only iterates over the spring beans that has been loaded (at run time) in
the memory but not over all beans defined,
so it isn't the desired effect.

it happens too whith KnowledgeSessionDefinitionParser:

        // find any kagent's for the current kbase and assign (why?)
        for ( String beanName :
parserContext.getRegistry().getBeanDefinitionNames() ) {


and may ocurr the exception with stateful  sessions: Error setting property
values; nested exception is
org.springframework.beans.NotWritablePropertyException: Invalid property
'knowledgeAgent' 

this not happens in test cases because the order of drools-spring beans
definitions

Tanks for your help!
-- 
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/why-inject-the-kagent-drools-spring-api-tp2512738p2512738.html
Sent from the Drools - User mailing list archive at Nabble.com.



More information about the rules-users mailing list