Author: sichen
Date: Mon Aug 20 16:10:44 2007
New Revision: 567872

URL: http://svn.apache.org/viewvc?rev=567872&view=rev
Log:
Improve service to changing production run task statuses:  It should pass the 
original statusId before change so that SECAS can check whether there was an 
actual change in status.

Modified:
    
ofbiz/trunk/applications/manufacturing/servicedef/services_production_run.xml
    
ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.java

Modified: 
ofbiz/trunk/applications/manufacturing/servicedef/services_production_run.xml
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/manufacturing/servicedef/services_production_run.xml?rev=567872&r1=567871&r2=567872&view=diff
==============================================================================
--- 
ofbiz/trunk/applications/manufacturing/servicedef/services_production_run.xml 
(original)
+++ 
ofbiz/trunk/applications/manufacturing/servicedef/services_production_run.xml 
Mon Aug 20 16:10:44 2007
@@ -76,6 +76,7 @@
         <attribute name="workEffortId" type="String" mode="IN" 
optional="false"/> <!-- The task id -->
         <attribute name="statusId" type="String" mode="IN" optional="true"/>
         <attribute name="issueAllComponents" type="Boolean" mode="IN" 
optional="true"/>
+        <attribute name="oldStatusId" type="String" mode="OUT" 
optional="false"/>
         <attribute name="newStatusId" type="String" mode="OUT" 
optional="false"/>
     </service>
     <service name="addProductionRunRoutingTask" engine="java"

Modified: 
ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.java
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.java?rev=567872&r1=567871&r2=567872&view=diff
==============================================================================
--- 
ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.java
 (original)
+++ 
ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.java
 Mon Aug 20 16:10:44 2007
@@ -732,8 +732,10 @@
         }
         
         String currentStatusId = theTask.getString("currentStatusId");
-        
+        String oldStatusId = theTask.getString("currentStatusId"); // pass 
back old status for secas to check
+
         if (statusId != null && currentStatusId.equals(statusId)) {
+            result.put("oldStatusId", oldStatusId);
             result.put("newStatusId", currentStatusId);
             result.put(ModelService.SUCCESS_MESSAGE, 
UtilProperties.getMessage(resource, 
"ManufacturingProductionRunTaskStatusChanged",UtilMisc.toMap("newStatusId", 
currentStatusId), locale));
             return result;
@@ -776,6 +778,7 @@
                     return 
ServiceUtil.returnError(UtilProperties.getMessage(resource, 
"ManufacturingProductionRunStatusNotChanged", locale));
                 }
             }
+            result.put("oldStatusId", oldStatusId);
             result.put("newStatusId", "PRUN_RUNNING");
             result.put(ModelService.SUCCESS_MESSAGE, 
UtilProperties.getMessage(resource, 
"ManufacturingProductionRunStatusChanged",UtilMisc.toMap("newStatusId", 
"PRUN_DOC_PRINTED"), locale));
             return result;
@@ -854,10 +857,12 @@
                     return 
ServiceUtil.returnError(UtilProperties.getMessage(resource, 
"ManufacturingProductionRunStatusNotChanged", locale));
                 }
             }
+            result.put("oldStatusId", oldStatusId);
             result.put("newStatusId", "PRUN_COMPLETED");
             result.put(ModelService.SUCCESS_MESSAGE, 
UtilProperties.getMessage(resource, 
"ManufacturingProductionRunStatusChanged",UtilMisc.toMap("newStatusId", 
"PRUN_DOC_PRINTED"), locale));
             return result;
         }
+        result.put("oldStatusId", oldStatusId);
         result.put("newStatusId", currentStatusId);
         result.put(ModelService.SUCCESS_MESSAGE, 
UtilProperties.getMessage(resource, 
"ManufacturingProductionRunTaskStatusChanged",UtilMisc.toMap("newStatusId", 
currentStatusId), locale));
         return result;


Reply via email to