You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by ap...@apache.org on 2009/06/24 04:48:29 UTC

svn commit: r787890 - in /ofbiz/trunk/applications/marketing: config/MarketingUiLabels.xml script/org/ofbiz/sfa/lead/LeadServices.xml

Author: apatel
Date: Wed Jun 24 02:48:28 2009
New Revision: 787890

URL: http://svn.apache.org/viewvc?rev=787890&view=rev
Log:
Minor code clean up in createLead service. Convert lead now expires relationship instead of deleting it.

Modified:
    ofbiz/trunk/applications/marketing/config/MarketingUiLabels.xml
    ofbiz/trunk/applications/marketing/script/org/ofbiz/sfa/lead/LeadServices.xml

Modified: ofbiz/trunk/applications/marketing/config/MarketingUiLabels.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/marketing/config/MarketingUiLabels.xml?rev=787890&r1=787889&r2=787890&view=diff
==============================================================================
--- ofbiz/trunk/applications/marketing/config/MarketingUiLabels.xml (original)
+++ ofbiz/trunk/applications/marketing/config/MarketingUiLabels.xml Wed Jun 24 02:48:28 2009
@@ -1734,6 +1734,9 @@
         <value xml:lang="fr">Premier contact</value>
         <value xml:lang="it">Primo contatto</value>
     </property>
+    <property key="SfaFirstNameLastNameAndCompanyNameMissingError">
+        <value xml:lang="en">Please enter Person First name or Last name or Company name</value>
+    </property>
     <property key="SfaForecasts">
         <value xml:lang="en">Forecast</value>
         <value xml:lang="es">Previsión</value>

Modified: ofbiz/trunk/applications/marketing/script/org/ofbiz/sfa/lead/LeadServices.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/marketing/script/org/ofbiz/sfa/lead/LeadServices.xml?rev=787890&r1=787889&r2=787890&view=diff
==============================================================================
--- ofbiz/trunk/applications/marketing/script/org/ofbiz/sfa/lead/LeadServices.xml (original)
+++ ofbiz/trunk/applications/marketing/script/org/ofbiz/sfa/lead/LeadServices.xml Wed Jun 24 02:48:28 2009
@@ -34,7 +34,7 @@
                 </and>
             </condition>
             <then>
-                <add-error><fail-message message="Please enter person first name or last name or Company name"/></add-error>
+                <add-error><fail-property resource="MarketingUiLabels" property="SfaFirstNameLastNameAndCompanyNameMissingError"/></add-error>
             </then>
         </if>
         <check-errors/>
@@ -52,15 +52,18 @@
                 <set field="parameters.roleTypeId" value="LEAD"/>
                 <call-simple-method method-name="createPersonRoleAndContactMechs" xml-resource="component://party/script/org/ofbiz/party/party/PartySimpleMethods.xml"/>
                 <check-errors/>
+                
+                <set field="leadContactPartyId" from-field="partyId"/>
+                <clear-field field="partyId"/>
                 <set field="partyRelationshipCtx.partyIdFrom" from-field="userLogin.partyId"/>
-                <set field="partyRelationshipCtx.partyIdTo" from-field="partyId"/>
+                <set field="partyRelationshipCtx.partyIdTo" from-field="leadContactPartyId"/>
                 <set field="partyRelationshipCtx.roleTypeIdFrom" value="OWNER"/>
                 <set field="partyRelationshipCtx.roleTypeIdTo" value="LEAD"/>
                 <set field="partyRelationshipCtx.partyRelationshipTypeId" value="LEAD_OWNER"/>
                 <call-service service-name="createPartyRelationship" in-map-name="partyRelationshipCtx"/>
                 <check-errors/>
         
-                <set field="updatePartyStatusCtx.partyId" from-field="partyId"/>
+                <set field="updatePartyStatusCtx.partyId" from-field="leadContactPartyId"/>
                 <set field="updatePartyStatusCtx.statusId" value="LEAD_ASSIGNED"/>
                 <call-service service-name="setPartyStatus" in-map-name="updatePartyStatusCtx"/>
             </then>
