UEL issue - Field-name not evaluated for expression

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

UEL issue - Field-name not evaluated for expression

rshekhar.in
The problem


<simple-method>
  <set field="attrEntity" value="Party"/>
  <set field="attrName" value="partyId"/>
  <set field="attrVal" value="10000"/>
  <entity-condition list="newValList" entity-name="${attrEntity}">
    <condition-expr field-name="${attrName}" from-field="${attrVal}" />
  </entity-condition>
</simple method>


Only the expression in field-name is not evaluated to partyId. Is there a work around?

Could any one help?
-------------------------------------------------
'There are two choices in life-Take it or leave it !'
-------------------------------------------------
Reply | Threaded
Open this post in threaded view
|

Re: UEL issue - Field-name not evaluated for expression

rshekhar.in
Got a workaround through groovy

<i><set field="attrEntity" value="Party"/>
<set field="attrName" value="partyId"/>
<set field="attrVal" value="10000"/>

<set field="entityAttributeMap{}" type="Map"/>
<set field="entityAttributeMap.${attrName}" from-field="attrVal"/>

<script location="component://location/getTheList.groovy"/></i>


Groovy File - getTheList.groovy
<i>import org.ofbiz.entity.*;
context.newValList = delegator.findByAnd(context.attrEntity,context.entityAttributeMap);</i>

And the result is stored in "newValList"
-------------------------------------------------
'There are two choices in life-Take it or leave it !'
-------------------------------------------------