KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > opensourcestrategies > crmsfa > leads > LeadsServices


1 /*
2  * Copyright (c) 2006 - 2007 Open Source Strategies, Inc.
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the Honest Public License.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * Honest Public License for more details.
11  *
12  * You should have received a copy of the Honest Public License
13  * along with this program; if not, write to Funambol,
14  * 643 Bair Island Road, Suite 305 - Redwood City, CA 94063, USA
15  */

16 /*
17  * Copyright (c) 2001-2005 The Open For Business Project - www.ofbiz.org
18  *
19  * Permission is hereby granted, free of charge, to any person obtaining a
20  * copy of this software and associated documentation files (the "Software"),
21  * to deal in the Software without restriction, including without limitation
22  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
23  * and/or sell copies of the Software, and to permit persons to whom the
24  * Software is furnished to do so, subject to the following conditions:
25  *
26  * The above copyright notice and this permission notice shall be included
27  * in all copies or substantial portions of the Software.
28  *
29  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
30  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
31  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
32  * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
33  * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT
34  * OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
35  * THE USE OR OTHER DEALINGS IN THE SOFTWARE.
36  */

37 package com.opensourcestrategies.crmsfa.leads;
38
39 import java.util.Map JavaDoc;
40 import java.util.List JavaDoc;
41 import java.util.Locale JavaDoc;
42 import java.util.Iterator JavaDoc;
43
44 import org.ofbiz.base.util.Debug;
45 import org.ofbiz.base.util.UtilMisc;
46 import org.ofbiz.base.util.UtilDateTime;
47 import org.ofbiz.entity.GenericDelegator;
48 import org.ofbiz.entity.GenericEntityException;
49 import org.ofbiz.entity.GenericValue;
50 import org.ofbiz.entity.util.EntityUtil;
51 import org.ofbiz.service.DispatchContext;
52 import org.ofbiz.service.GenericServiceException;
53 import org.ofbiz.service.LocalDispatcher;
54 import org.ofbiz.service.ServiceUtil;
55 import org.ofbiz.service.ModelService;
56 import org.ofbiz.security.Security;
57
58 import com.opensourcestrategies.crmsfa.party.PartyHelper;
59 import com.opensourcestrategies.crmsfa.security.CrmsfaSecurity;
60 import com.opensourcestrategies.crmsfa.util.UtilCommon;
61
62 /**
63  * Leads services. The service documentation is in services_leads.xml.
64  *
65  * @author <a HREF="mailto:leon@opensourcestrategies.com">Leon Torres</a>
66  */