@@ -69,11 +72,16 @@
         <if-not-empty field="parameters.groupName">
             <set field="parameters.partyTypeId" value="PARTY_GROUP"/>
             <set field="parameters.roleTypeId" value="ACCOUNT_LEAD"/>
-            <if-empty field="partyId">
+            <if-empty field="leadContactPartyId">
                 <!-- In case we have any contact mech data then associate with party group  -->
                 <call-simple-method method-name="createPartyGroupRoleAndContactMechs" xml-resource="component://party/script/org/ofbiz/party/party/PartySimpleMethods.xml"/>
                 <set field="partyGroupPartyId" from-field="partyId"/>
                 <clear-field field="partyId"/>
+         
+               <set field="updatePartyStatusCtx.partyId" from-field="partyGroupPartyId"/>
+               <set field="updatePartyStatusCtx.statusId" value="LEAD_ASSIGNED"/>
+               <call-service service-name="setPartyStatus" in-map-name="updatePartyStatusCtx"/>
+
                 <else>
                     <call-map-processor processor-name="partyGroup" in-map-name="parameters" out-map-name="partyGroupCtx"
                         xml-resource="component://party/script/org/ofbiz/party/party/PartyMapProcs.xml"/>
@@ -87,9 +95,9 @@
                 </else>
             </if-empty>
             
-            <if-not-empty field="partyId">
+            <if-not-empty field="leadContactPartyId">
                 <set field="partyRelationshipCtx.partyIdFrom" from-field="partyGroupPartyId"/>
-                <set field="partyRelationshipCtx.partyIdTo" from-field="partyId"/>
+                <set field="partyRelationshipCtx.partyIdTo" from-field="leadContactPartyId"/>
                 <set field="partyRelationshipCtx.roleTypeIdFrom" value="ACCOUNT_LEAD"/>
                 <set field="partyRelationshipCtx.roleTypeIdTo" value="LEAD"/>
                 <set field="partyRelationshipCtx.positionTitle" from-field="parameters.title"/>
@@ -109,7 +117,7 @@
             <set field="partyDataSourceCtx.dataSourceId" from-field="parameters.dataSourceId"/>
             <call-service service-name="createPartyDataSource" in-map-name="partyDataSourceCtx"/>
         </if-not-empty>
-        <field-to-result field="partyId"/>
+        <field-to-result field="leadContactPartyId" result-name="partyId" />
         <field-to-result field="partyGroupPartyId"/>
         <field-to-result field="parameters.roleTypeId" result-name="roleTypeId"/>
     </simple-method>
@@ -125,10 +133,11 @@
             <order-by field-name="-fromDate"/>
         </entity-and>
         <first-from-list list="partyRelationships" entry="partyRelationship"/>
-        
+
         <if-not-empty field="partyRelationship">
             <set-service-fields service-name="updatePartyRelationship" map="partyRelationship" to-map="deletePartyRelationship"/>
-            <call-service service-name="deletePartyRelationship" in-map-name="deletePartyRelationship"/>
+            <set from-field="nowTimestamp" field="deletePartyRelationship.thruDate"/>
+            <call-service service-name="updatePartyRelationship" in-map-name="deletePartyRelationship"/>
             <set field="partyGroupId" from-field="partyRelationship.partyIdFrom"/>
             <else>
                 <set field="partyGroupId" from-field="parameters.partyGroupId"/>
@@ -143,11 +152,6 @@
         <set field="partyRoleCtx.partyId" from-field="partyGroupId"/>
         <set field="partyRoleCtx.roleTypeId" value="ACCOUNT"/>
         <call-service service-name="createPartyRole" in-map-name="partyRoleCtx"/>
-        <set field="partyRoleCtx.roleTypeId" value="ACCOUNT_LEAD"/>
-        <call-service service-name="deletePartyRole" in-map-name="partyRoleCtx"/>
-        <set field="partyRoleCtx.partyId" from-field="parameters.partyId"/>
-        <!--set field="partyRoleCtx.roleTypeId" value="LEAD"/>
-        <call-service service-name="deletePartyRole" in-map-name="partyRoleCtx"/-->
 
         <!-- create new relationship -->
         <set field="partyRelationshipCtx.partyIdFrom" from-field="partyGroupId"/>



