jose mendoza [http://community.jboss.org/people/mmjose26] created the discussion

"Re: Problem installation jbpm5 with spring beans"

To view the discussion, visit: http://community.jboss.org/message/587613#587613

--------------------------------------------------------------
I have the same problem with simple test case using Spring + drools +guvrnor.
debuging the spring-drools jar,  I found that KnowledgeSessionDefinitionParser 
is the problem.
Here the code:
....
......
        // find any kagent's for the current kbase and assign
        for ( String beanName : 
parserContext.getRegistry().getBeanDefinitionNames() ) {
            BeanDefinition def = 
parserContext.getRegistry().getBeanDefinition(beanName);
            if ( def.getBeanClassName().equals( 
KnowledgeAgentBeanFactory.class.getName() ) ) {                                
                 PropertyValue pvalue = 
def.getPropertyValues().getPropertyValue( "kbase" );
                 RuntimeBeanReference tbf = ( RuntimeBeanReference ) 
pvalue.getValue();                 
                if ( kbase.equals( tbf.getBeanName() ) ) {
*factory.addPropertyValue( "knowledgeAgent", new RuntimeBeanReference( beanName 
) );*
                }
            }           
        }        

        return factory.getBeanDefinition();
    }


it fails when ksession is stateful, because StatefulKnowledgeSessionBeanFactory 
don't have the property *knowledgeAgent*

I dont understand the propose of this part of code.

if you change the order definition from xml and define ksession at top, "it 
works" because how spring container load the beans, and is the reason of in the 
test cases of drools all works fine. 

I tink that is a bug.
--------------------------------------------------------------

Reply to this message by going to Community
[http://community.jboss.org/message/587613#587613]

Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]

_______________________________________________
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to