svn commit: r1831467 - in /ofbiz/ofbiz-framework/trunk/applications/order: minilang/requirement/RequirementServices.xml servicedef/services_requirement.xml

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

svn commit: r1831467 - in /ofbiz/ofbiz-framework/trunk/applications/order: minilang/requirement/RequirementServices.xml servicedef/services_requirement.xml

jleroux@apache.org
Author: jleroux
Date: Sat May 12 11:23:29 2018
New Revision: 1831467

URL: http://svn.apache.org/viewvc?rev=1831467&view=rev
Log:
Improved: Convert Requirement related services from simple to entity-auto
(OFBIZ-10395)

There is nothing extra in these services and they can be made to entity-auto.

Thanks: Suraj Khurana

Modified:
    ofbiz/ofbiz-framework/trunk/applications/order/minilang/requirement/RequirementServices.xml
    ofbiz/ofbiz-framework/trunk/applications/order/servicedef/services_requirement.xml

Modified: ofbiz/ofbiz-framework/trunk/applications/order/minilang/requirement/RequirementServices.xml
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/order/minilang/requirement/RequirementServices.xml?rev=1831467&r1=1831466&r2=1831467&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/applications/order/minilang/requirement/RequirementServices.xml (original)
+++ ofbiz/ofbiz-framework/trunk/applications/order/minilang/requirement/RequirementServices.xml Sat May 12 11:23:29 2018
@@ -20,35 +20,6 @@ under the License.
 
 <simple-methods xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xmlns="http://ofbiz.apache.org/Simple-Method" xsi:schemaLocation="http://ofbiz.apache.org/Simple-Method http://ofbiz.apache.org/dtds/simple-methods.xsd">
-    <simple-method method-name="createRequirement" short-description="Create a new requirement">
-        <make-value entity-name="Requirement" value-field="newEntity"/>
-        <sequenced-id sequence-name="Requirement" field="requirementId"/>
-        <set field="newEntity.requirementId" from-field="requirementId"/>
-        <set-nonpk-fields map="parameters" value-field="newEntity"/>
-        <if-empty field="parameters.statusId">
-            <set value="REQ_CREATED" field="newEntity.statusId"/>
-        </if-empty>
-        <now-timestamp field="nowTimestamp"/>
-        <set field="newEntity.createdDate" from-field="nowTimestamp"/>
-        <set field="newEntity.lastModifiedDate" from-field="nowTimestamp"/>
-        <set field="newEntity.createdByUserLogin" from-field="userLogin.userLoginId"/>
-        <set field="newEntity.lastModifiedByUserLogin" from-field="userLogin.userLoginId"/>
-        <create-value value-field="newEntity"/>
-        <field-to-result field="requirementId" result-name="requirementId"/>
-    </simple-method>
-
-    <simple-method method-name="updateRequirement" short-description="Update a requirement">
-        <make-value entity-name="Requirement" value-field="lookupPKMap"/>
-        <set-pk-fields map="parameters" value-field="lookupPKMap"/>
-        <find-by-primary-key entity-name="Requirement" map="lookupPKMap" value-field="lookedUpValue"/>
-        <field-to-result field="lookedUpValue.statusId" result-name="oldStatusId"/>
-        <set-nonpk-fields map="parameters" value-field="lookedUpValue"/>
-        <now-timestamp field="nowTimestamp"/>
-        <set field="newEntity.lastModifiedDate" from-field="nowTimestamp"/>
-        <set field="newEntity.lastModifiedByUserLogin" from-field="userLogin.userLoginId"/>
-        <store-value value-field="lookedUpValue"/>
-    </simple-method>
-
     <simple-method method-name="deleteRequirement" short-description="Delete a requirement">
         <entity-one entity-name="Requirement" value-field="requirement" auto-field-map="true"/>
         <check-errors/>

Modified: ofbiz/ofbiz-framework/trunk/applications/order/servicedef/services_requirement.xml
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/order/servicedef/services_requirement.xml?rev=1831467&r1=1831466&r2=1831467&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/applications/order/servicedef/services_requirement.xml (original)
+++ ofbiz/ofbiz-framework/trunk/applications/order/servicedef/services_requirement.xml Sat May 12 11:23:29 2018
@@ -24,33 +24,18 @@ under the License.
     <vendor>OFBiz</vendor>
     <version>1.0</version>
 
-    <!-- Requirement Services -->
-    <service name="requirementInterface" engine="interface" location="" invoke="">
-        <description>Requirement Interface</description>
-        <auto-attributes mode="IN" entity-name="Requirement" include="nonpk" optional="true">
-            <exclude field-name="createdDate"/>
-            <exclude field-name="createdByUserLogin"/>
-            <exclude field-name="lastModifiedDate"/>
-            <exclude field-name="lastModifiedByUserLogin"/>
-        </auto-attributes>
-    </service>
-    <service name="createRequirement" engine="simple"
-            location="component://order/minilang/requirement/RequirementServices.xml" invoke="createRequirement">
+    <service name="createRequirement" default-entity-name="Requirement" engine="entity-auto" invoke="create" auth="true">
         <description>Create a new requirement</description>
-        <implements service="requirementInterface"/>
-        <attribute name="requirementTypeId" type="String" mode="IN" optional="false"/>
-        <attribute name="custRequestId" type="String" mode="IN" optional="true"/>
-        <attribute name="custRequestItemSeqId" type="String" mode="IN" optional="true"/>
-        <attribute name="requirementId" type="String" mode="INOUT" optional="true"/>
+        <auto-attributes include="pk" mode="INOUT" optional="true"/>
+        <auto-attributes include="nonpk" mode="IN" optional="true"/>
+        <override name="statusId" default-value="REQ_CREATED"/>
     </service>
-    <service name="updateRequirement" engine="simple"
-            location="component://order/minilang/requirement/RequirementServices.xml" invoke="updateRequirement">
+    <service name="updateRequirement" default-entity-name="Requirement" engine="entity-auto" invoke="update" auth="true">
         <description>Update an existing requirement</description>
-        <implements service="requirementInterface"/>
-        <attribute name="requirementId" type="String" mode="IN" optional="false"/>
-        <attribute name="oldStatusId" type="String" mode="OUT" optional="false"/>
+        <auto-attributes include="pk" mode="IN" optional="false"/>
+        <auto-attributes include="nonpk" mode="IN" optional="true"/>
+        <attribute name="oldStatusId" type="String" mode="OUT" optional="true"/>
     </service>
-
     <service name="deleteRequirement" engine="simple"
             location="component://order/minilang/requirement/RequirementServices.xml" invoke="deleteRequirement">
         <description>Delete a requirement</description>