Author: jleroux
Date: Sat Aug 5 09:23:34 2006
New Revision: 429010
URL:
http://svn.apache.org/viewvc?rev=429010&view=revLog:
My last commit for Apache OFBIZ-90 (Deprecated operations replaced by set operations in PromoServices.xml)gets a comment from David J. :
The set operation is not equivalent to the if-empty + string-to-field. In other words, you still need the if-empty around the set operation.
The set-if-empty attribute does not mean "set only if empty" it means "set if empty or not empty".
-David
This commit resolves this problem.
Modified:
incubator/ofbiz/trunk/applications/product/script/org/ofbiz/product/promo/PromoServices.xml
Modified: incubator/ofbiz/trunk/applications/product/script/org/ofbiz/product/promo/PromoServices.xml
URL:
http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/product/script/org/ofbiz/product/promo/PromoServices.xml?rev=429010&r1=429009&r2=429010&view=diff==============================================================================
--- incubator/ofbiz/trunk/applications/product/script/org/ofbiz/product/promo/PromoServices.xml (original)
+++ incubator/ofbiz/trunk/applications/product/script/org/ofbiz/product/promo/PromoServices.xml Sat Aug 5 09:23:34 2006
@@ -29,7 +29,9 @@
<sequenced-id-to-env sequence-name="ProductPromo" env-name="newEntity.productPromoId"/>
<field-to-result field-name="productPromoId" map-name="newEntity"/>
- <set value="Y" set-if-empty="true" field="newEntity.userEntered"/>
+ <if-empty field-name="newEntity.userEntered">
+ <set value="Y" set-if-empty="true" field="newEntity.userEntered"/>
+ </if-empty>
<now-timestamp-to-env env-name="nowTimestamp"/>
<set from-field="nowTimestamp" field="newEntity.createdDate"/>
@@ -48,7 +50,9 @@
<find-by-primary-key entity-name="ProductPromo" map-name="lookupPKMap" value-name="lookedUpValue"/>
<set-nonpk-fields map-name="parameters" value-name="lookedUpValue"/>
- <set value="Y" set-if-empty="true" field="newEntity.userEntered"/>
+ <if-empty field-name="newEntity.userEntered">
+ <set value="Y" set-if-empty="true" field="newEntity.userEntered"/>
+ </if-empty>
<now-timestamp-to-env env-name="nowTimestamp"/>
<set from-field="nowTimestamp" field="newEntity.lastModifiedDate"/>
@@ -346,9 +350,10 @@
<set-pk-fields map-name="parameters" value-name="newEntity"/>
<set-nonpk-fields map-name="parameters" value-name="newEntity"/>
- <now-timestamp-to-env env-name="nowTimestamp"/>
- <set from-field="nowTimestamp.fromDate" set-if-empty="true" field="newEntity.fromDate"/>
-
+ <if-empty field-name="fromDate" map-name="newEntity">
+ <now-timestamp-to-env env-name="nowTimestamp"/>
+ <set from-field="nowTimestamp.fromDate" set-if-empty="true" field="newEntity.fromDate"/>
+ </if-empty>
<create-value value-name="newEntity"/>
</simple-method>