[rules-users] Keep getting error trying to access value in hash map.

samd sdoyle_2 at yahoo.com
Sat Apr 11 15:01:49 EDT 2009


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.

Alessandro Terrinoni wrote:
> 
> 
> 
> 
>> Date: Fri, 10 Apr 2009 17:02:14 -0700
>> From: sdoyle_2 at yahoo.com
>> To: rules-users at lists.jboss.org
>> 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];
> 
> 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
> 
> 
>> 
>> 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:
>> http://www.nabble.com/Keep-getting-error-trying-to-access-value-in-hash-map.-tp22996482p22996482.html
>> Sent from the drools - user mailing list archive at Nabble.com.
>> 
>> _______________________________________________
>> rules-users mailing list
>> rules-users at lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/rules-users
> 
> _________________________________________________________________
> Chiama gratis dal tuo PC! Parla su Messenger
> http://clk.atdmt.com/GBL/go/140630369/direct/01/
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
> 
> 

-- 
View this message in context: http://www.nabble.com/Keep-getting-error-trying-to-access-value-in-hash-map.-tp22996482p23004358.html
Sent from the drools - user mailing list archive at Nabble.com.




More information about the rules-users mailing list