문제

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top