Are you sure this is correct?
In the original comparison there is a 'not' around the 'or' which i do not see in the UEL.... I also do not see much advantages in these kind of changes they only can create problems.... Regards, Hans On Fri, 2009-07-17 at 10:23 +0000, [hidden email] wrote: > Author: apatel > Date: Fri Jul 17 10:23:56 2009 > New Revision: 795030 > > URL: http://svn.apache.org/viewvc?rev=795030&view=rev > Log: > Minor code improvements, now using UEL. Thanks Rishi for working on it. > > Modified: > ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/finaccount/FinAccountServices.xml > > Modified: ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/finaccount/FinAccountServices.xml > URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/finaccount/FinAccountServices.xml?rev=795030&r1=795029&r2=795030&view=diff > ============================================================================== > --- ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/finaccount/FinAccountServices.xml (original) > +++ ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/finaccount/FinAccountServices.xml Fri Jul 17 10:23:56 2009 > @@ -391,19 +391,10 @@ > <add-error><fail-property resource="AccountingUiLabels" property="AccountingPaymentAlreadyAssociatedToFinAccountError"/></add-error> > </if-not-empty> > <check-errors/> > - <if> > - <condition> > - <not> > - <or> > - <if-compare field="payment.statusId" operator="equals" value="PMNT_SENT"/> > - <if-compare field="payment.statusId" operator="equals" value="PMNT_RECEIVED"/> > - </or> > - </not> > - </condition> > - <then> > - <add-error><fail-property resource="AccountingUiLabels" property="AccountingPaymentStatusIsNotReceivedOrSentError"/></add-error> > - </then> > - </if> > + <set field="isValidStatus" value="${payment.statusId == 'PMNT_SENT' @or payment.statusId == 'PMNT_RECEIVED'}" type="Boolean"/> > + <if-compare field="isValidStatus" operator="equals" value="false"> > + <add-error><fail-property resource="AccountingUiLabels" property="AccountingPaymentStatusIsNotReceivedOrSentError"/></add-error> > + </if-compare> > <check-errors/> > </iterate> > <if-compare field="parameters.groupInOneTransaction" operator="equals" value="Y"> > > Antwebsystems.com: Quality OFBiz services for competitive rates |
Comments Inline :-
Hans Bakker wrote: > Are you sure this is correct? > > In the original comparison there is a 'not' around the 'or' which i do > not see in the UEL.... > > I also do not see much advantages in these kind of changes they only can > create problems.... > > Regards, > Hans > > > > > On Fri, 2009-07-17 at 10:23 +0000, [hidden email] wrote: > >> Author: apatel >> Date: Fri Jul 17 10:23:56 2009 >> New Revision: 795030 >> >> URL: http://svn.apache.org/viewvc?rev=795030&view=rev >> Log: >> Minor code improvements, now using UEL. Thanks Rishi for working on it. >> >> Modified: >> ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/finaccount/FinAccountServices.xml >> >> Modified: ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/finaccount/FinAccountServices.xml >> URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/finaccount/FinAccountServices.xml?rev=795030&r1=795029&r2=795030&view=diff >> ============================================================================== >> --- ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/finaccount/FinAccountServices.xml (original) >> +++ ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/finaccount/FinAccountServices.xml Fri Jul 17 10:23:56 2009 >> @@ -391,19 +391,10 @@ >> <add-error><fail-property resource="AccountingUiLabels" property="AccountingPaymentAlreadyAssociatedToFinAccountError"/></add-error> >> </if-not-empty> >> <check-errors/> >> - <if> >> - <condition> >> - <not> >> - <or> >> - <if-compare field="payment.statusId" operator="equals" value="PMNT_SENT"/> >> - <if-compare field="payment.statusId" operator="equals" value="PMNT_RECEIVED"/> >> - </or> >> - </not> >> - </condition> >> - <then> >> - <add-error><fail-property resource="AccountingUiLabels" property="AccountingPaymentStatusIsNotReceivedOrSentError"/></add-error> >> - </then> >> - </if> >> + <set field="isValidStatus" value="${payment.statusId == 'PMNT_SENT' @or payment.statusId == 'PMNT_RECEIVED'}" type="Boolean"/> >> + <if-compare field="isValidStatus" operator="equals" value="false"> >> >> + <add-error><fail-property resource="AccountingUiLabels" property="AccountingPaymentStatusIsNotReceivedOrSentError"/></add-error> >> + </if-compare> >> <check-errors/> >> </iterate> >> <if-compare field="parameters.groupInOneTransaction" operator="equals" value="Y"> >> >> >> Rishi & Anil, This seems very good use of UEL to me. Hans , Can you please clarify how this creates problem. Thanks And Regards -- Chirag Manocha |
I am sorry but the xml definition was much more clear and the whole
equation together....the separate 'false' with uel not nice.... On Fri, 2009-07-17 at 16:24 +0530, Chirag Manocha wrote: > Comments Inline :- > > Hans Bakker wrote: > > Are you sure this is correct? > > > > In the original comparison there is a 'not' around the 'or' which i do > > not see in the UEL.... > > > > I also do not see much advantages in these kind of changes they only can > > create problems.... > > > > Regards, > > Hans > > > > > > > > > > On Fri, 2009-07-17 at 10:23 +0000, [hidden email] wrote: > > > >> Author: apatel > >> Date: Fri Jul 17 10:23:56 2009 > >> New Revision: 795030 > >> > >> URL: http://svn.apache.org/viewvc?rev=795030&view=rev > >> Log: > >> Minor code improvements, now using UEL. Thanks Rishi for working on it. > >> > >> Modified: > >> ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/finaccount/FinAccountServices.xml > >> > >> Modified: ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/finaccount/FinAccountServices.xml > >> URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/finaccount/FinAccountServices.xml?rev=795030&r1=795029&r2=795030&view=diff > >> ============================================================================== > >> --- ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/finaccount/FinAccountServices.xml (original) > >> +++ ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/finaccount/FinAccountServices.xml Fri Jul 17 10:23:56 2009 > >> @@ -391,19 +391,10 @@ > >> <add-error><fail-property resource="AccountingUiLabels" property="AccountingPaymentAlreadyAssociatedToFinAccountError"/></add-error> > >> </if-not-empty> > >> <check-errors/> > >> - <if> > >> - <condition> > >> - <not> > >> - <or> > >> - <if-compare field="payment.statusId" operator="equals" value="PMNT_SENT"/> > >> - <if-compare field="payment.statusId" operator="equals" value="PMNT_RECEIVED"/> > >> - </or> > >> - </not> > >> - </condition> > >> - <then> > >> - <add-error><fail-property resource="AccountingUiLabels" property="AccountingPaymentStatusIsNotReceivedOrSentError"/></add-error> > >> - </then> > >> - </if> > >> + <set field="isValidStatus" value="${payment.statusId == 'PMNT_SENT' @or payment.statusId == 'PMNT_RECEIVED'}" type="Boolean"/> > >> + <if-compare field="isValidStatus" operator="equals" value="false"> > >> > false check is used for <not> tag > >> + <add-error><fail-property resource="AccountingUiLabels" property="AccountingPaymentStatusIsNotReceivedOrSentError"/></add-error> > >> + </if-compare> > >> <check-errors/> > >> </iterate> > >> <if-compare field="parameters.groupInOneTransaction" operator="equals" value="Y"> > >> > >> > >> > Rishi & Anil, > This seems very good use of UEL to me. > Hans , > Can you please clarify how this creates problem. > > > Thanks And Regards > -- > Chirag Manocha Antwebsystems.com: Quality OFBiz services for competitive rates |
I don't see where using UEL expressions is any different than using
BeanShell scriptlets: ${bsh:payment.statusId == 'PMNT_SENT' @or payment.statusId == 'PMNT_RECEIVED';} - which are used a lot in the project. The code could be simplified further by using: <if-compare field="payment.statusId == 'PMNT_SENT' @or payment.statusId == 'PMNT_RECEIVED'" operator="equals" value="false"> <add-error><fail-property resource="AccountingUiLabels" property="AccountingPaymentStatusIsNotReceivedOrSentError"/></add-error> </if-compare> From my perspective, that expression is easier to read and understand than the mini-lang expression it replaces. -Adrian Hans Bakker wrote: > I am sorry but the xml definition was much more clear and the whole > equation together....the separate 'false' with uel not nice.... > > On Fri, 2009-07-17 at 16:24 +0530, Chirag Manocha wrote: >> Comments Inline :- >> >> Hans Bakker wrote: >>> Are you sure this is correct? >>> >>> In the original comparison there is a 'not' around the 'or' which i do >>> not see in the UEL.... >>> >>> I also do not see much advantages in these kind of changes they only can >>> create problems.... >>> >>> Regards, >>> Hans >>> >>> >>> >>> >>> On Fri, 2009-07-17 at 10:23 +0000, [hidden email] wrote: >>> >>>> Author: apatel >>>> Date: Fri Jul 17 10:23:56 2009 >>>> New Revision: 795030 >>>> >>>> URL: http://svn.apache.org/viewvc?rev=795030&view=rev >>>> Log: >>>> Minor code improvements, now using UEL. Thanks Rishi for working on it. >>>> >>>> Modified: >>>> ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/finaccount/FinAccountServices.xml >>>> >>>> Modified: ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/finaccount/FinAccountServices.xml >>>> URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/finaccount/FinAccountServices.xml?rev=795030&r1=795029&r2=795030&view=diff >>>> ============================================================================== >>>> --- ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/finaccount/FinAccountServices.xml (original) >>>> +++ ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/finaccount/FinAccountServices.xml Fri Jul 17 10:23:56 2009 >>>> @@ -391,19 +391,10 @@ >>>> <add-error><fail-property resource="AccountingUiLabels" property="AccountingPaymentAlreadyAssociatedToFinAccountError"/></add-error> >>>> </if-not-empty> >>>> <check-errors/> >>>> - <if> >>>> - <condition> >>>> - <not> >>>> - <or> >>>> - <if-compare field="payment.statusId" operator="equals" value="PMNT_SENT"/> >>>> - <if-compare field="payment.statusId" operator="equals" value="PMNT_RECEIVED"/> >>>> - </or> >>>> - </not> >>>> - </condition> >>>> - <then> >>>> - <add-error><fail-property resource="AccountingUiLabels" property="AccountingPaymentStatusIsNotReceivedOrSentError"/></add-error> >>>> - </then> >>>> - </if> >>>> + <set field="isValidStatus" value="${payment.statusId == 'PMNT_SENT' @or payment.statusId == 'PMNT_RECEIVED'}" type="Boolean"/> >>>> + <if-compare field="isValidStatus" operator="equals" value="false"> >>>> >> false check is used for <not> tag >>>> + <add-error><fail-property resource="AccountingUiLabels" property="AccountingPaymentStatusIsNotReceivedOrSentError"/></add-error> >>>> + </if-compare> >>>> <check-errors/> >>>> </iterate> >>>> <if-compare field="parameters.groupInOneTransaction" operator="equals" value="Y"> >>>> >>>> >>>> >> Rishi & Anil, >> This seems very good use of UEL to me. >> Hans , >> Can you please clarify how this creates problem. >> >> >> Thanks And Regards >> -- >> Chirag Manocha |
+1 on Adrian's comment.
-- Ashish On Fri, Jul 17, 2009 at 7:53 PM, Adrian Crum <[hidden email]> wrote: > I don't see where using UEL expressions is any different than using > BeanShell scriptlets: ${bsh:payment.statusId == 'PMNT_SENT' @or > payment.statusId == 'PMNT_RECEIVED';} - which are used a lot in the project. > > The code could be simplified further by using: > > <if-compare field="payment.statusId == 'PMNT_SENT' @or payment.statusId == > 'PMNT_RECEIVED'" operator="equals" value="false"> > <add-error><fail-property resource="AccountingUiLabels" > property="AccountingPaymentStatusIsNotReceivedOrSentError"/></add-error> > </if-compare> > > From my perspective, that expression is easier to read and understand than > the mini-lang expression it replaces. > > -Adrian > > > Hans Bakker wrote: > >> I am sorry but the xml definition was much more clear and the whole >> equation together....the separate 'false' with uel not nice.... >> > |
Free forum by Nabble | Edit this page |