Author: jonesde
Date: Sun Aug 26 19:30:23 2007 New Revision: 569963 URL: http://svn.apache.org/viewvc?rev=569963&view=rev Log: Added service to take Set of orderIds that are no longer on backorder and call the oagisSendProcessShipment message for each; uses new Set returned by balanceInventoryItems service; as per normal the SECAs are commented out so that none of this runs by default 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 Modified: ofbiz/trunk/specialpurpose/oagis/servicedef/secas.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/oagis/servicedef/secas.xml?rev=569963&r1=569962&r2=569963&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/oagis/servicedef/secas.xml (original) +++ ofbiz/trunk/specialpurpose/oagis/servicedef/secas.xml Sun Aug 26 19:30:23 2007 @@ -27,15 +27,13 @@ <condition-field field-name="statusId" operator="not-equals" to-field-name="oldStatusId"/> <action service="oagisSendProcessShipment" mode="async" persist="true"/> </eca> + <eca service="balanceInventoryItems" event="commit"> + <condition field-name="noLongerOnBackOrderIdSet" operator="is-not-empty"/> + <action service="oagisSendProcessShipmentsFromBackOrderSet" mode="async"/> + </eca> <eca service="updateReturnHeader" event="commit"> <condition field-name="statusId" operator="equals" value="RETURN_ACCEPTED"/> <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="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=569963&r1=569962&r2=569963&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/oagis/servicedef/services.xml (original) +++ ofbiz/trunk/specialpurpose/oagis/servicedef/services.xml Sun Aug 26 19:30:23 2007 @@ -105,6 +105,10 @@ <attribute name="outputStream" type="java.io.OutputStream" mode="IN" optional="true"/> <attribute name="orderId" mode="IN" type="String" optional="false"/> </service> + <service name="oagisSendProcessShipmentsFromBackOrderSet" engine="java" + location="org.ofbiz.oagis.OagisShipmentServices" invoke="oagisSendProcessShipmentsFromBackOrderSet"> + <attribute name="noLongerOnBackOrderIdSet" type="Set" mode="IN" optional="false"/> + </service> <service name="oagisSendReceiveDelivery" max-retry="0" engine="java" location="org.ofbiz.oagis.OagisShipmentServices" invoke="oagisSendReceiveDelivery"> 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=569963&r1=569962&r2=569963&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/oagis/src/org/ofbiz/oagis/OagisInventoryServices.java (original) +++ ofbiz/trunk/specialpurpose/oagis/src/org/ofbiz/oagis/OagisInventoryServices.java Sun Aug 26 19:30:23 2007 @@ -75,7 +75,7 @@ GenericValue userLogin = null; try { userLogin = delegator.findByPrimaryKey("UserLogin", UtilMisc.toMap("userLoginId", "system")); - } catch (GenericEntityException e){ + } catch (GenericEntityException e) { String errMsg = "Error Getting UserLogin: " + e.toString(); Debug.logError(e, errMsg, module); } @@ -307,7 +307,7 @@ try { comiCtx.put("processingStatusId", "OAGMP_PROC_ERROR"); dispatcher.runSync("updateOagisMessageInfo", comiCtx, 60, true); - } catch (GenericServiceException e){ + } catch (GenericServiceException e) { String errMsg = "Error updating OagisMessageInfo for the Incoming Message: " + e.toString(); Debug.logError(e, errMsg, module); } @@ -322,7 +322,7 @@ saveErrorMapListCtx.put("userLogin", userLogin); try { dispatcher.runSync("createOagisMsgErrInfosFromErrMapList", saveErrorMapListCtx, 60, true); - } catch (GenericServiceException e){ + } catch (GenericServiceException e) { String errMsg = "Error updating OagisMessageInfo for the Incoming Message: " + e.toString(); Debug.logError(e, errMsg, module); } @@ -335,7 +335,7 @@ // run async because this will send a message back to the other server and may take some time, and/or fail dispatcher.runAsync("oagisSendConfirmBod", sendConfirmBodCtx, null, true, 60, true); - } catch (GenericServiceException e){ + } catch (GenericServiceException e) { String errMsg = "Error sending Confirm BOD: " + e.toString(); Debug.logError(e, errMsg, module); } @@ -347,7 +347,7 @@ try { comiCtx.put("processingStatusId", "OAGMP_PROC_SUCCESS"); dispatcher.runSync("updateOagisMessageInfo", comiCtx, 60, true); - } catch (GenericServiceException e){ + } catch (GenericServiceException e) { String errMsg = "Error updating OagisMessageInfo for the Incoming Message: " + e.toString(); // don't pass this back, nothing they can do about it: errorMapList.add(UtilMisc.toMap("description", errMsg, "reasonCode", "GenericServiceException")); Debug.logError(e, errMsg, module); @@ -557,7 +557,7 @@ try { comiCtx.put("processingStatusId", "OAGMP_PROC_ERROR"); dispatcher.runSync("updateOagisMessageInfo", comiCtx, 60, true); - } catch (GenericServiceException e){ + } catch (GenericServiceException e) { String errMsg = "Error updating OagisMessageInfo for the Incoming Message: " + e.toString(); Debug.logError(e, errMsg, module); } @@ -572,7 +572,7 @@ saveErrorMapListCtx.put("userLogin", userLogin); try { dispatcher.runSync("createOagisMsgErrInfosFromErrMapList", saveErrorMapListCtx, 60, true); - } catch (GenericServiceException e){ + } catch (GenericServiceException e) { String errMsg = "Error updating OagisMessageInfo for the Incoming Message: " + e.toString(); Debug.logError(e, errMsg, module); } @@ -585,7 +585,7 @@ // run async because this will send a message back to the other server and may take some time, and/or fail dispatcher.runAsync("oagisSendConfirmBod", sendConfirmBodCtx, null, true, 60, true); - } catch (GenericServiceException e){ + } catch (GenericServiceException e) { String errMsg = "Error sending Confirm BOD: " + e.toString(); Debug.logError(e, errMsg, module); } @@ -597,7 +597,7 @@ comiCtx.put("processingStatusId", "OAGMP_PROC_SUCCESS"); try { dispatcher.runSync("updateOagisMessageInfo", comiCtx, 60, true); - } catch (GenericServiceException e){ + } catch (GenericServiceException e) { String errMsg = "Error updating OagisMessageInfo for the Incoming Message: " + e.toString(); // don't pass this back, nothing they can do about it: errorMapList.add(UtilMisc.toMap("description", errMsg, "reasonCode", "GenericServiceException")); Debug.logError(e, errMsg, module); @@ -795,7 +795,7 @@ if (inventoryItem !=null) { productId = inventoryItem.getString("productId"); } - } catch (GenericEntityException e){ + } catch (GenericEntityException e) { String errMsg = "Error Getting Entity InventoryItem"; Debug.logError(e, errMsg, module); } */ @@ -1033,7 +1033,7 @@ try { comiCtx.put("processingStatusId", "OAGMP_PROC_ERROR"); dispatcher.runSync("updateOagisMessageInfo", comiCtx, 60, true); - } catch (GenericServiceException e){ + } catch (GenericServiceException e) { String errMsg = "Error updating OagisMessageInfo for the Incoming Message: " + e.toString(); Debug.logError(e, errMsg, module); } @@ -1048,7 +1048,7 @@ saveErrorMapListCtx.put("userLogin", userLogin); try { dispatcher.runSync("createOagisMsgErrInfosFromErrMapList", saveErrorMapListCtx, 60, true); - } catch (GenericServiceException e){ + } catch (GenericServiceException e) { String errMsg = "Error updating OagisMessageInfo for the Incoming Message: " + e.toString(); Debug.logError(e, errMsg, module); } @@ -1062,7 +1062,7 @@ // run async because this will send a message back to the other server and may take some time, and/or fail dispatcher.runAsync("oagisSendConfirmBod", sendConfirmBodCtx, null, true, 60, true); - } catch (GenericServiceException e){ + } catch (GenericServiceException e) { String errMsg = "Error sending Confirm BOD: " + e.toString(); Debug.logError(e, errMsg, module); } @@ -1074,7 +1074,7 @@ comiCtx.put("processingStatusId", "OAGMP_PROC_SUCCESS"); try { dispatcher.runSync("updateOagisMessageInfo", comiCtx, 60, true); - } catch (GenericServiceException e){ + } catch (GenericServiceException e) { String errMsg = "Error updating OagisMessageInfo for the Incoming Message: " + e.toString(); // don't pass this back, nothing they can do about it: errorMapList.add(UtilMisc.toMap("description", errMsg, "reasonCode", "GenericServiceException")); Debug.logError(e, errMsg, module); @@ -1319,7 +1319,7 @@ try { comiCtx.put("processingStatusId", "OAGMP_PROC_ERROR"); dispatcher.runSync("updateOagisMessageInfo", comiCtx, 60, true); - } catch (GenericServiceException e){ + } catch (GenericServiceException e) { String errMsg = "Error updating OagisMessageInfo for the Incoming Message: " + e.toString(); Debug.logError(e, errMsg, module); } @@ -1334,7 +1334,7 @@ saveErrorMapListCtx.put("userLogin", userLogin); try { dispatcher.runSync("createOagisMsgErrInfosFromErrMapList", saveErrorMapListCtx, 60, true); - } catch (GenericServiceException e){ + } catch (GenericServiceException e) { String errMsg = "Error updating OagisMessageInfo for the Incoming Message: " + e.toString(); Debug.logError(e, errMsg, module); } @@ -1345,7 +1345,7 @@ // run async because this will send a message back to the other server and may take some time, and/or fail dispatcher.runAsync("oagisSendConfirmBod", sendConfirmBodCtx, null, true, 60, true); - } catch (GenericServiceException e){ + } catch (GenericServiceException e) { String errMsg = "Error sending Confirm BOD: " + e.toString(); Debug.logError(e, errMsg, module); } @@ -1357,7 +1357,7 @@ comiCtx.put("processingStatusId", "OAGMP_PROC_SUCCESS"); try { dispatcher.runSync("updateOagisMessageInfo", comiCtx, 60, true); - } catch (GenericServiceException e){ + } catch (GenericServiceException e) { String errMsg = "Error updating OagisMessageInfo for the Incoming Message: " + e.toString(); // don't pass this back, nothing they can do about it: errorMapList.add(UtilMisc.toMap("description", errMsg, "reasonCode", "GenericServiceException")); Debug.logError(e, errMsg, module); 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=569963&r1=569962&r2=569963&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/oagis/src/org/ofbiz/oagis/OagisServices.java (original) +++ ofbiz/trunk/specialpurpose/oagis/src/org/ofbiz/oagis/OagisServices.java Sun Aug 26 19:30:23 2007 @@ -198,7 +198,7 @@ } try { dispatcher.runSync("updateOagisMessageInfo", oagisMsgInfoContext, 60, true); - } catch (GenericServiceException e){ + } catch (GenericServiceException e) { String errMsg = UtilProperties.getMessage(ServiceUtil.resource, "OagisErrorInCreatingDataForOagisMessageInfoEntity", (Locale) context.get("locale")); Debug.logError(e, errMsg, module); } @@ -212,7 +212,7 @@ oagisMsgInfoContext.put("processingStatusId", "OAGMP_SENT"); try { dispatcher.runSync("updateOagisMessageInfo", oagisMsgInfoContext, 60, true); - } catch (GenericServiceException e){ + } catch (GenericServiceException e) { String errMsg = UtilProperties.getMessage(ServiceUtil.resource, "OagisErrorInCreatingDataForOagisMessageInfoEntity", (Locale) context.get("locale")); Debug.logError(e, errMsg, module); } @@ -229,7 +229,7 @@ GenericValue userLogin = null; try { userLogin = delegator.findByPrimaryKey("UserLogin",UtilMisc.toMap("userLoginId", "system")); - } catch (GenericEntityException e){ + } catch (GenericEntityException e) { String errMsg = "Error Getting UserLogin with userLoginId 'system':" + e.toString(); Debug.logError(e, errMsg, module); } @@ -298,7 +298,7 @@ try { dispatcher.runSync("createOagisMessageInfo", oagisMsgInfoCtx, 60, true); /* running async for better error handling - if (ServiceUtil.isError(oagisMsgInfoResult)){ + if (ServiceUtil.isError(oagisMsgInfoResult)) { String errMsg = "Error creating OagisMessageInfo for the Incoming Message: "+ServiceUtil.getErrorMessage(oagisMsgInfoResult); errorMapList.add(UtilMisc.toMap("description", errMsg, "reasonCode", "CreateOagisMessageInfoServiceError")); Debug.logError(errMsg, module); @@ -328,7 +328,7 @@ createOagisMessageErrorInfoForOriginal.put("description", description); Map oagisMsgErrorInfoResult = dispatcher.runSync("createOagisMessageErrorInfo", createOagisMessageErrorInfoForOriginal); - if (ServiceUtil.isError(oagisMsgErrorInfoResult)){ + if (ServiceUtil.isError(oagisMsgErrorInfoResult)) { String errMsg = "Error creating OagisMessageErrorInfo: " + ServiceUtil.getErrorMessage(oagisMsgErrorInfoResult); errorMapList.add(UtilMisc.toMap("description", errMsg, "reasonCode", "CreateOagisMessageErrorInfoServiceError")); Debug.logError(errMsg, module); @@ -360,7 +360,7 @@ // 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)){ + if (ServiceUtil.isError(oagisMsgErrorInfoResult)) { String errMsg = "Error creating OagisMessageErrorInfo: " + ServiceUtil.getErrorMessage(oagisMsgErrorInfoResult); Debug.logError(errMsg, module); } @@ -389,7 +389,7 @@ saveErrorMapListCtx.put("userLogin", userLogin); try { dispatcher.runSync("createOagisMsgErrInfosFromErrMapList", saveErrorMapListCtx, 60, true); - } catch (GenericServiceException e){ + } catch (GenericServiceException e) { String errMsg = "Error updating OagisMessageInfo for the Incoming Message: " + e.toString(); Debug.logError(e, errMsg, module); } @@ -403,7 +403,7 @@ // run async because this will send a message back to the other server and may take some time, and/or fail dispatcher.runAsync("oagisSendConfirmBod", sendConfirmBodCtx, null, true, 60, true); - } catch (GenericServiceException e){ + } catch (GenericServiceException e) { String errMsg = "Error updating OagisMessageInfo for the Incoming Message: " + e.toString(); Debug.logError(e, errMsg, module); } @@ -415,7 +415,7 @@ oagisMsgInfoCtx.put("processingStatusId", "OAGMP_PROC_SUCCESS"); try { dispatcher.runSync("updateOagisMessageInfo", oagisMsgInfoCtx, 60, true); - } catch (GenericServiceException e){ + } catch (GenericServiceException e) { String errMsg = "Error updating OagisMessageInfo for the Incoming Message: " + e.toString(); // don't pass this back, nothing they can do about it: errorMapList.add(UtilMisc.toMap("description", errMsg, "reasonCode", "GenericServiceException")); Debug.logError(e, errMsg, module); @@ -435,7 +435,7 @@ GenericValue userLogin = null; try { userLogin = delegator.findByPrimaryKey("UserLogin", UtilMisc.toMap("userLoginId", "system")); - } catch (GenericEntityException e){ + } catch (GenericEntityException e) { String errMsg = "Error Getting UserLogin with userLoginId system: "+e.toString(); Debug.logError(e, errMsg, module); } @@ -526,7 +526,7 @@ try { // run async because this will send a message back to the other server and may take some time, and/or fail dispatcher.runAsync("oagisSendConfirmBod", sendConfirmBodCtx, null, true, 60, true); - } catch (GenericServiceException e){ + } catch (GenericServiceException e) { String errMsg = "Error sending Confirm BOD: " + e.toString(); 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=569963&r1=569962&r2=569963&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/oagis/src/org/ofbiz/oagis/OagisShipmentServices.java (original) +++ ofbiz/trunk/specialpurpose/oagis/src/org/ofbiz/oagis/OagisShipmentServices.java Sun Aug 26 19:30:23 2007 @@ -57,7 +57,9 @@ import org.ofbiz.service.DispatchContext; import org.ofbiz.service.GenericServiceException; import org.ofbiz.service.LocalDispatcher; +import org.ofbiz.service.ServiceAuthException; import org.ofbiz.service.ServiceUtil; +import org.ofbiz.service.ServiceValidationException; import org.ofbiz.widget.fo.FoFormRenderer; import org.ofbiz.widget.html.HtmlScreenRenderer; import org.ofbiz.widget.screen.ScreenRenderer; @@ -94,7 +96,7 @@ GenericValue userLogin = null; try { userLogin = delegator.findByPrimaryKey("UserLogin", UtilMisc.toMap("userLoginId", "system")); - } catch (GenericEntityException e){ + } catch (GenericEntityException e) { String errMsg = "Error Getting UserLogin with userLoginId system: "+e.toString(); Debug.logError(e, errMsg, module); } @@ -154,13 +156,13 @@ dispatcher.runSync("createOagisMessageInfo", oagisMsgInfoCtx, 60, true); } /* running async for better error handling - if (ServiceUtil.isError(oagisMsgInfoResult)){ + if (ServiceUtil.isError(oagisMsgInfoResult)) { String errMsg = ServiceUtil.getErrorMessage(oagisMsgInfoResult); // errorMapList.add(UtilMisc.toMap("description", errMsg, "reasonCode", "CreateOagisMessageInfoServiceError")); Debug.logError(errMsg, module); } */ - } catch (GenericServiceException e){ + } catch (GenericServiceException e) { String errMsg = "Error creating OagisMessageInfo for the Incoming Message: "+e.toString(); // don't pass this back, nothing they can do about it: errorMapList.add(UtilMisc.toMap("description", errMsg, "reasonCode", "GenericServiceException")); Debug.logError(e, errMsg, module); @@ -189,7 +191,7 @@ Element shipUnitElement = (Element)shipUnitElementList.get(0); String trackingNum = UtilXml.childElementValue(shipUnitElement, "of:TRACKINGID"); // of String carrierCode = UtilXml.childElementValue(shipUnitElement, "of:CARRIER"); // of - if (UtilValidate.isNotEmpty(carrierCode)){ + if (UtilValidate.isNotEmpty(carrierCode)) { String carrierPartyId = null; if ( carrierCode.startsWith("F") || carrierCode.startsWith("f")) { carrierPartyId = "FEDEX"; @@ -197,7 +199,7 @@ carrierPartyId = "UPS"; } Map resultMap = dispatcher.runSync("updateShipmentRouteSegment", UtilMisc.toMap("shipmentId", shipmentId, "shipmentRouteSegmentId", "00001", "carrierPartyId", carrierPartyId, "trackingIdNumber", trackingNum, "userLogin", userLogin)); - if (ServiceUtil.isError(resultMap)){ + if (ServiceUtil.isError(resultMap)) { String errMsg = ServiceUtil.getErrorMessage(resultMap); errorMapList.add(UtilMisc.toMap("description", errMsg, "reasonCode", "updateShipmentRouteSegmentError")); Debug.logError(errMsg, module); @@ -444,7 +446,7 @@ isitspastCtx.put("inventoryItemId", orderItemShipGrpInvReservation.get("inventoryItemId")); isitspastCtx.remove("itemIssuanceId"); Map resultMap = dispatcher.runSync("issueSerializedInvToShipmentPackageAndSetTracking", isitspastCtx); - if (ServiceUtil.isError(resultMap)){ + if (ServiceUtil.isError(resultMap)) { String errMsg = ServiceUtil.getErrorMessage(resultMap); errorMapList.add(UtilMisc.toMap("description", errMsg, "reasonCode", "IssueSerializedInvServiceError")); Debug.logError(errMsg, module); @@ -454,7 +456,7 @@ isitspastCtx.put("quantity", new Double(quantityToUse)); // NOTE: this same service is called for non-serialized inventory in spite of the name it is made to handle it Map resultMap = dispatcher.runSync("issueSerializedInvToShipmentPackageAndSetTracking", isitspastCtx); - if (ServiceUtil.isError(resultMap)){ + if (ServiceUtil.isError(resultMap)) { String errMsg = ServiceUtil.getErrorMessage(resultMap); errorMapList.add(UtilMisc.toMap("description", errMsg, "reasonCode", "IssueSerializedInvServiceError")); Debug.logError(errMsg, module); @@ -468,7 +470,7 @@ if (errorMapList.size() == 0) { Map resultMap = dispatcher.runSync("setShipmentStatusPackedAndShipped", UtilMisc.toMap("shipmentId", shipmentId, "userLogin", userLogin)); - if (ServiceUtil.isError(resultMap)){ + if (ServiceUtil.isError(resultMap)) { String errMsg = ServiceUtil.getErrorMessage(resultMap); errorMapList.add(UtilMisc.toMap("description", errMsg, "reasonCode", "SetShipmentStatusPackedAndShippedError")); Debug.logError(errMsg, module); @@ -496,7 +498,7 @@ try { oagisMsgInfoCtx.put("processingStatusId", "OAGMP_PROC_ERROR"); dispatcher.runSync("updateOagisMessageInfo", oagisMsgInfoCtx, 60, true); - } catch (GenericServiceException e){ + } catch (GenericServiceException e) { String errMsg = "Error updating OagisMessageInfo for the Incoming Message: " + e.toString(); Debug.logError(e, errMsg, module); } @@ -511,7 +513,7 @@ saveErrorMapListCtx.put("userLogin", userLogin); try { dispatcher.runSync("createOagisMsgErrInfosFromErrMapList", saveErrorMapListCtx, 60, true); - } catch (GenericServiceException e){ + } catch (GenericServiceException e) { String errMsg = "Error updating OagisMessageInfo for the Incoming Message: " + e.toString(); Debug.logError(e, errMsg, module); } @@ -524,7 +526,7 @@ // run async because this will send a message back to the other server and may take some time, and/or fail dispatcher.runAsync("oagisSendConfirmBod", sendConfirmBodCtx, null, true, 60, true); - } catch (GenericServiceException e){ + } catch (GenericServiceException e) { String errMsg = "Error sending Confirm BOD: " + e.toString(); Debug.logError(e, errMsg, module); } @@ -537,7 +539,7 @@ try { oagisMsgInfoCtx.put("processingStatusId", "OAGMP_PROC_SUCCESS"); dispatcher.runSync("updateOagisMessageInfo", oagisMsgInfoCtx, 60, true); - } catch (GenericServiceException e){ + } catch (GenericServiceException e) { String errMsg = "Error updating OagisMessageInfo for the Incoming Message: " + e.toString(); Debug.logError(e, errMsg, module); } @@ -546,6 +548,28 @@ result.putAll(ServiceUtil.returnSuccess("Service Completed Successfully")); return result; } + + public static Map oagisSendProcessShipmentsFromBackOrderSet(DispatchContext ctx, Map context) { + LocalDispatcher dispatcher = ctx.getDispatcher(); + + Set noLongerOnBackOrderIdSet = (Set) context.get("noLongerOnBackOrderIdSet"); + if (UtilValidate.isEmpty(noLongerOnBackOrderIdSet)) { + return ServiceUtil.returnSuccess(); + } + + try { + Iterator noLongerOnBackOrderIdIter = noLongerOnBackOrderIdSet.iterator(); + while (noLongerOnBackOrderIdIter.hasNext()) { + String orderId = (String) noLongerOnBackOrderIdIter.next(); + dispatcher.runAsync("oagisSendProcessShipment", UtilMisc.toMap("orderId", orderId), true); + } + } catch (GenericServiceException e) { + String errMsg = "Error calling oagisSendProcessShipment service for orders with items no longer on backorder: " + e.toString(); + return ServiceUtil.returnError(errMsg); + } + + return ServiceUtil.returnSuccess(); + } public static Map oagisSendProcessShipment(DispatchContext ctx, Map context) { LocalDispatcher dispatcher = ctx.getDispatcher(); @@ -672,7 +696,7 @@ comiCtx.put("userLogin", userLogin); try { dispatcher.runSync("createOagisMessageInfo", comiCtx, 60, true); - } catch (GenericServiceException e){ + } catch (GenericServiceException e) { String errMsg = UtilProperties.getMessage(ServiceUtil.resource, "OagisErrorInCreatingDataForOagisMessageInfoEntity", (Locale) context.get("locale")); Debug.logError(e, errMsg, module); } @@ -817,7 +841,7 @@ comiCtx.put("fullMessageXml", outText); } dispatcher.runSync("updateOagisMessageInfo", comiCtx, 60, true); - } catch (GenericServiceException e){ + } catch (GenericServiceException e) { String errMsg = UtilProperties.getMessage(ServiceUtil.resource, "OagisErrorInCreatingDataForOagisMessageInfoEntity", (Locale) context.get("locale")); Debug.logError(e, errMsg, module); } @@ -828,7 +852,7 @@ try { comiCtx.put("processingStatusId", "OAGMP_SENT"); dispatcher.runSync("updateOagisMessageInfo", comiCtx, 60, true); - } catch (GenericServiceException e){ + } catch (GenericServiceException e) { String errMsg = UtilProperties.getMessage(ServiceUtil.resource, "OagisErrorInCreatingDataForOagisMessageInfoEntity", (Locale) context.get("locale")); Debug.logError(e, errMsg, module); } |
Free forum by Nabble | Edit this page |