DRL file not getting picked

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

DRL file not getting picked

dwipin
Hi,

I am using kie-spring.6.0.0.Final artefact to build my project.

This is my app ctx data -

        <kie:kmodule id="module-1">
                <kie:kbase name="kbase" packages="validation_rules">
                        <kie:ksession name="ksession">
                                <kie:consoleLogger />
                               
                        </kie:ksession>
                </kie:kbase>
        </kie:kmodule>

        <bean id="kiePostProcessor" class="org.kie.spring.KModuleBeanFactoryPostProcessor" />
       
        <bean id="ruleService" class="com.poc.RuleService">
                <property name="ksession" ref="ksession" />
        </bean>

My Rule Service ->

ksession.fireAllRules();
log.debug("...finished running .");

My DRL File input ->
package validation_rules

rule "Test Rule"
when

then
System.out.println("Testing...");
end

I wanted to test with a sample rule without any conditions. However this never gets executed. This DRL file is present under src/main/resources/validation_rules. The KieSession gets injected properly though.

Thanks and Regards,
Dwipin Chandran.
Reply | Threaded
Open this post in threaded view
|

Re: DRL file not getting picked

Vinod Kiran
Dwipin - Can you post the contents of the log/console ? Also, is your test project a maven project?

-Vinod
Reply | Threaded
Open this post in threaded view
|

Re: DRL file not getting picked

dwipin
This is a maven project. I tried to test using a junit test class and did not see any console output in eclipse. I have <kie:consoleLogger /> tag within the <kie:ksession> tag.
Reply | Threaded
Open this post in threaded view
|

Re: DRL file not getting picked

dwipin
anyone there who could give some pointers ?

Thanks and Regards,
Dwipin Chandran.
Reply | Threaded
Open this post in threaded view
|

Re: DRL file not getting picked

Vinod Kiran
Dwipin,

It is difficult to diagnose given the limited information. Can you take a sample (test) and try running it locally ?

https://github.com/droolsjbpm/droolsjbpm-integration/blob/master/kie-spring/src/test/java/org/kie/spring/tests/KieSpringBasicsTest2.java

- Vinod