Re: svn commit: r787890 - in /ofbiz/trunk/applications/marketing: config/MarketingUiLabels.xml script/org/ofbiz/sfa/lead/LeadServices.xml

Posted by Adam Heath <do...@brainfood.com>.
Anil Patel wrote:
> Adam,
> The service is returning id of two parties created in in the service. I
> don't see anything bad about it. Can you please explain why is it not good?
> 
> Also in this modification I have changed variable name used in method,
> partyId out parameter was there before my this commit.

Sure, no problem returning any number of party ids.  I was saying it
should return 'leadPartyId', to match the name of the service,
'createLead'.  The name of the service is *not* createLeadContact.


Re: svn commit: r787890 - in /ofbiz/trunk/applications/marketing: config/MarketingUiLabels.xml script/org/ofbiz/sfa/lead/LeadServices.xml

Posted by Anil Patel <an...@hotwaxmedia.com>.
Adam,
The service is returning id of two parties created in in the service.  
I don't see anything bad about it. Can you please explain why is it  
not good?

Also in this modification I have changed variable name used in method,  
partyId out parameter was there before my this commit.

Regards
Anil Patel


On Jun 23, 2009, at 11:46 PM, Adam Heath wrote:

> apatel@apache.org wrote:
>> Author: apatel
>> Date: Wed Jun 24 02:48:28 2009
>> New Revision: 787890
>>
>> URL: http://svn.apache.org/viewvc?rev=787890&view=rev
>> Log:
>> Minor code clean up in createLead service. Convert lead now expires  
>> relationship instead of deleting it.
>>
>> Modified:
>>    ofbiz/trunk/applications/marketing/config/MarketingUiLabels.xml
>>    ofbiz/trunk/applications/marketing/script/org/ofbiz/sfa/lead/ 
>> LeadServices.xml
>>
>> Modified: ofbiz/trunk/applications/marketing/script/org/ofbiz/sfa/ 
>> lead/LeadServices.xml
>> URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/marketing/script/org/ofbiz/sfa/lead/LeadServices.xml?rev=787890&r1=787889&r2=787890&view=diff
>> = 
>> = 
>> = 
>> = 
>> = 
>> = 
>> = 
>> = 
>> = 
>> =====================================================================
>> --- ofbiz/trunk/applications/marketing/script/org/ofbiz/sfa/lead/ 
>> LeadServices.xml (original)
>> +++ ofbiz/trunk/applications/marketing/script/org/ofbiz/sfa/lead/ 
>> LeadServices.xml Wed Jun 24 02:48:28 2009
>> @@ -52,15 +52,18 @@
>>                 <set field="parameters.roleTypeId" value="LEAD"/>
>>                 <call-simple-method method- 
>> name="createPersonRoleAndContactMechs" xml-resource="component:// 
>> party/script/org/ofbiz/party/party/PartySimpleMethods.xml"/>
>>                 <check-errors/>
>> +
>> +                <set field="leadContactPartyId" from- 
>> field="partyId"/>
>> +                <clear-field field="partyId"/>
>>                 <set field="partyRelationshipCtx.partyIdFrom" from- 
>> field="userLogin.partyId"/>
>> -                <set field="partyRelationshipCtx.partyIdTo" from- 
>> field="partyId"/>
>> +                <set field="partyRelationshipCtx.partyIdTo" from- 
>> field="leadContactPartyId"/>
>
> Service is createLead, but returns leadContactPartyId?  That doesn't
> seem sensible.


Re: svn commit: r787890 - in /ofbiz/trunk/applications/marketing: config/MarketingUiLabels.xml script/org/ofbiz/sfa/lead/LeadServices.xml

