svn commit: r566646 - in /ofbiz/trunk/specialpurpose/oagis: servicedef/services.xml src/org/ofbiz/oagis/OagisInventoryServices.java src/org/ofbiz/oagis/OagisServices.java src/org/ofbiz/oagis/OagisShipmentServices.java

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

svn commit: r566646 - in /ofbiz/trunk/specialpurpose/oagis: servicedef/services.xml src/org/ofbiz/oagis/OagisInventoryServices.java src/org/ofbiz/oagis/OagisServices.java src/org/ofbiz/oagis/OagisShipmentServices.java

jonesde
Author: jonesde
Date: Thu Aug 16 03:22:17 2007
New Revision: 566646

URL: http://svn.apache.org/viewvc?view=rev&rev=566646
Log:
Changed for better userLogin passing around and a fairly big change to handle business/message errors separate from system errors so that retry and Confirm BOD behavior is as desired

Modified:
    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

Modified: ofbiz/trunk/specialpurpose/oagis/servicedef/services.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/oagis/servicedef/services.xml?view=diff&rev=566646&r1=566645&r2=566646
==============================================================================
--- ofbiz/trunk/specialpurpose/oagis/servicedef/services.xml (original)
+++ ofbiz/trunk/specialpurpose/oagis/servicedef/services.xml Thu Aug 16 03:22:17 2007
@@ -71,8 +71,8 @@
     </service>
     
     <!-- Confirm BOD Messages, general flow and error handling -->    
-    <service name="oagisSendConfirmBod" engine="java" transaction-timeout="300"
-            location="org.ofbiz.oagis.OagisServices" invoke="oagisSendConfirmBod" auth="false">
+    <service name="oagisSendConfirmBod" engine="java" transaction-timeout="300" max-retry="3"
+        location="org.ofbiz.oagis.OagisServices" invoke="oagisSendConfirmBod" auth="true">
         <description>Send ConfirmBod</description>
         <attribute name="sendToUrl" type="String" mode="IN" optional="true"/>
         <attribute name="saveToFilename" type="String" mode="IN" optional="true"/>
@@ -86,20 +86,12 @@
         <attribute name="origRefId" type="String" mode="IN" optional="true"/>
     </service>
     <service name="receiveConfirmBod" engine="java" transaction-timeout="300"
-            location="org.ofbiz.oagis.OagisServices" invoke="receiveConfirmBod" auth="false">
+        location="org.ofbiz.oagis.OagisServices" invoke="receiveConfirmBod" auth="true">
         <description>Process incoming ConfirmBod</description>
         <implements service="oagisMessageIdOutInterface"/>
         <attribute name="document" type="org.w3c.dom.Document" mode="IN" optional="false"/>
     </service>
     
-    <service name="exportMsgFromScreen" max-retry="0" engine="java"
-        location="org.ofbiz.oagis.OagisShipmentServices" invoke="exportMsgFromScreen">
-        <description>Export Message From Screen</description>
-        <attribute name="bodyScreenUri" type="String" mode="IN" optional="true"/>
-        <attribute name="bodyParameters" type="Map" mode="IN" optional="true"/>
-        <attribute name="body" type="String" mode="OUT" optional="true"/>
-    </service>
-    
     <!-- ==================================== -->
     <!-- Outgoing Message Services -->
     <service name="oagisProcessShipment" max-retry="0" engine="java"
@@ -127,7 +119,7 @@
     <!-- ==================================== -->
     <!-- Incoming Message Services -->
     <service name="syncInventory" engine="java" transaction-timeout="300" max-retry="3"
-        location="org.ofbiz.oagis.OagisInventoryServices" invoke="syncInventory" auth="false">
+        location="org.ofbiz.oagis.OagisInventoryServices" invoke="syncInventory" auth="true">
         <description>Process incoming Inventory Sync message</description>
         <implements service="oagisMessageIdOutInterface"/>
         <attribute name="document" type="org.w3c.dom.Document" mode="IN" optional="false"/>
@@ -136,7 +128,7 @@
     
     <!-- 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="false">
+        location="org.ofbiz.oagis.OagisShipmentServices" invoke="showShipment" auth="true">
         <description>Process incoming shipment message</description>
         <implements service="oagisMessageIdOutInterface"/>
         <attribute name="document" type="org.w3c.dom.Document" mode="IN" optional="false"/>
