You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by ja...@apache.org on 2009/08/06 09:06:54 UTC

svn commit: r801519 - /ofbiz/trunk/applications/party/script/org/ofbiz/party/communication/CommunicationEventServices.xml

Author: jacopoc
Date: Thu Aug  6 07:06:53 2009
New Revision: 801519

URL: http://svn.apache.org/viewvc?rev=801519&view=rev
Log:
Fix to prevent error caused by duplicate key in the PartyRole entity.

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

Modified: ofbiz/trunk/applications/party/script/org/ofbiz/party/communication/CommunicationEventServices.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/script/org/ofbiz/party/communication/CommunicationEventServices.xml?rev=801519&r1=801518&r2=801519&view=diff
==============================================================================
--- ofbiz/trunk/applications/party/script/org/ofbiz/party/communication/CommunicationEventServices.xml (original)
+++ ofbiz/trunk/applications/party/script/org/ofbiz/party/communication/CommunicationEventServices.xml Thu Aug  6 07:06:53 2009
@@ -400,9 +400,13 @@
             <entity-one entity-name="UserLogin" value-field="sysUserLogin">
                 <field-map field-name="userLoginId" value="system"/>
             </entity-one>
-            <set-service-fields service-name="createPartyRole" map="parameters" to-map="partyRole"/>
-            <set field="partyRole.userLogin" from-field="sysUserLogin"/>
-            <call-service service-name="createPartyRole" in-map-name="partyRole" include-user-login="false"/>
+
+            <entity-one entity-name="PartyRole" value-field="partyRole"/>
+            <if-empty field="partyRole">
+                <set-service-fields service-name="createPartyRole" map="parameters" to-map="partyRole"/>
+                <set field="partyRole.userLogin" from-field="sysUserLogin"/>
+                <call-service service-name="createPartyRole" in-map-name="partyRole" include-user-login="false"/>
+            </if-empty>
 
             <make-value value-field="newEntity" entity-name="CommunicationEventRole"/>
             <set-pk-fields map="parameters" value-field="newEntity"/>