<br> What error are you getting?<br><br> I just tested this in MVELSH and it works:<br><br>mvel$ map["outerKey"]["innerKey"]<br>OUT: innerValue<br><br> []s<br> Edson<br><br><br><div><span class="gmail_quote">
2007/7/24, Felipe Piccolini <<a href="mailto:felipe.piccolini@bluesoft.cl">felipe.piccolini@bluesoft.cl</a>>:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div style="">Suppouse I have a Map attribute and one of the values is another Map...how can I check a member of the inner Map?<div><br></div><div>class MyFact{</div><div> Map map;</div><div> public MyFact(){</div>
<div> this.map = new HashMap();</div><div> }</div><div><br></div><div> ....setter and getter...</div><div><br></div><div>}</div><div><br></div><div>-- test --</div><div>MyFact myFact = new MyFact();</div>
<div><br></div><div>Map innerMap = new HashMap();</div><div>innerMap.put("innerKey", new String("InnerValue"));</div><div><br></div><div>Map map = new HashMap();</div><div>map.put("mapKey", innerMap);
</div><div><br></div><div>myFact.setMap(map);</div><div><br></div><div>.... set the RuleBase and insert myFact as a fact for the WorkingMemory...</div><div><br></div><div>-------</div><div><br></div><div>Now... how should I write the rule to check the innerKey ??
</div><div><br></div><div>rule "test InnerMap"</div><div> when</div><div> $mf: MyFact( map['mapKey']['innerKey'] == "InnerValue" ) // doesnt work...</div><div> ....</div>
<div><br></div><div> $mf: MyFact( map['mapKey'].this['innerKey'] == "InnerValue" ) // doesnt work...</div><div><span style="white-space: pre;">        </span> $mf: MyFact( map['mapKey'].['innerKey'] == "InnerValue" ) // doesnt work...
</div><div><span style="white-space: pre;">        </span> $mf: MyFact( $innerMap: map['mapKey'], $innerMap['innerKey'] == "InnerValue" ) // doesnt work...</div><div> $mf: MyFact( $innerMap: map['mapKey'] -> ($innerMap['innerKey'] == "InnerValue" )) // doesnt work...
</div><div><br></div><div><br></div><div>Thanks.<br><div> <span style="border-collapse: separate; border-spacing: 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">
<div><span style="text-decoration: underline;"><span> </span></span><div><font size="3"><span style="font-size: 13px;"><b style="font-size: 13px; font-weight: bold;">
<span style="font-size: 13px; font-weight: bold;">Felipe Piccolini M.</span></b></span></font></div><div><a href="mailto:felipe.piccolini@bluesoft.cl" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
<span style="color: rgb(0, 0, 238);">felipe.piccolini@bluesoft.cl</span></a></div><br></div><div><br></div><br></span> </div><br></div></div><br>_______________________________________________<br>rules-users mailing list<br>
<a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br><a onclick="return top.js.OpenExtLink(window,event,this)" href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">
https://lists.jboss.org/mailman/listinfo/rules-users</a><br><br></blockquote></div><br><br clear="all"><br>-- <br> Edson Tirelli<br> Software Engineer - JBoss Rules Core Developer<br> Office: +55 11 3529-6000<br> Mobile: +55 11 9287-5646
<br> JBoss, a division of Red Hat @ <a href="http://www.jboss.com">www.jboss.com</a>