Posted by Rishi Solanki <ri...@gmail.com>.
Hi,
As the createLead service is creating PartyRelationship record on the basis
of some parameters conditions so it should return the both partyId only, and
the code committed is improved code to make it more sensible so that the
partyId is now in whole service identified by the leadContactPartyId,
finally it just change way of outing the partyId. I think the code is fine
and creating a lead means tie up a party in the LEAD role with the
PartyGroup. I do not seen any problem in returning the leadContactPartyId as
partyId.

Rishi Solanki
Enterprise Software Developer
HotWax Media Pvt. Ltd.


On Wed, Jun 24, 2009 at 11:51 AM, Anil Patel <an...@hotwaxmedia.com>wrote:

> Adam,
> The service is returning id of two parties created in in the service.
> I don't see anything bad about it. Can you please explain why is it
> not good?
>
> Also in this modification I have changed variable name used in method,
> partyId out parameter was there before my this commit.
>
> Regards
> Anil Patel
>
>
>
> On Jun 23, 2009, at 11:46 PM, Adam Heath wrote:
>
>  apatel@apache.org wrote:
>>
>>> Author: apatel
>>> Date: Wed Jun 24 02:48:28 2009
>>> New Revision: 787890
>>>
>>> URL: http://svn.apache.org/viewvc?rev=787890&view=rev
>>> Log:
>>> Minor code clean up in createLead service. Convert lead now expires
>>> relationship instead of deleting it.
>>>
>>> Modified:
>>>   ofbiz/trunk/applications/marketing/config/MarketingUiLabels.xml
>>>
>>> ofbiz/trunk/applications/marketing/script/org/ofbiz/sfa/lead/LeadServices.xml
>>>
>>> Modified:
>>> ofbiz/trunk/applications/marketing/script/org/ofbiz/sfa/lead/LeadServices.xml
>>> URL:
>>> http://svn.apache.org/viewvc/ofbiz/trunk/applications/marketing/script/org/ofbiz/sfa/lead/LeadServices.xml?rev=787890&r1=787889&r2=787890&view=diff
>>>
>>> ==============================================================================
>>> ---
>>> ofbiz/trunk/applications/marketing/script/org/ofbiz/sfa/lead/LeadServices.xml
>>> (original)
>>> +++
>>> ofbiz/trunk/applications/marketing/script/org/ofbiz/sfa/lead/LeadServices.xml
>>> Wed Jun 24 02:48:28 2009
>>> @@ -52,15 +52,18 @@
>>>                <set field="parameters.roleTypeId" value="LEAD"/>
>>>                <call-simple-method
>>> method-name="createPersonRoleAndContactMechs"
>>> xml-resource="component://party/script/org/ofbiz/party/party/PartySimpleMethods.xml"/>
>>>                <check-errors/>
>>> +
>>> +                <set field="leadContactPartyId" from-field="partyId"/>
>>> +                <clear-field field="partyId"/>
>>>                <set field="partyRelationshipCtx.partyIdFrom"
>>> from-field="userLogin.partyId"/>
>>> -                <set field="partyRelationshipCtx.partyIdTo"
>>> from-field="partyId"/>
>>> +                <set field="partyRelationshipCtx.partyIdTo"
>>> from-field="leadContactPartyId"/>
>>>
>>
>> Service is createLead, but returns leadContactPartyId?  That doesn't
>> seem sensible.
>>
>
>

Re: svn commit: r787890 - in /ofbiz/trunk/applications/marketing: config/MarketingUiLabels.xml script/org/ofbiz/sfa/lead/LeadServices.xml

Posted by Anil Patel <an...@hotwaxmedia.com>.
Adam,
The service is returning id of two parties created in in the service.
I don't see anything bad about it. Can you please explain why is it
not good?

Also in this modification I have changed variable name used in method,
partyId out parameter was there before my this commit.

Regards
Anil Patel



On Jun 23, 2009, at 11:46 PM, Adam Heath wrote:

