According to java documentation the result of Map.put is:<div><br></div><div>"the previous value associated with <tt>key</tt>, or <tt>null</tt> if there was no mapping for <tt>key</tt>. (A <tt>null</tt> return can also indicate that the map previously associated <tt>null</tt> with <tt>key</tt>, if the implementation supports <tt>null</tt> values.)"<br>
</div><div><br></div><div>Are you sure that you are doing what you think you are doing when you do: <span style="font-family:arial,sans-serif;font-size:13px">$testObj.getResult().add($</span><span style="font-family:arial,sans-serif;font-size:13px">rule.put(.....)) ?</span></div>
<div><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div><div><span style="font-family:arial,sans-serif;font-size:13px">Best Regards,</span></div><div class="gmail_extra"><br clear="all"><br>XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX<br>
<br>Esteban Aliverti<br>- Blog @ <a href="http://ilesteban.wordpress.com" target="_blank">http://ilesteban.wordpress.com</a><br>
<br><br><div class="gmail_quote">On Mon, Nov 5, 2012 at 2:28 PM, himansu.nayak <span dir="ltr"><<a href="mailto:himansumca@gmail.com" target="_blank">himansumca@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi,<br>
i m trying to do something like this.<br>
<br>
RHS OF MY RULE<br>
================<br>
Map <String, String>$result = new HashMap<String, String>();<br>
Map <String, Map>$rule = new HashMap<String, Map>();<br>
$result.put("Result1", "@{Result1}");<br>
$result.put("Result2", "@{Result2}");<br>
$result.put("Result3", "@{Result3}");<br>
$testObj.getResult().add($rule.put(drools.getRule().getName(), $result));<br>
update($testObj.getResult());<br>
<br>
i am not able to get this 2 object i.e "result and rule" from my java code<br>
after the execution of the rule. even though i have the reference of testobj<br>
in my java code.<br>
<br>
did i miss anything?<br>
<br>
<br>
<br>
-----<br>
Thanks...<br>
Himansu<br>
--<br>
View this message in context: <a href="http://drools.46999.n3.nabble.com/Creating-HashMap-object-in-rules-tp4020690p4020700.html" target="_blank">http://drools.46999.n3.nabble.com/Creating-HashMap-object-in-rules-tp4020690p4020700.html</a><br>
<div class="HOEnZb"><div class="h5">Sent from the Drools: User forum mailing list archive at Nabble.com.<br>
_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
</div></div></blockquote></div><br></div>