svn commit: r567672 - in /ofbiz/trunk/specialpurpose/oagis: servicedef/ src/org/ofbiz/oagis/ webapp/oagis/WEB-INF/

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

svn commit: r567672 - in /ofbiz/trunk/specialpurpose/oagis: servicedef/ src/org/ofbiz/oagis/ webapp/oagis/WEB-INF/

jonesde
Author: jonesde
Date: Mon Aug 20 05:40:30 2007
New Revision: 567672

URL: http://svn.apache.org/viewvc?rev=567672&view=rev
Log:
Refactoring to improve service names to clarify their purpose and avoid future conflicts; also separately commening out the reserveProductInventoryByFacility SECA because it caused a double call to oagisSendProcessShipment, and somehow in a way that resulted in multiple shipments too

Modified:
    ofbiz/trunk/specialpurpose/oagis/servicedef/secas.xml
    ofbiz/trunk/specialpurpose/oagis/servicedef/services.xml
    ofbiz/trunk/specialpurpose/oagis/src/org/ofbiz/oagis/OagisInventoryServices.java
    ofbiz/trunk/specialpurpose/oagis/src/org/ofbiz/oagis/OagisServices.java
    ofbiz/trunk/specialpurpose/oagis/src/org/ofbiz/oagis/OagisShipmentServices.java
    ofbiz/trunk/specialpurpose/oagis/webapp/oagis/WEB-INF/controller.xml

Modified: ofbiz/trunk/specialpurpose/oagis/servicedef/secas.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/oagis/servicedef/secas.xml?rev=567672&r1=567671&r2=567672&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/oagis/servicedef/secas.xml (original)
+++ ofbiz/trunk/specialpurpose/oagis/servicedef/secas.xml Mon Aug 20 05:40:30 2007
@@ -25,15 +25,17 @@
         <condition field-name="statusId" operator="equals" value="ORDER_APPROVED"/>
         <condition field-name="orderTypeId" operator="equals" value="SALES_ORDER"/>
         <condition-field field-name="statusId" operator="not-equals" to-field-name="oldStatusId"/>
-        <action service="oagisProcessShipment" mode="async" persist="true"/>
+        <action service="oagisSendProcessShipment" mode="async" persist="true"/>
     </eca>
     <eca service="updateReturnHeader" event="commit">
         <condition field-name="statusId" operator="equals" value="RETURN_ACCEPTED"/>
-        <action service="oagisReceiveDelivery" mode="async" persist="true"/>
+        <action service="oagisSendReceiveDelivery" mode="async" persist="true"/>
     </eca>
+    -->
     
+    <!-- causing double calls to oagisSendProcessShipment for non-backorder scenarios
     <eca service="reserveProductInventoryByFacility" event="global-commit">
-        <action service="oagisProcessShipment" mode="sync"/>
+        <action service="oagisSendProcessShipment" mode="async" persist="true"/>
     </eca>
     -->
 </service-eca>

Modified: ofbiz/trunk/specialpurpose/oagis/servicedef/services.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/oagis/servicedef/services.xml?rev=567672&r1=567671&r2=567672&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/oagis/servicedef/services.xml (original)
+++ ofbiz/trunk/specialpurpose/oagis/servicedef/services.xml Mon Aug 20 05:40:30 2007
@@ -94,8 +94,8 @@
     
     <!-- ==================================== -->
     <!-- Outgoing Message Services -->
-    <service name="oagisProcessShipment" max-retry="0" engine="java"
-        location="org.ofbiz.oagis.OagisShipmentServices" invoke="oagisProcessShipment">
+    <service name="oagisSendProcessShipment" max-retry="0" engine="java"
+        location="org.ofbiz.oagis.OagisShipmentServices" invoke="oagisSendProcessShipment">
         <description>Prepare and Optionally Send OAGIS Process Shipment Message.
             Note on usage: you can pass in either sendToUrl, saveToFilename, or outputStream.
             If none are passed in the URL in oagis.properties will be used at the target for the message.</description>
@@ -106,8 +106,8 @@
         <attribute name="orderId" mode="IN" type="String" optional="false"/>
     </service>
     
-    <service name="oagisReceiveDelivery" max-retry="0" engine="java"
-        location="org.ofbiz.oagis.OagisShipmentServices" invoke="oagisReceiveDelivery">
+    <service name="oagisSendReceiveDelivery" max-retry="0" engine="java"
+        location="org.ofbiz.oagis.OagisShipmentServices" invoke="oagisSendReceiveDelivery">
         <description>Receive Delivery</description>
         <attribute name="sendToUrl" type="String" mode="IN" optional="true"/>
         <attribute name="saveToFilename" type="String" mode="IN" optional="true"/>
