Drools 规则中的映射和字符串
我有以下 Drools 规则,我将填充有 element 的 map 发送到该规则,但是当它执行时,我有 element 。为什么值应该是“Y”时却得到 null?当我在 ACDebug.debug() 方法中放置断点并在执行 $map.put() 后检查地图时,它看起来不错,它的值是“Y”,但在我的规则执行后,我有 null?有人有类似的问题吗?
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
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
对地图进行更改后,您需要进行更新。这让工作记忆知道您修改了地图。
添加以下行:
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: