protected void initConfigFilePath() {
try {configFilePath = getClass().getResource("/").toURI().getPath();} catch (URISyntaxException e) {configFilePath = getClass().getResource("/").getPath();}
}
<bean id="kiePostProcessor" class="org.kie.spring.KModuleBeanFactoryPostProcessor"/>
<bean id="kiePostProcessor" class="org.kie.spring.KModuleBeanFactoryPostProcessor"/>
<Constructor-arg class = "configFileURL" value = ""/>
<Constructor-arg class = "configFilePath" value = "Give an absolute path of rule files here"/> </bean>
<kie:import />
<kie:kmodule id="Kmodule1">
<kie:kbase name="process" packages="process">
<kie:ksession name="ksession-process" />
</kie:kbase>
</kie:kmodule>
<bean id="kiePostProcessor" class="org.kie.spring.KModuleBeanFactoryPostProcessor" />
Hi,
I too have the situation where ProjectB contains the .drl files and ProjectA uses them to create KieSession instances via kie-spring. I’ve tried the solution of having the META-INF/kmodule.xml in ProjectB and using the <kie:import/> tag in the spring config for ProjectA. This seems to work fine with one important exception: there doesn’t seem to be a way to tell spring that the beans are to have scope=prototype. When trying to obtain new KieSession instances this obviously a huge problem for most use cases since only one singleton instance is created. This seems to make kie-spring usable only in a project that contains the .drl files.
The other major issue I’ve run into trying to use kie-spring is the problem with Junit tests only being able to locate .drl files from within /source/test/resources and not /source/main/resources (covered in another thread). This creates a situation where we are forced to keep 2 sets of .drl files in sync.
Am I overlooking anything relative to these 2 problems? I would love to use kie-spring but these issues seem to be show stoppers.