Hi,I'm using drools-5.3.0.Beta1. I've following rule file:
import java.util.*;
declare Student
name : String @key
subjectGradeMap : HashMap
end
rule "Subject grade points"
dialect "mvel"
when
$u : Student()
then
if($u.subjectGradeMap == null)
{
$u.subjectGradeMap = new HashMap<String,Integer>();
}
$u.subjectGradeMap["CompSc"] += 100;
System.out.println("Marks added");
end
I get following error while rule compilation:Unable to Analyse Expression
if($u.subjectGradeMap == null);
{
$u.subjectGradeMap = new HashMap<String,Integer>();
};
$u.subjectGradeMap["CompSc"] += 100;
System.out.println("Marks added");:
[Error: was expecting type: java.lang.Object; but found type: <Unknown>]
[Near : {... if($u.subjectGradeMap == null) ....}]
^
[Line: 1, Column: 1] : [Rule name='Subject grade points']
Please let me know if this is correct usage in the above scenario.
Thanks,Neel