Author: jacopoc
Date: Wed Oct 10 01:12:07 2007 New Revision: 583384 URL: http://svn.apache.org/viewvc?rev=583384&view=rev Log: In the 'convertUom' service the 'convertedValue' output parameter is now optional: if no converion is available, then null is returned, not an error (and a rollback etc...). Modified: ofbiz/trunk/applications/product/script/org/ofbiz/product/cost/CostServices.xml ofbiz/trunk/applications/product/servicedef/services_cost.xml ofbiz/trunk/applications/product/servicedef/services_uom.xml ofbiz/trunk/applications/product/src/org/ofbiz/shipment/thirdparty/usps/UspsServices.java ofbiz/trunk/framework/common/servicedef/services.xml Modified: ofbiz/trunk/applications/product/script/org/ofbiz/product/cost/CostServices.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/script/org/ofbiz/product/cost/CostServices.xml?rev=583384&r1=583383&r2=583384&view=diff ============================================================================== --- ofbiz/trunk/applications/product/script/org/ofbiz/product/cost/CostServices.xml (original) +++ ofbiz/trunk/applications/product/script/org/ofbiz/product/cost/CostServices.xml Wed Oct 10 01:12:07 2007 @@ -153,7 +153,7 @@ <set from-field="priceCost.lastPrice" field="inputMap.originalValue"/> <set from-field="priceCost.currencyUomId" field="inputMap.uomId"/> <set from-field="parameters.currencyUomId" field="inputMap.uomIdTo"/> - <call-service service-name="convertUom" in-map-name="inputMap" break-on-error="false"> + <call-service service-name="convertUom" in-map-name="inputMap"> <result-to-field result-name="convertedValue" field-name="productCost"/> </call-service> </if-not-empty> Modified: ofbiz/trunk/applications/product/servicedef/services_cost.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/servicedef/services_cost.xml?rev=583384&r1=583383&r2=583384&view=diff ============================================================================== --- ofbiz/trunk/applications/product/servicedef/services_cost.xml (original) +++ ofbiz/trunk/applications/product/servicedef/services_cost.xml Wed Oct 10 01:12:07 2007 @@ -75,7 +75,7 @@ </service> <service name="calculateProductCosts" engine="simple" auth="true" location="org/ofbiz/product/cost/CostServices.xml" invoke="calculateProductCosts"> - <description>Calculates the product's costs. If the product does not cost component defined, will use the BOM to calculate the cost.</description> + <description>Calculates the product's costs. If the product does not have cost component defined, will use the BOM to calculate the cost.</description> <attribute mode="IN" name="productId" optional="false" type="String"/> <attribute mode="IN" name="currencyUomId" optional="false" type="String"/> <attribute mode="IN" name="costComponentTypePrefix" optional="false" type="String"/> Modified: ofbiz/trunk/applications/product/servicedef/services_uom.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/servicedef/services_uom.xml?rev=583384&r1=583383&r2=583384&view=diff ============================================================================== --- ofbiz/trunk/applications/product/servicedef/services_uom.xml (original) +++ ofbiz/trunk/applications/product/servicedef/services_uom.xml Wed Oct 10 01:12:07 2007 @@ -27,7 +27,7 @@ <!-- UOM Formulas --> <service name="interfaceUomFormula" engine="interface" location="" invoke=""> <attribute mode="IN" name="arguments" optional="false" type="java.util.Map"/> - <attribute mode="OUT" name="convertedValue" optional="false" type="Double"/> + <attribute mode="OUT" name="convertedValue" optional="true" type="Double"/> </service> <service name="convertUomProduct" engine="simple" auth="false" location="org/ofbiz/product/product/ProductUomFormulas.xml" invoke="convertUomProduct"> Modified: ofbiz/trunk/applications/product/src/org/ofbiz/shipment/thirdparty/usps/UspsServices.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/shipment/thirdparty/usps/UspsServices.java?rev=583384&r1=583383&r2=583384&view=diff ============================================================================== --- ofbiz/trunk/applications/product/src/org/ofbiz/shipment/thirdparty/usps/UspsServices.java (original) +++ ofbiz/trunk/applications/product/src/org/ofbiz/shipment/thirdparty/usps/UspsServices.java Wed Oct 10 01:12:07 2007 @@ -300,7 +300,7 @@ Debug.logError(ex, module); } - if (result.get(ModelService.RESPONSE_MESSAGE).equals(ModelService.RESPOND_SUCCESS)) { + if (result.get(ModelService.RESPONSE_MESSAGE).equals(ModelService.RESPOND_SUCCESS) && result.get("convertedValue") != null) { productWeight = ((Double) result.get("convertedValue")).doubleValue(); } else { Debug.logError("Unsupported weightUom [" + weightUomId + "] for calcPackageWeight running productId " + productId + ", could not find a conversion factor to WT_lb",module); @@ -910,7 +910,7 @@ return ServiceUtil.returnError(ex.getMessage()); } - if (result.get(ModelService.RESPONSE_MESSAGE).equals(ModelService.RESPOND_SUCCESS)) { + if (result.get(ModelService.RESPONSE_MESSAGE).equals(ModelService.RESPOND_SUCCESS) && result.get("convertedValue") != null) { weight *= ((Double) result.get("convertedValue")).doubleValue(); } else { return ServiceUtil.returnError("Unsupported weightUom [" + weightUomId + "] for ShipmentPackage " + Modified: ofbiz/trunk/framework/common/servicedef/services.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/servicedef/services.xml?rev=583384&r1=583383&r2=583384&view=diff ============================================================================== --- ofbiz/trunk/framework/common/servicedef/services.xml (original) +++ ofbiz/trunk/framework/common/servicedef/services.xml Wed Oct 10 01:12:07 2007 @@ -320,7 +320,7 @@ <attribute name="asOfDate" mode="IN" type="Timestamp" optional="true"/> <attribute name="originalValue" mode="IN" type="Double" optional="false"/> <attribute name="conversionParameters" mode="IN" type="Map" optional="true"/> - <attribute name="convertedValue" mode="OUT" type="Double" optional="false"/> + <attribute name="convertedValue" mode="OUT" type="Double" optional="true"/> </service> <service name="convertUomCustom" default-entity-name="UomConversion" engine="simple" location="org/ofbiz/common/CommonServices.xml" invoke="convertUomCustom" auth="false"> @@ -329,7 +329,7 @@ <attribute name="originalValue" mode="IN" type="Double" optional="false"/> <attribute name="uomConversion" mode="IN" type="Map" optional="false"/> <attribute name="conversionParameters" mode="IN" type="Map" optional="true"/> - <attribute name="convertedValue" mode="OUT" type="Double" optional="false"/> + <attribute name="convertedValue" mode="OUT" type="Double" optional="true"/> </service> <!-- ftp services --> |
Free forum by Nabble | Edit this page |