0
votes

Hello I am getting the following error on my drools program:

java.lang.RuntimeException: Unable to get KieModule, Errors Existed

My .drl file is as follows:

package com.baeldung.drools.rules

import com.model.Variable;
import com.model.Recommendation;

global com.model.Recommendation recommendation;
dialect "mvel" 

rule "Rule 0"
when
variable1:Variable(Name=="Number of cigs per day", NumericValue>0)             
then
recommendation.setRecommendation("Encourage smoking cessation.");
end
rule "Rule 1"
when
variable1:Variable(Name=="Smoker", Value=="Yes")             
then
recommendation.setRecommendation("Encourage smoking cessation.");
end

In my Variable object I have added a Double NumericValue and a String Value. If I remove Rule 0 the .drl compiler will work and detect Rule 1, however with Rule 0 the compiler always generates the KieModule compiler error. I don't know what is wrong with my code and why It does not compile with the rule with a conditional comparison.

1

1 Answers

1
votes

I solved my issue. The problem was not in the .drl file but instead in my Variable class which did not have a public getNumericValue() constructor.