[ofbiz-framework] branch trunk updated: Improved: Converted all TimesheetRole related CRUD services from simple to entity-auto (#90)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[ofbiz-framework] branch trunk updated: Improved: Converted all TimesheetRole related CRUD services from simple to entity-auto (#90)

surajk
This is an automated email from the ASF dual-hosted git repository.

surajk pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ofbiz-framework.git


The following commit(s) were added to refs/heads/trunk by this push:
     new 0f56568  Improved: Converted all TimesheetRole related CRUD services from simple to entity-auto (#90)
0f56568 is described below

commit 0f56568bc140dad0075d65b00d94f93dc80527bb
Author: Suraj Khurana <[hidden email]>
AuthorDate: Sat May 2 12:58:35 2020 +0530

    Improved: Converted all TimesheetRole related CRUD services from simple to entity-auto (#90)
   
    * Improved: Converted all TimesheetRole related CRUD services from simple to entity-auto
    (OFBIZ-11617)
---
 .../workeffort/minilang/timesheet/TimesheetServices.xml    | 14 --------------
 applications/workeffort/servicedef/secas.xml               |  3 +++
 applications/workeffort/servicedef/services_timesheet.xml  |  6 ++----
 3 files changed, 5 insertions(+), 18 deletions(-)

diff --git a/applications/workeffort/minilang/timesheet/TimesheetServices.xml b/applications/workeffort/minilang/timesheet/TimesheetServices.xml
index c879965..0d48d84 100644
--- a/applications/workeffort/minilang/timesheet/TimesheetServices.xml
+++ b/applications/workeffort/minilang/timesheet/TimesheetServices.xml
@@ -295,20 +295,6 @@ under the License.
         </iterate>
     </simple-method>
 
-    <!-- TimesheetRole Services -->
-    <simple-method method-name="createTimesheetRole" short-description="Create TimesheetRole">
-        <set field="ensurePartyRoleCtx.partyId" from-field="parameters.partyId"/>
-        <set field="ensurePartyRoleCtx.roleTypeId" from-field="parameters.roleTypeId"/>
-        <call-service service-name="ensurePartyRole" in-map-name="ensurePartyRoleCtx"/>
-        <make-value entity-name="TimesheetRole" value-field="newEntity"/>
-        <set-pk-fields map="parameters" value-field="newEntity"/>
-        <create-value value-field="newEntity"/>
-    </simple-method>
-    <simple-method method-name="deleteTimesheetRole" short-description="Delete TimesheetRole">
-        <entity-one entity-name="TimesheetRole" value-field="lookedUpValue"/>
-        <remove-value value-field="lookedUpValue"/>
-    </simple-method>
-
     <!-- TimeEntry Services -->
     <simple-method method-name="createTimeEntry" short-description="Create TimeEntry">
         <call-simple-method method-name="checkTimesheetStatus"/>
diff --git a/applications/workeffort/servicedef/secas.xml b/applications/workeffort/servicedef/secas.xml
index eb378a2..502c81d 100644
--- a/applications/workeffort/servicedef/secas.xml
+++ b/applications/workeffort/servicedef/secas.xml
@@ -62,4 +62,7 @@ under the License.
         <condition field-name="orderId" operator="is-empty"/>
         <action service="createOrderHeader" mode="sync"/>
     </eca>
+    <eca service="createTimesheetRole" event="invoke">
+        <action service="ensurePartyRole" mode="sync"/>
+    </eca>
 </service-eca>
diff --git a/applications/workeffort/servicedef/services_timesheet.xml b/applications/workeffort/servicedef/services_timesheet.xml
index 3fd4749..9e5f545 100644
--- a/applications/workeffort/servicedef/services_timesheet.xml
+++ b/applications/workeffort/servicedef/services_timesheet.xml
@@ -106,15 +106,13 @@ under the License.
     </service>
 
     <!-- TimesheetRole Services -->
-    <service name="createTimesheetRole" default-entity-name="TimesheetRole" engine="simple" auth="true"
-        location="component://workeffort/minilang/timesheet/TimesheetServices.xml" invoke="createTimesheetRole">
+    <service name="createTimesheetRole" default-entity-name="TimesheetRole" engine="entity-auto" auth="true" invoke="create">
         <description>Creates TimesheetRole</description>
         <permission-service service-name="workEffortGenericPermission" main-action="CREATE"/>
         <auto-attributes include="pk" mode="IN" optional="false"/>
         <auto-attributes include="nonpk" mode="IN" optional="true"/>
     </service>
-    <service name="deleteTimesheetRole" default-entity-name="TimesheetRole" engine="simple" auth="true"
-        location="component://workeffort/minilang/timesheet/TimesheetServices.xml" invoke="deleteTimesheetRole">
+    <service name="deleteTimesheetRole" default-entity-name="TimesheetRole" engine="entity-auto" auth="true" invoke="delete">
         <description>Deletes TimesheetRole</description>
         <permission-service service-name="workEffortGenericPermission" main-action="DELETE"/>
         <auto-attributes include="pk" mode="IN" optional="false"/>