Question

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.

Was it helpful?

Solution

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top