Author: adrianc
Date: Tue Jan  3 13:48:28 2012
New Revision: 1226782

URL: http://svn.apache.org/viewvc?rev=1226782&view=rev
Log:
Fixed createWorkEffortAndPartyAssign service that didn't work. The service 
failed because it called the assignPartyToWorkEffort service which failed 
permission checks because the user wasn't already assigned to the (just 
created) work effort.

Modified:
    
ofbiz/trunk/applications/workeffort/script/org/ofbiz/workeffort/workeffort/WorkEffortSimpleServices.xml

Modified: 
ofbiz/trunk/applications/workeffort/script/org/ofbiz/workeffort/workeffort/WorkEffortSimpleServices.xml
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/workeffort/script/org/ofbiz/workeffort/workeffort/WorkEffortSimpleServices.xml?rev=1226782&r1=1226781&r2=1226782&view=diff
==============================================================================
--- 
ofbiz/trunk/applications/workeffort/script/org/ofbiz/workeffort/workeffort/WorkEffortSimpleServices.xml
 (original)
+++ 
ofbiz/trunk/applications/workeffort/script/org/ofbiz/workeffort/workeffort/WorkEffortSimpleServices.xml
 Tue Jan  3 13:48:28 2012
@@ -26,9 +26,16 @@ under the License.
         <call-service service-name="createWorkEffort" in-map-name="create">
             <result-to-field result-name="workEffortId"/>
         </call-service>
-        <set-service-fields service-name="assignPartyToWorkEffort" 
map="parameters" to-map="assign"/>
-        <set field="assign.workEffortId" from-field="workEffortId"/>
-        <call-service service-name="assignPartyToWorkEffort" 
in-map-name="assign"/>
+        <check-errors />
+        <make-value value-field="newEntity" 
entity-name="WorkEffortPartyAssignment"/>
+        <set-pk-fields map="parameters" value-field="newEntity"/>
+        <set-nonpk-fields map="parameters" value-field="newEntity"/>
+        <set field="newEntity.workEffortId" from-field="workEffortId"/>
+        <if-empty field="newEntity.fromDate">
+            <now-timestamp field="newEntity.fromDate"/>
+        </if-empty>
+        <set field="newEntity.assignedByUserLoginId" 
from-field="userLogin.userLoginId"/>
+        <create-value value-field="newEntity"/>
         <field-to-result field="workEffortId"/>
     </simple-method>
 


Reply via email to