[OFBiz] SVN: r7761 - in trunk/applications/party: script/org/ofbiz/party/communication servicedef
jacopo@svn.ofbiz.org
jacopo at svn.ofbiz.org
Fri Jun 9 14:45:25 CDT 2006
Author: jacopo
Date: 2006-06-09 14:45:15 -0500 (Fri, 09 Jun 2006)
New Revision: 7761
Modified:
trunk/applications/party/script/org/ofbiz/party/communication/CommunicationEventServices.xml
trunk/applications/party/servicedef/services.xml
Log:
Added two optional input parameters to the createCommunicationEvent service: orderId and productId.
If they are present, the communication is created and linked to the order and/or product.
Modified: trunk/applications/party/script/org/ofbiz/party/communication/CommunicationEventServices.xml
===================================================================
--- trunk/applications/party/script/org/ofbiz/party/communication/CommunicationEventServices.xml 2006-06-09 16:29:39 UTC (rev 7760)
+++ trunk/applications/party/script/org/ofbiz/party/communication/CommunicationEventServices.xml 2006-06-09 19:45:15 UTC (rev 7761)
@@ -60,7 +60,20 @@
<now-timestamp-to-env env-name="newEntity.entryDate"/>
- <create-value value-name="newEntity"/>
+ <create-value value-name="newEntity"/>
+
+ <if-not-empty field-name="parameters.productId">
+ <make-value value-name="eventProduct" entity-name="CommunicationEventProduct"/>
+ <set from-field="parameters.productId" field="eventProduct.productId"/>
+ <set from-field="newEntity.communicationEventId" field="eventProduct.communicationEventId"/>
+ <create-value value-name="eventProduct"/>
+ </if-not-empty>
+ <if-not-empty field-name="parameters.orderId">
+ <make-value value-name="eventOrder" entity-name="CommunicationEventOrder"/>
+ <set from-field="parameters.orderId" field="eventOrder.orderId"/>
+ <set from-field="newEntity.communicationEventId" field="eventOrder.communicationEventId"/>
+ <create-value value-name="eventOrder"/>
+ </if-not-empty>
</simple-method>
<simple-method method-name="updateCommunicationEvent" short-description="Update a CommunicationEvent">
<check-permission permission="PARTYMGR" action="_CME_UPDATE">
Modified: trunk/applications/party/servicedef/services.xml
===================================================================
--- trunk/applications/party/servicedef/services.xml 2006-06-09 16:29:39 UTC (rev 7760)
+++ trunk/applications/party/servicedef/services.xml 2006-06-09 19:45:15 UTC (rev 7761)
@@ -588,6 +588,8 @@
<description>Create a Communication Event</description>
<auto-attributes entity-name="CommunicationEvent" include="nonpk" mode="IN" optional="true"/>
<auto-attributes entity-name="CommunicationEvent" include="pk" mode="INOUT" optional="true"/>
+ <attribute name="productId" type="String" mode="IN" optional="true"/>
+ <attribute name="orderId" type="String" mode="IN" optional="true"/>
</service>
<service name="updateCommunicationEvent" engine="simple"
location="org/ofbiz/party/communication/CommunicationEventServices.xml" invoke="updateCommunicationEvent" auth="true">
More information about the Svn
mailing list