简体   繁体   English

流口水的规则不开除

[英]Drools Rule not firing

What I need to do is, if a KeymarkDocField identified by lineId 2016 has a null value, get the value from another KeymarkDocField identified by fieldOrderNumber 265, and set it. 我需要做的是,如果由lineId 2016标识的KeymarkDocField具有空值,请从由fieldOrderNumber 265标识的另一个KeymarkDocField获取值,然后进行设置。

I have the following rule: 我有以下规则:

rule "Add Disbursement Date to NLS XML Output"
when
    $modify : KeymarkDocField(lineId == 2016, value == null)            
    KeymarkDocField($disDate : value, fieldOrderNumber == 265)
then
    modify($modify){
        setValue($disDate)
    }
end

All this info is coming from an xml file. 所有这些信息都来自xml文件。 I have looked at the XML file and verified all the data is correct. 我查看了XML文件,并验证了所有数据正确。 This rule, however, will not fire. 但是,此规则不会生效。 I am new to Drools and wondering if someone might be able to identify the mistake I have made. 我是Drools的新手,想知道是否有人可以识别我所犯的错误。

Figured it out. 弄清楚了。 It was because lineId returns a String, not and int. 这是因为lineId返回String,而不是int。 So the comparison failed. 因此比较失败。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM