svn commit: r576816 - in /ofbiz/trunk/specialpurpose/oagis: ofbiz-component.xml servicedef/secas.xml servicedef/services.xml 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: r576816 - in /ofbiz/trunk/specialpurpose/oagis: ofbiz-component.xml servicedef/secas.xml servicedef/services.xml src/org/ofbiz/oagis/OagisShipmentServices.java

jonesde
Author: jonesde
Date: Tue Sep 18 03:07:57 2007
New Revision: 576816

URL: http://svn.apache.org/viewvc?rev=576816&view=rev
Log:
Some adjustments to the services so that they will run on global-commit, or global-commit-post-run where needed; also changed the configuration so that the secas file is not commented out, but the eca ref in the ofbiz-component.xml file is, this allows add in components to mount that eca rule themselves; in general a number of bug fixes so these work again

Modified:
    ofbiz/trunk/specialpurpose/oagis/ofbiz-component.xml
    ofbiz/trunk/specialpurpose/oagis/servicedef/secas.xml
    ofbiz/trunk/specialpurpose/oagis/servicedef/services.xml
    ofbiz/trunk/specialpurpose/oagis/src/org/ofbiz/oagis/OagisShipmentServices.java

Modified: ofbiz/trunk/specialpurpose/oagis/ofbiz-component.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/oagis/ofbiz-component.xml?rev=576816&r1=576815&r2=576816&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/oagis/ofbiz-component.xml (original)
+++ ofbiz/trunk/specialpurpose/oagis/ofbiz-component.xml Tue Sep 18 03:07:57 2007
@@ -31,8 +31,9 @@
     <entity-resource type="data" reader-name="seed" loader="main" location="data/OagisTypeData.xml"/>
     
     <service-resource type="model" loader="main" location="servicedef/services.xml"/>
-    <!-- Uncomment To activate automatic messaging to the partner -->
-    <service-resource type="eca" loader="main" location="servicedef/secas.xml"/>      
+    <!-- Uncomment To activate automatic messaging to the partner
+    <service-resource type="eca" loader="main" location="servicedef/secas.xml"/>
+    -->      
     
     <webapp name="oagis"
         title="Oagis"

Modified: ofbiz/trunk/specialpurpose/oagis/servicedef/secas.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/oagis/servicedef/secas.xml?rev=576816&r1=576815&r2=576816&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/oagis/servicedef/secas.xml (original)
+++ ofbiz/trunk/specialpurpose/oagis/servicedef/secas.xml Tue Sep 18 03:07:57 2007
@@ -20,20 +20,18 @@
 
 <service-eca xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/service-eca.xsd">
-    <!-- uncomment these to enable OAGIS message sending
+    <!-- uncomment these to enable OAGIS message sending -->
     <eca service="changeOrderStatus" event="global-commit" run-on-error="false">
         <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="oagisSendProcessShipment" mode="async" persist="true"/>
     </eca>
-    <eca service="balanceInventoryItems" event="global-commit" run-on-error="false">
-        <condition field-name="noLongerOnBackOrderIdSet" operator="is-not-empty"/>
+    <eca service="balanceInventoryItems" event="global-commit-post-run" run-on-error="false">
+        <!-- NOTE: no condition because the condition we want is in the result of the service call and these are evaluated before the service call, so we check it inside the service: <condition field-name="noLongerOnBackOrderIdSet" operator="is-not-empty"/> -->
         <action service="oagisSendProcessShipmentsFromBackOrderSet" mode="async"/>
     </eca>
     <eca service="updateReturnHeader" event="global-commit" run-on-error="false">
         <condition field-name="statusId" operator="equals" value="RETURN_ACCEPTED"/>
         <action service="oagisSendReceiveDelivery" 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=576816&r1=576815&r2=576816&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/oagis/servicedef/services.xml (original)
+++ ofbiz/trunk/specialpurpose/oagis/servicedef/services.xml Tue Sep 18 03:07:57 2007
@@ -117,7 +117,7 @@
     </service>
     <service name="oagisSendProcessShipmentsFromBackOrderSet" engine="java"
         location="org.ofbiz.oagis.OagisShipmentServices" invoke="oagisSendProcessShipmentsFromBackOrderSet">
-        <attribute name="noLongerOnBackOrderIdSet" type="Set" mode="IN" optional="false"/>
+        <attribute name="noLongerOnBackOrderIdSet" type="Set" mode="IN" optional="true"/>
     </service>
     
     <service name="oagisSendReceiveDelivery" max-retry="0" engine="java"

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=576816&r1=576815&r2=576816&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/oagis/src/org/ofbiz/oagis/OagisShipmentServices.java (original)
+++ ofbiz/trunk/specialpurpose/oagis/src/org/ofbiz/oagis/OagisShipmentServices.java Tue Sep 18 03:07:57 2007
@@ -632,6 +632,7 @@
         LocalDispatcher dispatcher = ctx.getDispatcher();
         
         Set noLongerOnBackOrderIdSet = (Set) context.get("noLongerOnBackOrderIdSet");
+        Debug.logInfo("Running oagisSendProcessShipmentsFromBackOrderSet with noLongerOnBackOrderIdSet=" + noLongerOnBackOrderIdSet, module);
         if (UtilValidate.isEmpty(noLongerOnBackOrderIdSet)) {
             return ServiceUtil.returnSuccess();
         }
@@ -738,7 +739,7 @@
             orderHeader = delegator.findByPrimaryKey("OrderHeader", UtilMisc.toMap("orderId", orderId));
             if (orderHeader != null) {
                 String orderStatusId = orderHeader.getString("statusId");
-                if (orderStatusId.equals("ORDER_APPROVED")) {
+                if ("ORDER_APPROVED".equals(orderStatusId) && "SALES_ORDER".equals(orderHeader.getString("orderTypeId"))) {
                     // first check some things...
                     OrderReadHelper orderReadHelper = new OrderReadHelper(orderHeader);
                     // before doing or saving anything see if any OrderItems are Products with isPhysical=Y