Hi Adrian,
could you please review the following change I did? Is it the correct way to fix this issue? Do you think we should search for similar patterns in the system and fix them? Thanks, Jacopo Begin forwarded message: > From: [hidden email] > Date: April 20, 2009 4:19:28 PM GMT+02:00 > To: [hidden email] > Subject: svn commit: r766704 - /ofbiz/trunk/applications/order/ > script/org/ofbiz/order/order/OrderSimpleMethods.xml > Reply-To: [hidden email] > > Author: jacopoc > Date: Mon Apr 20 14:19:28 2009 > New Revision: 766704 > > URL: http://svn.apache.org/viewvc?rev=766704&view=rev > Log: > Fixed code that was not working (I think) after recent > implementation of UEL. > > Modified: > ofbiz/trunk/applications/order/script/org/ofbiz/order/order/ > OrderSimpleMethods.xml > > Modified: ofbiz/trunk/applications/order/script/org/ofbiz/order/ > order/OrderSimpleMethods.xml > URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/script/org/ofbiz/order/order/OrderSimpleMethods.xml?rev=766704&r1=766703&r2=766704&view=diff > = > = > = > = > = > = > = > = > ====================================================================== > --- ofbiz/trunk/applications/order/script/org/ofbiz/order/order/ > OrderSimpleMethods.xml (original) > +++ ofbiz/trunk/applications/order/script/org/ofbiz/order/order/ > OrderSimpleMethods.xml Mon Apr 20 14:19:28 2009 > @@ -85,11 +85,11 @@ > <field-map field-name="orderId" from- > field="parameters.orderId"/> > </entity-and> > <iterate list="shipmentReceipts" entry="receipt"> > - <if-empty field="totalsMap.${receipt.orderItemSeqId}"> > - <set field="totalsMap.${receipt.orderItemSeqId}" > value="0" type="BigDecimal"/> > + <if-empty field="totalsMap.receipt.orderItemSeqId"> > + <set field="totalsMap.receipt.orderItemSeqId" > value="0" type="BigDecimal"/> > </if-empty> > - <calculate field="totalsMap.${receipt.orderItemSeqId}"> > - <calcop field="totalsMap.${receipt.orderItemSeqId}" > operator="add"> > + <calculate field="totalsMap.receipt.orderItemSeqId"> > + <calcop field="totalsMap.receipt.orderItemSeqId" > operator="add"> > <calcop field="receipt.quantityAccepted" > operator="get"/> > <calcop field="receipt.quantityRejected" > operator="get"/> > </calcop> > @@ -98,7 +98,7 @@ > <set from-field="receipt.orderItemSeqId" > field="newLookupMap.orderItemSeqId"/> > <find-by-primary-key entity-name="OrderItem" > map="newLookupMap" value-field="orderItem"/> > <if-compare field="orderItem.statusId" operator="not- > equals" value="ITEM_COMPLETED"> > - <if-compare-field field="orderItem.quantity" to- > field="totalsMap.${receipt.orderItemSeqId}" operator="less-equals" > type="BigDecimal"> > + <if-compare-field field="orderItem.quantity" to- > field="totalsMap.receipt.orderItemSeqId" operator="less-equals" > type="BigDecimal"> > <!-- update the status for the item --> > <set field="orderItem.statusId" > value="ITEM_COMPLETED"/> > <store-value value-field="orderItem"/> > > smime.p7s (3K) Download Attachment |
Jacopo,
totalsMap.${receipt.orderItemSeqId} should work on revision 764992 or later. If not, try totalsMap[receipt.orderItemSeqId] A good explanation can be found in section 1.5 and 1.6 of the UEL syntax documentation. -Adrian Jacopo Cappellato wrote: > Hi Adrian, > > could you please review the following change I did? Is it the correct > way to fix this issue? Do you think we should search for similar > patterns in the system and fix them? > > Thanks, > > Jacopo > > Begin forwarded message: > >> From: [hidden email] >> Date: April 20, 2009 4:19:28 PM GMT+02:00 >> To: [hidden email] >> Subject: svn commit: r766704 - >> /ofbiz/trunk/applications/order/script/org/ofbiz/order/order/OrderSimpleMethods.xml >> >> Reply-To: [hidden email] >> >> Author: jacopoc >> Date: Mon Apr 20 14:19:28 2009 >> New Revision: 766704 >> >> URL: http://svn.apache.org/viewvc?rev=766704&view=rev >> Log: >> Fixed code that was not working (I think) after recent implementation >> of UEL. >> >> Modified: >> >> ofbiz/trunk/applications/order/script/org/ofbiz/order/order/OrderSimpleMethods.xml >> >> >> Modified: >> ofbiz/trunk/applications/order/script/org/ofbiz/order/order/OrderSimpleMethods.xml >> >> URL: >> http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/script/org/ofbiz/order/order/OrderSimpleMethods.xml?rev=766704&r1=766703&r2=766704&view=diff >> >> ============================================================================== >> >> --- >> ofbiz/trunk/applications/order/script/org/ofbiz/order/order/OrderSimpleMethods.xml >> (original) >> +++ >> ofbiz/trunk/applications/order/script/org/ofbiz/order/order/OrderSimpleMethods.xml >> Mon Apr 20 14:19:28 2009 >> @@ -85,11 +85,11 @@ >> <field-map field-name="orderId" >> from-field="parameters.orderId"/> >> </entity-and> >> <iterate list="shipmentReceipts" entry="receipt"> >> - <if-empty field="totalsMap.${receipt.orderItemSeqId}"> >> - <set field="totalsMap.${receipt.orderItemSeqId}" >> value="0" type="BigDecimal"/> >> + <if-empty field="totalsMap.receipt.orderItemSeqId"> >> + <set field="totalsMap.receipt.orderItemSeqId" >> value="0" type="BigDecimal"/> >> </if-empty> >> - <calculate field="totalsMap.${receipt.orderItemSeqId}"> >> - <calcop field="totalsMap.${receipt.orderItemSeqId}" >> operator="add"> >> + <calculate field="totalsMap.receipt.orderItemSeqId"> >> + <calcop field="totalsMap.receipt.orderItemSeqId" >> operator="add"> >> <calcop field="receipt.quantityAccepted" >> operator="get"/> >> <calcop field="receipt.quantityRejected" >> operator="get"/> >> </calcop> >> @@ -98,7 +98,7 @@ >> <set from-field="receipt.orderItemSeqId" >> field="newLookupMap.orderItemSeqId"/> >> <find-by-primary-key entity-name="OrderItem" >> map="newLookupMap" value-field="orderItem"/> >> <if-compare field="orderItem.statusId" >> operator="not-equals" value="ITEM_COMPLETED"> >> - <if-compare-field field="orderItem.quantity" >> to-field="totalsMap.${receipt.orderItemSeqId}" operator="less-equals" >> type="BigDecimal"> >> + <if-compare-field field="orderItem.quantity" >> to-field="totalsMap.receipt.orderItemSeqId" operator="less-equals" >> type="BigDecimal"> >> <!-- update the status for the item --> >> <set field="orderItem.statusId" >> value="ITEM_COMPLETED"/> >> <store-value value-field="orderItem"/> >> >> > |
Hi Adrian,
On Apr 20, 2009, at 4:52 PM, Adrian Crum wrote: > Jacopo, > > totalsMap.${receipt.orderItemSeqId} > > should work on revision 764992 or later. If not, try > It is not working on trunk. > totalsMap[receipt.orderItemSeqId] > I will try the above solution and commit the change if it works. Jacopo > A good explanation can be found in section 1.5 and 1.6 of the UEL > syntax documentation. > > -Adrian > > > Jacopo Cappellato wrote: >> Hi Adrian, >> could you please review the following change I did? Is it the >> correct way to fix this issue? Do you think we should search for >> similar patterns in the system and fix them? >> Thanks, >> Jacopo >> Begin forwarded message: >>> From: [hidden email] >>> Date: April 20, 2009 4:19:28 PM GMT+02:00 >>> To: [hidden email] >>> Subject: svn commit: r766704 - /ofbiz/trunk/applications/order/ >>> script/org/ofbiz/order/order/OrderSimpleMethods.xml >>> Reply-To: [hidden email] >>> >>> Author: jacopoc >>> Date: Mon Apr 20 14:19:28 2009 >>> New Revision: 766704 >>> >>> URL: http://svn.apache.org/viewvc?rev=766704&view=rev >>> Log: >>> Fixed code that was not working (I think) after recent >>> implementation of UEL. >>> >>> Modified: >>> ofbiz/trunk/applications/order/script/org/ofbiz/order/order/ >>> OrderSimpleMethods.xml >>> >>> Modified: ofbiz/trunk/applications/order/script/org/ofbiz/order/ >>> order/OrderSimpleMethods.xml >>> URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/script/org/ofbiz/order/order/OrderSimpleMethods.xml?rev=766704&r1=766703&r2=766704&view=diff >>> = >>> = >>> = >>> = >>> = >>> = >>> = >>> = >>> = >>> = >>> ==================================================================== >>> --- ofbiz/trunk/applications/order/script/org/ofbiz/order/order/ >>> OrderSimpleMethods.xml (original) >>> +++ ofbiz/trunk/applications/order/script/org/ofbiz/order/order/ >>> OrderSimpleMethods.xml Mon Apr 20 14:19:28 2009 >>> @@ -85,11 +85,11 @@ >>> <field-map field-name="orderId" from- >>> field="parameters.orderId"/> >>> </entity-and> >>> <iterate list="shipmentReceipts" entry="receipt"> >>> - <if-empty field="totalsMap.${receipt.orderItemSeqId}"> >>> - <set field="totalsMap.${receipt.orderItemSeqId}" >>> value="0" type="BigDecimal"/> >>> + <if-empty field="totalsMap.receipt.orderItemSeqId"> >>> + <set field="totalsMap.receipt.orderItemSeqId" >>> value="0" type="BigDecimal"/> >>> </if-empty> >>> - <calculate field="totalsMap.${receipt.orderItemSeqId}"> >>> - <calcop field="totalsMap.$ >>> {receipt.orderItemSeqId}" operator="add"> >>> + <calculate field="totalsMap.receipt.orderItemSeqId"> >>> + <calcop field="totalsMap.receipt.orderItemSeqId" >>> operator="add"> >>> <calcop field="receipt.quantityAccepted" >>> operator="get"/> >>> <calcop field="receipt.quantityRejected" >>> operator="get"/> >>> </calcop> >>> @@ -98,7 +98,7 @@ >>> <set from-field="receipt.orderItemSeqId" >>> field="newLookupMap.orderItemSeqId"/> >>> <find-by-primary-key entity-name="OrderItem" >>> map="newLookupMap" value-field="orderItem"/> >>> <if-compare field="orderItem.statusId" operator="not- >>> equals" value="ITEM_COMPLETED"> >>> - <if-compare-field field="orderItem.quantity" to- >>> field="totalsMap.${receipt.orderItemSeqId}" operator="less-equals" >>> type="BigDecimal"> >>> + <if-compare-field field="orderItem.quantity" to- >>> field="totalsMap.receipt.orderItemSeqId" operator="less-equals" >>> type="BigDecimal"> >>> <!-- update the status for the item --> >>> <set field="orderItem.statusId" >>> value="ITEM_COMPLETED"/> >>> <store-value value-field="orderItem"/> >>> >>> smime.p7s (3K) Download Attachment |
In reply to this post by Adrian Crum
The safest syntax to use (but a bit cumbersome) is: field="totalsMap["receipt.orderItemSeqId"]" If it works without the " then all the better though! -David On Apr 20, 2009, at 8:52 AM, Adrian Crum wrote: > Jacopo, > > totalsMap.${receipt.orderItemSeqId} > > should work on revision 764992 or later. If not, try > > totalsMap[receipt.orderItemSeqId] > > A good explanation can be found in section 1.5 and 1.6 of the UEL > syntax documentation. > > -Adrian > > > Jacopo Cappellato wrote: >> Hi Adrian, >> could you please review the following change I did? Is it the >> correct way to fix this issue? Do you think we should search for >> similar patterns in the system and fix them? >> Thanks, >> Jacopo >> Begin forwarded message: >>> From: [hidden email] >>> Date: April 20, 2009 4:19:28 PM GMT+02:00 >>> To: [hidden email] >>> Subject: svn commit: r766704 - /ofbiz/trunk/applications/order/ >>> script/org/ofbiz/order/order/OrderSimpleMethods.xml >>> Reply-To: [hidden email] >>> >>> Author: jacopoc >>> Date: Mon Apr 20 14:19:28 2009 >>> New Revision: 766704 >>> >>> URL: http://svn.apache.org/viewvc?rev=766704&view=rev >>> Log: >>> Fixed code that was not working (I think) after recent >>> implementation of UEL. >>> >>> Modified: >>> ofbiz/trunk/applications/order/script/org/ofbiz/order/order/ >>> OrderSimpleMethods.xml >>> >>> Modified: ofbiz/trunk/applications/order/script/org/ofbiz/order/ >>> order/OrderSimpleMethods.xml >>> URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/script/org/ofbiz/order/order/OrderSimpleMethods.xml?rev=766704&r1=766703&r2=766704&view=diff >>> = >>> = >>> = >>> = >>> = >>> = >>> = >>> = >>> = >>> = >>> ==================================================================== >>> --- ofbiz/trunk/applications/order/script/org/ofbiz/order/order/ >>> OrderSimpleMethods.xml (original) >>> +++ ofbiz/trunk/applications/order/script/org/ofbiz/order/order/ >>> OrderSimpleMethods.xml Mon Apr 20 14:19:28 2009 >>> @@ -85,11 +85,11 @@ >>> <field-map field-name="orderId" from- >>> field="parameters.orderId"/> >>> </entity-and> >>> <iterate list="shipmentReceipts" entry="receipt"> >>> - <if-empty field="totalsMap.${receipt.orderItemSeqId}"> >>> - <set field="totalsMap.${receipt.orderItemSeqId}" >>> value="0" type="BigDecimal"/> >>> + <if-empty field="totalsMap.receipt.orderItemSeqId"> >>> + <set field="totalsMap.receipt.orderItemSeqId" >>> value="0" type="BigDecimal"/> >>> </if-empty> >>> - <calculate field="totalsMap.${receipt.orderItemSeqId}"> >>> - <calcop field="totalsMap.$ >>> {receipt.orderItemSeqId}" operator="add"> >>> + <calculate field="totalsMap.receipt.orderItemSeqId"> >>> + <calcop field="totalsMap.receipt.orderItemSeqId" >>> operator="add"> >>> <calcop field="receipt.quantityAccepted" >>> operator="get"/> >>> <calcop field="receipt.quantityRejected" >>> operator="get"/> >>> </calcop> >>> @@ -98,7 +98,7 @@ >>> <set from-field="receipt.orderItemSeqId" >>> field="newLookupMap.orderItemSeqId"/> >>> <find-by-primary-key entity-name="OrderItem" >>> map="newLookupMap" value-field="orderItem"/> >>> <if-compare field="orderItem.statusId" operator="not- >>> equals" value="ITEM_COMPLETED"> >>> - <if-compare-field field="orderItem.quantity" to- >>> field="totalsMap.${receipt.orderItemSeqId}" operator="less-equals" >>> type="BigDecimal"> >>> + <if-compare-field field="orderItem.quantity" to- >>> field="totalsMap.receipt.orderItemSeqId" operator="less-equals" >>> type="BigDecimal"> >>> <!-- update the status for the item --> >>> <set field="orderItem.statusId" >>> value="ITEM_COMPLETED"/> >>> <store-value value-field="orderItem"/> >>> >>> |
In reply to this post by Jacopo Cappellato-4
Just a quick note on syntax: there is a difference between these two. The first one "totalsMap.${receipt.orderItemSeqId}" is saying find an entry in the totalsMap Map with the key consisting of the value of the receipt.orderItemSeqId field. The second one "totalsMap.receipt.orderItemSeqId" is saying find an entry in the totalsMap Map with the key consisting of the value "receipt", and then results of that should be a Map and find an entry in that "totalsMap.receipt" Map that has a key of "orderItemSeqId". -David On Apr 20, 2009, at 8:22 AM, Jacopo Cappellato wrote: > Hi Adrian, > > could you please review the following change I did? Is it the > correct way to fix this issue? Do you think we should search for > similar patterns in the system and fix them? > > Thanks, > > Jacopo > > Begin forwarded message: > >> From: [hidden email] >> Date: April 20, 2009 4:19:28 PM GMT+02:00 >> To: [hidden email] >> Subject: svn commit: r766704 - /ofbiz/trunk/applications/order/ >> script/org/ofbiz/order/order/OrderSimpleMethods.xml >> Reply-To: [hidden email] >> >> Author: jacopoc >> Date: Mon Apr 20 14:19:28 2009 >> New Revision: 766704 >> >> URL: http://svn.apache.org/viewvc?rev=766704&view=rev >> Log: >> Fixed code that was not working (I think) after recent >> implementation of UEL. >> >> Modified: >> ofbiz/trunk/applications/order/script/org/ofbiz/order/order/ >> OrderSimpleMethods.xml >> >> Modified: ofbiz/trunk/applications/order/script/org/ofbiz/order/ >> order/OrderSimpleMethods.xml >> URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/script/org/ofbiz/order/order/OrderSimpleMethods.xml?rev=766704&r1=766703&r2=766704&view=diff >> = >> = >> = >> = >> = >> = >> = >> = >> = >> ===================================================================== >> --- ofbiz/trunk/applications/order/script/org/ofbiz/order/order/ >> OrderSimpleMethods.xml (original) >> +++ ofbiz/trunk/applications/order/script/org/ofbiz/order/order/ >> OrderSimpleMethods.xml Mon Apr 20 14:19:28 2009 >> @@ -85,11 +85,11 @@ >> <field-map field-name="orderId" from- >> field="parameters.orderId"/> >> </entity-and> >> <iterate list="shipmentReceipts" entry="receipt"> >> - <if-empty field="totalsMap.${receipt.orderItemSeqId}"> >> - <set field="totalsMap.${receipt.orderItemSeqId}" >> value="0" type="BigDecimal"/> >> + <if-empty field="totalsMap.receipt.orderItemSeqId"> >> + <set field="totalsMap.receipt.orderItemSeqId" >> value="0" type="BigDecimal"/> >> </if-empty> >> - <calculate field="totalsMap.${receipt.orderItemSeqId}"> >> - <calcop field="totalsMap.$ >> {receipt.orderItemSeqId}" operator="add"> >> + <calculate field="totalsMap.receipt.orderItemSeqId"> >> + <calcop field="totalsMap.receipt.orderItemSeqId" >> operator="add"> >> <calcop field="receipt.quantityAccepted" >> operator="get"/> >> <calcop field="receipt.quantityRejected" >> operator="get"/> >> </calcop> >> @@ -98,7 +98,7 @@ >> <set from-field="receipt.orderItemSeqId" >> field="newLookupMap.orderItemSeqId"/> >> <find-by-primary-key entity-name="OrderItem" >> map="newLookupMap" value-field="orderItem"/> >> <if-compare field="orderItem.statusId" operator="not- >> equals" value="ITEM_COMPLETED"> >> - <if-compare-field field="orderItem.quantity" to- >> field="totalsMap.${receipt.orderItemSeqId}" operator="less-equals" >> type="BigDecimal"> >> + <if-compare-field field="orderItem.quantity" to- >> field="totalsMap.receipt.orderItemSeqId" operator="less-equals" >> type="BigDecimal"> >> <!-- update the status for the item --> >> <set field="orderItem.statusId" >> value="ITEM_COMPLETED"/> >> <store-value value-field="orderItem"/> >> >> > |
In reply to this post by David E Jones-3
ok, thanks I will test both.
BTW it also worked in the way I have changed it in the commit (i.e. I was able to receive items in inventory with no errors)... but I didn't test it heavily, so I can't guarantee. :-) Jacopo On Apr 20, 2009, at 5:04 PM, David E Jones wrote: > > The safest syntax to use (but a bit cumbersome) is: > > field="totalsMap["receipt.orderItemSeqId"]" > > If it works without the " then all the better though! > > -David > > > On Apr 20, 2009, at 8:52 AM, Adrian Crum wrote: > >> Jacopo, >> >> totalsMap.${receipt.orderItemSeqId} >> >> should work on revision 764992 or later. If not, try >> >> totalsMap[receipt.orderItemSeqId] >> >> A good explanation can be found in section 1.5 and 1.6 of the UEL >> syntax documentation. >> >> -Adrian >> >> >> Jacopo Cappellato wrote: >>> Hi Adrian, >>> could you please review the following change I did? Is it the >>> correct way to fix this issue? Do you think we should search for >>> similar patterns in the system and fix them? >>> Thanks, >>> Jacopo >>> Begin forwarded message: >>>> From: [hidden email] >>>> Date: April 20, 2009 4:19:28 PM GMT+02:00 >>>> To: [hidden email] >>>> Subject: svn commit: r766704 - /ofbiz/trunk/applications/order/ >>>> script/org/ofbiz/order/order/OrderSimpleMethods.xml >>>> Reply-To: [hidden email] >>>> >>>> Author: jacopoc >>>> Date: Mon Apr 20 14:19:28 2009 >>>> New Revision: 766704 >>>> >>>> URL: http://svn.apache.org/viewvc?rev=766704&view=rev >>>> Log: >>>> Fixed code that was not working (I think) after recent >>>> implementation of UEL. >>>> >>>> Modified: >>>> ofbiz/trunk/applications/order/script/org/ofbiz/order/order/ >>>> OrderSimpleMethods.xml >>>> >>>> Modified: ofbiz/trunk/applications/order/script/org/ofbiz/order/ >>>> order/OrderSimpleMethods.xml >>>> URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/script/org/ofbiz/order/order/OrderSimpleMethods.xml?rev=766704&r1=766703&r2=766704&view=diff >>>> = >>>> = >>>> = >>>> = >>>> = >>>> = >>>> = >>>> = >>>> = >>>> = >>>> = >>>> =================================================================== >>>> --- ofbiz/trunk/applications/order/script/org/ofbiz/order/order/ >>>> OrderSimpleMethods.xml (original) >>>> +++ ofbiz/trunk/applications/order/script/org/ofbiz/order/order/ >>>> OrderSimpleMethods.xml Mon Apr 20 14:19:28 2009 >>>> @@ -85,11 +85,11 @@ >>>> <field-map field-name="orderId" from- >>>> field="parameters.orderId"/> >>>> </entity-and> >>>> <iterate list="shipmentReceipts" entry="receipt"> >>>> - <if-empty field="totalsMap.${receipt.orderItemSeqId}"> >>>> - <set field="totalsMap.${receipt.orderItemSeqId}" >>>> value="0" type="BigDecimal"/> >>>> + <if-empty field="totalsMap.receipt.orderItemSeqId"> >>>> + <set field="totalsMap.receipt.orderItemSeqId" >>>> value="0" type="BigDecimal"/> >>>> </if-empty> >>>> - <calculate field="totalsMap.$ >>>> {receipt.orderItemSeqId}"> >>>> - <calcop field="totalsMap.$ >>>> {receipt.orderItemSeqId}" operator="add"> >>>> + <calculate field="totalsMap.receipt.orderItemSeqId"> >>>> + <calcop field="totalsMap.receipt.orderItemSeqId" >>>> operator="add"> >>>> <calcop field="receipt.quantityAccepted" >>>> operator="get"/> >>>> <calcop field="receipt.quantityRejected" >>>> operator="get"/> >>>> </calcop> >>>> @@ -98,7 +98,7 @@ >>>> <set from-field="receipt.orderItemSeqId" >>>> field="newLookupMap.orderItemSeqId"/> >>>> <find-by-primary-key entity-name="OrderItem" >>>> map="newLookupMap" value-field="orderItem"/> >>>> <if-compare field="orderItem.statusId" operator="not- >>>> equals" value="ITEM_COMPLETED"> >>>> - <if-compare-field field="orderItem.quantity" to- >>>> field="totalsMap.${receipt.orderItemSeqId}" operator="less- >>>> equals" type="BigDecimal"> >>>> + <if-compare-field field="orderItem.quantity" to- >>>> field="totalsMap.receipt.orderItemSeqId" operator="less-equals" >>>> type="BigDecimal"> >>>> <!-- update the status for the item --> >>>> <set field="orderItem.statusId" >>>> value="ITEM_COMPLETED"/> >>>> <store-value value-field="orderItem"/> >>>> >>>> > smime.p7s (3K) Download Attachment |
In reply to this post by Jacopo Cappellato-4
Jacopo,
You're right. It looks like I'll need to hack the JUEL parser to get this to work. I was trying to avoid that, but I can't come up with any other solution. -Adrian Jacopo Cappellato wrote: > Hi Adrian, > > On Apr 20, 2009, at 4:52 PM, Adrian Crum wrote: > >> Jacopo, >> >> totalsMap.${receipt.orderItemSeqId} >> >> should work on revision 764992 or later. If not, try >> > > It is not working on trunk. > >> totalsMap[receipt.orderItemSeqId] >> > > I will try the above solution and commit the change if it works. > > Jacopo > >> A good explanation can be found in section 1.5 and 1.6 of the UEL >> syntax documentation. >> >> -Adrian >> >> >> Jacopo Cappellato wrote: >>> Hi Adrian, >>> could you please review the following change I did? Is it the correct >>> way to fix this issue? Do you think we should search for similar >>> patterns in the system and fix them? >>> Thanks, >>> Jacopo >>> Begin forwarded message: >>>> From: [hidden email] >>>> Date: April 20, 2009 4:19:28 PM GMT+02:00 >>>> To: [hidden email] >>>> Subject: svn commit: r766704 - >>>> /ofbiz/trunk/applications/order/script/org/ofbiz/order/order/OrderSimpleMethods.xml >>>> >>>> Reply-To: [hidden email] >>>> >>>> Author: jacopoc >>>> Date: Mon Apr 20 14:19:28 2009 >>>> New Revision: 766704 >>>> >>>> URL: http://svn.apache.org/viewvc?rev=766704&view=rev >>>> Log: >>>> Fixed code that was not working (I think) after recent >>>> implementation of UEL. >>>> >>>> Modified: >>>> >>>> ofbiz/trunk/applications/order/script/org/ofbiz/order/order/OrderSimpleMethods.xml >>>> >>>> >>>> Modified: >>>> ofbiz/trunk/applications/order/script/org/ofbiz/order/order/OrderSimpleMethods.xml >>>> >>>> URL: >>>> http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/script/org/ofbiz/order/order/OrderSimpleMethods.xml?rev=766704&r1=766703&r2=766704&view=diff >>>> >>>> ============================================================================== >>>> >>>> --- >>>> ofbiz/trunk/applications/order/script/org/ofbiz/order/order/OrderSimpleMethods.xml >>>> (original) >>>> +++ >>>> ofbiz/trunk/applications/order/script/org/ofbiz/order/order/OrderSimpleMethods.xml >>>> Mon Apr 20 14:19:28 2009 >>>> @@ -85,11 +85,11 @@ >>>> <field-map field-name="orderId" >>>> from-field="parameters.orderId"/> >>>> </entity-and> >>>> <iterate list="shipmentReceipts" entry="receipt"> >>>> - <if-empty field="totalsMap.${receipt.orderItemSeqId}"> >>>> - <set field="totalsMap.${receipt.orderItemSeqId}" >>>> value="0" type="BigDecimal"/> >>>> + <if-empty field="totalsMap.receipt.orderItemSeqId"> >>>> + <set field="totalsMap.receipt.orderItemSeqId" >>>> value="0" type="BigDecimal"/> >>>> </if-empty> >>>> - <calculate field="totalsMap.${receipt.orderItemSeqId}"> >>>> - <calcop field="totalsMap.${receipt.orderItemSeqId}" >>>> operator="add"> >>>> + <calculate field="totalsMap.receipt.orderItemSeqId"> >>>> + <calcop field="totalsMap.receipt.orderItemSeqId" >>>> operator="add"> >>>> <calcop field="receipt.quantityAccepted" >>>> operator="get"/> >>>> <calcop field="receipt.quantityRejected" >>>> operator="get"/> >>>> </calcop> >>>> @@ -98,7 +98,7 @@ >>>> <set from-field="receipt.orderItemSeqId" >>>> field="newLookupMap.orderItemSeqId"/> >>>> <find-by-primary-key entity-name="OrderItem" >>>> map="newLookupMap" value-field="orderItem"/> >>>> <if-compare field="orderItem.statusId" >>>> operator="not-equals" value="ITEM_COMPLETED"> >>>> - <if-compare-field field="orderItem.quantity" >>>> to-field="totalsMap.${receipt.orderItemSeqId}" >>>> operator="less-equals" type="BigDecimal"> >>>> + <if-compare-field field="orderItem.quantity" >>>> to-field="totalsMap.receipt.orderItemSeqId" operator="less-equals" >>>> type="BigDecimal"> >>>> <!-- update the status for the item --> >>>> <set field="orderItem.statusId" >>>> value="ITEM_COMPLETED"/> >>>> <store-value value-field="orderItem"/> >>>> >>>> > |
In reply to this post by David E Jones-3
ok, thanks for the extra explanation, now I see (please ignore my last
post) and I will fix it today. Jacopo On Apr 20, 2009, at 5:07 PM, David E Jones wrote: > > Just a quick note on syntax: there is a difference between these two. > > The first one "totalsMap.${receipt.orderItemSeqId}" is saying find > an entry in the totalsMap Map with the key consisting of the value > of the receipt.orderItemSeqId field. > > The second one "totalsMap.receipt.orderItemSeqId" is saying find an > entry in the totalsMap Map with the key consisting of the value > "receipt", and then results of that should be a Map and find an > entry in that "totalsMap.receipt" Map that has a key of > "orderItemSeqId". > > -David > > > On Apr 20, 2009, at 8:22 AM, Jacopo Cappellato wrote: > >> Hi Adrian, >> >> could you please review the following change I did? Is it the >> correct way to fix this issue? Do you think we should search for >> similar patterns in the system and fix them? >> >> Thanks, >> >> Jacopo >> >> Begin forwarded message: >> >>> From: [hidden email] >>> Date: April 20, 2009 4:19:28 PM GMT+02:00 >>> To: [hidden email] >>> Subject: svn commit: r766704 - /ofbiz/trunk/applications/order/ >>> script/org/ofbiz/order/order/OrderSimpleMethods.xml >>> Reply-To: [hidden email] >>> >>> Author: jacopoc >>> Date: Mon Apr 20 14:19:28 2009 >>> New Revision: 766704 >>> >>> URL: http://svn.apache.org/viewvc?rev=766704&view=rev >>> Log: >>> Fixed code that was not working (I think) after recent >>> implementation of UEL. >>> >>> Modified: >>> ofbiz/trunk/applications/order/script/org/ofbiz/order/order/ >>> OrderSimpleMethods.xml >>> >>> Modified: ofbiz/trunk/applications/order/script/org/ofbiz/order/ >>> order/OrderSimpleMethods.xml >>> URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/script/org/ofbiz/order/order/OrderSimpleMethods.xml?rev=766704&r1=766703&r2=766704&view=diff >>> = >>> = >>> = >>> = >>> = >>> = >>> = >>> = >>> = >>> = >>> ==================================================================== >>> --- ofbiz/trunk/applications/order/script/org/ofbiz/order/order/ >>> OrderSimpleMethods.xml (original) >>> +++ ofbiz/trunk/applications/order/script/org/ofbiz/order/order/ >>> OrderSimpleMethods.xml Mon Apr 20 14:19:28 2009 >>> @@ -85,11 +85,11 @@ >>> <field-map field-name="orderId" from- >>> field="parameters.orderId"/> >>> </entity-and> >>> <iterate list="shipmentReceipts" entry="receipt"> >>> - <if-empty field="totalsMap.${receipt.orderItemSeqId}"> >>> - <set field="totalsMap.${receipt.orderItemSeqId}" >>> value="0" type="BigDecimal"/> >>> + <if-empty field="totalsMap.receipt.orderItemSeqId"> >>> + <set field="totalsMap.receipt.orderItemSeqId" >>> value="0" type="BigDecimal"/> >>> </if-empty> >>> - <calculate field="totalsMap.${receipt.orderItemSeqId}"> >>> - <calcop field="totalsMap.$ >>> {receipt.orderItemSeqId}" operator="add"> >>> + <calculate field="totalsMap.receipt.orderItemSeqId"> >>> + <calcop field="totalsMap.receipt.orderItemSeqId" >>> operator="add"> >>> <calcop field="receipt.quantityAccepted" >>> operator="get"/> >>> <calcop field="receipt.quantityRejected" >>> operator="get"/> >>> </calcop> >>> @@ -98,7 +98,7 @@ >>> <set from-field="receipt.orderItemSeqId" >>> field="newLookupMap.orderItemSeqId"/> >>> <find-by-primary-key entity-name="OrderItem" >>> map="newLookupMap" value-field="orderItem"/> >>> <if-compare field="orderItem.statusId" operator="not- >>> equals" value="ITEM_COMPLETED"> >>> - <if-compare-field field="orderItem.quantity" to- >>> field="totalsMap.${receipt.orderItemSeqId}" operator="less-equals" >>> type="BigDecimal"> >>> + <if-compare-field field="orderItem.quantity" to- >>> field="totalsMap.receipt.orderItemSeqId" operator="less-equals" >>> type="BigDecimal"> >>> <!-- update the status for the item --> >>> <set field="orderItem.statusId" >>> value="ITEM_COMPLETED"/> >>> <store-value value-field="orderItem"/> >>> >>> >> > smime.p7s (3K) Download Attachment |
In reply to this post by Jacopo Cappellato-4
I just sent an email that commented more, but in short it may have run without errors, but I don't think it "worked". :) -David On Apr 20, 2009, at 9:09 AM, Jacopo Cappellato wrote: > ok, thanks I will test both. > > BTW it also worked in the way I have changed it in the commit (i.e. > I was able to receive items in inventory with no errors)... but I > didn't test it heavily, so I can't guarantee. :-) > > Jacopo > On Apr 20, 2009, at 5:04 PM, David E Jones wrote: > >> >> The safest syntax to use (but a bit cumbersome) is: >> >> field="totalsMap["receipt.orderItemSeqId"]" >> >> If it works without the " then all the better though! >> >> -David >> >> >> On Apr 20, 2009, at 8:52 AM, Adrian Crum wrote: >> >>> Jacopo, >>> >>> totalsMap.${receipt.orderItemSeqId} >>> >>> should work on revision 764992 or later. If not, try >>> >>> totalsMap[receipt.orderItemSeqId] >>> >>> A good explanation can be found in section 1.5 and 1.6 of the UEL >>> syntax documentation. >>> >>> -Adrian >>> >>> >>> Jacopo Cappellato wrote: >>>> Hi Adrian, >>>> could you please review the following change I did? Is it the >>>> correct way to fix this issue? Do you think we should search for >>>> similar patterns in the system and fix them? >>>> Thanks, >>>> Jacopo >>>> Begin forwarded message: >>>>> From: [hidden email] >>>>> Date: April 20, 2009 4:19:28 PM GMT+02:00 >>>>> To: [hidden email] >>>>> Subject: svn commit: r766704 - /ofbiz/trunk/applications/order/ >>>>> script/org/ofbiz/order/order/OrderSimpleMethods.xml >>>>> Reply-To: [hidden email] >>>>> >>>>> Author: jacopoc >>>>> Date: Mon Apr 20 14:19:28 2009 >>>>> New Revision: 766704 >>>>> >>>>> URL: http://svn.apache.org/viewvc?rev=766704&view=rev >>>>> Log: >>>>> Fixed code that was not working (I think) after recent >>>>> implementation of UEL. >>>>> >>>>> Modified: >>>>> ofbiz/trunk/applications/order/script/org/ofbiz/order/order/ >>>>> OrderSimpleMethods.xml >>>>> >>>>> Modified: ofbiz/trunk/applications/order/script/org/ofbiz/order/ >>>>> order/OrderSimpleMethods.xml >>>>> URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/script/org/ofbiz/order/order/OrderSimpleMethods.xml?rev=766704&r1=766703&r2=766704&view=diff >>>>> = >>>>> = >>>>> = >>>>> = >>>>> = >>>>> = >>>>> = >>>>> = >>>>> = >>>>> = >>>>> = >>>>> = >>>>> ================================================================== >>>>> --- ofbiz/trunk/applications/order/script/org/ofbiz/order/order/ >>>>> OrderSimpleMethods.xml (original) >>>>> +++ ofbiz/trunk/applications/order/script/org/ofbiz/order/order/ >>>>> OrderSimpleMethods.xml Mon Apr 20 14:19:28 2009 >>>>> @@ -85,11 +85,11 @@ >>>>> <field-map field-name="orderId" from- >>>>> field="parameters.orderId"/> >>>>> </entity-and> >>>>> <iterate list="shipmentReceipts" entry="receipt"> >>>>> - <if-empty field="totalsMap.$ >>>>> {receipt.orderItemSeqId}"> >>>>> - <set field="totalsMap.$ >>>>> {receipt.orderItemSeqId}" value="0" type="BigDecimal"/> >>>>> + <if-empty field="totalsMap.receipt.orderItemSeqId"> >>>>> + <set field="totalsMap.receipt.orderItemSeqId" >>>>> value="0" type="BigDecimal"/> >>>>> </if-empty> >>>>> - <calculate field="totalsMap.$ >>>>> {receipt.orderItemSeqId}"> >>>>> - <calcop field="totalsMap.$ >>>>> {receipt.orderItemSeqId}" operator="add"> >>>>> + <calculate field="totalsMap.receipt.orderItemSeqId"> >>>>> + <calcop >>>>> field="totalsMap.receipt.orderItemSeqId" operator="add"> >>>>> <calcop field="receipt.quantityAccepted" >>>>> operator="get"/> >>>>> <calcop field="receipt.quantityRejected" >>>>> operator="get"/> >>>>> </calcop> >>>>> @@ -98,7 +98,7 @@ >>>>> <set from-field="receipt.orderItemSeqId" >>>>> field="newLookupMap.orderItemSeqId"/> >>>>> <find-by-primary-key entity-name="OrderItem" >>>>> map="newLookupMap" value-field="orderItem"/> >>>>> <if-compare field="orderItem.statusId" operator="not- >>>>> equals" value="ITEM_COMPLETED"> >>>>> - <if-compare-field field="orderItem.quantity" to- >>>>> field="totalsMap.${receipt.orderItemSeqId}" operator="less- >>>>> equals" type="BigDecimal"> >>>>> + <if-compare-field field="orderItem.quantity" to- >>>>> field="totalsMap.receipt.orderItemSeqId" operator="less-equals" >>>>> type="BigDecimal"> >>>>> <!-- update the status for the item --> >>>>> <set field="orderItem.statusId" >>>>> value="ITEM_COMPLETED"/> >>>>> <store-value value-field="orderItem"/> >>>>> >>>>> >> > |
Administrator
|
In reply to this post by David E Jones-3
Thanks David,
I remember you already wrote that. Last time I searched I did not find the right syntax (because of the " I guess) Jacques From: "David E Jones" <[hidden email]> > > The safest syntax to use (but a bit cumbersome) is: > > field="totalsMap["receipt.orderItemSeqId"]" > > If it works without the " then all the better though! > > -David > > > On Apr 20, 2009, at 8:52 AM, Adrian Crum wrote: > >> Jacopo, >> >> totalsMap.${receipt.orderItemSeqId} >> >> should work on revision 764992 or later. If not, try >> >> totalsMap[receipt.orderItemSeqId] >> >> A good explanation can be found in section 1.5 and 1.6 of the UEL syntax documentation. >> >> -Adrian >> >> >> Jacopo Cappellato wrote: >>> Hi Adrian, >>> could you please review the following change I did? Is it the correct way to fix this issue? Do you think we should search for >>> similar patterns in the system and fix them? >>> Thanks, >>> Jacopo >>> Begin forwarded message: >>>> From: [hidden email] >>>> Date: April 20, 2009 4:19:28 PM GMT+02:00 >>>> To: [hidden email] >>>> Subject: svn commit: r766704 - /ofbiz/trunk/applications/order/ script/org/ofbiz/order/order/OrderSimpleMethods.xml >>>> Reply-To: [hidden email] >>>> >>>> Author: jacopoc >>>> Date: Mon Apr 20 14:19:28 2009 >>>> New Revision: 766704 >>>> >>>> URL: http://svn.apache.org/viewvc?rev=766704&view=rev >>>> Log: >>>> Fixed code that was not working (I think) after recent implementation of UEL. >>>> >>>> Modified: >>>> ofbiz/trunk/applications/order/script/org/ofbiz/order/order/ OrderSimpleMethods.xml >>>> >>>> Modified: ofbiz/trunk/applications/order/script/org/ofbiz/order/ order/OrderSimpleMethods.xml >>>> URL: >>>> http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/script/org/ofbiz/order/order/OrderSimpleMethods.xml?rev=766704&r1=766703&r2=766704&view=diff >>>> = = = = = = = = = = ==================================================================== >>>> --- ofbiz/trunk/applications/order/script/org/ofbiz/order/order/ OrderSimpleMethods.xml (original) >>>> +++ ofbiz/trunk/applications/order/script/org/ofbiz/order/order/ OrderSimpleMethods.xml Mon Apr 20 14:19:28 2009 >>>> @@ -85,11 +85,11 @@ >>>> <field-map field-name="orderId" from- field="parameters.orderId"/> >>>> </entity-and> >>>> <iterate list="shipmentReceipts" entry="receipt"> >>>> - <if-empty field="totalsMap.${receipt.orderItemSeqId}"> >>>> - <set field="totalsMap.${receipt.orderItemSeqId}" value="0" type="BigDecimal"/> >>>> + <if-empty field="totalsMap.receipt.orderItemSeqId"> >>>> + <set field="totalsMap.receipt.orderItemSeqId" value="0" type="BigDecimal"/> >>>> </if-empty> >>>> - <calculate field="totalsMap.${receipt.orderItemSeqId}"> >>>> - <calcop field="totalsMap.$ {receipt.orderItemSeqId}" operator="add"> >>>> + <calculate field="totalsMap.receipt.orderItemSeqId"> >>>> + <calcop field="totalsMap.receipt.orderItemSeqId" operator="add"> >>>> <calcop field="receipt.quantityAccepted" operator="get"/> >>>> <calcop field="receipt.quantityRejected" operator="get"/> >>>> </calcop> >>>> @@ -98,7 +98,7 @@ >>>> <set from-field="receipt.orderItemSeqId" field="newLookupMap.orderItemSeqId"/> >>>> <find-by-primary-key entity-name="OrderItem" map="newLookupMap" value-field="orderItem"/> >>>> <if-compare field="orderItem.statusId" operator="not- equals" value="ITEM_COMPLETED"> >>>> - <if-compare-field field="orderItem.quantity" to- field="totalsMap.${receipt.orderItemSeqId}" >>>> operator="less-equals" type="BigDecimal"> >>>> + <if-compare-field field="orderItem.quantity" to- field="totalsMap.receipt.orderItemSeqId" >>>> operator="less-equals" type="BigDecimal"> >>>> <!-- update the status for the item --> >>>> <set field="orderItem.statusId" value="ITEM_COMPLETED"/> >>>> <store-value value-field="orderItem"/> >>>> >>>> > |
I'd rather get the UEL code to work with the existing syntax. If
everyone could be patient, I should have this fixed soon. -Adrian Jacques Le Roux wrote: > Thanks David, > > I remember you already wrote that. Last time I searched I did not find > the right syntax (because of the " I guess) > > Jacques > > From: "David E Jones" <[hidden email]> >> >> The safest syntax to use (but a bit cumbersome) is: >> >> field="totalsMap["receipt.orderItemSeqId"]" >> >> If it works without the " then all the better though! >> >> -David >> >> >> On Apr 20, 2009, at 8:52 AM, Adrian Crum wrote: >> >>> Jacopo, >>> >>> totalsMap.${receipt.orderItemSeqId} >>> >>> should work on revision 764992 or later. If not, try >>> >>> totalsMap[receipt.orderItemSeqId] >>> >>> A good explanation can be found in section 1.5 and 1.6 of the UEL >>> syntax documentation. >>> >>> -Adrian >>> >>> >>> Jacopo Cappellato wrote: >>>> Hi Adrian, >>>> could you please review the following change I did? Is it the >>>> correct way to fix this issue? Do you think we should search for >>>> similar patterns in the system and fix them? >>>> Thanks, >>>> Jacopo >>>> Begin forwarded message: >>>>> From: [hidden email] >>>>> Date: April 20, 2009 4:19:28 PM GMT+02:00 >>>>> To: [hidden email] >>>>> Subject: svn commit: r766704 - /ofbiz/trunk/applications/order/ >>>>> script/org/ofbiz/order/order/OrderSimpleMethods.xml >>>>> Reply-To: [hidden email] >>>>> >>>>> Author: jacopoc >>>>> Date: Mon Apr 20 14:19:28 2009 >>>>> New Revision: 766704 >>>>> >>>>> URL: http://svn.apache.org/viewvc?rev=766704&view=rev >>>>> Log: >>>>> Fixed code that was not working (I think) after recent >>>>> implementation of UEL. >>>>> >>>>> Modified: >>>>> ofbiz/trunk/applications/order/script/org/ofbiz/order/order/ >>>>> OrderSimpleMethods.xml >>>>> >>>>> Modified: ofbiz/trunk/applications/order/script/org/ofbiz/order/ >>>>> order/OrderSimpleMethods.xml >>>>> URL: >>>>> http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/script/org/ofbiz/order/order/OrderSimpleMethods.xml?rev=766704&r1=766703&r2=766704&view=diff >>>>> >>>>> = = = = = = = = = = >>>>> ==================================================================== >>>>> --- ofbiz/trunk/applications/order/script/org/ofbiz/order/order/ >>>>> OrderSimpleMethods.xml (original) >>>>> +++ ofbiz/trunk/applications/order/script/org/ofbiz/order/order/ >>>>> OrderSimpleMethods.xml Mon Apr 20 14:19:28 2009 >>>>> @@ -85,11 +85,11 @@ >>>>> <field-map field-name="orderId" from- >>>>> field="parameters.orderId"/> >>>>> </entity-and> >>>>> <iterate list="shipmentReceipts" entry="receipt"> >>>>> - <if-empty field="totalsMap.${receipt.orderItemSeqId}"> >>>>> - <set field="totalsMap.${receipt.orderItemSeqId}" >>>>> value="0" type="BigDecimal"/> >>>>> + <if-empty field="totalsMap.receipt.orderItemSeqId"> >>>>> + <set field="totalsMap.receipt.orderItemSeqId" >>>>> value="0" type="BigDecimal"/> >>>>> </if-empty> >>>>> - <calculate field="totalsMap.${receipt.orderItemSeqId}"> >>>>> - <calcop field="totalsMap.$ >>>>> {receipt.orderItemSeqId}" operator="add"> >>>>> + <calculate field="totalsMap.receipt.orderItemSeqId"> >>>>> + <calcop field="totalsMap.receipt.orderItemSeqId" >>>>> operator="add"> >>>>> <calcop field="receipt.quantityAccepted" >>>>> operator="get"/> >>>>> <calcop field="receipt.quantityRejected" >>>>> operator="get"/> >>>>> </calcop> >>>>> @@ -98,7 +98,7 @@ >>>>> <set from-field="receipt.orderItemSeqId" >>>>> field="newLookupMap.orderItemSeqId"/> >>>>> <find-by-primary-key entity-name="OrderItem" >>>>> map="newLookupMap" value-field="orderItem"/> >>>>> <if-compare field="orderItem.statusId" operator="not- >>>>> equals" value="ITEM_COMPLETED"> >>>>> - <if-compare-field field="orderItem.quantity" to- >>>>> field="totalsMap.${receipt.orderItemSeqId}" operator="less-equals" >>>>> type="BigDecimal"> >>>>> + <if-compare-field field="orderItem.quantity" to- >>>>> field="totalsMap.receipt.orderItemSeqId" operator="less-equals" >>>>> type="BigDecimal"> >>>>> <!-- update the status for the item --> >>>>> <set field="orderItem.statusId" >>>>> value="ITEM_COMPLETED"/> >>>>> <store-value value-field="orderItem"/> >>>>> >>>>> >> > > > |
Administrator
|
Fix them all in 1 shoot : +1
Jacques From: "Adrian Crum" <[hidden email]> > I'd rather get the UEL code to work with the existing syntax. If everyone could be patient, I should have this fixed soon. > > -Adrian > > Jacques Le Roux wrote: >> Thanks David, >> >> I remember you already wrote that. Last time I searched I did not find the right syntax (because of the " I guess) >> >> Jacques >> >> From: "David E Jones" <[hidden email]> >>> >>> The safest syntax to use (but a bit cumbersome) is: >>> >>> field="totalsMap["receipt.orderItemSeqId"]" >>> >>> If it works without the " then all the better though! >>> >>> -David >>> >>> >>> On Apr 20, 2009, at 8:52 AM, Adrian Crum wrote: >>> >>>> Jacopo, >>>> >>>> totalsMap.${receipt.orderItemSeqId} >>>> >>>> should work on revision 764992 or later. If not, try >>>> >>>> totalsMap[receipt.orderItemSeqId] >>>> >>>> A good explanation can be found in section 1.5 and 1.6 of the UEL syntax documentation. >>>> >>>> -Adrian >>>> >>>> >>>> Jacopo Cappellato wrote: >>>>> Hi Adrian, >>>>> could you please review the following change I did? Is it the correct way to fix this issue? Do you think we should search >>>>> for similar patterns in the system and fix them? >>>>> Thanks, >>>>> Jacopo >>>>> Begin forwarded message: >>>>>> From: [hidden email] >>>>>> Date: April 20, 2009 4:19:28 PM GMT+02:00 >>>>>> To: [hidden email] >>>>>> Subject: svn commit: r766704 - /ofbiz/trunk/applications/order/ script/org/ofbiz/order/order/OrderSimpleMethods.xml >>>>>> Reply-To: [hidden email] >>>>>> >>>>>> Author: jacopoc >>>>>> Date: Mon Apr 20 14:19:28 2009 >>>>>> New Revision: 766704 >>>>>> >>>>>> URL: http://svn.apache.org/viewvc?rev=766704&view=rev >>>>>> Log: >>>>>> Fixed code that was not working (I think) after recent implementation of UEL. >>>>>> >>>>>> Modified: >>>>>> ofbiz/trunk/applications/order/script/org/ofbiz/order/order/ OrderSimpleMethods.xml >>>>>> >>>>>> Modified: ofbiz/trunk/applications/order/script/org/ofbiz/order/ order/OrderSimpleMethods.xml >>>>>> URL: >>>>>> http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/script/org/ofbiz/order/order/OrderSimpleMethods.xml?rev=766704&r1=766703&r2=766704&view=diff >>>>>> = = = = = = = = = = ==================================================================== >>>>>> --- ofbiz/trunk/applications/order/script/org/ofbiz/order/order/ OrderSimpleMethods.xml (original) >>>>>> +++ ofbiz/trunk/applications/order/script/org/ofbiz/order/order/ OrderSimpleMethods.xml Mon Apr 20 14:19:28 2009 >>>>>> @@ -85,11 +85,11 @@ >>>>>> <field-map field-name="orderId" from- field="parameters.orderId"/> >>>>>> </entity-and> >>>>>> <iterate list="shipmentReceipts" entry="receipt"> >>>>>> - <if-empty field="totalsMap.${receipt.orderItemSeqId}"> >>>>>> - <set field="totalsMap.${receipt.orderItemSeqId}" value="0" type="BigDecimal"/> >>>>>> + <if-empty field="totalsMap.receipt.orderItemSeqId"> >>>>>> + <set field="totalsMap.receipt.orderItemSeqId" value="0" type="BigDecimal"/> >>>>>> </if-empty> >>>>>> - <calculate field="totalsMap.${receipt.orderItemSeqId}"> >>>>>> - <calcop field="totalsMap.$ {receipt.orderItemSeqId}" operator="add"> >>>>>> + <calculate field="totalsMap.receipt.orderItemSeqId"> >>>>>> + <calcop field="totalsMap.receipt.orderItemSeqId" operator="add"> >>>>>> <calcop field="receipt.quantityAccepted" operator="get"/> >>>>>> <calcop field="receipt.quantityRejected" operator="get"/> >>>>>> </calcop> >>>>>> @@ -98,7 +98,7 @@ >>>>>> <set from-field="receipt.orderItemSeqId" field="newLookupMap.orderItemSeqId"/> >>>>>> <find-by-primary-key entity-name="OrderItem" map="newLookupMap" value-field="orderItem"/> >>>>>> <if-compare field="orderItem.statusId" operator="not- equals" value="ITEM_COMPLETED"> >>>>>> - <if-compare-field field="orderItem.quantity" to- field="totalsMap.${receipt.orderItemSeqId}" >>>>>> operator="less-equals" type="BigDecimal"> >>>>>> + <if-compare-field field="orderItem.quantity" to- field="totalsMap.receipt.orderItemSeqId" >>>>>> operator="less-equals" type="BigDecimal"> >>>>>> <!-- update the status for the item --> >>>>>> <set field="orderItem.statusId" value="ITEM_COMPLETED"/> >>>>>> <store-value value-field="orderItem"/> >>>>>> >>>>>> >>> >> >> >> > |
In reply to this post by Adrian Crum
This should be fixed in the trunk, rev 766827.
-Adrian Adrian Crum wrote: > I'd rather get the UEL code to work with the existing syntax. If > everyone could be patient, I should have this fixed soon. > > -Adrian > > Jacques Le Roux wrote: >> Thanks David, >> >> I remember you already wrote that. Last time I searched I did not find >> the right syntax (because of the " I guess) >> >> Jacques >> >> From: "David E Jones" <[hidden email]> >>> >>> The safest syntax to use (but a bit cumbersome) is: >>> >>> field="totalsMap["receipt.orderItemSeqId"]" >>> >>> If it works without the " then all the better though! >>> >>> -David >>> >>> >>> On Apr 20, 2009, at 8:52 AM, Adrian Crum wrote: >>> >>>> Jacopo, >>>> >>>> totalsMap.${receipt.orderItemSeqId} >>>> >>>> should work on revision 764992 or later. If not, try >>>> >>>> totalsMap[receipt.orderItemSeqId] >>>> >>>> A good explanation can be found in section 1.5 and 1.6 of the UEL >>>> syntax documentation. >>>> >>>> -Adrian >>>> >>>> >>>> Jacopo Cappellato wrote: >>>>> Hi Adrian, >>>>> could you please review the following change I did? Is it the >>>>> correct way to fix this issue? Do you think we should search for >>>>> similar patterns in the system and fix them? >>>>> Thanks, >>>>> Jacopo >>>>> Begin forwarded message: >>>>>> From: [hidden email] >>>>>> Date: April 20, 2009 4:19:28 PM GMT+02:00 >>>>>> To: [hidden email] >>>>>> Subject: svn commit: r766704 - /ofbiz/trunk/applications/order/ >>>>>> script/org/ofbiz/order/order/OrderSimpleMethods.xml >>>>>> Reply-To: [hidden email] >>>>>> >>>>>> Author: jacopoc >>>>>> Date: Mon Apr 20 14:19:28 2009 >>>>>> New Revision: 766704 >>>>>> >>>>>> URL: http://svn.apache.org/viewvc?rev=766704&view=rev >>>>>> Log: >>>>>> Fixed code that was not working (I think) after recent >>>>>> implementation of UEL. >>>>>> >>>>>> Modified: >>>>>> ofbiz/trunk/applications/order/script/org/ofbiz/order/order/ >>>>>> OrderSimpleMethods.xml >>>>>> >>>>>> Modified: ofbiz/trunk/applications/order/script/org/ofbiz/order/ >>>>>> order/OrderSimpleMethods.xml >>>>>> URL: >>>>>> http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/script/org/ofbiz/order/order/OrderSimpleMethods.xml?rev=766704&r1=766703&r2=766704&view=diff >>>>>> >>>>>> = = = = = = = = = = >>>>>> ==================================================================== >>>>>> --- ofbiz/trunk/applications/order/script/org/ofbiz/order/order/ >>>>>> OrderSimpleMethods.xml (original) >>>>>> +++ ofbiz/trunk/applications/order/script/org/ofbiz/order/order/ >>>>>> OrderSimpleMethods.xml Mon Apr 20 14:19:28 2009 >>>>>> @@ -85,11 +85,11 @@ >>>>>> <field-map field-name="orderId" from- >>>>>> field="parameters.orderId"/> >>>>>> </entity-and> >>>>>> <iterate list="shipmentReceipts" entry="receipt"> >>>>>> - <if-empty field="totalsMap.${receipt.orderItemSeqId}"> >>>>>> - <set field="totalsMap.${receipt.orderItemSeqId}" >>>>>> value="0" type="BigDecimal"/> >>>>>> + <if-empty field="totalsMap.receipt.orderItemSeqId"> >>>>>> + <set field="totalsMap.receipt.orderItemSeqId" >>>>>> value="0" type="BigDecimal"/> >>>>>> </if-empty> >>>>>> - <calculate field="totalsMap.${receipt.orderItemSeqId}"> >>>>>> - <calcop field="totalsMap.$ >>>>>> {receipt.orderItemSeqId}" operator="add"> >>>>>> + <calculate field="totalsMap.receipt.orderItemSeqId"> >>>>>> + <calcop field="totalsMap.receipt.orderItemSeqId" >>>>>> operator="add"> >>>>>> <calcop field="receipt.quantityAccepted" >>>>>> operator="get"/> >>>>>> <calcop field="receipt.quantityRejected" >>>>>> operator="get"/> >>>>>> </calcop> >>>>>> @@ -98,7 +98,7 @@ >>>>>> <set from-field="receipt.orderItemSeqId" >>>>>> field="newLookupMap.orderItemSeqId"/> >>>>>> <find-by-primary-key entity-name="OrderItem" >>>>>> map="newLookupMap" value-field="orderItem"/> >>>>>> <if-compare field="orderItem.statusId" operator="not- >>>>>> equals" value="ITEM_COMPLETED"> >>>>>> - <if-compare-field field="orderItem.quantity" to- >>>>>> field="totalsMap.${receipt.orderItemSeqId}" >>>>>> operator="less-equals" type="BigDecimal"> >>>>>> + <if-compare-field field="orderItem.quantity" to- >>>>>> field="totalsMap.receipt.orderItemSeqId" operator="less-equals" >>>>>> type="BigDecimal"> >>>>>> <!-- update the status for the item --> >>>>>> <set field="orderItem.statusId" >>>>>> value="ITEM_COMPLETED"/> >>>>>> <store-value value-field="orderItem"/> >>>>>> >>>>>> >>> >> >> >> > |
In reply to this post by Adrian Crum
Just a final note on this...
The expression totalsMap[receipt.orderItemSeqId] is the preferred syntax because it is UEL compliant. The expression totalsMap.${receipt.orderItemSeqId} works the same, but it is technically a nested expression (which is not UEL compliant) and it results in two expression expansions. That is because of how the OFBiz framework stores l-value expressions internally: ${totalsMap.${receipt.orderItemSeqId}} -Adrian Adrian Crum wrote: > Jacopo, > > totalsMap.${receipt.orderItemSeqId} > > should work on revision 764992 or later. If not, try > > totalsMap[receipt.orderItemSeqId] > > A good explanation can be found in section 1.5 and 1.6 of the UEL syntax > documentation. > > -Adrian > > > Jacopo Cappellato wrote: >> Hi Adrian, >> >> could you please review the following change I did? Is it the correct >> way to fix this issue? Do you think we should search for similar >> patterns in the system and fix them? >> >> Thanks, >> >> Jacopo >> >> Begin forwarded message: >> >>> From: [hidden email] >>> Date: April 20, 2009 4:19:28 PM GMT+02:00 >>> To: [hidden email] >>> Subject: svn commit: r766704 - >>> /ofbiz/trunk/applications/order/script/org/ofbiz/order/order/OrderSimpleMethods.xml >>> >>> Reply-To: [hidden email] >>> >>> Author: jacopoc >>> Date: Mon Apr 20 14:19:28 2009 >>> New Revision: 766704 >>> >>> URL: http://svn.apache.org/viewvc?rev=766704&view=rev >>> Log: >>> Fixed code that was not working (I think) after recent implementation >>> of UEL. >>> >>> Modified: >>> >>> ofbiz/trunk/applications/order/script/org/ofbiz/order/order/OrderSimpleMethods.xml >>> >>> >>> Modified: >>> ofbiz/trunk/applications/order/script/org/ofbiz/order/order/OrderSimpleMethods.xml >>> >>> URL: >>> http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/script/org/ofbiz/order/order/OrderSimpleMethods.xml?rev=766704&r1=766703&r2=766704&view=diff >>> >>> ============================================================================== >>> >>> --- >>> ofbiz/trunk/applications/order/script/org/ofbiz/order/order/OrderSimpleMethods.xml >>> (original) >>> +++ >>> ofbiz/trunk/applications/order/script/org/ofbiz/order/order/OrderSimpleMethods.xml >>> Mon Apr 20 14:19:28 2009 >>> @@ -85,11 +85,11 @@ >>> <field-map field-name="orderId" >>> from-field="parameters.orderId"/> >>> </entity-and> >>> <iterate list="shipmentReceipts" entry="receipt"> >>> - <if-empty field="totalsMap.${receipt.orderItemSeqId}"> >>> - <set field="totalsMap.${receipt.orderItemSeqId}" >>> value="0" type="BigDecimal"/> >>> + <if-empty field="totalsMap.receipt.orderItemSeqId"> >>> + <set field="totalsMap.receipt.orderItemSeqId" >>> value="0" type="BigDecimal"/> >>> </if-empty> >>> - <calculate field="totalsMap.${receipt.orderItemSeqId}"> >>> - <calcop field="totalsMap.${receipt.orderItemSeqId}" >>> operator="add"> >>> + <calculate field="totalsMap.receipt.orderItemSeqId"> >>> + <calcop field="totalsMap.receipt.orderItemSeqId" >>> operator="add"> >>> <calcop field="receipt.quantityAccepted" >>> operator="get"/> >>> <calcop field="receipt.quantityRejected" >>> operator="get"/> >>> </calcop> >>> @@ -98,7 +98,7 @@ >>> <set from-field="receipt.orderItemSeqId" >>> field="newLookupMap.orderItemSeqId"/> >>> <find-by-primary-key entity-name="OrderItem" >>> map="newLookupMap" value-field="orderItem"/> >>> <if-compare field="orderItem.statusId" >>> operator="not-equals" value="ITEM_COMPLETED"> >>> - <if-compare-field field="orderItem.quantity" >>> to-field="totalsMap.${receipt.orderItemSeqId}" operator="less-equals" >>> type="BigDecimal"> >>> + <if-compare-field field="orderItem.quantity" >>> to-field="totalsMap.receipt.orderItemSeqId" operator="less-equals" >>> type="BigDecimal"> >>> <!-- update the status for the item --> >>> <set field="orderItem.statusId" >>> value="ITEM_COMPLETED"/> >>> <store-value value-field="orderItem"/> >>> >>> >> > |
Administrator
|
Should we not rewrite it "correctly" and backport to 9.04 ?
Jacques From: "Adrian Crum" <[hidden email]> > Just a final note on this... > > The expression > > totalsMap[receipt.orderItemSeqId] > > is the preferred syntax because it is UEL compliant. The expression > > totalsMap.${receipt.orderItemSeqId} > > works the same, but it is technically a nested expression (which is not UEL compliant) and it results in two expression > expansions. That is because of how the OFBiz framework stores l-value expressions internally: > > ${totalsMap.${receipt.orderItemSeqId}} > > -Adrian > > > > Adrian Crum wrote: >> Jacopo, >> >> totalsMap.${receipt.orderItemSeqId} >> >> should work on revision 764992 or later. If not, try >> >> totalsMap[receipt.orderItemSeqId] >> >> A good explanation can be found in section 1.5 and 1.6 of the UEL syntax documentation. >> >> -Adrian >> >> >> Jacopo Cappellato wrote: >>> Hi Adrian, >>> >>> could you please review the following change I did? Is it the correct way to fix this issue? Do you think we should search for >>> similar patterns in the system and fix them? >>> >>> Thanks, >>> >>> Jacopo >>> >>> Begin forwarded message: >>> >>>> From: [hidden email] >>>> Date: April 20, 2009 4:19:28 PM GMT+02:00 >>>> To: [hidden email] >>>> Subject: svn commit: r766704 - /ofbiz/trunk/applications/order/script/org/ofbiz/order/order/OrderSimpleMethods.xml >>>> Reply-To: [hidden email] >>>> >>>> Author: jacopoc >>>> Date: Mon Apr 20 14:19:28 2009 >>>> New Revision: 766704 >>>> >>>> URL: http://svn.apache.org/viewvc?rev=766704&view=rev >>>> Log: >>>> Fixed code that was not working (I think) after recent implementation of UEL. >>>> >>>> Modified: >>>> ofbiz/trunk/applications/order/script/org/ofbiz/order/order/OrderSimpleMethods.xml >>>> >>>> Modified: ofbiz/trunk/applications/order/script/org/ofbiz/order/order/OrderSimpleMethods.xml >>>> URL: >>>> http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/script/org/ofbiz/order/order/OrderSimpleMethods.xml?rev=766704&r1=766703&r2=766704&view=diff >>>> ============================================================================== >>>> --- >>>> ofbiz/trunk/applications/order/script/org/ofbiz/order/order/OrderSimpleMethods.xml (original) >>>> +++ ofbiz/trunk/applications/order/script/org/ofbiz/order/order/OrderSimpleMethods.xml Mon Apr 20 14:19:28 2009 >>>> @@ -85,11 +85,11 @@ >>>> <field-map field-name="orderId" from-field="parameters.orderId"/> >>>> </entity-and> >>>> <iterate list="shipmentReceipts" entry="receipt"> >>>> - <if-empty field="totalsMap.${receipt.orderItemSeqId}"> >>>> - <set field="totalsMap.${receipt.orderItemSeqId}" value="0" type="BigDecimal"/> >>>> + <if-empty field="totalsMap.receipt.orderItemSeqId"> >>>> + <set field="totalsMap.receipt.orderItemSeqId" value="0" type="BigDecimal"/> >>>> </if-empty> >>>> - <calculate field="totalsMap.${receipt.orderItemSeqId}"> >>>> - <calcop field="totalsMap.${receipt.orderItemSeqId}" operator="add"> >>>> + <calculate field="totalsMap.receipt.orderItemSeqId"> >>>> + <calcop field="totalsMap.receipt.orderItemSeqId" operator="add"> >>>> <calcop field="receipt.quantityAccepted" operator="get"/> >>>> <calcop field="receipt.quantityRejected" operator="get"/> >>>> </calcop> >>>> @@ -98,7 +98,7 @@ >>>> <set from-field="receipt.orderItemSeqId" field="newLookupMap.orderItemSeqId"/> >>>> <find-by-primary-key entity-name="OrderItem" map="newLookupMap" value-field="orderItem"/> >>>> <if-compare field="orderItem.statusId" operator="not-equals" value="ITEM_COMPLETED"> >>>> - <if-compare-field field="orderItem.quantity" to-field="totalsMap.${receipt.orderItemSeqId}" >>>> operator="less-equals" type="BigDecimal"> >>>> + <if-compare-field field="orderItem.quantity" to-field="totalsMap.receipt.orderItemSeqId" >>>> operator="less-equals" type="BigDecimal"> >>>> <!-- update the status for the item --> >>>> <set field="orderItem.statusId" value="ITEM_COMPLETED"/> >>>> <store-value value-field="orderItem"/> >>>> >>>> >>> >> > |
I'm thinking of it more as a "Best Practice" - try to use the preferred
syntax from now on. There's no need to make global changes to the release unless something is broken. -Adrian Jacques Le Roux wrote: > Should we not rewrite it "correctly" and backport to 9.04 ? > > Jacques > > From: "Adrian Crum" <[hidden email]> >> Just a final note on this... >> >> The expression >> >> totalsMap[receipt.orderItemSeqId] >> >> is the preferred syntax because it is UEL compliant. The expression >> >> totalsMap.${receipt.orderItemSeqId} >> >> works the same, but it is technically a nested expression (which is >> not UEL compliant) and it results in two expression expansions. That >> is because of how the OFBiz framework stores l-value expressions >> internally: >> >> ${totalsMap.${receipt.orderItemSeqId}} >> >> -Adrian >> >> >> >> Adrian Crum wrote: >>> Jacopo, >>> >>> totalsMap.${receipt.orderItemSeqId} >>> >>> should work on revision 764992 or later. If not, try >>> >>> totalsMap[receipt.orderItemSeqId] >>> >>> A good explanation can be found in section 1.5 and 1.6 of the UEL >>> syntax documentation. >>> >>> -Adrian >>> >>> >>> Jacopo Cappellato wrote: >>>> Hi Adrian, >>>> >>>> could you please review the following change I did? Is it the >>>> correct way to fix this issue? Do you think we should search for >>>> similar patterns in the system and fix them? >>>> >>>> Thanks, >>>> >>>> Jacopo >>>> >>>> Begin forwarded message: >>>> >>>>> From: [hidden email] >>>>> Date: April 20, 2009 4:19:28 PM GMT+02:00 >>>>> To: [hidden email] >>>>> Subject: svn commit: r766704 - >>>>> /ofbiz/trunk/applications/order/script/org/ofbiz/order/order/OrderSimpleMethods.xml >>>>> >>>>> Reply-To: [hidden email] >>>>> >>>>> Author: jacopoc >>>>> Date: Mon Apr 20 14:19:28 2009 >>>>> New Revision: 766704 >>>>> >>>>> URL: http://svn.apache.org/viewvc?rev=766704&view=rev >>>>> Log: >>>>> Fixed code that was not working (I think) after recent >>>>> implementation of UEL. >>>>> >>>>> Modified: >>>>> >>>>> ofbiz/trunk/applications/order/script/org/ofbiz/order/order/OrderSimpleMethods.xml >>>>> >>>>> >>>>> Modified: >>>>> ofbiz/trunk/applications/order/script/org/ofbiz/order/order/OrderSimpleMethods.xml >>>>> >>>>> URL: >>>>> http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/script/org/ofbiz/order/order/OrderSimpleMethods.xml?rev=766704&r1=766703&r2=766704&view=diff >>>>> >>>>> ============================================================================== >>>>> >>>>> --- >>>>> ofbiz/trunk/applications/order/script/org/ofbiz/order/order/OrderSimpleMethods.xml >>>>> (original) >>>>> +++ >>>>> ofbiz/trunk/applications/order/script/org/ofbiz/order/order/OrderSimpleMethods.xml >>>>> Mon Apr 20 14:19:28 2009 >>>>> @@ -85,11 +85,11 @@ >>>>> <field-map field-name="orderId" >>>>> from-field="parameters.orderId"/> >>>>> </entity-and> >>>>> <iterate list="shipmentReceipts" entry="receipt"> >>>>> - <if-empty field="totalsMap.${receipt.orderItemSeqId}"> >>>>> - <set field="totalsMap.${receipt.orderItemSeqId}" >>>>> value="0" type="BigDecimal"/> >>>>> + <if-empty field="totalsMap.receipt.orderItemSeqId"> >>>>> + <set field="totalsMap.receipt.orderItemSeqId" >>>>> value="0" type="BigDecimal"/> >>>>> </if-empty> >>>>> - <calculate field="totalsMap.${receipt.orderItemSeqId}"> >>>>> - <calcop >>>>> field="totalsMap.${receipt.orderItemSeqId}" operator="add"> >>>>> + <calculate field="totalsMap.receipt.orderItemSeqId"> >>>>> + <calcop field="totalsMap.receipt.orderItemSeqId" >>>>> operator="add"> >>>>> <calcop field="receipt.quantityAccepted" >>>>> operator="get"/> >>>>> <calcop field="receipt.quantityRejected" >>>>> operator="get"/> >>>>> </calcop> >>>>> @@ -98,7 +98,7 @@ >>>>> <set from-field="receipt.orderItemSeqId" >>>>> field="newLookupMap.orderItemSeqId"/> >>>>> <find-by-primary-key entity-name="OrderItem" >>>>> map="newLookupMap" value-field="orderItem"/> >>>>> <if-compare field="orderItem.statusId" >>>>> operator="not-equals" value="ITEM_COMPLETED"> >>>>> - <if-compare-field field="orderItem.quantity" >>>>> to-field="totalsMap.${receipt.orderItemSeqId}" >>>>> operator="less-equals" type="BigDecimal"> >>>>> + <if-compare-field field="orderItem.quantity" >>>>> to-field="totalsMap.receipt.orderItemSeqId" operator="less-equals" >>>>> type="BigDecimal"> >>>>> <!-- update the status for the item --> >>>>> <set field="orderItem.statusId" >>>>> value="ITEM_COMPLETED"/> >>>>> <store-value value-field="orderItem"/> >>>>> >>>>> >>>> >>> >> > > > |
Thanks Adrian,
I have reverted my "fix" now. Jacopo On Apr 20, 2009, at 10:51 PM, Adrian Crum wrote: > I'm thinking of it more as a "Best Practice" - try to use the > preferred syntax from now on. There's no need to make global changes > to the release unless something is broken. > > -Adrian > > Jacques Le Roux wrote: >> Should we not rewrite it "correctly" and backport to 9.04 ? >> Jacques >> From: "Adrian Crum" <[hidden email]> >>> Just a final note on this... >>> >>> The expression >>> >>> totalsMap[receipt.orderItemSeqId] >>> >>> is the preferred syntax because it is UEL compliant. The expression >>> >>> totalsMap.${receipt.orderItemSeqId} >>> >>> works the same, but it is technically a nested expression (which >>> is not UEL compliant) and it results in two expression expansions. >>> That is because of how the OFBiz framework stores l-value >>> expressions internally: >>> >>> ${totalsMap.${receipt.orderItemSeqId}} >>> >>> -Adrian >>> >>> >>> >>> Adrian Crum wrote: >>>> Jacopo, >>>> >>>> totalsMap.${receipt.orderItemSeqId} >>>> >>>> should work on revision 764992 or later. If not, try >>>> >>>> totalsMap[receipt.orderItemSeqId] >>>> >>>> A good explanation can be found in section 1.5 and 1.6 of the UEL >>>> syntax documentation. >>>> >>>> -Adrian >>>> >>>> >>>> Jacopo Cappellato wrote: >>>>> Hi Adrian, >>>>> >>>>> could you please review the following change I did? Is it the >>>>> correct way to fix this issue? Do you think we should search for >>>>> similar patterns in the system and fix them? >>>>> >>>>> Thanks, >>>>> >>>>> Jacopo >>>>> >>>>> Begin forwarded message: >>>>> >>>>>> From: [hidden email] >>>>>> Date: April 20, 2009 4:19:28 PM GMT+02:00 >>>>>> To: [hidden email] >>>>>> Subject: svn commit: r766704 - /ofbiz/trunk/applications/order/ >>>>>> script/org/ofbiz/order/order/OrderSimpleMethods.xml >>>>>> Reply-To: [hidden email] >>>>>> >>>>>> Author: jacopoc >>>>>> Date: Mon Apr 20 14:19:28 2009 >>>>>> New Revision: 766704 >>>>>> >>>>>> URL: http://svn.apache.org/viewvc?rev=766704&view=rev >>>>>> Log: >>>>>> Fixed code that was not working (I think) after recent >>>>>> implementation of UEL. >>>>>> >>>>>> Modified: >>>>>> ofbiz/trunk/applications/order/script/org/ofbiz/order/order/ >>>>>> OrderSimpleMethods.xml >>>>>> >>>>>> Modified: ofbiz/trunk/applications/order/script/org/ofbiz/order/ >>>>>> order/OrderSimpleMethods.xml >>>>>> URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/script/org/ofbiz/order/order/OrderSimpleMethods.xml?rev=766704&r1=766703&r2=766704&view=diff >>>>>> = >>>>>> = >>>>>> = >>>>>> = >>>>>> = >>>>>> = >>>>>> = >>>>>> = >>>>>> = >>>>>> = >>>>>> = >>>>>> = >>>>>> = >>>>>> ================================================================= >>>>>> --- ofbiz/trunk/applications/order/script/org/ofbiz/order/order/ >>>>>> OrderSimpleMethods.xml (original) >>>>>> +++ ofbiz/trunk/applications/order/script/org/ofbiz/order/order/ >>>>>> OrderSimpleMethods.xml Mon Apr 20 14:19:28 2009 >>>>>> @@ -85,11 +85,11 @@ >>>>>> <field-map field-name="orderId" from- >>>>>> field="parameters.orderId"/> >>>>>> </entity-and> >>>>>> <iterate list="shipmentReceipts" entry="receipt"> >>>>>> - <if-empty field="totalsMap.$ >>>>>> {receipt.orderItemSeqId}"> >>>>>> - <set field="totalsMap.$ >>>>>> {receipt.orderItemSeqId}" value="0" type="BigDecimal"/> >>>>>> + <if-empty field="totalsMap.receipt.orderItemSeqId"> >>>>>> + <set field="totalsMap.receipt.orderItemSeqId" >>>>>> value="0" type="BigDecimal"/> >>>>>> </if-empty> >>>>>> - <calculate field="totalsMap.$ >>>>>> {receipt.orderItemSeqId}"> >>>>>> - <calcop field="totalsMap.$ >>>>>> {receipt.orderItemSeqId}" operator="add"> >>>>>> + <calculate field="totalsMap.receipt.orderItemSeqId"> >>>>>> + <calcop >>>>>> field="totalsMap.receipt.orderItemSeqId" operator="add"> >>>>>> <calcop field="receipt.quantityAccepted" >>>>>> operator="get"/> >>>>>> <calcop field="receipt.quantityRejected" >>>>>> operator="get"/> >>>>>> </calcop> >>>>>> @@ -98,7 +98,7 @@ >>>>>> <set from-field="receipt.orderItemSeqId" >>>>>> field="newLookupMap.orderItemSeqId"/> >>>>>> <find-by-primary-key entity-name="OrderItem" >>>>>> map="newLookupMap" value-field="orderItem"/> >>>>>> <if-compare field="orderItem.statusId" operator="not- >>>>>> equals" value="ITEM_COMPLETED"> >>>>>> - <if-compare-field field="orderItem.quantity" >>>>>> to-field="totalsMap.${receipt.orderItemSeqId}" operator="less- >>>>>> equals" type="BigDecimal"> >>>>>> + <if-compare-field field="orderItem.quantity" >>>>>> to-field="totalsMap.receipt.orderItemSeqId" operator="less- >>>>>> equals" type="BigDecimal"> >>>>>> <!-- update the status for the item --> >>>>>> <set field="orderItem.statusId" >>>>>> value="ITEM_COMPLETED"/> >>>>>> <store-value value-field="orderItem"/> >>>>>> >>>>>> >>>>> >>>> >>> smime.p7s (3K) Download Attachment |
Administrator
|
In reply to this post by Adrian Crum
Yes, I thought at it after and remembered I even suggested the one shoot fix all ;o)
Thanks Jacques From: "Adrian Crum" <[hidden email]> > I'm thinking of it more as a "Best Practice" - try to use the preferred syntax from now on. There's no need to make global changes > to the release unless something is broken. > > -Adrian > > Jacques Le Roux wrote: >> Should we not rewrite it "correctly" and backport to 9.04 ? >> >> Jacques >> >> From: "Adrian Crum" <[hidden email]> >>> Just a final note on this... >>> >>> The expression >>> >>> totalsMap[receipt.orderItemSeqId] >>> >>> is the preferred syntax because it is UEL compliant. The expression >>> >>> totalsMap.${receipt.orderItemSeqId} >>> >>> works the same, but it is technically a nested expression (which is not UEL compliant) and it results in two expression >>> expansions. That is because of how the OFBiz framework stores l-value expressions internally: >>> >>> ${totalsMap.${receipt.orderItemSeqId}} >>> >>> -Adrian >>> >>> >>> >>> Adrian Crum wrote: >>>> Jacopo, >>>> >>>> totalsMap.${receipt.orderItemSeqId} >>>> >>>> should work on revision 764992 or later. If not, try >>>> >>>> totalsMap[receipt.orderItemSeqId] >>>> >>>> A good explanation can be found in section 1.5 and 1.6 of the UEL syntax documentation. >>>> >>>> -Adrian >>>> >>>> >>>> Jacopo Cappellato wrote: >>>>> Hi Adrian, >>>>> >>>>> could you please review the following change I did? Is it the correct way to fix this issue? Do you think we should search for >>>>> similar patterns in the system and fix them? >>>>> >>>>> Thanks, >>>>> >>>>> Jacopo >>>>> >>>>> Begin forwarded message: >>>>> >>>>>> From: [hidden email] >>>>>> Date: April 20, 2009 4:19:28 PM GMT+02:00 >>>>>> To: [hidden email] >>>>>> Subject: svn commit: r766704 - /ofbiz/trunk/applications/order/script/org/ofbiz/order/order/OrderSimpleMethods.xml >>>>>> Reply-To: [hidden email] >>>>>> >>>>>> Author: jacopoc >>>>>> Date: Mon Apr 20 14:19:28 2009 >>>>>> New Revision: 766704 >>>>>> >>>>>> URL: http://svn.apache.org/viewvc?rev=766704&view=rev >>>>>> Log: >>>>>> Fixed code that was not working (I think) after recent implementation of UEL. >>>>>> >>>>>> Modified: >>>>>> ofbiz/trunk/applications/order/script/org/ofbiz/order/order/OrderSimpleMethods.xml >>>>>> >>>>>> Modified: ofbiz/trunk/applications/order/script/org/ofbiz/order/order/OrderSimpleMethods.xml >>>>>> URL: >>>>>> http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/script/org/ofbiz/order/order/OrderSimpleMethods.xml?rev=766704&r1=766703&r2=766704&view=diff >>>>>> ============================================================================== >>>>>> --- >>>>>> ofbiz/trunk/applications/order/script/org/ofbiz/order/order/OrderSimpleMethods.xml (original) >>>>>> +++ ofbiz/trunk/applications/order/script/org/ofbiz/order/order/OrderSimpleMethods.xml Mon Apr 20 14:19:28 2009 >>>>>> @@ -85,11 +85,11 @@ >>>>>> <field-map field-name="orderId" from-field="parameters.orderId"/> >>>>>> </entity-and> >>>>>> <iterate list="shipmentReceipts" entry="receipt"> >>>>>> - <if-empty field="totalsMap.${receipt.orderItemSeqId}"> >>>>>> - <set field="totalsMap.${receipt.orderItemSeqId}" value="0" type="BigDecimal"/> >>>>>> + <if-empty field="totalsMap.receipt.orderItemSeqId"> >>>>>> + <set field="totalsMap.receipt.orderItemSeqId" value="0" type="BigDecimal"/> >>>>>> </if-empty> >>>>>> - <calculate field="totalsMap.${receipt.orderItemSeqId}"> >>>>>> - <calcop field="totalsMap.${receipt.orderItemSeqId}" operator="add"> >>>>>> + <calculate field="totalsMap.receipt.orderItemSeqId"> >>>>>> + <calcop field="totalsMap.receipt.orderItemSeqId" operator="add"> >>>>>> <calcop field="receipt.quantityAccepted" operator="get"/> >>>>>> <calcop field="receipt.quantityRejected" operator="get"/> >>>>>> </calcop> >>>>>> @@ -98,7 +98,7 @@ >>>>>> <set from-field="receipt.orderItemSeqId" field="newLookupMap.orderItemSeqId"/> >>>>>> <find-by-primary-key entity-name="OrderItem" map="newLookupMap" value-field="orderItem"/> >>>>>> <if-compare field="orderItem.statusId" operator="not-equals" value="ITEM_COMPLETED"> >>>>>> - <if-compare-field field="orderItem.quantity" to-field="totalsMap.${receipt.orderItemSeqId}" >>>>>> operator="less-equals" type="BigDecimal"> >>>>>> + <if-compare-field field="orderItem.quantity" to-field="totalsMap.receipt.orderItemSeqId" >>>>>> operator="less-equals" type="BigDecimal"> >>>>>> <!-- update the status for the item --> >>>>>> <set field="orderItem.statusId" value="ITEM_COMPLETED"/> >>>>>> <store-value value-field="orderItem"/> >>>>>> >>>>>> >>>>> >>>> >>> >> >> >> > |
Free forum by Nabble | Edit this page |