@@ -144,7 +136,7 @@
     </service>
     
     <service name="receivePoAcknowledge" engine="java" transaction-timeout="300" max-retry="3"
-        location="org.ofbiz.oagis.OagisInventoryServices" invoke="receivePoAcknowledge" auth="false">
+        location="org.ofbiz.oagis.OagisInventoryServices" invoke="receivePoAcknowledge" auth="true">
         <description>Process PO Acknowledge message</description>
         <implements service="oagisMessageIdOutInterface"/>
         <attribute name="document" type="org.w3c.dom.Document" mode="IN" optional="false"/>
@@ -152,7 +144,7 @@
     </service>
     
     <service name="receiveRmaAcknowledge" engine="java" transaction-timeout="300" max-retry="3"
-        location="org.ofbiz.oagis.OagisInventoryServices" invoke="receiveRmaAcknowledge" auth="false">
+        location="org.ofbiz.oagis.OagisInventoryServices" invoke="receiveRmaAcknowledge" 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?view=diff&rev=566646&r1=566645&r2=566646
==============================================================================
--- ofbiz/trunk/specialpurpose/oagis/src/org/ofbiz/oagis/OagisInventoryServices.java (original)
+++ ofbiz/trunk/specialpurpose/oagis/src/org/ofbiz/oagis/OagisInventoryServices.java Thu Aug 16 03:22:17 2007
@@ -288,9 +288,10 @@
                     Debug.logImportant("No sendTo email address found in process syncInventory service: inventoryMapList: " + inventoryMapList, module);
                 }
             } catch (Throwable t) {
-                String errMsg = "Error processing Sync Inventory message: " + t.toString();
-                errorMapList.add(UtilMisc.toMap("description", errMsg, "reasonCode", "Exception"));
+                String errMsg = "System Error processing Sync Inventory message: " + t.toString();
                 Debug.logInfo(t, errMsg, module);
+                // in this case we don't want to return a Confirm BOD, so return an error now
+                return ServiceUtil.returnError(errMsg);
             }
         }
         
@@ -317,6 +318,7 @@
             saveErrorMapListCtx.put("task", task);
             saveErrorMapListCtx.put("referenceId", referenceId);
             saveErrorMapListCtx.put("errorMapList", errorMapList);
+            saveErrorMapListCtx.put("userLogin", userLogin);
             try {
                 dispatcher.runSync("createOagisMsgErrInfosFromErrMapList", saveErrorMapListCtx, 60, true);
             } catch (GenericServiceException e){
@@ -337,8 +339,8 @@
                 Debug.logError(e, errMsg, module);
             }
             
-            // DEJ20070807 what was this next line commented out? if there are errors we want to return an error so this will roll back
-            result.putAll(ServiceUtil.returnError("Errors found processing message; information saved and return error sent back"));
+            // return success here so that the message won't be retried and the Confirm BOD, etc won't be sent multiple times
+            result.putAll(ServiceUtil.returnSuccess("Errors found processing message; information saved and return error sent back"));
             return result;
         } else {
             try {
@@ -531,9 +533,10 @@
                     }
                 }
             } catch (Throwable t) {
-                String errMsg = "Error processing Acknowledge Delivery PO message: " + t.toString();
-                errorMapList.add(UtilMisc.toMap("description", errMsg, "reasonCode", "Exception"));
+                String errMsg = "System Error processing Acknowledge Delivery PO message: " + t.toString();
                 Debug.logInfo(t, errMsg, module);
+                // in this case we don't want to return a Confirm BOD, so return an error now
+                return ServiceUtil.returnError(errMsg);
             }
         }
 
@@ -560,6 +563,7 @@
             saveErrorMapListCtx.put("task", task);
             saveErrorMapListCtx.put("referenceId", referenceId);
             saveErrorMapListCtx.put("errorMapList", errorMapList);
+            saveErrorMapListCtx.put("userLogin", userLogin);
             try {
                 dispatcher.runSync("createOagisMsgErrInfosFromErrMapList", saveErrorMapListCtx, 60, true);
             } catch (GenericServiceException e){
@@ -580,8 +584,8 @@
                 Debug.logError(e, errMsg, module);
             }
             