67
68 public class LeadsServices {
69
70     public static final String JavaDoc module = LeadsServices.class.getName();
71
72     public static Map JavaDoc createLead(DispatchContext dctx, Map JavaDoc context) {
73         GenericDelegator delegator = dctx.getDelegator();
74         LocalDispatcher dispatcher = dctx.getDispatcher();
75         Security security = dctx.getSecurity();
76         GenericValue userLogin = (GenericValue) context.get("userLogin");
77         Locale JavaDoc locale = (Locale JavaDoc) context.get("locale");
78
79         if (!security.hasPermission("CRMSFA_LEAD_CREATE", userLogin)) {
80             return UtilCommon.createAndLogServiceError("CrmErrorPermissionDenied", locale, module);
81         }
82
83         // the net result of creating an lead is the generation of a Lead partyId
84
String JavaDoc leadPartyId = null;
85         try {
86
87             // set statusId is PTYLEAD_ASSIGNED, because we are assigning to the user down below.
88
// perhaps a better alternative is to create the lead as NEW, call the reassignLeadResponsibleParty service below, and have it update it to ASSIGNED if not already so.
89
String JavaDoc statusId = "PTYLEAD_ASSIGNED";
90             
91             // create the Party and Person, which results in a partyId
92
Map JavaDoc input = UtilMisc.toMap("firstName", context.get("firstName"), "lastName", context.get("lastName"));
93             input.put("firstNameLocal", context.get("firstNameLocal"));
94             input.put("lastNameLocal", context.get("lastNameLocal"));
95             input.put("personalTitle", context.get("personalTitle"));
96             input.put("preferredCurrencyUomId", context.get("currencyUomId"));
97             input.put("description", context.get("description"));
98             input.put("birthDate", context.get("birthDate"));
99             input.put("statusId", statusId); // initial status
100
Map JavaDoc serviceResults = dispatcher.runSync("createPerson", input);
101             if (ServiceUtil.isError(serviceResults)) {
102                 return UtilCommon.createAndLogServiceError(serviceResults, "CrmErrorCreateLeadFail", locale, module);
103             }
104             leadPartyId = (String JavaDoc) serviceResults.get("partyId");
105
106             // create a PartyRole for the resulting Lead partyId with roleTypeId = PROSPECT
107
serviceResults = dispatcher.runSync("createPartyRole", UtilMisc.toMap("partyId", leadPartyId, "roleTypeId", "PROSPECT", "userLogin", userLogin));
108             if (ServiceUtil.isError(serviceResults)) {
109                 return UtilCommon.createAndLogServiceError(serviceResults, "CrmErrorCreateLeadFail", locale, module);
110             }
111
112             // create PartySupplementalData
113
GenericValue partyData = delegator.makeValue("PartySupplementalData", UtilMisc.toMap("partyId", leadPartyId));
114             partyData.setNonPKFields(context);
115             partyData.create();
116
117             // create a party relationship between the userLogin and the Lead with partyRelationshipTypeId RESPONSIBLE_FOR
118
PartyHelper.createNewPartyToRelationship(userLogin.getString("partyId"), leadPartyId, "PROSPECT", "RESPONSIBLE_FOR",
119                     "LEAD_OWNER", PartyHelper.TEAM_MEMBER_ROLES, true, userLogin, delegator, dispatcher);
120
121             // if initial data source is provided, add it
122
String JavaDoc dataSourceId = (String JavaDoc) context.get("dataSourceId");
123             if (dataSourceId != null) {
124                 serviceResults = dispatcher.runSync("crmsfa.addLeadDataSource",
125                         UtilMisc.toMap("partyId", leadPartyId, "dataSourceId", dataSourceId, "userLogin", userLogin));
126                 if (ServiceUtil.isError(serviceResults)) {
127                     return UtilCommon.createAndLogServiceError(serviceResults, "CrmErrorCreateLeadFail", locale, module);
128                 }
129             }
130             
131         } catch (GenericServiceException e) {
132             return UtilCommon.createAndLogServiceError(e, "CrmErrorCreateLeadFail", locale, module);
133         } catch (GenericEntityException e) {
134             return UtilCommon.createAndLogServiceError(e, "CrmErrorCreateLeadFail", locale, module);
135         }
136
137         // return the partyId of the newly created Lead
138
Map JavaDoc results = ServiceUtil.returnSuccess();
139         results.put("partyId", leadPartyId);
140         return results;
141     }
142
143     public static Map JavaDoc updateLead(DispatchContext dctx, Map JavaDoc context) {
144         GenericDelegator delegator = dctx.getDelegator();
145         LocalDispatcher dispatcher = dctx.getDispatcher();
146         Security security = dctx.getSecurity();
147         GenericValue userLogin = (GenericValue) context.get("userLogin");
148         Locale JavaDoc locale = (Locale JavaDoc) context.get("locale");
149
150         String JavaDoc leadPartyId = (String JavaDoc) context.get("partyId");
151          
152         // make sure userLogin has CRMSFA_LEAD_UPDATE permission for this lead
153
if (!CrmsfaSecurity.hasPartyRelationSecurity(security, "CRMSFA_LEAD", "_UPDATE", userLogin, leadPartyId)) {
154             return UtilCommon.createAndLogServiceError("CrmErrorPermissionDenied", locale, module);
155         }
156         try {
157             // get the party
158
GenericValue party = delegator.findByPrimaryKey("Party", UtilMisc.toMap("partyId", leadPartyId));
159             if (party == null) {
160                 return UtilCommon.createAndLogServiceError("CrmErrorUpdateLeadFail", locale, module);
161             }
162
163             // change status if passed in statusId is different
164
String JavaDoc statusId = (String JavaDoc) context.get("statusId");
165             if ((statusId != null) && (!statusId.equals(party.getString("statusId")))) {
166                 Map JavaDoc serviceResults = dispatcher.runSync("setPartyStatus", UtilMisc.toMap("partyId", leadPartyId, "statusId", statusId, "userLogin", userLogin));
167                 if (ServiceUtil.isError(serviceResults)) {
168                     return UtilCommon.createAndLogServiceError(serviceResults, "CrmErrorUpdateLeadFail", locale, module);
169                 }
170             }
171
172             // update the Party and Person
173
Map JavaDoc input = UtilMisc.toMap("partyId", leadPartyId, "firstName", context.get("firstName"), "lastName", context.get("lastName"));
174             input.put("firstNameLocal", context.get("firstNameLocal"));
175             input.put("lastNameLocal", context.get("lastNameLocal"));
176             input.put("personalTitle", context.get("personalTitle"));
177             input.put("preferredCurrencyUomId", context.get("currencyUomId"));
178             input.put("description", context.get("description"));
179             input.put("birthDate", context.get("birthDate"));
180             input.put("userLogin", userLogin);
181             Map JavaDoc serviceResults = dispatcher.runSync("updatePerson", input);
182             if (ServiceUtil.isError(serviceResults)) {
183                 return UtilCommon.createAndLogServiceError(serviceResults, "CrmErrorUpdateLeadFail", locale, module);
184             }
185
186             // update PartySupplementalData
187
GenericValue partyData = delegator.findByPrimaryKey("PartySupplementalData", UtilMisc.toMap("partyId", leadPartyId));
188             if (partyData == null) {
189                 // create a new one
190
partyData = delegator.makeValue("PartySupplementalData", UtilMisc.toMap("partyId", leadPartyId));
191                 partyData.create();
192             }
193             partyData.setNonPKFields(context);
194             partyData.store();
195
196         } catch (GenericServiceException e) {
197             return UtilCommon.createAndLogServiceError(e, "CrmErrorUpdateLeadFail", locale, module);
198         } catch (GenericEntityException e) {
199             return UtilCommon.createAndLogServiceError(e, "CrmErrorUpdateLeadFail", locale, module);
200         }
201         return ServiceUtil.returnSuccess();
202     }
203
204     public static Map JavaDoc convertLead(DispatchContext dctx, Map JavaDoc context) {
205         GenericDelegator delegator = dctx.getDelegator();
206         LocalDispatcher dispatcher = dctx.getDispatcher();
207         Security security = dctx.getSecurity();
208         GenericValue userLogin = (GenericValue) context.get("userLogin");
209         Locale JavaDoc locale = (Locale JavaDoc) context.get("locale");
210
211         String JavaDoc leadPartyId = (String JavaDoc) context.get("leadPartyId");
212         String JavaDoc accountPartyId = (String JavaDoc) context.get("accountPartyId");
213
214         // make sure userLogin has CRMSFA_LEAD_UPDATE permission for this lead
215
if (!CrmsfaSecurity.hasPartyRelationSecurity(security, "CRMSFA_LEAD", "_UPDATE", userLogin, leadPartyId)) {
216             return UtilCommon.createAndLogServiceError("CrmErrorPermissionDenied", locale, module);
217         }
218         
219         Map JavaDoc input = null; // used later for service inputs
220
try {
221             GenericValue lead = delegator.findByPrimaryKey("PartySummaryCRMView", UtilMisc.toMap("partyId", leadPartyId));
222
223             // create a PartyRole of type CONTACT for the lead
224
Map JavaDoc serviceResults = dispatcher.runSync("createPartyRole", UtilMisc.toMap("partyId", leadPartyId, "roleTypeId", "CONTACT", "userLogin", userLogin));
225             if (ServiceUtil.isError(serviceResults)) {
226                 return UtilCommon.createAndLogServiceError(serviceResults, "CrmErrorConvertLeadFail", locale, module);
227             }
228
229             // set the status of the lead to PTYLEAD_CONVERTED
230
serviceResults = dispatcher.runSync("setPartyStatus", UtilMisc.toMap("partyId", leadPartyId, "statusId", "PTYLEAD_CONVERTED", "userLogin", userLogin));
231             if (ServiceUtil.isError(serviceResults)) {
232                 return UtilCommon.createAndLogServiceError(serviceResults, "CrmErrorConvertLeadFail", locale, module);
233             }
234
235             // if no account was given, then create an account based on the PartySupplementalData of the lead
236
if (accountPartyId == null) {
237                 input = UtilMisc.toMap("groupName", lead.getString("companyName"), "description", lead.getString("description"), "userLogin", userLogin);
238                 input.put("parentPartyId", lead.getString("parentPartyId"));
239                 input.put("annualRevenue", lead.getDouble("annualRevenue"));
240                 input.put("currencyUomId", lead.getString("currencyUomId"));
241                 input.put("numberEmployees", lead.getLong("numberEmployees"));
242                 input.put("industryEnumId", lead.getString("industryEnumId"));
243                 input.put("ownershipEnumId", lead.getString("ownershipEnumId"));
244                 input.put("sicCode", lead.getString("sicCode"));
245                 input.put("tickerSymbol", lead.getString("tickerSymbol"));
246                 serviceResults = dispatcher.runSync("crmsfa.createAccount", input);
247                 if (ServiceUtil.isError(serviceResults)) {
248                     return serviceResults;
249                 }
250                 accountPartyId = (String JavaDoc) serviceResults.get("partyId");
251                 
252                 // copy all the datasources over to the new account
253
List JavaDoc dataSources = delegator.findByAnd("PartyDataSource", UtilMisc.toMap("partyId", leadPartyId));
254                 for (Iterator JavaDoc iter = dataSources.iterator(); iter.hasNext(); ) {
255                     GenericValue dataSource = (GenericValue) iter.next();
256                     serviceResults = dispatcher.runSync("createPartyDataSource", UtilMisc.toMap("partyId", accountPartyId,
257                                 "dataSourceId", dataSource.getString("dataSourceId"), "userLogin", userLogin));
258                     if (ServiceUtil.isError(serviceResults)) {
259                         return UtilCommon.createAndLogServiceError(serviceResults, "CrmErrorConvertLeadFail", locale, module);
260                     }
261                 }
262
263                 // copy all the contact mechs to the account
264
serviceResults = dispatcher.runSync("copyPartyContactMechs", UtilMisc.toMap("partyIdFrom", leadPartyId, "partyIdTo", accountPartyId, "userLogin", userLogin));
265                 if (ServiceUtil.isError(serviceResults)) {
266                     return UtilCommon.createAndLogServiceError(serviceResults, "CrmErrorConvertLeadFail", locale, module);
267                 }
268             }
269             
270             // erase (null out) the PartySupplementalData fields from the lead
271
lead.set("parentPartyId", null);
272             lead.set("annualRevenue", null);
273             lead.set("currencyUomId", null);
274             lead.set("numberEmployees", null);
275             lead.set("industryEnumId", null);
276             lead.set("ownershipEnumId", null);
277             lead.set("sicCode", null);
278             lead.set("tickerSymbol", null);
279             lead.store();
280
281             // assign the lead, who is now a contact, to the account
282
input = UtilMisc.toMap("contactPartyId", leadPartyId, "accountPartyId", accountPartyId, "userLogin", userLogin);
283             serviceResults = dispatcher.runSync("crmsfa.assignContactToAccount", input);
284             if (ServiceUtil.isError(serviceResults)) {
285                 return serviceResults;
286             }
287
288             // expire all lead party relationships (roleTypeIdFrom = PROSPECT)
289
List JavaDoc partyRelationships = delegator.findByAnd("PartyRelationship", UtilMisc.toMap("partyIdFrom", leadPartyId, "roleTypeIdFrom", "PROSPECT"));
290             PartyHelper.expirePartyRelationships(partyRelationships, UtilDateTime.nowTimestamp(), dispatcher, userLogin);
291
292             // make the userLogin a RESPONSIBLE_FOR CONTACT_OWNER of the CONTACT
293
PartyHelper.createNewPartyToRelationship(userLogin.getString("partyId"), leadPartyId, "CONTACT", "RESPONSIBLE_FOR", "CONTACT_OWNER",
294                     PartyHelper.TEAM_MEMBER_ROLES, true, userLogin, delegator, dispatcher);
295
296             // now we need to assign the account and contact to the lead's work efforts and expire all the lead ones
297
List JavaDoc associations = EntityUtil.filterByDate(delegator.findByAnd("WorkEffortPartyAssignment", UtilMisc.toMap("partyId", leadPartyId)));
298             for (Iterator JavaDoc iter = associations.iterator(); iter.hasNext(); ) {
299                 GenericValue wepa = (GenericValue) iter.next();
300                 ModelService service = dctx.getModelService("assignPartyToWorkEffort");
301                 input = service.makeValid(wepa, "IN");
302                 input.put("userLogin", userLogin);
303
304                 // expire the current lead association (done by hand because service is suspect)
305
wepa.set("thruDate", UtilDateTime.nowTimestamp());
306                 wepa.store();
307                 
308                 // assign the account to the work effort
309
input.put("partyId", accountPartyId);
310                 input.put("fromDate", null);
311                 input.put("thruDate", null);
312                 input.put("roleTypeId", "ACCOUNT");
313                 serviceResults = dispatcher.runSync("assignPartyToWorkEffort", input);
314                 if (ServiceUtil.isError(serviceResults)) {
315                     return UtilCommon.createAndLogServiceError(serviceResults, "CrmErrorConvertLeadFail", locale, module);
316                 }
317                 
318                 // assign the contact to the work effort
319
input.put("partyId", leadPartyId);
320                 input.put("fromDate", null);
321                 input.put("thruDate", null);
322                 input.put("roleTypeId", "CONTACT");
323                 serviceResults = dispatcher.runSync("assignPartyToWorkEffort", input);
324                 if (ServiceUtil.isError(serviceResults)) {
325                     return UtilCommon.createAndLogServiceError(serviceResults, "CrmErrorConvertLeadFail", locale, module);
326                 }
327             }
328
329             // opportunities assigned to the lead have to be updated to refer to both contact and account
330
List JavaDoc oppRoles = delegator.findByAnd("SalesOpportunityRole", UtilMisc.toMap("partyId", leadPartyId, "roleTypeId", "PROSPECT"));
331             for (Iterator JavaDoc iter = oppRoles.iterator(); iter.hasNext(); ) {
332                 GenericValue oppRole = (GenericValue) iter.next();
333
334                 // create a CONTACT role using the leadPartyId
335
input = UtilMisc.toMap("partyId", leadPartyId, "salesOpportunityId", oppRole.get("salesOpportunityId"), "roleTypeId", "CONTACT");
336                 GenericValue contactOppRole = delegator.makeValue("SalesOpportunityRole", input);
337                 contactOppRole.create();
338
339                 // create an ACCOUNT role for the new accountPartyId
340
input = UtilMisc.toMap("partyId", accountPartyId, "salesOpportunityId", oppRole.get("salesOpportunityId"), "roleTypeId", "ACCOUNT");
341                 GenericValue accountOppRole = delegator.makeValue("SalesOpportunityRole", input);
342                 accountOppRole.create();
343
344                 // delete the PROSPECT role
345
oppRole.remove();
346             }
347
348             // set the status of the lead to PTYLEAD_CONVERTED
349
serviceResults = dispatcher.runSync("setPartyStatus", UtilMisc.toMap("partyId", leadPartyId, "statusId", "PTYLEAD_CONVERTED", "userLogin", userLogin));
350             if (ServiceUtil.isError(serviceResults)) {
351                 return UtilCommon.createAndLogServiceError(serviceResults, "CrmErrorConvertLeadFail", locale, module);
352             }
353         } catch (GenericServiceException e) {
354             return UtilCommon.createAndLogServiceError(e, "CrmErrorUpdateLeadFail", locale, module);
355         } catch (GenericEntityException e) {
356             return UtilCommon.createAndLogServiceError(e, "CrmErrorUpdateLeadFail", locale, module);
357         }
358         // put leadPartyId as partyId
359
Map JavaDoc results = ServiceUtil.returnSuccess();
360         results.put("partyId", leadPartyId);
361         return results;
362     }
363
364     public static Map JavaDoc reassignLeadResponsibleParty(DispatchContext dctx, Map JavaDoc context) {
365         GenericDelegator delegator = dctx.getDelegator();
366         LocalDispatcher dispatcher = dctx.getDispatcher();
367         Security security = dctx.getSecurity();
368         GenericValue userLogin = (GenericValue) context.get("userLogin");
369         Locale JavaDoc locale = (Locale JavaDoc) context.get("locale");
370
371         String JavaDoc leadPartyId = (String JavaDoc) context.get("leadPartyId");
372         String JavaDoc newPartyId = (String JavaDoc) context.get("newPartyId");
373
374         // ensure reassign permission on this lead
375
if (!CrmsfaSecurity.hasPartyRelationSecurity(security, "CRMSFA_LEAD", "_REASSIGN", userLogin, leadPartyId)) {
376             return UtilCommon.createAndLogServiceError("CrmErrorPermissionDenied", locale, module);
377         }
378         try {
379             // reassign relationship with this helper method, which expires previous ones
380
boolean result = PartyHelper.createNewPartyToRelationship(newPartyId, leadPartyId, "PROSPECT", "RESPONSIBLE_FOR",
381                     "LEAD_OWNER", PartyHelper.TEAM_MEMBER_ROLES, true, userLogin, delegator, dispatcher);
382             if (result == false) {
383                 return UtilCommon.createAndLogServiceError("CrmErrorReassignFail", locale, module);
384             }
385         } catch (GenericServiceException e) {
386             return UtilCommon.createAndLogServiceError(e, "CrmErrorReassignFail", locale, module);
387         } catch (GenericEntityException e) {
388             return UtilCommon.createAndLogServiceError(e, "CrmErrorReassignFail", locale, module);
389         }
390         return ServiceUtil.returnSuccess();
391     }
392
393     /**
394      * Delete a "new" lead. A new lead has status PTYLEAD_NEW, PTYLEAD_ASSIGNED or PTYLEAD_QUALIFIED.
395      * This will physically remove the lead from the Party entity and related entities.
396      * If the party was successfully deleted, the method will return a service success, otherwise it
397      * will return a service error with the reason.
398      */

399     public static Map JavaDoc deleteLead(DispatchContext dctx, Map JavaDoc context) {
400         GenericDelegator delegator = dctx.getDelegator();
401         Security security = dctx.getSecurity();
402         GenericValue userLogin = (GenericValue) context.get("userLogin");
403         Locale JavaDoc locale = (Locale JavaDoc) context.get("locale");
404
405         String JavaDoc leadPartyId = (String JavaDoc) context.get("leadPartyId");
406
407         // ensure delete permission on this lead
408
if (!CrmsfaSecurity.hasPartyRelationSecurity(security, "CRMSFA_LEAD", "_DELETE", userLogin, leadPartyId)) {
409             return UtilCommon.createAndLogServiceError("CrmErrorPermissionDenied", locale, module);
410         }
411
412         try {
413             // first ensure the lead is "new" (note that there's no need to check for role because only leads can have these statuses)
414
GenericValue lead = delegator.findByPrimaryKey("Party", UtilMisc.toMap("partyId", leadPartyId));
415             if (lead == null) {
416                 return UtilCommon.createAndLogServiceError("Lead [" + leadPartyId + "] not found.",
417                         "CrmErrorDeleteLeadFail", locale, module);
418             }
419             String JavaDoc statusId = lead.getString("statusId");
420             if (statusId == null || !(statusId.equals("PTYLEAD_NEW") || statusId.equals("PTYLEAD_ASSIGNED") || statusId.equals("PTYLEAD_QUALIFIED"))) {
421                 return UtilCommon.createAndLogServiceError("Lead [" + leadPartyId + "] cannot be deleted. Only new, assigned or qualified leads may be deleted.",
422                         "CrmErrorDeleteLeadFail", locale, module);
423             }
424
425             // delete!
426
PartyHelper.deleteCrmParty(leadPartyId, delegator);
427
428         } catch (GenericEntityException e) {
429             return UtilCommon.createAndLogServiceError(e, "CrmErrorDeleteLeadFail", locale, module);
430         }
431         return ServiceUtil.returnSuccess();
432     }
433 }
434
Popular Tags