<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
samd wrote:
<blockquote cite="mid:23004358.post@talk.nabble.com" type="cite">
<pre wrap="">It was my understanding based on other posts that was the required syntax for
dealing with with a Map in Drools. I'll try what you suggest.
</pre>
</blockquote>
var.map['key] is valid syntax.<br>
<br>
But looking at your example "codes" is your map, so if you do
codes.values you are returning a set. you can't use the square notation
on a set.<br>
<br>
Mark<br>
<blockquote cite="mid:23004358.post@talk.nabble.com" type="cite">
<pre wrap="">
Alessandro Terrinoni wrote:
</pre>
<blockquote type="cite">
<pre wrap="">
</pre>
<blockquote type="cite">
<pre wrap="">Date: Fri, 10 Apr 2009 17:02:14 -0700
From: <a class="moz-txt-link-abbreviated" href="mailto:sdoyle_2@yahoo.com">sdoyle_2@yahoo.com</a>
To: <a class="moz-txt-link-abbreviated" href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a>
Subject: [rules-users] Keep getting error trying to access value in hash
map.
I'm trying to extract the value from a hashmap after first extracting a
key
and I keep getting the same error.
Here is the rule information:
target: Target();
perm: PermissionCheck(target == target, action == "edit", granted ==
false);
primaryKey : TargetId(targetNum == 1) from target.codes.keySet();
primaryCode : TargetCode() from target.codes.values[primaryKey];
</pre>
</blockquote>
<pre wrap="">when you write target.codes.values[primaryKey] drools looks for a getter
method "getValues" in the object "codes" trying to return a field called
"values".
try to replace target.codes.values[primaryKey] with
target.codes.get(primaryKey)
Alessandro Terrinoni
</pre>
<blockquote type="cite">
<pre wrap="">Here is the error:
Caused by: javax.el.ELException: /layout/test.xhtml @25,111
rendered="#{s:hasPermission(target,'edit')}": org.mvel.CompileException:
unable to resolve property: values
at
com.sun.facelets.el.TagValueExpression.getValue(TagValueExpression.java:76)
at
javax.faces.component.UIComponentBase.isRendered(UIComponentBase.java:390)
... 61 more
Caused by: org.mvel.CompileException: unable to resolve property: values
at
org.mvel.optimizers.impl.refl.ReflectiveAccessorOptimizer.compileGetChain(ReflectiveAcces
sorOptimizer.java:288)
at
org.mvel.optimizers.impl.refl.ReflectiveAccessorOptimizer.optimizeAccessor(ReflectiveAcce
ssorOptimizer.java:109)
at
org.mvel.ast.VariableDeepPropertyNode.getReducedValueAccelerated(VariableDeepPropertyNode
.java:29)
Thanks
--
View this message in context:
<a class="moz-txt-link-freetext" href="http://www.nabble.com/Keep-getting-error-trying-to-access-value-in-hash-map.-tp22996482p22996482.html">http://www.nabble.com/Keep-getting-error-trying-to-access-value-in-hash-map.-tp22996482p22996482.html</a>
Sent from the drools - user mailing list archive at Nabble.com.
_______________________________________________
rules-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a>
<a class="moz-txt-link-freetext" href="https://lists.jboss.org/mailman/listinfo/rules-users">https://lists.jboss.org/mailman/listinfo/rules-users</a>
</pre>
</blockquote>
<pre wrap="">_________________________________________________________________
Chiama gratis dal tuo PC! Parla su Messenger
<a class="moz-txt-link-freetext" href="http://clk.atdmt.com/GBL/go/140630369/direct/01/">http://clk.atdmt.com/GBL/go/140630369/direct/01/</a>
_______________________________________________
rules-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a>
<a class="moz-txt-link-freetext" href="https://lists.jboss.org/mailman/listinfo/rules-users">https://lists.jboss.org/mailman/listinfo/rules-users</a>
</pre>
</blockquote>
<pre wrap=""><!---->
</pre>
</blockquote>
<br>
</body>
</html>