-            // DEJ20070807 what was this next line commented out? if there are errors we want to return an error so this will roll back
-            result.putAll(ServiceUtil.returnError("Errors found processing message; information saved and return error sent back"));
+            // return success here so that the message won't be retried and the Confirm BOD, etc won't be sent multiple times
+            result.putAll(ServiceUtil.returnSuccess("Errors found processing message; information saved and return error sent back"));
             return result;
         } else {
             comiCtx.put("processingStatusId", "OAGMP_PROC_SUCCESS");
@@ -955,9 +959,10 @@
                     }
                 }
             } catch (Throwable t) {
-                String errMsg = "Error processing Acknowledge Delivery RMA message: " + t.toString();
-                errorMapList.add(UtilMisc.toMap("description", errMsg, "reasonCode", "Exception"));
+                String errMsg = "System Error processing Acknowledge Delivery RMA message: " + t.toString();
                 Debug.logInfo(t, errMsg, module);
+                // in this case we don't want to return a Confirm BOD, so return an error now
+                return ServiceUtil.returnError(errMsg);
             }
         }
 
@@ -984,6 +989,7 @@
             saveErrorMapListCtx.put("task", task);
             saveErrorMapListCtx.put("referenceId", referenceId);
             saveErrorMapListCtx.put("errorMapList", errorMapList);
+            saveErrorMapListCtx.put("userLogin", userLogin);
             try {
                 dispatcher.runSync("createOagisMsgErrInfosFromErrMapList", saveErrorMapListCtx, 60, true);
             } catch (GenericServiceException e){
@@ -1005,8 +1011,8 @@
                 Debug.logError(e, errMsg, module);
             }
             
-            // DEJ20070807 what was this next line commented out? if there are errors we want to return an error so this will roll back
-            result.putAll(ServiceUtil.returnError("Errors found processing message; information saved and return error sent back"));
+            // return success here so that the message won't be retried and the Confirm BOD, etc won't be sent multiple times
+            result.putAll(ServiceUtil.returnSuccess("Errors found processing message; information saved and return error sent back"));
             return result;
         } else {
             comiCtx.put("processingStatusId", "OAGMP_PROC_SUCCESS");

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?view=diff&rev=566646&r1=566645&r2=566646
==============================================================================
--- ofbiz/trunk/specialpurpose/oagis/src/org/ofbiz/oagis/OagisServices.java (original)
+++ ofbiz/trunk/specialpurpose/oagis/src/org/ofbiz/oagis/OagisServices.java Thu Aug 16 03:22:17 2007
@@ -101,7 +101,6 @@
     }
 
     public static Map oagisSendConfirmBod(DispatchContext ctx, Map context) {
-        
         GenericDelegator delegator = ctx.getDelegator();
         LocalDispatcher dispatcher = ctx.getDispatcher();
         
@@ -295,6 +294,7 @@
                 Debug.logWarning(errMsg, module);
             }
         }
+        
         try {
             dispatcher.runSync("createOagisMessageInfo", oagisMsgInfoCtx, 60, true);
             /* running async for better error handling
@@ -304,60 +304,73 @@
                 Debug.logError(errMsg, module);
             }
             */
-        } catch (GenericServiceException e){
-            String errMsg = "Error creating OagisMessageInfo for the Incoming Message: " + e.toString();
-            errorMapList.add(UtilMisc.toMap("description", errMsg, "reasonCode", "GenericServiceException"));
-            Debug.logError(e, errMsg, module);
-        }
 
