我已經在DRL文件中定義了一些規則,並且它是我的第一個創建drl文件的程序。我收到錯誤「無法分析表達」。這裏是我的代碼:drools - 無法分析表達式
package rules
import com.sample.Applicant.appli;
rule "Is of valid age"
when
$a : appli (age < 18) // appli is my class name
// age is a variable in that class
then
$a.setValid(false); // setValid is a method of appli
end
,並得到錯誤:
Unable to Analyse Expression age < 18:
[Error: unable to resolve method using strict-mode: com.sample.Applicant$appli.age()]
[Near : {... age < 18 ....}]
^
[Line: 16, Column: 4] : [Rule name='Is of valid age']