62:
63: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
64: fnd_message.Set_token('TEXT', 'Invalid bypass CM Approval flag: ' || l_temp);
65: fnd_msg_pub.Add;
66: raise FND_API.G_EXC_ERROR;
67:
68: end if;
69:
70: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
88: for i in 1 .. l_assignment_id_tbl.count loop
89:
90: pv_assignment_pvt.UpdateAssignment (
91: p_api_version_number => 1.0
92: ,p_init_msg_list => FND_API.G_FALSE
93: ,p_commit => FND_API.G_FALSE
94: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
95: ,p_action => pv_assignment_pub.g_asgn_action_status_update
96: ,p_lead_assignment_id => l_assignment_id_tbl(i)
89:
90: pv_assignment_pvt.UpdateAssignment (
91: p_api_version_number => 1.0
92: ,p_init_msg_list => FND_API.G_FALSE
93: ,p_commit => FND_API.G_FALSE
94: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
95: ,p_action => pv_assignment_pub.g_asgn_action_status_update
96: ,p_lead_assignment_id => l_assignment_id_tbl(i)
97: ,p_status_date => sysdate
90: pv_assignment_pvt.UpdateAssignment (
91: p_api_version_number => 1.0
92: ,p_init_msg_list => FND_API.G_FALSE
93: ,p_commit => FND_API.G_FALSE
94: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
95: ,p_action => pv_assignment_pub.g_asgn_action_status_update
96: ,p_lead_assignment_id => l_assignment_id_tbl(i)
97: ,p_status_date => sysdate
98: ,p_status => pv_assignment_pub.g_la_status_cm_bypassed
101: ,x_msg_count => l_msg_count
102: ,x_msg_data => l_msg_data
103: ,x_return_status => l_return_status);
104:
105: if l_return_status <> FND_API.G_RET_STS_SUCCESS then
106: raise FND_API.G_EXC_ERROR;
107: end if;
108:
109: end loop;
102: ,x_msg_data => l_msg_data
103: ,x_return_status => l_return_status);
104:
105: if l_return_status <> FND_API.G_RET_STS_SUCCESS then
106: raise FND_API.G_EXC_ERROR;
107: end if;
108:
109: end loop;
110: end if;
124:
125: resultout := l_resultout;
126:
127: EXCEPTION
128: WHEN FND_API.G_EXC_ERROR THEN
129:
130: fnd_msg_pub.Count_And_Get(
131: p_encoded => FND_API.G_TRUE
132: ,p_count => l_msg_count
127: EXCEPTION
128: WHEN FND_API.G_EXC_ERROR THEN
129:
130: fnd_msg_pub.Count_And_Get(
131: p_encoded => FND_API.G_TRUE
132: ,p_count => l_msg_count
133: ,p_data => l_msg_data);
134:
135: wf_core.context(G_PKG_NAME, l_api_name,l_msg_data);
134:
135: wf_core.context(G_PKG_NAME, l_api_name,l_msg_data);
136: raise;
137:
138: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
139:
140: fnd_msg_pub.Count_And_Get(
141: p_encoded => FND_API.G_TRUE
142: ,p_count => l_msg_count
137:
138: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
139:
140: fnd_msg_pub.Count_And_Get(
141: p_encoded => FND_API.G_TRUE
142: ,p_count => l_msg_count
143: ,p_data => l_msg_data);
144:
145: wf_core.context(G_PKG_NAME, l_api_name,l_msg_data);
147:
148: WHEN OTHERS THEN
149:
150: fnd_msg_pub.Count_And_Get(
151: p_encoded => FND_API.G_TRUE
152: ,p_count => l_msg_count
153: ,p_data => l_msg_data);
154:
155: wf_core.context(G_PKG_NAME, l_api_name,l_msg_data);
189: actid => actid,
190: aname => g_wf_attr_pvt_timeout_type);
191: pv_assignment_pvt.setTimeout (
192: p_api_version_number => 1.0,
193: p_init_msg_list => FND_API.G_FALSE,
194: p_commit => FND_API.G_FALSE,
195: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
196: p_itemtype => itemType,
197: p_itemkey => itemKey,
190: aname => g_wf_attr_pvt_timeout_type);
191: pv_assignment_pvt.setTimeout (
192: p_api_version_number => 1.0,
193: p_init_msg_list => FND_API.G_FALSE,
194: p_commit => FND_API.G_FALSE,
195: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
196: p_itemtype => itemType,
197: p_itemkey => itemKey,
198: p_partner_id => NULL,
191: pv_assignment_pvt.setTimeout (
192: p_api_version_number => 1.0,
193: p_init_msg_list => FND_API.G_FALSE,
194: p_commit => FND_API.G_FALSE,
195: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
196: p_itemtype => itemType,
197: p_itemkey => itemKey,
198: p_partner_id => NULL,
199: p_timeoutType => l_timeout_type,
200: x_return_status => l_return_status,
201: x_msg_count => l_msg_count,
202: x_msg_data => l_msg_data);
203:
204: if l_return_status <> FND_API.G_RET_STS_SUCCESS then
205: raise FND_API.G_EXC_ERROR;
206: end if;
207:
208: l_resultout := 'COMPLETE:';
201: x_msg_count => l_msg_count,
202: x_msg_data => l_msg_data);
203:
204: if l_return_status <> FND_API.G_RET_STS_SUCCESS then
205: raise FND_API.G_EXC_ERROR;
206: end if;
207:
208: l_resultout := 'COMPLETE:';
209:
220:
221: resultout := l_resultout;
222:
223: EXCEPTION
224: WHEN FND_API.G_EXC_ERROR THEN
225:
226: fnd_msg_pub.Count_And_Get(
227: p_encoded => FND_API.G_TRUE
228: ,p_count => l_msg_count
223: EXCEPTION
224: WHEN FND_API.G_EXC_ERROR THEN
225:
226: fnd_msg_pub.Count_And_Get(
227: p_encoded => FND_API.G_TRUE
228: ,p_count => l_msg_count
229: ,p_data => l_msg_data);
230:
231: wf_core.context(G_PKG_NAME, l_api_name,l_msg_data);
230:
231: wf_core.context(G_PKG_NAME, l_api_name,l_msg_data);
232: raise;
233:
234: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
235:
236: fnd_msg_pub.Count_And_Get(
237: p_encoded => FND_API.G_TRUE
238: ,p_count => l_msg_count
233:
234: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
235:
236: fnd_msg_pub.Count_And_Get(
237: p_encoded => FND_API.G_TRUE
238: ,p_count => l_msg_count
239: ,p_data => l_msg_data);
240:
241: wf_core.context(G_PKG_NAME, l_api_name,l_msg_data);
243:
244: WHEN OTHERS THEN
245:
246: fnd_msg_pub.Count_And_Get(
247: p_encoded => FND_API.G_TRUE
248: ,p_count => l_msg_count
249: ,p_data => l_msg_data);
250:
251: wf_core.context(G_PKG_NAME, l_api_name,l_msg_data);
296: if (funcmode = 'RUN') then
297:
298: pv_assignment_pvt.send_notification (
299: p_api_version_number => 1.0
300: ,p_init_msg_list => FND_API.G_FALSE
301: ,p_commit => FND_API.G_FALSE
302: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
303: ,p_itemtype => itemType
304: ,p_itemkey => itemKey
297:
298: pv_assignment_pvt.send_notification (
299: p_api_version_number => 1.0
300: ,p_init_msg_list => FND_API.G_FALSE
301: ,p_commit => FND_API.G_FALSE
302: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
303: ,p_itemtype => itemType
304: ,p_itemkey => itemKey
305: ,p_activity_id => actid
298: pv_assignment_pvt.send_notification (
299: p_api_version_number => 1.0
300: ,p_init_msg_list => FND_API.G_FALSE
301: ,p_commit => FND_API.G_FALSE
302: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
303: ,p_itemtype => itemType
304: ,p_itemkey => itemKey
305: ,p_activity_id => actid
306: ,P_route_stage => pv_assignment_pub.g_r_status_matched
308: ,x_return_status => l_return_status
309: ,x_msg_count => l_msg_count
310: ,x_msg_data => l_msg_data);
311:
312: if l_return_status <> FND_API.G_RET_STS_SUCCESS then
313: raise FND_API.G_EXC_ERROR;
314: end if;
315:
316: wf_standard.block(itemtype => itemtype,
309: ,x_msg_count => l_msg_count
310: ,x_msg_data => l_msg_data);
311:
312: if l_return_status <> FND_API.G_RET_STS_SUCCESS then
313: raise FND_API.G_EXC_ERROR;
314: end if;
315:
316: wf_standard.block(itemtype => itemtype,
317: itemkey => itemkey,
348: -- CM did not act and timeout happened
349:
350: pv_assignment_pvt.UpdateAssignment (
351: p_api_version_number => 1.0
352: ,p_init_msg_list => FND_API.G_FALSE
353: ,p_commit => FND_API.G_FALSE
354: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
355: ,p_action => pv_assignment_pub.g_asgn_action_status_update
356: ,p_lead_assignment_id => l_assignment_id_tbl(i)
349:
350: pv_assignment_pvt.UpdateAssignment (
351: p_api_version_number => 1.0
352: ,p_init_msg_list => FND_API.G_FALSE
353: ,p_commit => FND_API.G_FALSE
354: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
355: ,p_action => pv_assignment_pub.g_asgn_action_status_update
356: ,p_lead_assignment_id => l_assignment_id_tbl(i)
357: ,p_status_date => sysdate
350: pv_assignment_pvt.UpdateAssignment (
351: p_api_version_number => 1.0
352: ,p_init_msg_list => FND_API.G_FALSE
353: ,p_commit => FND_API.G_FALSE
354: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
355: ,p_action => pv_assignment_pub.g_asgn_action_status_update
356: ,p_lead_assignment_id => l_assignment_id_tbl(i)
357: ,p_status_date => sysdate
358: ,p_status => pv_assignment_pub.g_la_status_cm_timeout
361: ,x_msg_count => l_msg_count
362: ,x_msg_data => l_msg_data
363: ,x_return_status => l_return_status);
364:
365: if l_return_status <> FND_API.G_RET_STS_SUCCESS then
366: raise FND_API.G_EXC_ERROR;
367: end if;
368:
369: update pv_party_notifications
362: ,x_msg_data => l_msg_data
363: ,x_return_status => l_return_status);
364:
365: if l_return_status <> FND_API.G_RET_STS_SUCCESS then
366: raise FND_API.G_EXC_ERROR;
367: end if;
368:
369: update pv_party_notifications
370: set resource_response = pv_assignment_pub.g_la_status_cm_timeout,
391:
392: resultout := l_resultout;
393:
394: EXCEPTION
395: WHEN FND_API.G_EXC_ERROR THEN
396:
397: fnd_msg_pub.Count_And_Get(
398: p_encoded => FND_API.G_TRUE
399: ,p_count => l_msg_count
394: EXCEPTION
395: WHEN FND_API.G_EXC_ERROR THEN
396:
397: fnd_msg_pub.Count_And_Get(
398: p_encoded => FND_API.G_TRUE
399: ,p_count => l_msg_count
400: ,p_data => l_msg_data);
401:
402: wf_core.context(G_PKG_NAME, l_api_name,l_msg_data);
401:
402: wf_core.context(G_PKG_NAME, l_api_name,l_msg_data);
403: raise;
404:
405: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
406:
407: fnd_msg_pub.Count_And_Get(
408: p_encoded => FND_API.G_TRUE
409: ,p_count => l_msg_count
404:
405: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
406:
407: fnd_msg_pub.Count_And_Get(
408: p_encoded => FND_API.G_TRUE
409: ,p_count => l_msg_count
410: ,p_data => l_msg_data);
411:
412: wf_core.context(G_PKG_NAME, l_api_name,l_msg_data);
414:
415: WHEN OTHERS THEN
416:
417: fnd_msg_pub.Count_And_Get(
418: p_encoded => FND_API.G_TRUE
419: ,p_count => l_msg_count
420: ,p_data => l_msg_data);
421:
422: wf_core.context(G_PKG_NAME, l_api_name,l_msg_data);
460: -- in direct matching and cm has rejected
461:
462: pv_assignment_pvt.removeRejectedFromAccess (
463: p_api_version_number => 1.0,
464: p_init_msg_list => FND_API.G_FALSE,
465: p_commit => FND_API.G_FALSE,
466: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
467: p_itemtype => itemType,
468: p_itemkey => itemKey,
461:
462: pv_assignment_pvt.removeRejectedFromAccess (
463: p_api_version_number => 1.0,
464: p_init_msg_list => FND_API.G_FALSE,
465: p_commit => FND_API.G_FALSE,
466: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
467: p_itemtype => itemType,
468: p_itemkey => itemKey,
469: p_partner_id => NULL,
462: pv_assignment_pvt.removeRejectedFromAccess (
463: p_api_version_number => 1.0,
464: p_init_msg_list => FND_API.G_FALSE,
465: p_commit => FND_API.G_FALSE,
466: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
467: p_itemtype => itemType,
468: p_itemkey => itemKey,
469: p_partner_id => NULL,
470: x_return_status => l_return_status,
470: x_return_status => l_return_status,
471: x_msg_count => l_msg_count,
472: x_msg_data => l_msg_data);
473:
474: if l_return_status <> FND_API.G_RET_STS_SUCCESS then
475: raise FND_API.G_EXC_ERROR;
476: end if;
477:
478: l_resultout := 'COMPLETE:' || l_match_outcome;
471: x_msg_count => l_msg_count,
472: x_msg_data => l_msg_data);
473:
474: if l_return_status <> FND_API.G_RET_STS_SUCCESS then
475: raise FND_API.G_EXC_ERROR;
476: end if;
477:
478: l_resultout := 'COMPLETE:' || l_match_outcome;
479:
490:
491: resultout := l_resultout;
492:
493: EXCEPTION
494: WHEN FND_API.G_EXC_ERROR THEN
495:
496: fnd_msg_pub.Count_And_Get(
497: p_encoded => FND_API.G_TRUE
498: ,p_count => l_msg_count
493: EXCEPTION
494: WHEN FND_API.G_EXC_ERROR THEN
495:
496: fnd_msg_pub.Count_And_Get(
497: p_encoded => FND_API.G_TRUE
498: ,p_count => l_msg_count
499: ,p_data => l_msg_data);
500:
501: wf_core.context(G_PKG_NAME, l_api_name,l_msg_data);
500:
501: wf_core.context(G_PKG_NAME, l_api_name,l_msg_data);
502: raise;
503:
504: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
505:
506: fnd_msg_pub.Count_And_Get(
507: p_encoded => FND_API.G_TRUE
508: ,p_count => l_msg_count
503:
504: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
505:
506: fnd_msg_pub.Count_And_Get(
507: p_encoded => FND_API.G_TRUE
508: ,p_count => l_msg_count
509: ,p_data => l_msg_data);
510:
511: wf_core.context(G_PKG_NAME, l_api_name,l_msg_data);
513:
514: WHEN OTHERS THEN
515:
516: fnd_msg_pub.Count_And_Get(
517: p_encoded => FND_API.G_TRUE
518: ,p_count => l_msg_count
519: ,p_data => l_msg_data);
520:
521: wf_core.context(G_PKG_NAME, l_api_name,l_msg_data);
566: if (funcmode = 'RUN') then
567:
568: pv_assignment_pvt.send_notification (
569: p_api_version_number => 1.0
570: ,p_init_msg_list => FND_API.G_FALSE
571: ,p_commit => FND_API.G_FALSE
572: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
573: ,p_itemtype => itemType
574: ,p_itemkey => itemKey
567:
568: pv_assignment_pvt.send_notification (
569: p_api_version_number => 1.0
570: ,p_init_msg_list => FND_API.G_FALSE
571: ,p_commit => FND_API.G_FALSE
572: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
573: ,p_itemtype => itemType
574: ,p_itemkey => itemKey
575: ,p_activity_id => actid
568: pv_assignment_pvt.send_notification (
569: p_api_version_number => 1.0
570: ,p_init_msg_list => FND_API.G_FALSE
571: ,p_commit => FND_API.G_FALSE
572: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
573: ,p_itemtype => itemType
574: ,p_itemkey => itemKey
575: ,p_activity_id => actid
576: ,P_route_stage => pv_assignment_pub.g_r_status_matched
578: ,x_return_status => l_return_status
579: ,x_msg_count => l_msg_count
580: ,x_msg_data => l_msg_data);
581:
582: if l_return_status <> FND_API.G_RET_STS_SUCCESS then
583: raise FND_API.G_EXC_ERROR;
584: end if;
585:
586: pv_assignment_pvt.update_routing_stage (
579: ,x_msg_count => l_msg_count
580: ,x_msg_data => l_msg_data);
581:
582: if l_return_status <> FND_API.G_RET_STS_SUCCESS then
583: raise FND_API.G_EXC_ERROR;
584: end if;
585:
586: pv_assignment_pvt.update_routing_stage (
587: p_api_version_number => 1.0,
584: end if;
585:
586: pv_assignment_pvt.update_routing_stage (
587: p_api_version_number => 1.0,
588: p_init_msg_list => FND_API.G_FALSE,
589: p_commit => FND_API.G_FALSE,
590: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
591: p_itemType => itemtype,
592: p_itemKey => itemKey,
585:
586: pv_assignment_pvt.update_routing_stage (
587: p_api_version_number => 1.0,
588: p_init_msg_list => FND_API.G_FALSE,
589: p_commit => FND_API.G_FALSE,
590: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
591: p_itemType => itemtype,
592: p_itemKey => itemKey,
593: p_routing_stage => pv_assignment_pub.g_r_status_offered,
586: pv_assignment_pvt.update_routing_stage (
587: p_api_version_number => 1.0,
588: p_init_msg_list => FND_API.G_FALSE,
589: p_commit => FND_API.G_FALSE,
590: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
591: p_itemType => itemtype,
592: p_itemKey => itemKey,
593: p_routing_stage => pv_assignment_pub.g_r_status_offered,
594: p_active_but_open_flag => 'N',
595: x_return_status => l_return_status,
596: x_msg_count => l_msg_count,
597: x_msg_data => l_msg_data);
598:
599: if l_return_status <> FND_API.G_RET_STS_SUCCESS then
600: raise FND_API.G_EXC_ERROR;
601: end if;
602:
603: l_assignment_type := wf_engine.GetItemAttrText( itemtype => itemtype,
596: x_msg_count => l_msg_count,
597: x_msg_data => l_msg_data);
598:
599: if l_return_status <> FND_API.G_RET_STS_SUCCESS then
600: raise FND_API.G_EXC_ERROR;
601: end if;
602:
603: l_assignment_type := wf_engine.GetItemAttrText( itemtype => itemtype,
604: itemkey => itemkey,
613:
614: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
615: fnd_message.SET_TOKEN('TEXT', 'Cannot find Partner ID for itemkey: ' || itemkey );
616: fnd_msg_pub.ADD;
617: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
618:
619: end if;
620:
621: -- make sure there is only one partner in SINGLE assignment
625: if lc_get_pt_id%found then
626:
627: fnd_message.Set_Name('PV', 'PV_MULTIPLE_PRTNR_SINGLE');
628: fnd_msg_pub.ADD;
629: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
630:
631: end if;
632:
633: close lc_get_pt_id;
633: close lc_get_pt_id;
634:
635: pv_assignment_pvt.set_offered_attributes (
636: p_api_version_number => 1.0,
637: p_init_msg_list => FND_API.G_FALSE,
638: p_commit => FND_API.G_FALSE,
639: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
640: p_itemtype => itemType,
641: p_itemkey => itemKey,
634:
635: pv_assignment_pvt.set_offered_attributes (
636: p_api_version_number => 1.0,
637: p_init_msg_list => FND_API.G_FALSE,
638: p_commit => FND_API.G_FALSE,
639: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
640: p_itemtype => itemType,
641: p_itemkey => itemKey,
642: p_partner_id => l_partner_id,
635: pv_assignment_pvt.set_offered_attributes (
636: p_api_version_number => 1.0,
637: p_init_msg_list => FND_API.G_FALSE,
638: p_commit => FND_API.G_FALSE,
639: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
640: p_itemtype => itemType,
641: p_itemkey => itemKey,
642: p_partner_id => l_partner_id,
643: x_return_status => l_return_status,
643: x_return_status => l_return_status,
644: x_msg_count => l_msg_count,
645: x_msg_data => l_msg_data);
646:
647: if l_return_status <> FND_API.G_RET_STS_SUCCESS then
648: raise FND_API.G_EXC_ERROR;
649: end if;
650:
651: elsif l_assignment_type = g_wf_lkup_serial then
644: x_msg_count => l_msg_count,
645: x_msg_data => l_msg_data);
646:
647: if l_return_status <> FND_API.G_RET_STS_SUCCESS then
648: raise FND_API.G_EXC_ERROR;
649: end if;
650:
651: elsif l_assignment_type = g_wf_lkup_serial then
652:
657:
658: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
659: fnd_message.SET_TOKEN('TEXT', 'Cannot find Partner ID for itemkey: ' || itemkey );
660: fnd_msg_pub.ADD;
661: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
662:
663: end if;
664:
665: close lc_get_pt_id;
672: elsif l_assignment_type = g_wf_lkup_broadcast then
673:
674: pv_assignment_pvt.set_offered_attributes (
675: p_api_version_number => 1.0,
676: p_init_msg_list => FND_API.G_FALSE,
677: p_commit => FND_API.G_FALSE,
678: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
679: p_itemtype => itemType,
680: p_itemkey => itemKey,
673:
674: pv_assignment_pvt.set_offered_attributes (
675: p_api_version_number => 1.0,
676: p_init_msg_list => FND_API.G_FALSE,
677: p_commit => FND_API.G_FALSE,
678: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
679: p_itemtype => itemType,
680: p_itemkey => itemKey,
681: p_partner_id => null,
674: pv_assignment_pvt.set_offered_attributes (
675: p_api_version_number => 1.0,
676: p_init_msg_list => FND_API.G_FALSE,
677: p_commit => FND_API.G_FALSE,
678: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
679: p_itemtype => itemType,
680: p_itemkey => itemKey,
681: p_partner_id => null,
682: x_return_status => l_return_status,
682: x_return_status => l_return_status,
683: x_msg_count => l_msg_count,
684: x_msg_data => l_msg_data);
685:
686: if l_return_status <> FND_API.G_RET_STS_SUCCESS then
687: raise FND_API.G_EXC_ERROR;
688: end if;
689:
690:
683: x_msg_count => l_msg_count,
684: x_msg_data => l_msg_data);
685:
686: if l_return_status <> FND_API.G_RET_STS_SUCCESS then
687: raise FND_API.G_EXC_ERROR;
688: end if;
689:
690:
691: elsif l_assignment_type = g_wf_lkup_joint then
691: elsif l_assignment_type = g_wf_lkup_joint then
692:
693: pv_assignment_pvt.set_offered_attributes (
694: p_api_version_number => 1.0,
695: p_init_msg_list => FND_API.G_FALSE,
696: p_commit => FND_API.G_FALSE,
697: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
698: p_itemtype => itemType,
699: p_itemkey => itemKey,
692:
693: pv_assignment_pvt.set_offered_attributes (
694: p_api_version_number => 1.0,
695: p_init_msg_list => FND_API.G_FALSE,
696: p_commit => FND_API.G_FALSE,
697: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
698: p_itemtype => itemType,
699: p_itemkey => itemKey,
700: p_partner_id => null,
693: pv_assignment_pvt.set_offered_attributes (
694: p_api_version_number => 1.0,
695: p_init_msg_list => FND_API.G_FALSE,
696: p_commit => FND_API.G_FALSE,
697: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
698: p_itemtype => itemType,
699: p_itemkey => itemKey,
700: p_partner_id => null,
701: x_return_status => l_return_status,
701: x_return_status => l_return_status,
702: x_msg_count => l_msg_count,
703: x_msg_data => l_msg_data);
704:
705: if l_return_status <> FND_API.G_RET_STS_SUCCESS then
706: raise FND_API.G_EXC_ERROR;
707: end if;
708:
709: else
702: x_msg_count => l_msg_count,
703: x_msg_data => l_msg_data);
704:
705: if l_return_status <> FND_API.G_RET_STS_SUCCESS then
706: raise FND_API.G_EXC_ERROR;
707: end if;
708:
709: else
710:
710:
711: fnd_message.Set_Name('PV', 'PV_INVALID_ASSIGN_TYPE');
712: fnd_message.SET_TOKEN('TYPE', l_assignment_type);
713: fnd_msg_pub.ADD;
714: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
715:
716: end if;
717:
718: l_resultout := 'COMPLETE:' || l_assignment_type;
730:
731: resultout := l_resultout;
732:
733: EXCEPTION
734: WHEN FND_API.G_EXC_ERROR THEN
735:
736: fnd_msg_pub.Count_And_Get(
737: p_encoded => FND_API.G_TRUE
738: ,p_count => l_msg_count
733: EXCEPTION
734: WHEN FND_API.G_EXC_ERROR THEN
735:
736: fnd_msg_pub.Count_And_Get(
737: p_encoded => FND_API.G_TRUE
738: ,p_count => l_msg_count
739: ,p_data => l_msg_data);
740:
741: wf_core.context(G_PKG_NAME, l_api_name,l_msg_data);
740:
741: wf_core.context(G_PKG_NAME, l_api_name,l_msg_data);
742: raise;
743:
744: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
745:
746: fnd_msg_pub.Count_And_Get(
747: p_encoded => FND_API.G_TRUE
748: ,p_count => l_msg_count
743:
744: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
745:
746: fnd_msg_pub.Count_And_Get(
747: p_encoded => FND_API.G_TRUE
748: ,p_count => l_msg_count
749: ,p_data => l_msg_data);
750:
751: wf_core.context(G_PKG_NAME, l_api_name,l_msg_data);
753:
754: WHEN OTHERS THEN
755:
756: fnd_msg_pub.Count_And_Get(
757: p_encoded => FND_API.G_TRUE
758: ,p_count => l_msg_count
759: ,p_data => l_msg_data);
760:
761: wf_core.context(G_PKG_NAME, l_api_name,l_msg_data);
843: else
844:
845: pv_assignment_pvt.set_offered_attributes (
846: p_api_version_number => 1.0,
847: p_init_msg_list => FND_API.G_FALSE,
848: p_commit => FND_API.G_FALSE,
849: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
850: p_itemtype => itemType,
851: p_itemkey => itemKey,
844:
845: pv_assignment_pvt.set_offered_attributes (
846: p_api_version_number => 1.0,
847: p_init_msg_list => FND_API.G_FALSE,
848: p_commit => FND_API.G_FALSE,
849: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
850: p_itemtype => itemType,
851: p_itemkey => itemKey,
852: p_partner_id => l_partner_id,
845: pv_assignment_pvt.set_offered_attributes (
846: p_api_version_number => 1.0,
847: p_init_msg_list => FND_API.G_FALSE,
848: p_commit => FND_API.G_FALSE,
849: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
850: p_itemtype => itemType,
851: p_itemkey => itemKey,
852: p_partner_id => l_partner_id,
853: x_return_status => l_return_status,
853: x_return_status => l_return_status,
854: x_msg_count => l_msg_count,
855: x_msg_data => l_msg_data);
856:
857: if l_return_status <> FND_API.G_RET_STS_SUCCESS then
858: raise FND_API.G_EXC_ERROR;
859: end if;
860:
861: wf_engine.SetItemAttrNumber (itemtype => itemType,
854: x_msg_count => l_msg_count,
855: x_msg_data => l_msg_data);
856:
857: if l_return_status <> FND_API.G_RET_STS_SUCCESS then
858: raise FND_API.G_EXC_ERROR;
859: end if;
860:
861: wf_engine.SetItemAttrNumber (itemtype => itemType,
862: itemkey => itemKey,
878: l_assignment_log_rec.lead_assignment_id := l_lead_assignment_id;
879:
880: PV_ASSIGNMENT_PVT.Create_assignment_log_row (
881: p_api_version_number => 1.0,
882: p_init_msg_list => FND_API.G_FALSE,
883: p_commit => FND_API.G_FALSE,
884: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
885: p_assignment_log_rec => l_assignment_log_rec,
886: x_assignment_id => l_assignment_log_id,
879:
880: PV_ASSIGNMENT_PVT.Create_assignment_log_row (
881: p_api_version_number => 1.0,
882: p_init_msg_list => FND_API.G_FALSE,
883: p_commit => FND_API.G_FALSE,
884: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
885: p_assignment_log_rec => l_assignment_log_rec,
886: x_assignment_id => l_assignment_log_id,
887: x_return_status => l_return_status,
880: PV_ASSIGNMENT_PVT.Create_assignment_log_row (
881: p_api_version_number => 1.0,
882: p_init_msg_list => FND_API.G_FALSE,
883: p_commit => FND_API.G_FALSE,
884: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
885: p_assignment_log_rec => l_assignment_log_rec,
886: x_assignment_id => l_assignment_log_id,
887: x_return_status => l_return_status,
888: x_msg_count => l_msg_count,
887: x_return_status => l_return_status,
888: x_msg_count => l_msg_count,
889: x_msg_data => l_msg_data);
890:
891: if l_return_status <> FND_API.G_RET_STS_SUCCESS then
892: raise FND_API.G_EXC_ERROR;
893: end if;
894:
895: l_resultout := 'COMPLETE:' || g_wf_lkup_true;
888: x_msg_count => l_msg_count,
889: x_msg_data => l_msg_data);
890:
891: if l_return_status <> FND_API.G_RET_STS_SUCCESS then
892: raise FND_API.G_EXC_ERROR;
893: end if;
894:
895: l_resultout := 'COMPLETE:' || g_wf_lkup_true;
896:
909:
910: resultout := l_resultout;
911:
912: EXCEPTION
913: WHEN FND_API.G_EXC_ERROR THEN
914:
915: fnd_msg_pub.Count_And_Get(
916: p_encoded => FND_API.G_TRUE
917: ,p_count => l_msg_count
912: EXCEPTION
913: WHEN FND_API.G_EXC_ERROR THEN
914:
915: fnd_msg_pub.Count_And_Get(
916: p_encoded => FND_API.G_TRUE
917: ,p_count => l_msg_count
918: ,p_data => l_msg_data);
919:
920: wf_core.context(G_PKG_NAME, l_api_name,l_msg_data);
919:
920: wf_core.context(G_PKG_NAME, l_api_name,l_msg_data);
921: raise;
922:
923: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
924:
925: fnd_msg_pub.Count_And_Get(
926: p_encoded => FND_API.G_TRUE
927: ,p_count => l_msg_count
922:
923: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
924:
925: fnd_msg_pub.Count_And_Get(
926: p_encoded => FND_API.G_TRUE
927: ,p_count => l_msg_count
928: ,p_data => l_msg_data);
929:
930: wf_core.context(G_PKG_NAME, l_api_name,l_msg_data);
932:
933: WHEN OTHERS THEN
934:
935: fnd_msg_pub.Count_And_Get(
936: p_encoded => FND_API.G_TRUE
937: ,p_count => l_msg_count
938: ,p_data => l_msg_data);
939:
940: wf_core.context(G_PKG_NAME, l_api_name,l_msg_data);
994: itemkey => itemkey,
995: aname => g_wf_attr_partner_id);
996: pv_assignment_pvt.send_notification (
997: p_api_version_number => 1.0
998: ,p_init_msg_list => FND_API.G_FALSE
999: ,p_commit => FND_API.G_FALSE
1000: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
1001: ,p_itemtype => itemType
1002: ,p_itemkey => itemKey
995: aname => g_wf_attr_partner_id);
996: pv_assignment_pvt.send_notification (
997: p_api_version_number => 1.0
998: ,p_init_msg_list => FND_API.G_FALSE
999: ,p_commit => FND_API.G_FALSE
1000: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
1001: ,p_itemtype => itemType
1002: ,p_itemkey => itemKey
1003: ,p_activity_id => actid
996: pv_assignment_pvt.send_notification (
997: p_api_version_number => 1.0
998: ,p_init_msg_list => FND_API.G_FALSE
999: ,p_commit => FND_API.G_FALSE
1000: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
1001: ,p_itemtype => itemType
1002: ,p_itemkey => itemKey
1003: ,p_activity_id => actid
1004: ,P_route_stage => pv_assignment_pub.g_r_status_offered
1006: ,x_return_status => l_return_status
1007: ,x_msg_count => l_msg_count
1008: ,x_msg_data => l_msg_data);
1009:
1010: if l_return_status <> FND_API.G_RET_STS_SUCCESS then
1011: raise FND_API.G_EXC_ERROR;
1012: end if;
1013:
1014: l_assignment_type := wf_engine.GetItemAttrText( itemtype => itemtype,
1007: ,x_msg_count => l_msg_count
1008: ,x_msg_data => l_msg_data);
1009:
1010: if l_return_status <> FND_API.G_RET_STS_SUCCESS then
1011: raise FND_API.G_EXC_ERROR;
1012: end if;
1013:
1014: l_assignment_type := wf_engine.GetItemAttrText( itemtype => itemtype,
1015: itemkey => itemkey,
1041: exit when lc_get_partner_org%notfound;
1042:
1043: pv_assign_util_pvt.updateaccess(
1044: p_api_version_number => 1.0,
1045: p_init_msg_list => FND_API.G_FALSE,
1046: p_commit => FND_API.G_FALSE,
1047: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
1048: p_itemtype => itemType,
1049: p_itemkey => itemKey,
1042:
1043: pv_assign_util_pvt.updateaccess(
1044: p_api_version_number => 1.0,
1045: p_init_msg_list => FND_API.G_FALSE,
1046: p_commit => FND_API.G_FALSE,
1047: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
1048: p_itemtype => itemType,
1049: p_itemkey => itemKey,
1050: p_current_username => NULL,
1043: pv_assign_util_pvt.updateaccess(
1044: p_api_version_number => 1.0,
1045: p_init_msg_list => FND_API.G_FALSE,
1046: p_commit => FND_API.G_FALSE,
1047: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
1048: p_itemtype => itemType,
1049: p_itemkey => itemKey,
1050: p_current_username => NULL,
1051: p_lead_id => l_lead_id,
1058: x_return_status => l_return_status,
1059: x_msg_count => l_msg_count,
1060: x_msg_data => l_msg_data);
1061:
1062: if l_return_status <> FND_API.G_RET_STS_SUCCESS then
1063: raise FND_API.G_EXC_ERROR;
1064: end if;
1065:
1066: end loop;
1059: x_msg_count => l_msg_count,
1060: x_msg_data => l_msg_data);
1061:
1062: if l_return_status <> FND_API.G_RET_STS_SUCCESS then
1063: raise FND_API.G_EXC_ERROR;
1064: end if;
1065:
1066: end loop;
1067: close lc_get_partner_org;
1069: if l_pt_org_rs_id is not null then
1070:
1071: pv_assignment_pvt.update_routing_stage (
1072: p_api_version_number => 1.0,
1073: p_init_msg_list => FND_API.G_FALSE,
1074: p_commit => FND_API.G_FALSE,
1075: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
1076: p_itemType => itemtype,
1077: p_itemKey => itemKey,
1070:
1071: pv_assignment_pvt.update_routing_stage (
1072: p_api_version_number => 1.0,
1073: p_init_msg_list => FND_API.G_FALSE,
1074: p_commit => FND_API.G_FALSE,
1075: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
1076: p_itemType => itemtype,
1077: p_itemKey => itemKey,
1078: p_routing_stage => pv_assignment_pub.g_r_status_active,
1071: pv_assignment_pvt.update_routing_stage (
1072: p_api_version_number => 1.0,
1073: p_init_msg_list => FND_API.G_FALSE,
1074: p_commit => FND_API.G_FALSE,
1075: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
1076: p_itemType => itemtype,
1077: p_itemKey => itemKey,
1078: p_routing_stage => pv_assignment_pub.g_r_status_active,
1079: p_active_but_open_flag => 'Y',
1080: x_return_status => l_return_status,
1081: x_msg_count => l_msg_count,
1082: x_msg_data => l_msg_data);
1083:
1084: if l_return_status <> FND_API.G_RET_STS_SUCCESS then
1085: raise FND_API.G_EXC_ERROR;
1086: end if;
1087:
1088: end if;
1081: x_msg_count => l_msg_count,
1082: x_msg_data => l_msg_data);
1083:
1084: if l_return_status <> FND_API.G_RET_STS_SUCCESS then
1085: raise FND_API.G_EXC_ERROR;
1086: end if;
1087:
1088: end if;
1089: end if;
1107:
1108: resultout := l_resultout;
1109:
1110: EXCEPTION
1111: WHEN FND_API.G_EXC_ERROR THEN
1112:
1113: fnd_msg_pub.Count_And_Get(
1114: p_encoded => FND_API.G_TRUE
1115: ,p_count => l_msg_count
1110: EXCEPTION
1111: WHEN FND_API.G_EXC_ERROR THEN
1112:
1113: fnd_msg_pub.Count_And_Get(
1114: p_encoded => FND_API.G_TRUE
1115: ,p_count => l_msg_count
1116: ,p_data => l_msg_data);
1117:
1118: wf_core.context(G_PKG_NAME, l_api_name,l_msg_data);
1117:
1118: wf_core.context(G_PKG_NAME, l_api_name,l_msg_data);
1119: raise;
1120:
1121: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1122:
1123: fnd_msg_pub.Count_And_Get(
1124: p_encoded => FND_API.G_TRUE
1125: ,p_count => l_msg_count
1120:
1121: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1122:
1123: fnd_msg_pub.Count_And_Get(
1124: p_encoded => FND_API.G_TRUE
1125: ,p_count => l_msg_count
1126: ,p_data => l_msg_data);
1127:
1128: wf_core.context(G_PKG_NAME, l_api_name,l_msg_data);
1130:
1131: WHEN OTHERS THEN
1132:
1133: fnd_msg_pub.Count_And_Get(
1134: p_encoded => FND_API.G_TRUE
1135: ,p_count => l_msg_count
1136: ,p_data => l_msg_data);
1137:
1138: wf_core.context(G_PKG_NAME, l_api_name,l_msg_data);
1407: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
1408: fnd_message.Set_Token('TEXT', 'Cannot find assignment (itemkey): ' || itemkey);
1409: fnd_msg_pub.Add;
1410:
1411: raise FND_API.G_EXC_ERROR;
1412:
1413: end if;
1414:
1415: for i in 1 .. l_response_tbl.count loop
1423: -- partner timed out because status was not changed
1424:
1425: pv_assignment_pvt.UpdateAssignment (
1426: p_api_version_number => 1.0
1427: ,p_init_msg_list => FND_API.G_FALSE
1428: ,p_commit => FND_API.G_FALSE
1429: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
1430: ,p_action => pv_assignment_pub.g_asgn_action_status_update
1431: ,p_lead_assignment_id => l_assignment_id_tbl(i)
1424:
1425: pv_assignment_pvt.UpdateAssignment (
1426: p_api_version_number => 1.0
1427: ,p_init_msg_list => FND_API.G_FALSE
1428: ,p_commit => FND_API.G_FALSE
1429: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
1430: ,p_action => pv_assignment_pub.g_asgn_action_status_update
1431: ,p_lead_assignment_id => l_assignment_id_tbl(i)
1432: ,p_status_date => sysdate
1425: pv_assignment_pvt.UpdateAssignment (
1426: p_api_version_number => 1.0
1427: ,p_init_msg_list => FND_API.G_FALSE
1428: ,p_commit => FND_API.G_FALSE
1429: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
1430: ,p_action => pv_assignment_pub.g_asgn_action_status_update
1431: ,p_lead_assignment_id => l_assignment_id_tbl(i)
1432: ,p_status_date => sysdate
1433: ,p_status => pv_assignment_pub.g_la_status_pt_timeout
1436: ,x_msg_count => l_msg_count
1437: ,x_msg_data => l_msg_data
1438: ,x_return_status => l_return_status);
1439:
1440: if l_return_status <> FND_API.G_RET_STS_SUCCESS then
1441: raise FND_API.G_EXC_ERROR;
1442: end if;
1443:
1444: -- remove all partner contacts for partner from access
1437: ,x_msg_data => l_msg_data
1438: ,x_return_status => l_return_status);
1439:
1440: if l_return_status <> FND_API.G_RET_STS_SUCCESS then
1441: raise FND_API.G_EXC_ERROR;
1442: end if;
1443:
1444: -- remove all partner contacts for partner from access
1445:
1466: for i in 1 .. l_username_tbl.count loop
1467:
1468: pv_assign_util_pvt.updateaccess(
1469: p_api_version_number => 1.0,
1470: p_init_msg_list => FND_API.G_FALSE,
1471: p_commit => FND_API.G_FALSE,
1472: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
1473: p_itemtype => itemType,
1474: p_itemkey => itemKey,
1467:
1468: pv_assign_util_pvt.updateaccess(
1469: p_api_version_number => 1.0,
1470: p_init_msg_list => FND_API.G_FALSE,
1471: p_commit => FND_API.G_FALSE,
1472: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
1473: p_itemtype => itemType,
1474: p_itemkey => itemKey,
1475: p_current_username => l_username_tbl(i),
1468: pv_assign_util_pvt.updateaccess(
1469: p_api_version_number => 1.0,
1470: p_init_msg_list => FND_API.G_FALSE,
1471: p_commit => FND_API.G_FALSE,
1472: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
1473: p_itemtype => itemType,
1474: p_itemkey => itemKey,
1475: p_current_username => l_username_tbl(i),
1476: p_lead_id => l_lead_id,
1483: x_return_status => l_return_status,
1484: x_msg_count => l_msg_count,
1485: x_msg_data => l_msg_data);
1486:
1487: if l_return_status <> FND_API.G_RET_STS_SUCCESS then
1488: raise FND_API.G_EXC_ERROR;
1489: end if;
1490:
1491: end loop;
1484: x_msg_count => l_msg_count,
1485: x_msg_data => l_msg_data);
1486:
1487: if l_return_status <> FND_API.G_RET_STS_SUCCESS then
1488: raise FND_API.G_EXC_ERROR;
1489: end if;
1490:
1491: end loop;
1492:
1514: for i in 1 .. l_username_tbl.count loop
1515:
1516: pv_assign_util_pvt.updateaccess(
1517: p_api_version_number => 1.0,
1518: p_init_msg_list => FND_API.G_FALSE,
1519: p_commit => FND_API.G_FALSE,
1520: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
1521: p_itemtype => itemType,
1522: p_itemkey => itemKey,
1515:
1516: pv_assign_util_pvt.updateaccess(
1517: p_api_version_number => 1.0,
1518: p_init_msg_list => FND_API.G_FALSE,
1519: p_commit => FND_API.G_FALSE,
1520: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
1521: p_itemtype => itemType,
1522: p_itemkey => itemKey,
1523: p_current_username => l_username_tbl(i),
1516: pv_assign_util_pvt.updateaccess(
1517: p_api_version_number => 1.0,
1518: p_init_msg_list => FND_API.G_FALSE,
1519: p_commit => FND_API.G_FALSE,
1520: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
1521: p_itemtype => itemType,
1522: p_itemkey => itemKey,
1523: p_current_username => l_username_tbl(i),
1524: p_lead_id => l_lead_id,
1531: x_return_status => l_return_status,
1532: x_msg_count => l_msg_count,
1533: x_msg_data => l_msg_data);
1534:
1535: if l_return_status <> FND_API.G_RET_STS_SUCCESS then
1536: raise FND_API.G_EXC_ERROR;
1537: end if;
1538:
1539: end loop;
1532: x_msg_count => l_msg_count,
1533: x_msg_data => l_msg_data);
1534:
1535: if l_return_status <> FND_API.G_RET_STS_SUCCESS then
1536: raise FND_API.G_EXC_ERROR;
1537: end if;
1538:
1539: end loop;
1540: end if;
1555: END IF;
1556:
1557: pv_assign_util_pvt.updateaccess(
1558: p_api_version_number => 1.0,
1559: p_init_msg_list => FND_API.G_FALSE,
1560: p_commit => FND_API.G_FALSE,
1561: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
1562: p_itemtype => itemType,
1563: p_itemkey => itemKey,
1556:
1557: pv_assign_util_pvt.updateaccess(
1558: p_api_version_number => 1.0,
1559: p_init_msg_list => FND_API.G_FALSE,
1560: p_commit => FND_API.G_FALSE,
1561: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
1562: p_itemtype => itemType,
1563: p_itemkey => itemKey,
1564: p_current_username => NULL,
1557: pv_assign_util_pvt.updateaccess(
1558: p_api_version_number => 1.0,
1559: p_init_msg_list => FND_API.G_FALSE,
1560: p_commit => FND_API.G_FALSE,
1561: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
1562: p_itemtype => itemType,
1563: p_itemkey => itemKey,
1564: p_current_username => NULL,
1565: p_lead_id => l_lead_id,
1572: x_return_status => l_return_status,
1573: x_msg_count => l_msg_count,
1574: x_msg_data => l_msg_data);
1575:
1576: if l_return_status <> FND_API.G_RET_STS_SUCCESS then
1577: raise FND_API.G_EXC_ERROR;
1578: end if;
1579:
1580: end loop;
1573: x_msg_count => l_msg_count,
1574: x_msg_data => l_msg_data);
1575:
1576: if l_return_status <> FND_API.G_RET_STS_SUCCESS then
1577: raise FND_API.G_EXC_ERROR;
1578: end if;
1579:
1580: end loop;
1581: close lc_get_pt_org;
1584: elsif l_offer_outcome = g_wf_lkup_offer_withdrawn then
1585:
1586: pv_assignment_pvt.removeRejectedFromAccess (
1587: p_api_version_number => 1.0,
1588: p_init_msg_list => FND_API.G_FALSE,
1589: p_commit => FND_API.G_FALSE,
1590: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
1591: p_itemtype => itemType,
1592: p_itemkey => itemKey,
1585:
1586: pv_assignment_pvt.removeRejectedFromAccess (
1587: p_api_version_number => 1.0,
1588: p_init_msg_list => FND_API.G_FALSE,
1589: p_commit => FND_API.G_FALSE,
1590: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
1591: p_itemtype => itemType,
1592: p_itemkey => itemKey,
1593: p_partner_id => NULL,
1586: pv_assignment_pvt.removeRejectedFromAccess (
1587: p_api_version_number => 1.0,
1588: p_init_msg_list => FND_API.G_FALSE,
1589: p_commit => FND_API.G_FALSE,
1590: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
1591: p_itemtype => itemType,
1592: p_itemkey => itemKey,
1593: p_partner_id => NULL,
1594: x_return_status => l_return_status,
1594: x_return_status => l_return_status,
1595: x_msg_count => l_msg_count,
1596: x_msg_data => l_msg_data);
1597:
1598: if l_return_status <> FND_API.G_RET_STS_SUCCESS then
1599: raise FND_API.G_EXC_ERROR;
1600: end if;
1601:
1602: end if; -- l_offer_outcome
1595: x_msg_count => l_msg_count,
1596: x_msg_data => l_msg_data);
1597:
1598: if l_return_status <> FND_API.G_RET_STS_SUCCESS then
1599: raise FND_API.G_EXC_ERROR;
1600: end if;
1601:
1602: end if; -- l_offer_outcome
1603:
1633: for i in 1 .. l_assignment_id_tbl.count loop
1634:
1635: pv_assignment_pvt.UpdateAssignment (
1636: p_api_version_number => 1.0
1637: ,p_init_msg_list => FND_API.G_FALSE
1638: ,p_commit => FND_API.G_FALSE
1639: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
1640: ,p_action => pv_assignment_pub.g_asgn_action_status_update
1641: ,p_lead_assignment_id => l_assignment_id_tbl(i)
1634:
1635: pv_assignment_pvt.UpdateAssignment (
1636: p_api_version_number => 1.0
1637: ,p_init_msg_list => FND_API.G_FALSE
1638: ,p_commit => FND_API.G_FALSE
1639: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
1640: ,p_action => pv_assignment_pub.g_asgn_action_status_update
1641: ,p_lead_assignment_id => l_assignment_id_tbl(i)
1642: ,p_status_date => sysdate
1635: pv_assignment_pvt.UpdateAssignment (
1636: p_api_version_number => 1.0
1637: ,p_init_msg_list => FND_API.G_FALSE
1638: ,p_commit => FND_API.G_FALSE
1639: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
1640: ,p_action => pv_assignment_pub.g_asgn_action_status_update
1641: ,p_lead_assignment_id => l_assignment_id_tbl(i)
1642: ,p_status_date => sysdate
1643: ,p_status => pv_assignment_pub.g_la_status_lost_chance
1646: ,x_msg_count => l_msg_count
1647: ,x_msg_data => l_msg_data
1648: ,x_return_status => l_return_status);
1649:
1650: if l_return_status <> FND_API.G_RET_STS_SUCCESS then
1651: raise FND_API.G_EXC_ERROR;
1652: end if;
1653:
1654: -- remove all partner contacts for partner from access
1647: ,x_msg_data => l_msg_data
1648: ,x_return_status => l_return_status);
1649:
1650: if l_return_status <> FND_API.G_RET_STS_SUCCESS then
1651: raise FND_API.G_EXC_ERROR;
1652: end if;
1653:
1654: -- remove all partner contacts for partner from access
1655:
1678: for i in 1 .. l_username_tbl.count loop
1679:
1680: pv_assign_util_pvt.updateAccess(
1681: p_api_version_number => 1.0,
1682: p_init_msg_list => FND_API.G_FALSE,
1683: p_commit => FND_API.G_FALSE,
1684: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
1685: p_itemtype => itemType,
1686: p_itemkey => itemKey,
1679:
1680: pv_assign_util_pvt.updateAccess(
1681: p_api_version_number => 1.0,
1682: p_init_msg_list => FND_API.G_FALSE,
1683: p_commit => FND_API.G_FALSE,
1684: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
1685: p_itemtype => itemType,
1686: p_itemkey => itemKey,
1687: p_current_username => l_username_tbl(i),
1680: pv_assign_util_pvt.updateAccess(
1681: p_api_version_number => 1.0,
1682: p_init_msg_list => FND_API.G_FALSE,
1683: p_commit => FND_API.G_FALSE,
1684: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
1685: p_itemtype => itemType,
1686: p_itemkey => itemKey,
1687: p_current_username => l_username_tbl(i),
1688: p_lead_id => l_lead_id,
1695: x_return_status => l_return_status,
1696: x_msg_count => l_msg_count,
1697: x_msg_data => l_msg_data);
1698:
1699: if l_return_status <> FND_API.G_RET_STS_SUCCESS then
1700: raise FND_API.G_EXC_ERROR;
1701: end if;
1702:
1703: end loop;
1696: x_msg_count => l_msg_count,
1697: x_msg_data => l_msg_data);
1698:
1699: if l_return_status <> FND_API.G_RET_STS_SUCCESS then
1700: raise FND_API.G_EXC_ERROR;
1701: end if;
1702:
1703: end loop;
1704:
1728: for i in 1 .. l_username_tbl.count loop
1729:
1730: pv_assign_util_pvt.updateAccess(
1731: p_api_version_number => 1.0,
1732: p_init_msg_list => FND_API.G_FALSE,
1733: p_commit => FND_API.G_FALSE,
1734: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
1735: p_itemtype => itemType,
1736: p_itemkey => itemKey,
1729:
1730: pv_assign_util_pvt.updateAccess(
1731: p_api_version_number => 1.0,
1732: p_init_msg_list => FND_API.G_FALSE,
1733: p_commit => FND_API.G_FALSE,
1734: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
1735: p_itemtype => itemType,
1736: p_itemkey => itemKey,
1737: p_current_username => l_username_tbl(i),
1730: pv_assign_util_pvt.updateAccess(
1731: p_api_version_number => 1.0,
1732: p_init_msg_list => FND_API.G_FALSE,
1733: p_commit => FND_API.G_FALSE,
1734: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
1735: p_itemtype => itemType,
1736: p_itemkey => itemKey,
1737: p_current_username => l_username_tbl(i),
1738: p_lead_id => l_lead_id,
1745: x_return_status => l_return_status,
1746: x_msg_count => l_msg_count,
1747: x_msg_data => l_msg_data);
1748:
1749: if l_return_status <> FND_API.G_RET_STS_SUCCESS then
1750: raise FND_API.G_EXC_ERROR;
1751: end if;
1752:
1753: end loop;
1746: x_msg_count => l_msg_count,
1747: x_msg_data => l_msg_data);
1748:
1749: if l_return_status <> FND_API.G_RET_STS_SUCCESS then
1750: raise FND_API.G_EXC_ERROR;
1751: end if;
1752:
1753: end loop;
1754: end loop; -- lost_chance
1766: END IF;
1767:
1768: pv_assign_util_pvt.updateaccess(
1769: p_api_version_number => 1.0,
1770: p_init_msg_list => FND_API.G_FALSE,
1771: p_commit => FND_API.G_FALSE,
1772: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
1773: p_itemtype => itemType,
1774: p_itemkey => itemKey,
1767:
1768: pv_assign_util_pvt.updateaccess(
1769: p_api_version_number => 1.0,
1770: p_init_msg_list => FND_API.G_FALSE,
1771: p_commit => FND_API.G_FALSE,
1772: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
1773: p_itemtype => itemType,
1774: p_itemkey => itemKey,
1775: p_current_username => NULL,
1768: pv_assign_util_pvt.updateaccess(
1769: p_api_version_number => 1.0,
1770: p_init_msg_list => FND_API.G_FALSE,
1771: p_commit => FND_API.G_FALSE,
1772: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
1773: p_itemtype => itemType,
1774: p_itemkey => itemKey,
1775: p_current_username => NULL,
1776: p_lead_id => l_lead_id,
1783: x_return_status => l_return_status,
1784: x_msg_count => l_msg_count,
1785: x_msg_data => l_msg_data);
1786:
1787: if l_return_status <> FND_API.G_RET_STS_SUCCESS then
1788: raise FND_API.G_EXC_ERROR;
1789: end if;
1790:
1791: end loop;
1784: x_msg_count => l_msg_count,
1785: x_msg_data => l_msg_data);
1786:
1787: if l_return_status <> FND_API.G_RET_STS_SUCCESS then
1788: raise FND_API.G_EXC_ERROR;
1789: end if;
1790:
1791: end loop;
1792: close lc_get_pt_lc_org;
1804: exit when lc_get_partner_org%notfound;
1805:
1806: pv_assign_util_pvt.updateaccess(
1807: p_api_version_number => 1.0,
1808: p_init_msg_list => FND_API.G_FALSE,
1809: p_commit => FND_API.G_FALSE,
1810: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
1811: p_itemtype => itemType,
1812: p_itemkey => itemKey,
1805:
1806: pv_assign_util_pvt.updateaccess(
1807: p_api_version_number => 1.0,
1808: p_init_msg_list => FND_API.G_FALSE,
1809: p_commit => FND_API.G_FALSE,
1810: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
1811: p_itemtype => itemType,
1812: p_itemkey => itemKey,
1813: p_current_username => NULL,
1806: pv_assign_util_pvt.updateaccess(
1807: p_api_version_number => 1.0,
1808: p_init_msg_list => FND_API.G_FALSE,
1809: p_commit => FND_API.G_FALSE,
1810: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
1811: p_itemtype => itemType,
1812: p_itemkey => itemKey,
1813: p_current_username => NULL,
1814: p_lead_id => l_lead_id,
1821: x_return_status => l_return_status,
1822: x_msg_count => l_msg_count,
1823: x_msg_data => l_msg_data);
1824:
1825: if l_return_status <> FND_API.G_RET_STS_SUCCESS then
1826: raise FND_API.G_EXC_ERROR;
1827: end if;
1828:
1829: end loop;
1822: x_msg_count => l_msg_count,
1823: x_msg_data => l_msg_data);
1824:
1825: if l_return_status <> FND_API.G_RET_STS_SUCCESS then
1826: raise FND_API.G_EXC_ERROR;
1827: end if;
1828:
1829: end loop;
1830: close lc_get_partner_org;
1841: if l_offer_outcome = g_wf_lkup_offer_timedout then
1842:
1843: pv_assignment_pvt.send_notification (
1844: p_api_version_number => 1.0
1845: ,p_init_msg_list => FND_API.G_FALSE
1846: ,p_commit => FND_API.G_FALSE
1847: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
1848: ,p_itemtype => itemType
1849: ,p_itemkey => itemKey
1842:
1843: pv_assignment_pvt.send_notification (
1844: p_api_version_number => 1.0
1845: ,p_init_msg_list => FND_API.G_FALSE
1846: ,p_commit => FND_API.G_FALSE
1847: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
1848: ,p_itemtype => itemType
1849: ,p_itemkey => itemKey
1850: ,p_activity_id => actid
1843: pv_assignment_pvt.send_notification (
1844: p_api_version_number => 1.0
1845: ,p_init_msg_list => FND_API.G_FALSE
1846: ,p_commit => FND_API.G_FALSE
1847: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
1848: ,p_itemtype => itemType
1849: ,p_itemkey => itemKey
1850: ,p_activity_id => actid
1851: ,P_route_stage => pv_assignment_pub.g_r_status_offered
1853: ,x_return_status => l_return_status
1854: ,x_msg_count => l_msg_count
1855: ,x_msg_data => l_msg_data);
1856:
1857: if l_return_status <> FND_API.G_RET_STS_SUCCESS then
1858: raise FND_API.G_EXC_ERROR;
1859: end if;
1860:
1861: end if;
1854: ,x_msg_count => l_msg_count
1855: ,x_msg_data => l_msg_data);
1856:
1857: if l_return_status <> FND_API.G_RET_STS_SUCCESS then
1858: raise FND_API.G_EXC_ERROR;
1859: end if;
1860:
1861: end if;
1862:
1889:
1890: resultout := l_resultout;
1891:
1892: EXCEPTION
1893: WHEN FND_API.G_EXC_ERROR THEN
1894:
1895: fnd_msg_pub.Count_And_Get(
1896: p_encoded => FND_API.G_TRUE
1897: ,p_count => l_msg_count
1892: EXCEPTION
1893: WHEN FND_API.G_EXC_ERROR THEN
1894:
1895: fnd_msg_pub.Count_And_Get(
1896: p_encoded => FND_API.G_TRUE
1897: ,p_count => l_msg_count
1898: ,p_data => l_msg_data);
1899:
1900: wf_core.context(G_PKG_NAME, l_api_name,l_msg_data);
1899:
1900: wf_core.context(G_PKG_NAME, l_api_name,l_msg_data);
1901: raise;
1902:
1903: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1904:
1905: fnd_msg_pub.Count_And_Get(
1906: p_encoded => FND_API.G_TRUE
1907: ,p_count => l_msg_count
1902:
1903: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1904:
1905: fnd_msg_pub.Count_And_Get(
1906: p_encoded => FND_API.G_TRUE
1907: ,p_count => l_msg_count
1908: ,p_data => l_msg_data);
1909:
1910: wf_core.context(G_PKG_NAME, l_api_name,l_msg_data);
1912:
1913: WHEN OTHERS THEN
1914:
1915: fnd_msg_pub.Count_And_Get(
1916: p_encoded => FND_API.G_TRUE
1917: ,p_count => l_msg_count
1918: ,p_data => l_msg_data);
1919:
1920: wf_core.context(G_PKG_NAME, l_api_name,l_msg_data);
2010:
2011: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
2012: fnd_message.Set_token('TEXT', 'Incorrect WF function usage for assignment type: ' || l_assignment_type);
2013: fnd_msg_pub.Add;
2014: raise FND_API.G_EXC_ERROR;
2015:
2016: else
2017:
2018: fnd_message.Set_Name('PV', 'PV_INVALID_ASSIGN_TYPE');
2017:
2018: fnd_message.Set_Name('PV', 'PV_INVALID_ASSIGN_TYPE');
2019: fnd_message.SET_TOKEN('TYPE', l_assignment_type);
2020: fnd_msg_pub.ADD;
2021: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2022:
2023: end if;
2024:
2025: if l_status = pv_assignment_pub.g_la_status_cm_app_for_pt then
2042:
2043: resultout := l_resultout;
2044:
2045: EXCEPTION
2046: WHEN FND_API.G_EXC_ERROR THEN
2047:
2048: fnd_msg_pub.Count_And_Get(
2049: p_encoded => FND_API.G_TRUE
2050: ,p_count => l_msg_count
2045: EXCEPTION
2046: WHEN FND_API.G_EXC_ERROR THEN
2047:
2048: fnd_msg_pub.Count_And_Get(
2049: p_encoded => FND_API.G_TRUE
2050: ,p_count => l_msg_count
2051: ,p_data => l_msg_data);
2052:
2053: wf_core.context(G_PKG_NAME, l_api_name,l_msg_data);
2052:
2053: wf_core.context(G_PKG_NAME, l_api_name,l_msg_data);
2054: raise;
2055:
2056: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
2057:
2058: fnd_msg_pub.Count_And_Get(
2059: p_encoded => FND_API.G_TRUE
2060: ,p_count => l_msg_count
2055:
2056: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
2057:
2058: fnd_msg_pub.Count_And_Get(
2059: p_encoded => FND_API.G_TRUE
2060: ,p_count => l_msg_count
2061: ,p_data => l_msg_data);
2062:
2063: wf_core.context(G_PKG_NAME, l_api_name,l_msg_data);
2065:
2066: WHEN OTHERS THEN
2067:
2068: fnd_msg_pub.Count_And_Get(
2069: p_encoded => FND_API.G_TRUE
2070: ,p_count => l_msg_count
2071: ,p_data => l_msg_data);
2072:
2073: wf_core.context(G_PKG_NAME, l_api_name,l_msg_data);
2123:
2124: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
2125: fnd_message.Set_token('TEXT', 'Incorrect WF function usage for assignment type: ' || l_assignment_type);
2126: fnd_msg_pub.Add;
2127: raise FND_API.G_EXC_ERROR;
2128:
2129: elsif l_assignment_type = g_wf_lkup_joint then
2130:
2131: open lc_any_need_pt_ok_chk (pc_itemtype => itemtype, pc_itemkey => itemkey);
2142:
2143: fnd_message.Set_Name('PV', 'PV_INVALID_ASSIGN_TYPE');
2144: fnd_message.SET_TOKEN('TYPE', l_assignment_type);
2145: fnd_msg_pub.ADD;
2146: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2147:
2148: end if;
2149:
2150: if l_status is NULL then
2166:
2167: resultout := l_resultout;
2168:
2169: EXCEPTION
2170: WHEN FND_API.G_EXC_ERROR THEN
2171:
2172: fnd_msg_pub.Count_And_Get(
2173: p_encoded => FND_API.G_TRUE
2174: ,p_count => l_msg_count
2169: EXCEPTION
2170: WHEN FND_API.G_EXC_ERROR THEN
2171:
2172: fnd_msg_pub.Count_And_Get(
2173: p_encoded => FND_API.G_TRUE
2174: ,p_count => l_msg_count
2175: ,p_data => l_msg_data);
2176:
2177: wf_core.context(G_PKG_NAME, l_api_name,l_msg_data);
2176:
2177: wf_core.context(G_PKG_NAME, l_api_name,l_msg_data);
2178: raise;
2179:
2180: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
2181:
2182: fnd_msg_pub.Count_And_Get(
2183: p_encoded => FND_API.G_TRUE
2184: ,p_count => l_msg_count
2179:
2180: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
2181:
2182: fnd_msg_pub.Count_And_Get(
2183: p_encoded => FND_API.G_TRUE
2184: ,p_count => l_msg_count
2185: ,p_data => l_msg_data);
2186:
2187: wf_core.context(G_PKG_NAME, l_api_name,l_msg_data);
2189:
2190: WHEN OTHERS THEN
2191:
2192: fnd_msg_pub.Count_And_Get(
2193: p_encoded => FND_API.G_TRUE
2194: ,p_count => l_msg_count
2195: ,p_data => l_msg_data);
2196:
2197: wf_core.context(G_PKG_NAME, l_api_name,l_msg_data);
2319: else
2320:
2321: fnd_message.SET_NAME('PV', 'Invalid routing outcome: ' || l_routing_outcome);
2322: fnd_msg_pub.ADD;
2323: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2324:
2325: end if;
2326: IF l_routing_stage <> pv_assignment_pub.g_r_status_active THEN
2327: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
2332: IF l_lead_id IS NOT NULL THEN
2333: PV_ASSIGN_UTIL_PVT.removePreferedPartner
2334: (
2335: p_api_version_number => 1.0,
2336: p_init_msg_list => FND_API.G_FALSE,
2337: p_commit => FND_API.G_FALSE,
2338: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
2339: p_lead_id => l_lead_id,
2340: p_item_type => itemtype,
2333: PV_ASSIGN_UTIL_PVT.removePreferedPartner
2334: (
2335: p_api_version_number => 1.0,
2336: p_init_msg_list => FND_API.G_FALSE,
2337: p_commit => FND_API.G_FALSE,
2338: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
2339: p_lead_id => l_lead_id,
2340: p_item_type => itemtype,
2341: p_item_key => itemkey,
2334: (
2335: p_api_version_number => 1.0,
2336: p_init_msg_list => FND_API.G_FALSE,
2337: p_commit => FND_API.G_FALSE,
2338: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
2339: p_lead_id => l_lead_id,
2340: p_item_type => itemtype,
2341: p_item_key => itemkey,
2342: p_partner_id => NULL,
2343: x_return_status => l_return_status,
2344: x_msg_count => l_msg_count,
2345: x_msg_data => l_msg_data
2346: );
2347: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
2348: RAISE FND_API.G_EXC_ERROR;
2349: END IF;
2350: END IF;
2351:
2344: x_msg_count => l_msg_count,
2345: x_msg_data => l_msg_data
2346: );
2347: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
2348: RAISE FND_API.G_EXC_ERROR;
2349: END IF;
2350: END IF;
2351:
2352:
2352:
2353: END IF;
2354: pv_assignment_pvt.update_routing_stage (
2355: p_api_version_number => 1.0,
2356: p_init_msg_list => FND_API.G_FALSE,
2357: p_commit => FND_API.G_FALSE,
2358: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
2359: p_itemType => itemtype,
2360: p_itemKey => itemKey,
2353: END IF;
2354: pv_assignment_pvt.update_routing_stage (
2355: p_api_version_number => 1.0,
2356: p_init_msg_list => FND_API.G_FALSE,
2357: p_commit => FND_API.G_FALSE,
2358: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
2359: p_itemType => itemtype,
2360: p_itemKey => itemKey,
2361: p_routing_stage => l_routing_stage,
2354: pv_assignment_pvt.update_routing_stage (
2355: p_api_version_number => 1.0,
2356: p_init_msg_list => FND_API.G_FALSE,
2357: p_commit => FND_API.G_FALSE,
2358: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
2359: p_itemType => itemtype,
2360: p_itemKey => itemKey,
2361: p_routing_stage => l_routing_stage,
2362: p_active_but_open_flag => 'N',
2363: x_return_status => l_return_status,
2364: x_msg_count => l_msg_count,
2365: x_msg_data => l_msg_data);
2366:
2367: if l_return_status <> FND_API.G_RET_STS_SUCCESS then
2368: raise FND_API.G_EXC_ERROR;
2369: end if;
2370:
2371: pv_assignment_pvt.send_notification (
2364: x_msg_count => l_msg_count,
2365: x_msg_data => l_msg_data);
2366:
2367: if l_return_status <> FND_API.G_RET_STS_SUCCESS then
2368: raise FND_API.G_EXC_ERROR;
2369: end if;
2370:
2371: pv_assignment_pvt.send_notification (
2372: p_api_version_number => 1.0
2369: end if;
2370:
2371: pv_assignment_pvt.send_notification (
2372: p_api_version_number => 1.0
2373: ,p_init_msg_list => FND_API.G_FALSE
2374: ,p_commit => FND_API.G_FALSE
2375: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
2376: ,p_itemtype => itemType
2377: ,p_itemkey => itemKey
2370:
2371: pv_assignment_pvt.send_notification (
2372: p_api_version_number => 1.0
2373: ,p_init_msg_list => FND_API.G_FALSE
2374: ,p_commit => FND_API.G_FALSE
2375: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
2376: ,p_itemtype => itemType
2377: ,p_itemkey => itemKey
2378: ,p_activity_id => actid
2371: pv_assignment_pvt.send_notification (
2372: p_api_version_number => 1.0
2373: ,p_init_msg_list => FND_API.G_FALSE
2374: ,p_commit => FND_API.G_FALSE
2375: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
2376: ,p_itemtype => itemType
2377: ,p_itemkey => itemKey
2378: ,p_activity_id => actid
2379: ,P_route_stage => l_routing_stage
2381: ,x_return_status => l_return_status
2382: ,x_msg_count => l_msg_count
2383: ,x_msg_data => l_msg_data);
2384:
2385: if l_return_status <> FND_API.G_RET_STS_SUCCESS then
2386: raise FND_API.G_EXC_ERROR;
2387: end if;
2388:
2389: l_resultout := 'COMPLETE:null';
2382: ,x_msg_count => l_msg_count
2383: ,x_msg_data => l_msg_data);
2384:
2385: if l_return_status <> FND_API.G_RET_STS_SUCCESS then
2386: raise FND_API.G_EXC_ERROR;
2387: end if;
2388:
2389: l_resultout := 'COMPLETE:null';
2390:
2401:
2402: resultout := l_resultout;
2403:
2404: EXCEPTION
2405: WHEN FND_API.G_EXC_ERROR THEN
2406:
2407: fnd_msg_pub.Count_And_Get(
2408: p_encoded => FND_API.G_TRUE
2409: ,p_count => l_msg_count
2404: EXCEPTION
2405: WHEN FND_API.G_EXC_ERROR THEN
2406:
2407: fnd_msg_pub.Count_And_Get(
2408: p_encoded => FND_API.G_TRUE
2409: ,p_count => l_msg_count
2410: ,p_data => l_msg_data);
2411:
2412: wf_core.context(G_PKG_NAME, l_api_name,l_msg_data);
2411:
2412: wf_core.context(G_PKG_NAME, l_api_name,l_msg_data);
2413: raise;
2414:
2415: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
2416:
2417: fnd_msg_pub.Count_And_Get(
2418: p_encoded => FND_API.G_TRUE
2419: ,p_count => l_msg_count
2414:
2415: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
2416:
2417: fnd_msg_pub.Count_And_Get(
2418: p_encoded => FND_API.G_TRUE
2419: ,p_count => l_msg_count
2420: ,p_data => l_msg_data);
2421:
2422: wf_core.context(G_PKG_NAME, l_api_name,l_msg_data);
2424:
2425: WHEN OTHERS THEN
2426:
2427: fnd_msg_pub.Count_And_Get(
2428: p_encoded => FND_API.G_TRUE
2429: ,p_count => l_msg_count
2430: ,p_data => l_msg_data);
2431:
2432: wf_core.context(G_PKG_NAME, l_api_name,l_msg_data);
2468: aname => pv_workflow_pub.g_wf_attr_ext_org_party_id);
2469:
2470: pv_assignment_pvt.send_notification (
2471: p_api_version_number => 1.0
2472: ,p_init_msg_list => FND_API.G_FALSE
2473: ,p_commit => FND_API.G_FALSE
2474: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
2475: ,p_itemtype => itemType
2476: ,p_itemkey => itemKey
2469:
2470: pv_assignment_pvt.send_notification (
2471: p_api_version_number => 1.0
2472: ,p_init_msg_list => FND_API.G_FALSE
2473: ,p_commit => FND_API.G_FALSE
2474: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
2475: ,p_itemtype => itemType
2476: ,p_itemkey => itemKey
2477: ,p_activity_id => actid
2470: pv_assignment_pvt.send_notification (
2471: p_api_version_number => 1.0
2472: ,p_init_msg_list => FND_API.G_FALSE
2473: ,p_commit => FND_API.G_FALSE
2474: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
2475: ,p_itemtype => itemType
2476: ,p_itemkey => itemKey
2477: ,p_activity_id => actid
2478: ,P_route_stage => pv_assignment_pub.g_r_status_abandoned
2480: ,x_return_status => l_return_status
2481: ,x_msg_count => l_msg_count
2482: ,x_msg_data => l_msg_data);
2483:
2484: if l_return_status <> FND_API.G_RET_STS_SUCCESS then
2485: raise FND_API.G_EXC_ERROR;
2486: end if;
2487:
2488:
2481: ,x_msg_count => l_msg_count
2482: ,x_msg_data => l_msg_data);
2483:
2484: if l_return_status <> FND_API.G_RET_STS_SUCCESS then
2485: raise FND_API.G_EXC_ERROR;
2486: end if;
2487:
2488:
2489: elsif (funcmode = 'CANCEL') then
2499:
2500: resultout := l_resultout;
2501:
2502: EXCEPTION
2503: WHEN FND_API.G_EXC_ERROR THEN
2504:
2505: fnd_msg_pub.Count_And_Get(
2506: p_encoded => FND_API.G_TRUE
2507: ,p_count => l_msg_count
2502: EXCEPTION
2503: WHEN FND_API.G_EXC_ERROR THEN
2504:
2505: fnd_msg_pub.Count_And_Get(
2506: p_encoded => FND_API.G_TRUE
2507: ,p_count => l_msg_count
2508: ,p_data => l_msg_data);
2509:
2510: wf_core.context(G_PKG_NAME, l_api_name,l_msg_data);
2509:
2510: wf_core.context(G_PKG_NAME, l_api_name,l_msg_data);
2511: raise;
2512:
2513: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
2514:
2515: fnd_msg_pub.Count_And_Get(
2516: p_encoded => FND_API.G_TRUE
2517: ,p_count => l_msg_count
2512:
2513: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
2514:
2515: fnd_msg_pub.Count_And_Get(
2516: p_encoded => FND_API.G_TRUE
2517: ,p_count => l_msg_count
2518: ,p_data => l_msg_data);
2519:
2520: wf_core.context(G_PKG_NAME, l_api_name,l_msg_data);
2522:
2523: WHEN OTHERS THEN
2524:
2525: fnd_msg_pub.Count_And_Get(
2526: p_encoded => FND_API.G_TRUE
2527: ,p_count => l_msg_count
2528: ,p_data => l_msg_data);
2529:
2530: wf_core.context(G_PKG_NAME, l_api_name,l_msg_data);
2562: if (funcmode = 'RUN') then
2563:
2564: pv_assignment_pvt.send_notification (
2565: p_api_version_number => 1.0
2566: ,p_init_msg_list => FND_API.G_FALSE
2567: ,p_commit => FND_API.G_FALSE
2568: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
2569: ,p_itemtype => itemType
2570: ,p_itemkey => itemKey
2563:
2564: pv_assignment_pvt.send_notification (
2565: p_api_version_number => 1.0
2566: ,p_init_msg_list => FND_API.G_FALSE
2567: ,p_commit => FND_API.G_FALSE
2568: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
2569: ,p_itemtype => itemType
2570: ,p_itemkey => itemKey
2571: ,p_activity_id => actid
2564: pv_assignment_pvt.send_notification (
2565: p_api_version_number => 1.0
2566: ,p_init_msg_list => FND_API.G_FALSE
2567: ,p_commit => FND_API.G_FALSE
2568: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
2569: ,p_itemtype => itemType
2570: ,p_itemkey => itemKey
2571: ,p_activity_id => actid
2572: ,P_route_stage => pv_assignment_pub.g_r_status_withdrawn
2574: ,x_return_status => l_return_status
2575: ,x_msg_count => l_msg_count
2576: ,x_msg_data => l_msg_data);
2577:
2578: if l_return_status <> FND_API.G_RET_STS_SUCCESS then
2579: raise FND_API.G_EXC_ERROR;
2580: end if;
2581:
2582:
2575: ,x_msg_count => l_msg_count
2576: ,x_msg_data => l_msg_data);
2577:
2578: if l_return_status <> FND_API.G_RET_STS_SUCCESS then
2579: raise FND_API.G_EXC_ERROR;
2580: end if;
2581:
2582:
2583: elsif (funcmode = 'CANCEL') then
2593:
2594: resultout := l_resultout;
2595:
2596: EXCEPTION
2597: WHEN FND_API.G_EXC_ERROR THEN
2598:
2599: fnd_msg_pub.Count_And_Get(
2600: p_encoded => FND_API.G_TRUE
2601: ,p_count => l_msg_count
2596: EXCEPTION
2597: WHEN FND_API.G_EXC_ERROR THEN
2598:
2599: fnd_msg_pub.Count_And_Get(
2600: p_encoded => FND_API.G_TRUE
2601: ,p_count => l_msg_count
2602: ,p_data => l_msg_data);
2603:
2604: wf_core.context(G_PKG_NAME, l_api_name,l_msg_data);
2603:
2604: wf_core.context(G_PKG_NAME, l_api_name,l_msg_data);
2605: raise;
2606:
2607: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
2608:
2609: fnd_msg_pub.Count_And_Get(
2610: p_encoded => FND_API.G_TRUE
2611: ,p_count => l_msg_count
2606:
2607: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
2608:
2609: fnd_msg_pub.Count_And_Get(
2610: p_encoded => FND_API.G_TRUE
2611: ,p_count => l_msg_count
2612: ,p_data => l_msg_data);
2613:
2614: wf_core.context(G_PKG_NAME, l_api_name,l_msg_data);
2616:
2617: WHEN OTHERS THEN
2618:
2619: fnd_msg_pub.Count_And_Get(
2620: p_encoded => FND_API.G_TRUE
2621: ,p_count => l_msg_count
2622: ,p_data => l_msg_data);
2623:
2624: wf_core.context(G_PKG_NAME, l_api_name,l_msg_data);