-        Map originalOagisMsgCtx = FastMap.newInstance();
-        originalOagisMsgCtx.put("logicalId", dataAreaLogicalId);
-        originalOagisMsgCtx.put("component", dataAreaComponent);
-        originalOagisMsgCtx.put("task", dataAreaTask);
-        originalOagisMsgCtx.put("referenceId", dataAreaReferenceId);
-          
-        GenericValue originalOagisMsgInfo = null;
-        try {
-            originalOagisMsgInfo = delegator.findByPrimaryKey("OagisMessageInfo", originalOagisMsgCtx);
-        } catch (GenericEntityException e){
-            String errMsg = "Error Getting Entity OagisMessageInfo: " + e.toString();
-            errorMapList.add(UtilMisc.toMap("description", errMsg, "reasonCode", "GenericEntityException"));
-            Debug.logError(e, errMsg, module);
-        }
-        
-        originalOagisMsgCtx.put("userLogin", userLogin);
-        
-        List dataAreaConfirmMsgList = UtilXml.childElementList(dataAreaConfirmElement, "ns:CONFIRMMSG");
-        Iterator dataAreaConfirmMsgListItr = dataAreaConfirmMsgList.iterator();
-        if (originalOagisMsgInfo != null) {
-            while (dataAreaConfirmMsgListItr.hasNext()) {
-                Element dataAreaConfirmMsgElement = (Element) dataAreaConfirmMsgListItr.next();
-                String description = UtilXml.childElementValue(dataAreaConfirmMsgElement, "of:DESCRIPTN");
-                String reasonCode = UtilXml.childElementValue(dataAreaConfirmMsgElement, "of:REASONCODE");
-                
-                // TODO: should we attach these to the Confirm BOD message instead of the original, and then have the Confirm BOD record point to the original record? this was is fine for now
-                originalOagisMsgCtx.put("reasonCode", reasonCode);
-                originalOagisMsgCtx.put("description", description);
+            Map originalOagisMsgCtx = FastMap.newInstance();
+            originalOagisMsgCtx.put("logicalId", dataAreaLogicalId);
+            originalOagisMsgCtx.put("component", dataAreaComponent);
+            originalOagisMsgCtx.put("task", dataAreaTask);
+            originalOagisMsgCtx.put("referenceId", dataAreaReferenceId);
+            originalOagisMsgCtx.put("userLogin", userLogin);
+              
+            GenericValue originalOagisMsgInfo = delegator.findByPrimaryKey("OagisMessageInfo", originalOagisMsgCtx);
             
-                try {
-                    Map oagisMsgErrorInfoResult = dispatcher.runSync("createOagisMessageErrorInfo", originalOagisMsgCtx);
+            List dataAreaConfirmMsgList = UtilXml.childElementList(dataAreaConfirmElement, "ns:CONFIRMMSG");
+            if (originalOagisMsgInfo != null) {
+                Iterator dataAreaConfirmMsgListItr = dataAreaConfirmMsgList.iterator();
+                while (dataAreaConfirmMsgListItr.hasNext()) {
+                    Element dataAreaConfirmMsgElement = (Element) dataAreaConfirmMsgListItr.next();
+                    String description = UtilXml.childElementValue(dataAreaConfirmMsgElement, "of:DESCRIPTN");
+                    String reasonCode = UtilXml.childElementValue(dataAreaConfirmMsgElement, "of:REASONCODE");
+                    
+                    Map createOagisMessageErrorInfoForOriginal = FastMap.newInstance();
+                    createOagisMessageErrorInfoForOriginal.putAll(originalOagisMsgCtx);
+                    createOagisMessageErrorInfoForOriginal.put("reasonCode", reasonCode);
+                    createOagisMessageErrorInfoForOriginal.put("description", description);
+                
+                    Map oagisMsgErrorInfoResult = dispatcher.runSync("createOagisMessageErrorInfo", createOagisMessageErrorInfoForOriginal);
                     if (ServiceUtil.isError(oagisMsgErrorInfoResult)){
-                        String errMsg = "Error creating OagisMessageErrorInfo: "+ServiceUtil.getErrorMessage(oagisMsgErrorInfoResult);
+                        String errMsg = "Error creating OagisMessageErrorInfo: " + ServiceUtil.getErrorMessage(oagisMsgErrorInfoResult);
                         errorMapList.add(UtilMisc.toMap("description", errMsg, "reasonCode", "CreateOagisMessageErrorInfoServiceError"));
                         Debug.logError(errMsg, module);
                     }
-                } catch (GenericServiceException e){
-                    String errMsg = "Error creating OagisMessageErrorInfo: " + e.toString();
-                    errorMapList.add(UtilMisc.toMap("description", errMsg, "reasonCode", "GenericServiceException"));
-                    Debug.logError(e, errMsg, module);
                 }
+            } else {
+                String errMsg = "No such message with an error was found; Not creating OagisMessageErrorInfo record(s) for original message; ID info: " + originalOagisMsgCtx;
+                Debug.logWarning(errMsg, module);
+                errorMapList.add(UtilMisc.toMap("description", errMsg, "reasonCode", "OriginalOagisMessageInfoNotFoundError"));
             }
-        } else {
-            String errMsg = "No such message with an error was found; Not creating OagisMessageErrorInfo; ID info: " + originalOagisMsgCtx;
-            Debug.logWarning(errMsg, module);
-            errorMapList.add(UtilMisc.toMap("description", errMsg, "reasonCode", "OriginalOagisMessageInfoNotFoundError"));
+
+            // now attach all of the messages to the CBOD OagisMessageInfo record
+            Map cbodOagisMsgInfoBaseCtx = FastMap.newInstance();
+            cbodOagisMsgInfoBaseCtx.put("logicalId", logicalId);
+            cbodOagisMsgInfoBaseCtx.put("component", component);
+            cbodOagisMsgInfoBaseCtx.put("task", task);
+            cbodOagisMsgInfoBaseCtx.put("referenceId", referenceId);
+            cbodOagisMsgInfoBaseCtx.put("userLogin", userLogin);
+            Iterator dataAreaConfirmMsgListItr = dataAreaConfirmMsgList.iterator();
+            while (dataAreaConfirmMsgListItr.hasNext()) {
+                Element dataAreaConfirmMsgElement = (Element) dataAreaConfirmMsgListItr.next();
+                String description = UtilXml.childElementValue(dataAreaConfirmMsgElement, "of:DESCRIPTN");
+                String reasonCode = UtilXml.childElementValue(dataAreaConfirmMsgElement, "of:REASONCODE");
+                
+                Map createOagisMessageErrorInfoForCbod = FastMap.newInstance();
+                createOagisMessageErrorInfoForCbod.putAll(cbodOagisMsgInfoBaseCtx);
+                createOagisMessageErrorInfoForCbod.put("reasonCode", reasonCode);
+                createOagisMessageErrorInfoForCbod.put("description", description);
+
+                // this one will also go in another transaction as the create service for the base record did too
+                Map oagisMsgErrorInfoResult = dispatcher.runSync("createOagisMessageErrorInfo", createOagisMessageErrorInfoForCbod, 60, true);
+                if (ServiceUtil.isError(oagisMsgErrorInfoResult)){
+                    String errMsg = "Error creating OagisMessageErrorInfo: " + ServiceUtil.getErrorMessage(oagisMsgErrorInfoResult);
+                    Debug.logError(errMsg, module);
+                }
+            }
+        } catch (Throwable t) {
+            String errMsg = "System Error processing Confirm BOD message: " + t.toString();
+            Debug.logError(t, errMsg, module);
+            return ServiceUtil.returnError(errMsg);
         }
-        
+
         Map result = FastMap.newInstance();
         result.put("logicalId", logicalId);
         result.put("component", component);
@@ -373,13 +386,13 @@
             saveErrorMapListCtx.put("task", task);
             saveErrorMapListCtx.put("referenceId", referenceId);
             saveErrorMapListCtx.put("errorMapList", errorMapList);
+            saveErrorMapListCtx.put("userLogin", userLogin);
             try {
                 dispatcher.runSync("createOagisMsgErrInfosFromErrMapList", saveErrorMapListCtx, 60, true);
             } catch (GenericServiceException e){
                 String errMsg = "Error updating OagisMessageInfo for the Incoming Message: " + e.toString();
                 Debug.logError(e, errMsg, module);
             }
-
             
             // TODO and NOTE DEJ20070813: should we really send back a Confirm BOD if there is an error with the Confirm BOD they send us? probably so... will do for now...
             try {
@@ -395,8 +408,8 @@
                 Debug.logError(e, errMsg, module);
             }
             
-            // DEJ20070807 what was this next line commented out? if there are errors we want to return an error so this will roll back
-            result.putAll(ServiceUtil.returnError("Errors found processing message; information saved and return error sent back"));
+            // return success here so that the message won't be retried and the Confirm BOD, etc won't be sent multiple times
+            result.putAll(ServiceUtil.returnSuccess("Errors found processing message; information saved and return error sent back"));
             return result;
         } else {
             oagisMsgInfoCtx.put("processingStatusId", "OAGMP_PROC_SUCCESS");
@@ -418,6 +431,14 @@
         LocalDispatcher dispatcher = ctx.getDispatcher();
         InputStream in = (InputStream) context.get("inputStream");
         List errorList = FastList.newInstance();
+
+        GenericValue userLogin = null;
+        try {
+            userLogin = delegator.findByPrimaryKey("UserLogin", UtilMisc.toMap("userLoginId", "system"));    
+        } catch (GenericEntityException e){
+            String errMsg = "Error Getting UserLogin with userLoginId system: "+e.toString();
+            Debug.logError(e, errMsg, module);
+        }
         
         Document doc = null;
         String xmlText = null;
@@ -480,7 +501,7 @@
             Debug.logError(e, errMsg, module);
         }
         
-        Map messageProcessContext = UtilMisc.toMap("document", doc);
+        Map messageProcessContext = UtilMisc.toMap("document", doc, "userLogin", userLogin);
         
         // call async, no additional results to return: Map subServiceResult = FastMap.newInstance();
         if (UtilValidate.isNotEmpty(oagisMessageInfo)) {

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?view=diff&rev=566646&r1=566645&r2=566646
==============================================================================
--- ofbiz/trunk/specialpurpose/oagis/src/org/ofbiz/oagis/OagisShipmentServices.java (original)
+++ ofbiz/trunk/specialpurpose/oagis/src/org/ofbiz/oagis/OagisShipmentServices.java Thu Aug 16 03:22:17 2007
@@ -168,7 +168,7 @@
         try {
             shipment = delegator.findByPrimaryKey("Shipment", UtilMisc.toMap("shipmentId", shipmentId));
         } catch (GenericEntityException e) {
-            String errMsg = "Error getting Shipment from database: "+ e.toString();
+            String errMsg = "Error getting Shipment from database: " + e.toString();
             Debug.logInfo(e, errMsg, module);
             errorMapList.add(UtilMisc.toMap("description", errMsg, "reasonCode", "GenericEntityException"));
         }
@@ -178,12 +178,12 @@
             errorMapList.add(UtilMisc.toMap("description", errMsg, "reasonCode", "ShipmentIdNotValid"));
         }
         
-        String shipGroupSeqId = shipment.getString("primaryShipGroupSeqId");                
-        String originFacilityId = shipment.getString("originFacilityId");                              
-        
         List shipUnitElementList = UtilXml.childElementList(daShowShipmentElement, "ns:SHIPUNIT"); // n
         if (errorMapList.size() == 0 && UtilValidate.isNotEmpty(shipUnitElementList)) {
             try {
+                String shipGroupSeqId = shipment.getString("primaryShipGroupSeqId");
+                String originFacilityId = shipment.getString("originFacilityId");
+                
                 Element shipUnitElement = (Element)shipUnitElementList.get(0);
                 String trackingNum = UtilXml.childElementValue(shipUnitElement, "of:TRACKINGID"); // of
                 String carrierCode = UtilXml.childElementValue(shipUnitElement, "of:CARRIER"); // of
@@ -401,9 +401,10 @@
                     }
                 }
             } catch (Throwable t) {
-                String errMsg = "Error processing Show Shipment message: " + t.toString();
-                errorMapList.add(UtilMisc.toMap("description", errMsg, "reasonCode", "Exception"));
+                String errMsg = "System Error processing Show Shipment message: " + t.toString();
                 Debug.logInfo(t, errMsg, module);
+                // in this case we don't want to return a Confirm BOD, so return an error now
+                return ServiceUtil.returnError(errMsg);
             }
         }  
         
@@ -430,6 +431,7 @@
             saveErrorMapListCtx.put("task", task);
             saveErrorMapListCtx.put("referenceId", referenceId);
             saveErrorMapListCtx.put("errorMapList", errorMapList);
+            saveErrorMapListCtx.put("userLogin", userLogin);
             try {
                 dispatcher.runSync("createOagisMsgErrInfosFromErrMapList", saveErrorMapListCtx, 60, true);
             } catch (GenericServiceException e){
@@ -450,8 +452,8 @@
                 Debug.logError(e, errMsg, module);
             }
             
-            // DEJ20070807 what was this next line commented out? if there are errors we want to return an error so this will roll back
-            result.putAll(ServiceUtil.returnError("Errors found processing message; information saved and return error sent back"));
+            // return success here so that the message won't be retried and the Confirm BOD, etc won't be sent multiple times
+            result.putAll(ServiceUtil.returnSuccess("Errors found processing message; information saved and return error sent back"));
             return result;
         } else {
             try {