@@ -118,8 +118,8 @@
     
     <!-- ==================================== -->
     <!-- Incoming Message Services -->
-    <service name="syncInventory" engine="java" transaction-timeout="300" max-retry="3"
-        location="org.ofbiz.oagis.OagisInventoryServices" invoke="syncInventory" auth="true">
+    <service name="oagisReceiveSyncInventory" engine="java" transaction-timeout="300" max-retry="3"
+        location="org.ofbiz.oagis.OagisInventoryServices" invoke="oagisReceiveSyncInventory" auth="true">
         <description>Process incoming Inventory Sync message</description>
         <implements service="oagisMessageIdOutInterface"/>
         <attribute name="document" type="org.w3c.dom.Document" mode="IN" optional="false"/>
@@ -127,24 +127,24 @@
     </service>
     
     <!-- DEJ20070808 added max-rety=3 because this is run async persisted just in case there is a transaction problem under heavy load -->
-    <service name="showShipment" engine="java" transaction-timeout="300" max-retry="3"
-        location="org.ofbiz.oagis.OagisShipmentServices" invoke="showShipment" auth="true">
+    <service name="oagisReceiveShowShipment" engine="java" transaction-timeout="300" max-retry="3"
+        location="org.ofbiz.oagis.OagisShipmentServices" invoke="oagisReceiveShowShipment" auth="true">
         <description>Process incoming shipment message</description>
         <implements service="oagisMessageIdOutInterface"/>
         <attribute name="document" type="org.w3c.dom.Document" mode="IN" optional="false"/>
         <attribute name="isErrorRetry" type="Boolean" mode="IN" optional="true"/>
     </service>
     
-    <service name="receivePoAcknowledge" engine="java" transaction-timeout="300" max-retry="3"
-        location="org.ofbiz.oagis.OagisInventoryServices" invoke="receivePoAcknowledge" auth="true">
+    <service name="oagisReceiveAcknowledgeDeliveryPo" engine="java" transaction-timeout="300" max-retry="3"
+        location="org.ofbiz.oagis.OagisInventoryServices" invoke="oagisReceiveAcknowledgeDeliveryPo" auth="true">
         <description>Process PO Acknowledge message</description>
         <implements service="oagisMessageIdOutInterface"/>
         <attribute name="document" type="org.w3c.dom.Document" mode="IN" optional="false"/>
         <attribute name="isErrorRetry" type="Boolean" mode="IN" optional="true"/>
     </service>
     
-    <service name="receiveRmaAcknowledge" engine="java" transaction-timeout="300" max-retry="3"
-        location="org.ofbiz.oagis.OagisInventoryServices" invoke="receiveRmaAcknowledge" auth="true">
+    <service name="oagisReceiveAcknowledgeDeliveryRma" engine="java" transaction-timeout="300" max-retry="3"
+        location="org.ofbiz.oagis.OagisInventoryServices" invoke="oagisReceiveAcknowledgeDeliveryRma" auth="true">
         <description>Process RMA Acknowledge message</description>
         <implements service="oagisMessageIdOutInterface"/>
         <attribute name="document" type="org.w3c.dom.Document" mode="IN" optional="false"/>

Modified: ofbiz/trunk/specialpurpose/oagis/src/org/ofbiz/oagis/OagisInventoryServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/oagis/src/org/ofbiz/oagis/OagisInventoryServices.java?rev=567672&r1=567671&r2=567672&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/oagis/src/org/ofbiz/oagis/OagisInventoryServices.java (original)
+++ ofbiz/trunk/specialpurpose/oagis/src/org/ofbiz/oagis/OagisInventoryServices.java Mon Aug 20 05:40:30 2007
@@ -61,7 +61,7 @@
 
     public static final String syncInventoryFacilityId = UtilProperties.getPropertyValue("oagis.properties", "Oagis.Warehouse.SyncInventoryFacilityId");
     