> apatel@apache.org wrote:
>> Author: apatel
>> Date: Wed Jun 24 02:48:28 2009
>> New Revision: 787890
>>
>> URL: http://svn.apache.org/viewvc?rev=787890&view=rev
>> Log:
>> Minor code clean up in createLead service. Convert lead now expires  
>> relationship instead of deleting it.
>>
>> Modified:
>>    ofbiz/trunk/applications/marketing/config/MarketingUiLabels.xml
>>    ofbiz/trunk/applications/marketing/script/org/ofbiz/sfa/lead/ 
>> LeadServices.xml
>>
>> Modified: ofbiz/trunk/applications/marketing/script/org/ofbiz/sfa/ 
>> lead/LeadServices.xml
>> URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/marketing/script/org/ofbiz/sfa/lead/LeadServices.xml?rev=787890&r1=787889&r2=787890&view=diff
>> = 
>> = 
>> = 
>> = 
>> = 
>> = 
>> = 
>> = 
>> = 
>> =====================================================================
>> --- ofbiz/trunk/applications/marketing/script/org/ofbiz/sfa/lead/ 
>> LeadServices.xml (original)
>> +++ ofbiz/trunk/applications/marketing/script/org/ofbiz/sfa/lead/ 
>> LeadServices.xml Wed Jun 24 02:48:28 2009
>> @@ -52,15 +52,18 @@
>>                 <set field="parameters.roleTypeId" value="LEAD"/>
>>                 <call-simple-method method- 
>> name="createPersonRoleAndContactMechs" xml-resource="component:// 
>> party/script/org/ofbiz/party/party/PartySimpleMethods.xml"/>
>>                 <check-errors/>
>> +
>> +                <set field="leadContactPartyId" from- 
>> field="partyId"/>
>> +                <clear-field field="partyId"/>
>>                 <set field="partyRelationshipCtx.partyIdFrom" from- 
>> field="userLogin.partyId"/>
>> -                <set field="partyRelationshipCtx.partyIdTo" from- 
>> field="partyId"/>
>> +                <set field="partyRelationshipCtx.partyIdTo" from- 
>> field="leadContactPartyId"/>
>
> Service is createLead, but returns leadContactPartyId?  That doesn't
> seem sensible.


Re: svn commit: r787890 - in /ofbiz/trunk/applications/marketing: config/MarketingUiLabels.xml script/org/ofbiz/sfa/lead/LeadServices.xml

Posted by Adam Heath <do...@brainfood.com>.
apatel@apache.org wrote:
> Author: apatel
> Date: Wed Jun 24 02:48:28 2009
> New Revision: 787890
> 
> URL: http://svn.apache.org/viewvc?rev=787890&view=rev
> Log:
> Minor code clean up in createLead service. Convert lead now expires relationship instead of deleting it.
> 
> Modified:
>     ofbiz/trunk/applications/marketing/config/MarketingUiLabels.xml
>     ofbiz/trunk/applications/marketing/script/org/ofbiz/sfa/lead/LeadServices.xml
> 
> Modified: ofbiz/trunk/applications/marketing/script/org/ofbiz/sfa/lead/LeadServices.xml
> URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/marketing/script/org/ofbiz/sfa/lead/LeadServices.xml?rev=787890&r1=787889&r2=787890&view=diff
> ==============================================================================
> --- ofbiz/trunk/applications/marketing/script/org/ofbiz/sfa/lead/LeadServices.xml (original)
> +++ ofbiz/trunk/applications/marketing/script/org/ofbiz/sfa/lead/LeadServices.xml Wed Jun 24 02:48:28 2009
> @@ -52,15 +52,18 @@
>                  <set field="parameters.roleTypeId" value="LEAD"/>
>                  <call-simple-method method-name="createPersonRoleAndContactMechs" xml-resource="component://party/script/org/ofbiz/party/party/PartySimpleMethods.xml"/>
>                  <check-errors/>
> +                
> +                <set field="leadContactPartyId" from-field="partyId"/>
> +                <clear-field field="partyId"/>
>                  <set field="partyRelationshipCtx.partyIdFrom" from-field="userLogin.partyId"/>
> -                <set field="partyRelationshipCtx.partyIdTo" from-field="partyId"/>
> +                <set field="partyRelationshipCtx.partyIdTo" from-field="leadContactPartyId"/>

Service is createLead, but returns leadContactPartyId?  That doesn't
seem sensible.