Author: apatel
Date: Mon Jul 23 00:11:56 2007 New Revision: 558628 URL: http://svn.apache.org/viewvc?view=rev&rev=558628 Log: Cleaning up of error message response. Modified: ofbiz/trunk/specialpurpose/oagis/script/org/ofbiz/oagis/OagisMessageServices.xml 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/script/org/ofbiz/oagis/OagisMessageServices.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/oagis/script/org/ofbiz/oagis/OagisMessageServices.xml?view=diff&rev=558628&r1=558627&r2=558628 ============================================================================== --- ofbiz/trunk/specialpurpose/oagis/script/org/ofbiz/oagis/OagisMessageServices.xml (original) +++ ofbiz/trunk/specialpurpose/oagis/script/org/ofbiz/oagis/OagisMessageServices.xml Mon Jul 23 00:11:56 2007 @@ -53,6 +53,23 @@ <set-nonpk-fields value-name="lookedUpValue" map-name="parameters"/> <store-value value-name="lookedUpValue"/> </simple-method> + + <simple-method method-name="createOagisMsgErrInfosFromErrMapList" short-description="Create MessageErrorInfo From Error Map List"> + <set field="createOagisMsgErrCtx.logicalId" from-field="parameters.logicalId"/> + <set field="createOagisMsgErrCtx.component" from-field="parameters.component"/> + <set field="createOagisMsgErrCtx.task" from-field="parameters.task"/> + <set field="createOagisMsgErrCtx.referenceId" from-field="parameters.referenceId"/> + <if-not-empty field-name="parameters.errorMapList"> + <iterate list-name="parameters.errorMapList" entry-name="errorMap"> + <set field="createOagisMsgErrCtx.description" from-field="errorMap.description"/> + <set field="createOagisMsgErrCtx.reasonCode" from-field="errorMap.reasonCode"/> + <call-service service-name="createOagisMessageErrorInfo" in-map-name="createOagisMsgErrCtx"/> + </iterate> + <else> + <call-service service-name="createOagisMessageErrorInfo" in-map-name="createOagisMsgErrCtx"/> + </else> + </if-not-empty> + </simple-method> <simple-method method-name="sendProcessShipmentMsg" short-description="Send Process Shipment Message"> Modified: ofbiz/trunk/specialpurpose/oagis/servicedef/secas.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/oagis/servicedef/secas.xml?view=diff&rev=558628&r1=558627&r2=558628 ============================================================================== --- ofbiz/trunk/specialpurpose/oagis/servicedef/secas.xml (original) +++ ofbiz/trunk/specialpurpose/oagis/servicedef/secas.xml Mon Jul 23 00:11:56 2007 @@ -38,7 +38,7 @@ <eca service="receiveConfirmBod" event="commit" run-on-error="true"> <condition field-name="errorMapList" operator="is-not-empty"/> - <action service="createOagisMessageErrorInfo" mode="sync"/> + <action service="createOagisMsgErrInfosFromErrMapList" mode="sync"/> <action service="oagisSendConfirmBod" mode="sync"/> </eca> @@ -52,25 +52,25 @@ <eca service="showShipment" event="commit" run-on-error="true"> <condition field-name="errorMapList" operator="is-not-empty"/> - <action service="createOagisMessageErrorInfo" mode="sync"/> + <action service="createOagisMsgErrInfosFromErrMapList" mode="sync"/> <action service="oagisSendConfirmBod" mode="sync"/> </eca> <eca service="syncInventory" event="commit" run-on-error="true"> <condition field-name="errorMapList" operator="is-not-empty"/> - <action service="createOagisMessageErrorInfo" mode="sync"/> + <action service="createOagisMsgErrInfosFromErrMapList" mode="sync"/> <action service="oagisSendConfirmBod" mode="sync"/> </eca> <eca service="receivePoAcknowledge" event="commit" run-on-error="true"> <condition field-name="errorMapList" operator="is-not-empty"/> - <action service="createOagisMessageErrorInfo" mode="sync"/> + <action service="createOagisMsgErrInfosFromErrMapList" mode="sync"/> <action service="oagisSendConfirmBod" mode="sync"/> </eca> <eca service="receiveRmaAcknowledge" event="commit" run-on-error="true"> <condition field-name="errorMapList" operator="is-not-empty"/> - <action service="createOagisMessageErrorInfo" mode="sync"/> + <action service="createOagisMsgErrInfosFromErrMapList" mode="sync"/> <action service="oagisSendConfirmBod" mode="sync"/> </eca> </service-eca> Modified: ofbiz/trunk/specialpurpose/oagis/servicedef/services.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/oagis/servicedef/services.xml?view=diff&rev=558628&r1=558627&r2=558628 ============================================================================== --- ofbiz/trunk/specialpurpose/oagis/servicedef/services.xml (original) +++ ofbiz/trunk/specialpurpose/oagis/servicedef/services.xml Mon Jul 23 00:11:56 2007 @@ -41,7 +41,10 @@ </service> <service name="oagisMessageErrorInfoInterface" engine="interface"> - <implements service="oagisMessageInfoInterface"/> + <attribute name="logicalId" type="String" mode="OUT" optional="true"/> + <attribute name="component" type="String" mode="OUT" optional="true"/> + <attribute name="task" type="String" mode="OUT" optional="true"/> + <attribute name="referenceId" type="String" mode="OUT" optional="true"/> <attribute name="errorMapList" type="java.util.List" mode="OUT" optional="true"/> </service> @@ -58,7 +61,7 @@ <auto-attributes mode="IN" include="pk" optional="false"/> <auto-attributes mode="IN" include="nonpk" optional="true"/> </service> - + <service name="createOagisMessageErrorInfo" engine="simple" default-entity-name="OagisMessageErrorInfo" location="org/ofbiz/oagis/OagisMessageServices.xml" invoke="createOagisMessageErrorInfo" auth="true"> <description>Create MessageErrorInfo</description> @@ -73,6 +76,15 @@ <auto-attributes mode="IN" include="pk" optional="false"/> <auto-attributes mode="IN" include="nonpk" optional="true"/> </service> + + <service name="createOagisMsgErrInfosFromErrMapList" engine="simple" default-entity-name="OagisMessageErrorInfo" + location="org/ofbiz/oagis/OagisMessageServices.xml" invoke="createOagisMsgErrInfosFromErrMapList" auth="true"> + <description>Create MessageErrorInfo From Error Map List</description> + <auto-attributes mode="IN" include="pk" optional="false"/> + <attribute type="List" mode="IN" name="errorMapList" optional="true"/> + <override name="errorSeqId" optional="true"/> + </service> + <service name="showShipment" engine="java" transaction-timeout="300" location="org.ofbiz.oagis.OagisShipmentServices" invoke="showShipment" auth="false"> <description>Process incoming shipment message</description> @@ -106,11 +118,6 @@ <description>Process incoming Inventory Sync message</description> <implements service="serviceStreamInterface"/> <implements service="oagisMessageErrorInfoInterface"/> - <attribute name="logicalId" type="String" mode="OUT" optional="true"/> - <attribute name="component" type="String" mode="OUT" optional="true"/> - <attribute name="task" type="String" mode="OUT" optional="true"/> - <attribute name="referenceId" type="String" mode="OUT" optional="true"/> - </service> <service name="exportMsgFromScreen" max-retry="0" engine="java" location="org.ofbiz.oagis.OagisShipmentServices" invoke="exportMsgFromScreen"> 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=558628&r1=558627&r2=558628 ============================================================================== --- ofbiz/trunk/specialpurpose/oagis/src/org/ofbiz/oagis/OagisInventoryServices.java (original) +++ ofbiz/trunk/specialpurpose/oagis/src/org/ofbiz/oagis/OagisInventoryServices.java Mon Jul 23 00:11:56 2007 @@ -296,7 +296,11 @@ // check error list if there is any if (errorMapList.size() > 0) { - result.putAll(comiCtx); + result.put("logicalId", logicalId); + result.put("component", component); + result.put("task", task); + result.put("referenceId", referenceId); + result.put("userLogin", userLogin); result.put("errorMapList", errorMapList); String errMsg = "Error Processing Received Messages"; result.putAll(ServiceUtil.returnError(errMsg)); @@ -550,7 +554,11 @@ result.put("contentType", "text/plain"); if (errorMapList.size() > 0) { - result.putAll(comiCtx); + result.put("logicalId", logicalId); + result.put("component", component); + result.put("task", task); + result.put("referenceId", referenceId); + result.put("userLogin", userLogin); result.put("errorMapList", errorMapList); String errMsg = "Error Processing Received Messages"; result.putAll(ServiceUtil.returnError(errMsg)); @@ -794,7 +802,11 @@ Map result = FastMap.newInstance(); result.put("contentType", "text/plain"); if (errorMapList.size() > 0) { - result.putAll(comiCtx); + result.put("logicalId", logicalId); + result.put("component", component); + result.put("task", task); + result.put("referenceId", referenceId); + result.put("userLogin", userLogin); result.put("errorMapList", errorMapList); String errMsg = "Error Processing Received Messages"; result.putAll(ServiceUtil.returnError(errMsg)); 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=558628&r1=558627&r2=558628 ============================================================================== --- ofbiz/trunk/specialpurpose/oagis/src/org/ofbiz/oagis/OagisServices.java (original) +++ ofbiz/trunk/specialpurpose/oagis/src/org/ofbiz/oagis/OagisServices.java Mon Jul 23 00:11:56 2007 @@ -238,8 +238,8 @@ String task = UtilXml.childElementValue(docSenderElement, "N2:TASK"); String referenceId = UtilXml.childElementValue(docSenderElement, "N2:REFERENCEID"); String confirmation = UtilXml.childElementValue(docSenderElement, "N2:CONFIRMATION"); - String language = UtilXml.childElementValue(docSenderElement, "N2:LANGUAGE"); - String codepage = UtilXml.childElementValue(docSenderElement, "N2:CODEPAGE"); + //String language = UtilXml.childElementValue(docSenderElement, "N2:LANGUAGE"); + //String codepage = UtilXml.childElementValue(docSenderElement, "N2:CODEPAGE"); String authId = UtilXml.childElementValue(docSenderElement, "N2:AUTHID"); String sentDate = UtilXml.childElementValue(docCtrlAreaElement, "N1:DATETIMEANY"); @@ -333,7 +333,11 @@ result.put("contentType", "text/plain"); if (errorMapList.size()>0){ - result.putAll(oagisMsgInfoCtx); + result.put("logicalId", logicalId); + result.put("component", component); + result.put("task", task); + result.put("referenceId", referenceId); + result.put("userLogin", userLogin); String errMsg = "Error Processing Received Message"; result.put("errorMapList", errorMapList); //result.putAll(ServiceUtil.returnError(errMsg)); 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=558628&r1=558627&r2=558628 ============================================================================== --- ofbiz/trunk/specialpurpose/oagis/src/org/ofbiz/oagis/OagisShipmentServices.java (original) +++ ofbiz/trunk/specialpurpose/oagis/src/org/ofbiz/oagis/OagisShipmentServices.java Mon Jul 23 00:11:56 2007 @@ -226,10 +226,14 @@ Map result = new HashMap(); result.put("contentType","text/plain"); if (errorMapList.size() > 0) { - //result.putAll(ServiceUtil.returnError("Errors found processing message")); - result.putAll(oagisMsgInfoCtx); - result.put("errorMapList", errorMapList); - return result; + //result.putAll(ServiceUtil.returnError("Errors found processing message")); + result.put("logicalId", logicalId); + result.put("component", component); + result.put("task", task); + result.put("referenceId", referenceId); + result.put("userLogin", userLogin); + result.put("errorMapList", errorMapList); + return result; } result.putAll(ServiceUtil.returnSuccess("Service Completed Successfully")); |
Free forum by Nabble | Edit this page |