简体   繁体   中英

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.

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. I have looked at the XML file and verified all the data is correct. 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.

Figured it out. It was because lineId returns a String, not and int. So the comparison failed.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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