svn commit: r478095 - in /incubator/ofbiz/trunk/applications/party: script/org/ofbiz/party/communication/CommunicationEventServices.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: r478095 - in /incubator/ofbiz/trunk/applications/party: script/org/ofbiz/party/communication/CommunicationEventServices.xml servicedef/services.xml

hansbak-2
Author: hansbak
Date: Wed Nov 22 01:17:30 2006
New Revision: 478095

URL: http://svn.apache.org/viewvc?view=rev&rev=478095
Log:
the delete communicationEvent service now also deletes the related workeffort if this commubication event is the only one attached to the woreffort.

Modified:
    incubator/ofbiz/trunk/applications/party/script/org/ofbiz/party/communication/CommunicationEventServices.xml
    incubator/ofbiz/trunk/applications/party/servicedef/services.xml

Modified: incubator/ofbiz/trunk/applications/party/script/org/ofbiz/party/communication/CommunicationEventServices.xml
URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/party/script/org/ofbiz/party/communication/CommunicationEventServices.xml?view=diff&rev=478095&r1=478094&r2=478095
==============================================================================
--- incubator/ofbiz/trunk/applications/party/script/org/ofbiz/party/communication/CommunicationEventServices.xml (original)
+++ incubator/ofbiz/trunk/applications/party/script/org/ofbiz/party/communication/CommunicationEventServices.xml Wed Nov 22 01:17:30 2006
@@ -16,8 +16,9 @@
 under the License.
 -->
 
-<simple-methods xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-        xsi:noNamespaceSchemaLocation="http://www.ofbiz.org/dtds/simple-methods.xsd">
+<simple-methods xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:noNamespaceSchemaLocation="http://www.ofbiz.org/dtds/simple-methods.xsd">
+    <!-- xsi:noNamespaceSchemaLocation="../../../../../../../framework/minilang/dtd/simple-methods.xsd"-->
     <simple-method method-name="createCommunicationEvent" short-description="Create a CommunicationEvent">
         <if>
             <condition>
@@ -110,8 +111,25 @@
                 </if-compare>  
             </iterate>
         </if-not-empty>
+        <!-- remove related workeffort when this is the only communicationevent connected to it -->
+        <get-related value-name="event" relation-name="CommunicationEventWorkEff" list-name="workEffortComs"/>
+        <if-not-empty field-name="workEffortComs">
+            <iterate entry-name="workEffortCom" list-name="workEffortComs">
+                <remove-value value-name="workEffortCom"/>
+                <get-related-one value-name="workEffortCom" relation-name="WorkEffort" to-value-name="workEffort"/>
+                <get-related value-name="workEffort" relation-name="CommunicationEventWorkEff" list-name="otherComs"/>
+                <if-empty field-name="otherComs">
+                    <log level="info" message="remove workeffort ${workEffort.workEffortId} and related parties and status"/>
+                    <remove-related value-name="workEffort" relation-name="WorkEffortPartyAssignment"/>
+                    <remove-related value-name="workEffort" relation-name="WorkEffortStatus"/>
+                    <remove-value value-name="workEffort"/>
+                    <set field="workEffortMessage" value="and worEffort [${workEffort.workEffortId}]"/>
+                </if-empty>
+            </iterate>
+        </if-not-empty>
         <!-- delete the event itself -->
         <remove-value value-name="event"/>
+        <set field="successMessage" value="Communication [${event.communicationEventId}] ${workEffortMessage} deleted "/>
     </simple-method>
     <!-- since these ancillary operations on communication event cause them to be updated,
         they will all use the CME_UPDATE permission -->

Modified: incubator/ofbiz/trunk/applications/party/servicedef/services.xml
URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/party/servicedef/services.xml?view=diff&rev=478095&r1=478094&r2=478095
==============================================================================
--- incubator/ofbiz/trunk/applications/party/servicedef/services.xml (original)
+++ incubator/ofbiz/trunk/applications/party/servicedef/services.xml Wed Nov 22 01:17:30 2006
@@ -591,7 +591,8 @@
     </service>
     <service name="deleteCommunicationEvent" engine="simple"
             location="org/ofbiz/party/communication/CommunicationEventServices.xml" invoke="deleteCommunicationEvent" auth="true">
-        <description>Delete a Communication Event</description>
+        <description>Delete a Communication Event, optionally delete the attached content and dataresource
+                    and when this is the only communication event connected to a workeffort delete the workeffort too.</description>
         <auto-attributes entity-name="CommunicationEvent" include="pk" mode="IN" optional="false"/>
         <attribute name="delContentDataResource" type="String" mode="IN" optional="true"/>
     </service>