svn commit: r618189 - /ofbiz/trunk/applications/party/script/org/ofbiz/party/party/PartyServices.xml

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

svn commit: r618189 - /ofbiz/trunk/applications/party/script/org/ofbiz/party/party/PartyServices.xml

hansbak-2
Author: hansbak
Date: Sun Feb  3 23:42:16 2008
New Revision: 618189

URL: http://svn.apache.org/viewvc?rev=618189&view=rev
Log:
check in createPartyRelationship if there is already a active relationship, if yes do not add

Modified:
    ofbiz/trunk/applications/party/script/org/ofbiz/party/party/PartyServices.xml

Modified: ofbiz/trunk/applications/party/script/org/ofbiz/party/party/PartyServices.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/script/org/ofbiz/party/party/PartyServices.xml?rev=618189&r1=618188&r2=618189&view=diff
==============================================================================
--- ofbiz/trunk/applications/party/script/org/ofbiz/party/party/PartyServices.xml (original)
+++ ofbiz/trunk/applications/party/script/org/ofbiz/party/party/PartyServices.xml Sun Feb  3 23:42:16 2008
@@ -769,11 +769,20 @@
 
         <if-empty field-name="parameters.fromDate"><now-timestamp-to-env env-name="parameters.fromDate"/></if-empty>
         
-        <make-value value-name="newEntity" entity-name="PartyRelationship"/>
-        <set-pk-fields map-name="parameters" value-name="newEntity"/>
-        <set-nonpk-fields map-name="parameters" value-name="newEntity"/>
+        <!-- check if not already exist -->
+        <entity-and entity-name="PartyRelationShip" list-name="partyRels" filter-by-date="true">
+            <field-map field-name="partyIdFrom" env-name="parameters.partyIdFrom"/>
+            <field-map field-name="roleTypeIdFrom" env-name="parameters.roleTypeIdFrom"/>
+            <field-map field-name="partyIdTo" env-name="parameters.partyIdTo"/>
+            <field-map field-name="roleTypeIdTo" env-name="parameters.roleTypeIdTo"/>
+        </entity-and>
         
-        <create-value value-name="newEntity"/>
+        <if-empty field-name="partyRels">
+            <make-value value-name="newEntity" entity-name="PartyRelationship"/>
+            <set-pk-fields map-name="parameters" value-name="newEntity"/>
+            <set-nonpk-fields map-name="parameters" value-name="newEntity"/>
+            <create-value value-name="newEntity"/>
+        </if-empty>
     </simple-method>
     <simple-method method-name="updatePartyRelationship" short-description="updatePartyRelationship">
         <if-empty field-name="parameters.roleTypeIdFrom"><set field="parameters.roleTypeIdFrom" value="_NA_"/></if-empty>


Reply | Threaded
Open this post in threaded view
|

Re: svn commit: r618189 - /ofbiz/trunk/applications/party/script/org/ofbiz/party/party/PartyServices.xml

Mridul Pathak-2
Hi Hans,
    There is a spelling mistake in this commit which is breaking the code.
With <entity-and> tag entity-name="PartyRelation*S*hip" is used instead of
"PartyRelation*s*hip".


On Feb 4, 2008 1:12 PM, <[hidden email]> wrote:

> Author: hansbak
> Date: Sun Feb  3 23:42:16 2008
> New Revision: 618189
>
> URL: http://svn.apache.org/viewvc?rev=618189&view=rev
> Log:
> check in createPartyRelationship if there is already a active
> relationship, if yes do not add
>
> Modified:
>
>  ofbiz/trunk/applications/party/script/org/ofbiz/party/party/PartyServices.xml
>
> Modified:
> ofbiz/trunk/applications/party/script/org/ofbiz/party/party/PartyServices.xml
> URL:
> http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/script/org/ofbiz/party/party/PartyServices.xml?rev=618189&r1=618188&r2=618189&view=diff
>
> ==============================================================================
> ---
> ofbiz/trunk/applications/party/script/org/ofbiz/party/party/PartyServices.xml
> (original)
> +++
> ofbiz/trunk/applications/party/script/org/ofbiz/party/party/PartyServices.xml
> Sun Feb  3 23:42:16 2008
> @@ -769,11 +769,20 @@
>
>         <if-empty field-name="parameters.fromDate"><now-timestamp-to-env
> env-name="parameters.fromDate"/></if-empty>
>
> -        <make-value value-name="newEntity"
> entity-name="PartyRelationship"/>
> -        <set-pk-fields map-name="parameters" value-name="newEntity"/>
> -        <set-nonpk-fields map-name="parameters" value-name="newEntity"/>
> +        <!-- check if not already exist -->
> +        <entity-and entity-name="PartyRelationShip" list-name="partyRels"
> filter-by-date="true">
> +            <field-map field-name="partyIdFrom" env-name="
> parameters.partyIdFrom"/>
> +            <field-map field-name="roleTypeIdFrom" env-name="
> parameters.roleTypeIdFrom"/>
> +            <field-map field-name="partyIdTo" env-name="
> parameters.partyIdTo"/>
> +            <field-map field-name="roleTypeIdTo" env-name="
> parameters.roleTypeIdTo"/>
> +        </entity-and>
>
> -        <create-value value-name="newEntity"/>
> +        <if-empty field-name="partyRels">
> +            <make-value value-name="newEntity"
> entity-name="PartyRelationship"/>
> +            <set-pk-fields map-name="parameters" value-name="newEntity"/>
> +            <set-nonpk-fields map-name="parameters"
> value-name="newEntity"/>
> +            <create-value value-name="newEntity"/>
> +        </if-empty>
>     </simple-method>
>     <simple-method method-name="updatePartyRelationship"
> short-description="updatePartyRelationship">
>         <if-empty field-name="parameters.roleTypeIdFrom"><set field="
> parameters.roleTypeIdFrom" value="_NA_"/></if-empty>
>
>
>


--
Thanks & Regards
Mridul Pathak
Hotwax Media
http://www.hotwaxmedia.com
[hidden email]
__________________________________
Office          :   509.855.4113
Mobile         : +919425926892