例外情况“无法解析ObjectType'产品'”

时间:2017-04-25 07:05:08

标签: maven drools dsl

这个问题已经解决,但是主类规则正在解决。但是drl文件没有形成。

package com.sample;
import com.model.example.Product.*;
expander product.dsl

rule "success"
when 
     There is a Product that 
     -has price greater than 100 
     -has quantity less than 2 
     -has category equal to 'grocery'
then
    success
end

我在我创建了dsl和dslr文件的maven项目中遇到异常“无法解析ObjectType'Product'”。

rule "failure"
when 
    There is a Product that 
    -has price less than 100 
    -has quantity greater than 2
    -has category equal to 'medicine'
then
    fail
end    

1 个答案:

答案 0 :(得分:1)

DRL import语句与Java一样。因此,导入后跟完整的类名:

import com.model.example.Product;