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

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk/specialpurpose@567672 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
David E. Jones
2007-08-20 12:40:30 +00:00
parent 881d5a38d9
commit d28fddffb2
6 changed files with 49 additions and 47 deletions
+5 -3
View File
@@ -25,15 +25,17 @@ under the License.
<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>
+12 -12
View File
@@ -94,8 +94,8 @@ under the License.
<!-- ==================================== -->
<!-- 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 @@ under the License.
<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 @@ under the License.
<!-- ==================================== -->
<!-- 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 @@ under the License.
</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"/>
@@ -61,7 +61,7 @@ public class OagisInventoryServices {
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 @@ public class OagisInventoryServices {
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 @@ public class OagisInventoryServices {
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 @@ public class OagisInventoryServices {
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 @@ public class OagisInventoryServices {
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
+12 -12
View File
@@ -529,21 +529,21 @@ public class OagisServices {
}
} 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 @@ public class OagisServices {
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);
}
@@ -80,7 +80,7 @@ public class OagisShipmentServices {
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 @@ public class OagisShipmentServices {
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 @@ public class OagisShipmentServices {
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 @@ public class OagisShipmentServices {
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 @@ public class OagisShipmentServices {
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 @@ public class OagisShipmentServices {
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 @@ public class OagisShipmentServices {
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");
+8 -8
View File
@@ -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>