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

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 EmplLeave related CRUD services from simple to entity-auto (#97)

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 c3cda28  Improved: Converted all EmplLeave related CRUD services from simple to entity-auto (#97)
c3cda28 is described below

commit c3cda280997b6f523fb250f4a788670573133f8b
Author: Suraj Khurana <[hidden email]>
AuthorDate: Mon May 4 14:12:59 2020 +0530

    Improved: Converted all EmplLeave related CRUD services from simple to entity-auto (#97)
   
    (OFBIZ-11630)
    Also, added comments for similar types entity-auto services and clubbed them for better visibility.
---
 applications/humanres/minilang/HumanResServices.xml | 11 -----------
 applications/humanres/servicedef/services.xml       | 17 ++++++-----------
 2 files changed, 6 insertions(+), 22 deletions(-)

diff --git a/applications/humanres/minilang/HumanResServices.xml b/applications/humanres/minilang/HumanResServices.xml
index 96e00a5..57af824 100644
--- a/applications/humanres/minilang/HumanResServices.xml
+++ b/applications/humanres/minilang/HumanResServices.xml
@@ -152,17 +152,6 @@
         <set field="delRateAmount.fromDate" from-field="parameters.rateAmountFromDate"/>
         <call-service service-name="deleteRateAmount" in-map-name="delRateAmount"/>
     </simple-method>
-
-    <simple-method method-name="createEmplLeave" short-description="Create Employee Leave">
-        <make-value entity-name="EmplLeave" value-field="newEntity"/>
-        <set-pk-fields value-field="newEntity" map="parameters"/>
-        <set-nonpk-fields map="parameters" value-field="newEntity"/>
-        <create-value value-field="newEntity"/>
-        <check-errors/>
-        <property-to-field resource="HumanResUiLabels" property="HumanResLeaveCreationSuccess" field="successMessage"/>
-        <field-to-result field="responseMessage" result-name="successMessage"/>
-    </simple-method>
-
     <simple-method method-name="getCurrentPartyEmploymentData" short-description="Get all current employment information for a certain partyId">
         <!-- party benefit -->
         <entity-and entity-name="BenefitTypeAndParty" list="partyBenefitTypes" filter-by-date="true">
diff --git a/applications/humanres/servicedef/services.xml b/applications/humanres/servicedef/services.xml
index 4d671d8..d47bc17 100644
--- a/applications/humanres/servicedef/services.xml
+++ b/applications/humanres/servicedef/services.xml
@@ -546,6 +546,7 @@ under the License.
         <auto-attributes mode="IN" include="pk" optional="false"/>
     </service>
 
+    <!-- EmplPositionType services -->
     <service name="createEmplPositionType" engine="entity-auto" default-entity-name="EmplPositionType" invoke="create" auth="true">
         <description>Create Valid PositionType</description>
         <permission-service service-name="humanResManagerPermission" main-action="CREATE"/>
@@ -553,7 +554,6 @@ under the License.
         <auto-attributes mode="IN" include="nonpk" optional="true"/>
         <override name="description" optional="false"/>
     </service>
-
     <service name="updateEmplPositionType" engine="entity-auto" default-entity-name="EmplPositionType" invoke="update" auth="true">
         <description>Update Valid PositionType</description>
         <permission-service service-name="humanResManagerPermission" main-action="UPDATE"/>
@@ -561,7 +561,6 @@ under the License.
         <auto-attributes mode="IN" include="nonpk" optional="true"/>
         <override name="description" optional="false"/>
     </service>
-
     <service name="deleteEmplPositionType" engine="entity-auto" default-entity-name="EmplPositionType" invoke="delete" auth="true">
         <description>Delete EmplPositionType</description>
         <permission-service service-name="humanResManagerPermission" main-action="DELETE"/>
@@ -589,28 +588,27 @@ under the License.
         <attribute name="periodTypeId" type="String" mode="IN" optional="true"/>
     </service>
 
+    <!-- AgreementEmploymentAppl services -->
     <service name="createAgreementEmploymentAppl" engine="entity-auto" default-entity-name="AgreementEmploymentAppl" invoke="create" auth="true">
         <description>Create Agreement Employment Appl</description>
         <permission-service service-name="humanResManagerPermission" main-action="DELETE"/>
         <auto-attributes mode="IN" include="pk" optional="false"/>
         <auto-attributes mode="IN" include="nonpk" optional="true"/>
     </service>
-
     <service name="updateAgreementEmploymentAppl" engine="entity-auto" default-entity-name="AgreementEmploymentAppl" invoke="update" auth="true">
         <description>Update Valid AgreementEmploymentAppl</description>
         <permission-service service-name="humanResManagerPermission" main-action="UPDATE"/>
         <auto-attributes mode="IN" include="pk" optional="false"/>
         <auto-attributes mode="IN" include="nonpk" optional="true"/>
     </service>
-
     <service name="deleteAgreementEmploymentAppl" engine="entity-auto" default-entity-name="AgreementEmploymentAppl" invoke="delete" auth="true">
         <description>Delete AgreementEmploymentAppl</description>
         <permission-service service-name="humanResManagerPermission" main-action="DELETE"/>
         <auto-attributes mode="IN" include="pk" optional="false"/>
     </service>
-    
-    <service name="createEmplLeave" engine="simple" default-entity-name="EmplLeave"
-             location="component://humanres/minilang/HumanResServices.xml" invoke="createEmplLeave" auth="true">
+
+    <!-- EmplLeave services -->
+    <service name="createEmplLeave" engine="entity-auto" default-entity-name="EmplLeave" invoke="create" auth="true">
         <description>Create Employee Leave</description>
         <permission-service service-name="humanResManagerPermission" main-action="CREATE"/>
         <auto-attributes mode="IN" include="pk" optional="false"/>
@@ -618,7 +616,6 @@ under the License.
         <override name="approverPartyId" optional="false"/>
         <override name="thruDate" optional="false"/>
     </service>
-
     <service name="updateEmplLeave" engine="entity-auto" default-entity-name="EmplLeave" invoke="update" auth="true">
         <description>Update Valid Employee Leave</description>
         <permission-service service-name="humanResManagerPermission" main-action="UPDATE"/>
@@ -627,13 +624,13 @@ under the License.
         <override name="approverPartyId" optional="false"/>
         <override name="thruDate" optional="false"/>
     </service>
-
     <service name="deleteEmplLeave" engine="entity-auto" default-entity-name="EmplLeave" invoke="delete" auth="true">
         <description>Delete AgreementEmploymentAppl</description>
         <permission-service service-name="humanResManagerPermission" main-action="DELETE"/>
         <auto-attributes mode="IN" include="pk" optional="false"/>
     </service>
 
+    <!-- EmplLeaveType services -->
     <service name="createEmplLeaveType" engine="entity-auto" default-entity-name="EmplLeaveType" invoke="create" auth="true">
         <description>Create Valid LeaveType</description>
         <permission-service service-name="humanResManagerPermission" main-action="CREATE"/>
@@ -641,7 +638,6 @@ under the License.
         <auto-attributes mode="IN" include="nonpk" optional="true"/>
         <override name="description" optional="false"/>
     </service>
-
     <service name="updateEmplLeaveType" engine="entity-auto" default-entity-name="EmplLeaveType" invoke="update" auth="true">
         <description>Update Valid LeaveType</description>
         <permission-service service-name="humanResManagerPermission" main-action="UPDATE"/>
@@ -649,7 +645,6 @@ under the License.
         <auto-attributes mode="IN" include="nonpk" optional="true"/>
         <override name="description" optional="false"/>
     </service>
-
     <service name="deleteEmplLeaveType" engine="entity-auto" default-entity-name="EmplLeaveType" invoke="delete" auth="true">
         <description>Delete Valid LeaveType</description>
         <permission-service service-name="humanResManagerPermission" main-action="DELETE"/>