I am working on a drool(drl) POC in which I create java beans at run time using reflection. I have set the below property in the config:
KnowledgeBuilderConfiguration config = KnowledgeBuilderFactory.newKnowledgeBuilderConfiguration();
config.setProperty("drools.dialect.default", "mvel");
//drl sample:
package script.demo
dialect "mvel"
import Employee;
rule "Rule - 1"
when
$emp: Employee($emp_id: emp_id)
then
System.out.println("emp id: "+$emp.emp_id);
end
But I am getting below error:
Field Reader does not exist for declaration '$emp_id' in '$emp_id: emp_id' in the rule 'Rule - 1' : [Rule name='Rule - 1'] @line [I@4cb9v654...............
Request help, how to solve this?