svn commit: r673824 - in /ofbiz/trunk/specialpurpose/assetmaint: script/org/ofbiz/assetmaint/FixedAssetMaintEvents.xml servicedef/secas.xml servicedef/services.xml

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

svn commit: r673824 - in /ofbiz/trunk/specialpurpose/assetmaint: script/org/ofbiz/assetmaint/FixedAssetMaintEvents.xml servicedef/secas.xml servicedef/services.xml

adrianc
Author: adrianc
Date: Thu Jul  3 14:41:17 2008
New Revision: 673824

URL: http://svn.apache.org/viewvc?rev=673824&view=rev
Log:
Slight change in Asset Maintenance. Changed hard-coded simple method call to a SECA - so that parties can be auto-assigned to maintenances even when a maintenance is created from outside the Asset Maint component.

Modified:
    ofbiz/trunk/specialpurpose/assetmaint/script/org/ofbiz/assetmaint/FixedAssetMaintEvents.xml
    ofbiz/trunk/specialpurpose/assetmaint/servicedef/secas.xml
    ofbiz/trunk/specialpurpose/assetmaint/servicedef/services.xml

Modified: ofbiz/trunk/specialpurpose/assetmaint/script/org/ofbiz/assetmaint/FixedAssetMaintEvents.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/assetmaint/script/org/ofbiz/assetmaint/FixedAssetMaintEvents.xml?rev=673824&r1=673823&r2=673824&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/assetmaint/script/org/ofbiz/assetmaint/FixedAssetMaintEvents.xml (original)
+++ ofbiz/trunk/specialpurpose/assetmaint/script/org/ofbiz/assetmaint/FixedAssetMaintEvents.xml Thu Jul  3 14:41:17 2008
@@ -51,25 +51,25 @@
         <set field="updateWorkEffortCtx.description" from-field="maintType.description"/>
         <call-service service-name="updateWorkEffort" in-map-name="updateWorkEffortCtx"/>
         <check-errors/>
-        <!-- Assign fixed asset parties to workeffort -->
-        <set field="workEffortId" from-field="findAssetMaint.scheduleWorkEffortId"/>
-        <call-simple-method method-name="assignFixedAssetPartiesToWorkEffort"/>
     </simple-method>
 
-    <simple-method method-name="assignFixedAssetPartiesToWorkEffort" login-required="true"
-        short-description="Assign Fixed Asset Parties to a Work Effort">
+    <simple-method method-name="assignFixedAssetPartiesToMaintenance" login-required="true"
+        short-description="Assign Fixed Asset Parties to a Fixed Asset Maintenance">
+        <log level="info" message="assignFixedAssetPartiesToMaintenance invoked"/>
+        <if-empty field="maintHistSeqId">
+            <set field="maintHistSeqId" from-field="parameters.maintHistSeqId"/>
+        </if-empty>
         <if-empty field="fixedAssetId">
             <set field="fixedAssetId" from-field="parameters.fixedAssetId"/>
         </if-empty>
+        <entity-one entity-name="FixedAssetMaint" value-name="maintValue"/>
         <if-empty field="workEffortId">
-            <set field="workEffortId" from-field="parameters.workEffortId"/>
+            <set field="workEffortId" from-field="maintValue.scheduleWorkEffortId"/>
         </if-empty>
-        <entity-condition list-name="assignedParties" entity-name="PartyFixedAssetAssignAndRole" filter-by-date="true">
-            <condition-list>
-                <condition-expr field-name="fixedAssetId" env-name="fixedAssetId"/>
-                <condition-expr field-name="parentTypeId" value="FAM_ASSIGNEE"/>
-            </condition-list>
-        </entity-condition>
+        <entity-and list-name="assignedParties" entity-name="PartyFixedAssetAssignAndRole" filter-by-date="true">
+            <field-map field-name="fixedAssetId" env-name="fixedAssetId"/>
+            <field-map field-name="parentTypeId" value="FAM_ASSIGNEE"/>
+        </entity-and>
         <iterate list-name="assignedParties" entry-name="assignedParty">
             <set field="assignPartyCtx.partyId" from-field="assignedParty.partyId"/>
             <set field="assignPartyCtx.roleTypeId" from-field="assignedParty.roleTypeId"/>

Modified: ofbiz/trunk/specialpurpose/assetmaint/servicedef/secas.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/assetmaint/servicedef/secas.xml?rev=673824&r1=673823&r2=673824&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/assetmaint/servicedef/secas.xml (original)
+++ ofbiz/trunk/specialpurpose/assetmaint/servicedef/secas.xml Thu Jul  3 14:41:17 2008
@@ -37,4 +37,9 @@
         <action service="assetMaintPermissionCheck" mode="sync" result-to-result="true"/>
     </eca>
 
+    <!-- ECAs used to extend fixed asset services -->
+    <eca service="createFixedAssetMaint" event="commit" run-on-failure="false">
+        <action service="assignFixedAssetPartiesToMaintenance" mode="sync"/>
+    </eca>
+
 </service-eca>

Modified: ofbiz/trunk/specialpurpose/assetmaint/servicedef/services.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/assetmaint/servicedef/services.xml?rev=673824&r1=673823&r2=673824&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/assetmaint/servicedef/services.xml (original)
+++ ofbiz/trunk/specialpurpose/assetmaint/servicedef/services.xml Thu Jul  3 14:41:17 2008
@@ -31,6 +31,14 @@
         <attribute type="String" mode="IN" name="facilityId" optional="false"/>
     </service>
     
+    <service name="assignFixedAssetPartiesToMaintenance" engine="simple"
+                location="component://assetmaint/script/org/ofbiz/assetmaint/FixedAssetMaintEvents.xml" invoke="assignFixedAssetPartiesToMaintenance" auth="true">
+        <description>Assign Fixed Asset Parties to a Fixed Asset Maintenance</description>
+        <permission-service service-name="fixedAssetPermissionCheck" main-action="UPDATE"/>
+        <attribute name="fixedAssetId" mode="IN" type="String" optional="false"/>
+        <attribute name="maintHistSeqId" mode="IN" type="String" optional="false"/>
+    </service>
+
     <service name="assetMaintPermissionCheck" engine="simple"
             location="component://assetmaint/script/org/ofbiz/assetmaint/FixedAssetMaintEvents.xml" invoke="assetMaintPermissionCheck">
         <description>Asset Maintentance Permission Checking Logic</description>