开发者

Maps and strings in Drools rules

I have following Drools rule to which I send map filled with element , but when it gets executed I have element . Why do I get null when it should be "Y" for the value? When I put breakpoint in ACDebug.debug() method and inspect map after $map.put() was executed it looks good, it has "Y" for the value, but after my rules get executed I have null? Has anyone have similar problem?

import java.util.Map;
import java.util.HashMap;
import edu.abc.ACDebug;

rule "POSTPROCESSOR 8"
    ruleflow-group "supress-processor"
    when
        $map:Map(keySet开发者_如何转开发 contains "STANDARD_ADDRESS:STREET_NAME")
    then
        ACDebug.debug($map, "Map before PUT: ");
        $map.put("/locationList/sourceAddress/fullStreet",new String("Y"));
        ACDebug.debug($map, "Map after PUT: ");
        $map.remove("STANDARD_ADDRESS:STREET_NAME");
end


After you have done the changes to the map, you need to do an update. This lets the working memory know that you modified the map.

Add the following line:

update( $map );
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