-    public static Map syncInventory(DispatchContext ctx, Map context) {
+    public static Map oagisReceiveSyncInventory(DispatchContext ctx, Map context) {
         Document doc = (Document) context.get("document");
         boolean isErrorRetry = Boolean.TRUE.equals(context.get("isErrorRetry"));
 
@@ -285,7 +285,7 @@
                     dispatcher.runAsync("sendMailFromScreen", sendMap, true);
                 } else {
                     // no send to email address, just log to file
-                    Debug.logImportant("No sendTo email address found in process syncInventory service: inventoryMapList: " + inventoryMapList, module);
+                    Debug.logImportant("No sendTo email address found in process oagisReceiveSyncInventory service: inventoryMapList: " + inventoryMapList, module);
                 }
             } catch (Throwable t) {
                 String errMsg = "System Error processing Sync Inventory message: " + t.toString();
@@ -357,7 +357,7 @@
         return result;
     }
     
-    public static Map receivePoAcknowledge(DispatchContext ctx, Map context) {
+    public static Map oagisReceiveAcknowledgeDeliveryPo(DispatchContext ctx, Map context) {
         Document doc = (Document) context.get("document");
         boolean isErrorRetry = Boolean.TRUE.equals(context.get("isErrorRetry"));
 
@@ -602,7 +602,7 @@
         return result;
     }
     
-    public static Map receiveRmaAcknowledge(DispatchContext ctx, Map context) {
+    public static Map oagisReceiveAcknowledgeDeliveryRma(DispatchContext ctx, Map context) {
         Document doc = (Document) context.get("document");
         boolean isErrorRetry = Boolean.TRUE.equals(context.get("isErrorRetry"));
 
@@ -950,7 +950,7 @@
                     String statusId = (String) processedStatusIdByReturnIdEntry.getValue();
 
                     if (UtilValidate.isNotEmpty(statusId) && statusId.equals("RETURN_ACCEPTED")) {
-                        // TODOLATER (see note below): check to see if all return items have been received, if so then set to received then completed
+                        // TODO (see note below): check to see if all return items have been received, if so then set to received then completed
                         // NOTE DEJ20070815 because of the way the inventory is being received, ie not through the return; reviewing other code it looks like nothing
                         //updates ReturnItem status or anything anyway, and there is no Return/Item stuff on the InventoryItemDetail to track it back;
                         //so giving up on attempt to do this, will support multiple returns per message, but all must be complete a complete one at that, which is a BAD assumption

Modified: ofbiz/trunk/specialpurpose/oagis/src/org/ofbiz/oagis/OagisServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/oagis/src/org/ofbiz/oagis/OagisServices.java?rev=567672&r1=567671&r2=567672&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/oagis/src/org/ofbiz/oagis/OagisServices.java (original)
+++ ofbiz/trunk/specialpurpose/oagis/src/org/ofbiz/oagis/OagisServices.java Mon Aug 20 05:40:30 2007
@@ -529,21 +529,21 @@
             }
         } else if (bsrVerb.equalsIgnoreCase("SHOW") && bsrNoun.equalsIgnoreCase("SHIPMENT")) {
             try {
-                //subServiceResult = dispatcher.runSync("showShipment", messageProcessContext);
+                //subServiceResult = dispatcher.runSync("oagisReceiveShowShipment", messageProcessContext);
                 // DEJ20070808 changed to run asynchronously and persisted so that if it fails it will retry; for transaction deadlock and other reasons
-                dispatcher.runAsync("showShipment", messageProcessContext, true);
+                dispatcher.runAsync("oagisReceiveShowShipment", messageProcessContext, true);
             } catch (GenericServiceException e) {
-                String errMsg = "Error running service showShipment: " + e.toString();
+                String errMsg = "Error running service oagisReceiveShowShipment: " + e.toString();
                 errorList.add(UtilMisc.toMap("description", errMsg, "reasonCode", "GenericServiceException"));
                 Debug.logError(e, errMsg, module);
             }
         } else if (bsrVerb.equalsIgnoreCase("SYNC") && bsrNoun.equalsIgnoreCase("INVENTORY")) {
             try {
-                //subServiceResult = dispatcher.runSync("syncInventory", messageProcessContext);
+                //subServiceResult = dispatcher.runSync("oagisReceiveSyncInventory", messageProcessContext);
                 // DEJ20070808 changed to run asynchronously and persisted so that if it fails it will retry; for transaction deadlock and other reasons
-                dispatcher.runAsync("syncInventory", messageProcessContext, true);
+                dispatcher.runAsync("oagisReceiveSyncInventory", messageProcessContext, true);
             } catch (GenericServiceException e) {
-                String errMsg = "Error running service syncInventory: " + e.toString();
+                String errMsg = "Error running service oagisReceiveSyncInventory: " + e.toString();
                 errorList.add(UtilMisc.toMap("description", errMsg, "reasonCode", "GenericServiceException"));
                 Debug.logError(e, errMsg, module);
             }
@@ -555,19 +555,19 @@
             String docType = UtilXml.childElementValue(docRefElement, "of:DOCTYPE");
             if ("PO".equals(docType)) {
                 try {
-                    //subServiceResult = dispatcher.runSync("receivePoAcknowledge", messageProcessContext);
-                    dispatcher.runAsync("receivePoAcknowledge", messageProcessContext, true);
+                    //subServiceResult = dispatcher.runSync("oagisReceiveAcknowledgeDeliveryPo", messageProcessContext);
+                    dispatcher.runAsync("oagisReceiveAcknowledgeDeliveryPo", messageProcessContext, true);
                 } catch (GenericServiceException e) {
-                    String errMsg = "Error running service receivePoAcknowledge: " + e.toString();
+                    String errMsg = "Error running service oagisReceiveAcknowledgeDeliveryPo: " + e.toString();
                     errorList.add(UtilMisc.toMap("description", errMsg, "reasonCode", "GenericServiceException"));
                     Debug.logError(e, errMsg, module);
                 }
             } else if ("RMA".equals(docType)) {
                 try {
-                    //subServiceResult = dispatcher.runSync("receiveRmaAcknowledge", messageProcessContext);
-                    dispatcher.runAsync("receiveRmaAcknowledge", messageProcessContext, true);
+                    //subServiceResult = dispatcher.runSync("oagisReceiveAcknowledgeDeliveryRma", messageProcessContext);
+                    dispatcher.runAsync("oagisReceiveAcknowledgeDeliveryRma", messageProcessContext, true);
                 } catch (GenericServiceException e) {
-                    String errMsg = "Error running service receiveRmaAcknowledge: " + e.toString();
+                    String errMsg = "Error running service oagisReceiveAcknowledgeDeliveryRma: " + e.toString();
                     errorList.add(UtilMisc.toMap("description", errMsg, "reasonCode", "GenericServiceException"));
                     Debug.logError(e, errMsg, module);
                 }

Modified: ofbiz/trunk/specialpurpose/oagis/src/org/ofbiz/oagis/OagisShipmentServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/oagis/src/org/ofbiz/oagis/OagisShipmentServices.java?rev=567672&r1=567671&r2=567672&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/oagis/src/org/ofbiz/oagis/OagisShipmentServices.java (original)
+++ ofbiz/trunk/specialpurpose/oagis/src/org/ofbiz/oagis/OagisShipmentServices.java Mon Aug 20 05:40:30 2007
@@ -80,7 +80,7 @@
     public static final String oagisSegmentsNamespacePrefix = "os";
     public static final String oagisFieldsNamespacePrefix = "of";
         
-    public static Map showShipment(DispatchContext ctx, Map context) {
+    public static Map oagisReceiveShowShipment(DispatchContext ctx, Map context) {
         Document doc = (Document) context.get("document");
         boolean isErrorRetry = Boolean.TRUE.equals(context.get("isErrorRetry"));
         
@@ -469,7 +469,7 @@
         return result;
     }
 
-    public static Map oagisProcessShipment(DispatchContext ctx, Map context) {
+    public static Map oagisSendProcessShipment(DispatchContext ctx, Map context) {
         LocalDispatcher dispatcher = ctx.getDispatcher();
         GenericDelegator delegator = ctx.getDelegator();
         String orderId = (String) context.get("orderId");
@@ -505,7 +505,7 @@
         
         OutputStream out = (OutputStream) context.get("outputStream");
         
-        if (Debug.infoOn()) Debug.logInfo("Call to oagisProcessShipment for orderId [" + orderId + "], sendToUrl=[" + sendToUrl + "], saveToDirectory=[" + saveToDirectory + "], saveToFilename=[" + saveToFilename + "]", module);
+        if (Debug.infoOn()) Debug.logInfo("Call to oagisSendProcessShipment for orderId [" + orderId + "], sendToUrl=[" + sendToUrl + "], saveToDirectory=[" + saveToDirectory + "], saveToFilename=[" + saveToFilename + "]", module);
         
         Map result = ServiceUtil.returnSuccess();
         MapStack bodyParameters =  MapStack.create();
@@ -598,7 +598,7 @@
                     String errMsg = UtilProperties.getMessage(ServiceUtil.resource, "OagisErrorInCreatingDataForOagisMessageInfoEntity", (Locale) context.get("locale"));
                     Debug.logError(e, errMsg, module);
                 }
-                if (Debug.infoOn()) Debug.logInfo("Saved OagisMessageInfo for oagisProcessShipment message for orderId [" + orderId + "]", module);
+                if (Debug.infoOn()) Debug.logInfo("Saved OagisMessageInfo for oagisSendProcessShipment message for orderId [" + orderId + "]", module);
 
                 String shipmentId = null;
                 try {
@@ -709,7 +709,7 @@
                     Debug.logError(e, errMsg, module);
                     return ServiceUtil.returnError(errMsg);
                 }
-                if (Debug.infoOn()) Debug.logInfo("Finished rendering oagisProcessShipment message for orderId [" + orderId + "]", module);
+                if (Debug.infoOn()) Debug.logInfo("Finished rendering oagisSendProcessShipment message for orderId [" + orderId + "]", module);
 
                 try {
                     comiCtx.put("processingStatusId", "OAGMP_OGEN_SUCCESS");
@@ -725,7 +725,7 @@
                 
                 Map sendMessageReturn = OagisServices.sendMessageText(outText, out, sendToUrl, saveToDirectory, saveToFilename);
 
-                if (Debug.infoOn()) Debug.logInfo("Message send done for oagisProcessShipment for orderId [" + orderId + "], sendToUrl=[" + sendToUrl + "], saveToDirectory=[" + saveToDirectory + "], saveToFilename=[" + saveToFilename + "]", module);
+                if (Debug.infoOn()) Debug.logInfo("Message send done for oagisSendProcessShipment for orderId [" + orderId + "], sendToUrl=[" + sendToUrl + "], saveToDirectory=[" + saveToDirectory + "], saveToFilename=[" + saveToFilename + "]", module);
                 try {
                     comiCtx.put("processingStatusId", "OAGMP_SENT");
                     dispatcher.runSync("updateOagisMessageInfo", comiCtx, 60, true);
@@ -742,7 +742,7 @@
         return result;
     }
     
-    public static Map oagisReceiveDelivery(DispatchContext dctx, Map context) {
+    public static Map oagisSendReceiveDelivery(DispatchContext dctx, Map context) {
         LocalDispatcher dispatcher = dctx.getDispatcher();
         GenericDelegator delegator = dctx.getDelegator();
         String returnId = (String) context.get("returnId");

Modified: ofbiz/trunk/specialpurpose/oagis/webapp/oagis/WEB-INF/controller.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/oagis/webapp/oagis/WEB-INF/controller.xml?rev=567672&r1=567671&r2=567672&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/oagis/webapp/oagis/WEB-INF/controller.xml (original)
+++ ofbiz/trunk/specialpurpose/oagis/webapp/oagis/WEB-INF/controller.xml Mon Aug 20 05:40:30 2007
@@ -181,9 +181,9 @@
         <response name="error" type="view" value="UploadOagisMessage"/>
     </request-map>
 
-    <request-map uri="showShipment">
+    <request-map uri="oagisReceiveShowShipment">
         <security https="true" auth="false"/>
-        <event type="stream" invoke="showShipment"/>
+        <event type="stream" invoke="oagisReceiveShowShipment"/>
         <response name="success" type="none"/>
     </request-map>
 
@@ -193,21 +193,21 @@
         <response name="success" type="none"/>
     </request-map>
 
-    <request-map uri="syncInventory">
+    <request-map uri="oagisReceiveSyncInventory">
         <security https="true" auth="false"/>
-        <event type="stream" invoke="syncInventory"/>
+        <event type="stream" invoke="oagisReceiveSyncInventory"/>
         <response name="success" type="none"/>
     </request-map>
     
-    <request-map uri="receivePoAcknowledge">
+    <request-map uri="oagisReceiveAcknowledgeDeliveryPo">
         <security https="true" auth="false"/>
-        <event type="stream" invoke="receivePoAcknowledge"/>
+        <event type="stream" invoke="oagisReceiveAcknowledgeDeliveryPo"/>
         <response name="success" type="none"/>
     </request-map>
 
-    <request-map uri="receiveRmaAcknowledge">
+    <request-map uri="oagisReceiveAcknowledgeDeliveryRma">
         <security https="true" auth="false"/>
-        <event type="stream" invoke="receiveRmaAcknowledge"/>
+        <event type="stream" invoke="oagisReceiveAcknowledgeDeliveryRma"/>
         <response name="success" type="none"/>
     </request-map>