107:
108: --Send notifications to all task owners
109: BEGIN
110: IF (l_debug = 'Y') THEN
111: OKC_DEBUG.set_indentation(l_api_name);
112: OKC_DEBUG.log('10: Entered task_alert', 2);
113: END IF;
114:
115: l_return_status := OKC_API.START_ACTIVITY(l_api_name,
108: --Send notifications to all task owners
109: BEGIN
110: IF (l_debug = 'Y') THEN
111: OKC_DEBUG.set_indentation(l_api_name);
112: OKC_DEBUG.log('10: Entered task_alert', 2);
113: END IF;
114:
115: l_return_status := OKC_API.START_ACTIVITY(l_api_name,
116: G_PKG_NAME,
136: p_token1_value => P_WF_NAME,
137: p_token2 => G_WF_P_NAME_TOKEN,
138: p_token2_value => P_WF_PROCESS);
139: IF (l_debug = 'Y') THEN
140: OKC_DEBUG.log('20: WorkFlow Name OR Process Name do not exist ....');
141: OKC_DEBUG.log('30: WorkFlow Name ' || p_wf_name || ' OR Process Name '|| p_wf_process);
142: END IF;
143: RAISE OKC_API.G_EXCEPTION_ERROR;
144: END IF;
137: p_token2 => G_WF_P_NAME_TOKEN,
138: p_token2_value => P_WF_PROCESS);
139: IF (l_debug = 'Y') THEN
140: OKC_DEBUG.log('20: WorkFlow Name OR Process Name do not exist ....');
141: OKC_DEBUG.log('30: WorkFlow Name ' || p_wf_name || ' OR Process Name '|| p_wf_process);
142: END IF;
143: RAISE OKC_API.G_EXCEPTION_ERROR;
144: END IF;
145: --Check if the cursor is already open
148: END IF;
149: FOR alert_rec in alert_cur LOOP
150: BEGIN
151: IF (l_debug = 'Y') THEN
152: OKC_DEBUG.log('40: In the alert_rec LOOP ....');
153: END IF;
154: savepoint task_alert_PVT;
155: l_object_version_number := alert_rec.object_version_number;
156: l_task_id := alert_rec.task_id;
162: l_notification_period := alert_rec.notification_period;
163: l_tve_id := alert_rec.tve_id;
164:
165: IF (l_debug = 'Y') THEN
166: OKC_DEBUG.log('50: l_object_version_number is ... '|| alert_rec.object_version_number);
167: OKC_DEBUG.log('60: l_task_id ... '|| alert_rec.task_id);
168: OKC_DEBUG.log('70: l_task_number ... '|| alert_rec.task_number);
169: OKC_DEBUG.log('80: l_task_name ... '|| alert_rec.task_name);
170: OKC_DEBUG.log('90: l_source_object_id ... '|| alert_rec.source_object_id);
163: l_tve_id := alert_rec.tve_id;
164:
165: IF (l_debug = 'Y') THEN
166: OKC_DEBUG.log('50: l_object_version_number is ... '|| alert_rec.object_version_number);
167: OKC_DEBUG.log('60: l_task_id ... '|| alert_rec.task_id);
168: OKC_DEBUG.log('70: l_task_number ... '|| alert_rec.task_number);
169: OKC_DEBUG.log('80: l_task_name ... '|| alert_rec.task_name);
170: OKC_DEBUG.log('90: l_source_object_id ... '|| alert_rec.source_object_id);
171: OKC_DEBUG.log('100: l_owner_id ... '|| alert_rec.owner_id);
164:
165: IF (l_debug = 'Y') THEN
166: OKC_DEBUG.log('50: l_object_version_number is ... '|| alert_rec.object_version_number);
167: OKC_DEBUG.log('60: l_task_id ... '|| alert_rec.task_id);
168: OKC_DEBUG.log('70: l_task_number ... '|| alert_rec.task_number);
169: OKC_DEBUG.log('80: l_task_name ... '|| alert_rec.task_name);
170: OKC_DEBUG.log('90: l_source_object_id ... '|| alert_rec.source_object_id);
171: OKC_DEBUG.log('100: l_owner_id ... '|| alert_rec.owner_id);
172: OKC_DEBUG.log('110: l_planned_end_date ... '|| alert_rec.planned_end_date);
165: IF (l_debug = 'Y') THEN
166: OKC_DEBUG.log('50: l_object_version_number is ... '|| alert_rec.object_version_number);
167: OKC_DEBUG.log('60: l_task_id ... '|| alert_rec.task_id);
168: OKC_DEBUG.log('70: l_task_number ... '|| alert_rec.task_number);
169: OKC_DEBUG.log('80: l_task_name ... '|| alert_rec.task_name);
170: OKC_DEBUG.log('90: l_source_object_id ... '|| alert_rec.source_object_id);
171: OKC_DEBUG.log('100: l_owner_id ... '|| alert_rec.owner_id);
172: OKC_DEBUG.log('110: l_planned_end_date ... '|| alert_rec.planned_end_date);
173: OKC_DEBUG.log('120: l_notification_period ... '|| alert_rec.notification_period);
166: OKC_DEBUG.log('50: l_object_version_number is ... '|| alert_rec.object_version_number);
167: OKC_DEBUG.log('60: l_task_id ... '|| alert_rec.task_id);
168: OKC_DEBUG.log('70: l_task_number ... '|| alert_rec.task_number);
169: OKC_DEBUG.log('80: l_task_name ... '|| alert_rec.task_name);
170: OKC_DEBUG.log('90: l_source_object_id ... '|| alert_rec.source_object_id);
171: OKC_DEBUG.log('100: l_owner_id ... '|| alert_rec.owner_id);
172: OKC_DEBUG.log('110: l_planned_end_date ... '|| alert_rec.planned_end_date);
173: OKC_DEBUG.log('120: l_notification_period ... '|| alert_rec.notification_period);
174: END IF;
167: OKC_DEBUG.log('60: l_task_id ... '|| alert_rec.task_id);
168: OKC_DEBUG.log('70: l_task_number ... '|| alert_rec.task_number);
169: OKC_DEBUG.log('80: l_task_name ... '|| alert_rec.task_name);
170: OKC_DEBUG.log('90: l_source_object_id ... '|| alert_rec.source_object_id);
171: OKC_DEBUG.log('100: l_owner_id ... '|| alert_rec.owner_id);
172: OKC_DEBUG.log('110: l_planned_end_date ... '|| alert_rec.planned_end_date);
173: OKC_DEBUG.log('120: l_notification_period ... '|| alert_rec.notification_period);
174: END IF;
175:
168: OKC_DEBUG.log('70: l_task_number ... '|| alert_rec.task_number);
169: OKC_DEBUG.log('80: l_task_name ... '|| alert_rec.task_name);
170: OKC_DEBUG.log('90: l_source_object_id ... '|| alert_rec.source_object_id);
171: OKC_DEBUG.log('100: l_owner_id ... '|| alert_rec.owner_id);
172: OKC_DEBUG.log('110: l_planned_end_date ... '|| alert_rec.planned_end_date);
173: OKC_DEBUG.log('120: l_notification_period ... '|| alert_rec.notification_period);
174: END IF;
175:
176: --If the planned date - current date is less than or equal to the notification period
169: OKC_DEBUG.log('80: l_task_name ... '|| alert_rec.task_name);
170: OKC_DEBUG.log('90: l_source_object_id ... '|| alert_rec.source_object_id);
171: OKC_DEBUG.log('100: l_owner_id ... '|| alert_rec.owner_id);
172: OKC_DEBUG.log('110: l_planned_end_date ... '|| alert_rec.planned_end_date);
173: OKC_DEBUG.log('120: l_notification_period ... '|| alert_rec.notification_period);
174: END IF;
175:
176: --If the planned date - current date is less than or equal to the notification period
177: --send out notifications to all the task owners
187: CLOSE escal_owner_id;
188: END IF;
189:
190: IF (l_debug = 'Y') THEN
191: OKC_DEBUG.log('130: l_escalation_owner1_id ... '|| l_escalation_owner1_id);
192: OKC_DEBUG.log('140: l_escalation_owner2_id ... '|| l_escalation_owner2_id);
193: OKC_DEBUG.log('150: l_contract_id ... '|| l_contract_id);
194: END IF;
195:
188: END IF;
189:
190: IF (l_debug = 'Y') THEN
191: OKC_DEBUG.log('130: l_escalation_owner1_id ... '|| l_escalation_owner1_id);
192: OKC_DEBUG.log('140: l_escalation_owner2_id ... '|| l_escalation_owner2_id);
193: OKC_DEBUG.log('150: l_contract_id ... '|| l_contract_id);
194: END IF;
195:
196: --Select the owner of the Task
189:
190: IF (l_debug = 'Y') THEN
191: OKC_DEBUG.log('130: l_escalation_owner1_id ... '|| l_escalation_owner1_id);
192: OKC_DEBUG.log('140: l_escalation_owner2_id ... '|| l_escalation_owner2_id);
193: OKC_DEBUG.log('150: l_contract_id ... '|| l_contract_id);
194: END IF;
195:
196: --Select the owner of the Task
197: IF NOT escal_owner_cur%ISOPEN THEN
201: CLOSE escal_owner_cur;
202: END IF;
203:
204: IF (l_debug = 'Y') THEN
205: OKC_DEBUG.log('151: l_owner_name ... '|| l_owner_name);
206: OKC_DEBUG.log('160: l_dummy ... '|| l_dummy);
207: END IF;
208:
209: --Select escalation owner1
202: END IF;
203:
204: IF (l_debug = 'Y') THEN
205: OKC_DEBUG.log('151: l_owner_name ... '|| l_owner_name);
206: OKC_DEBUG.log('160: l_dummy ... '|| l_dummy);
207: END IF;
208:
209: --Select escalation owner1
210: IF NOT escal_owner_cur%ISOPEN THEN
214: CLOSE escal_owner_cur;
215: END IF;
216:
217: IF (l_debug = 'Y') THEN
218: OKC_DEBUG.log('161: l_escalate_owner1 ... '|| l_escalate_owner1);
219: OKC_DEBUG.log('162: l_escalate_name ... '|| l_escalate_name);
220: END IF;
221:
222: --Select the item key
215: END IF;
216:
217: IF (l_debug = 'Y') THEN
218: OKC_DEBUG.log('161: l_escalate_owner1 ... '|| l_escalate_owner1);
219: OKC_DEBUG.log('162: l_escalate_name ... '|| l_escalate_name);
220: END IF;
221:
222: --Select the item key
223: select okc_wf_notify_s1.nextval
228: l_item_type := p_wf_name;
229: l_process := p_wf_process;
230:
231: IF (l_debug = 'Y') THEN
232: OKC_DEBUG.log('170: l_item_key ... '|| l_item_key);
233: OKC_DEBUG.log('180: l_item_type ... '|| l_item_type);
234: OKC_DEBUG.log('190: l_process ... '|| l_process);
235: END IF;
236:
229: l_process := p_wf_process;
230:
231: IF (l_debug = 'Y') THEN
232: OKC_DEBUG.log('170: l_item_key ... '|| l_item_key);
233: OKC_DEBUG.log('180: l_item_type ... '|| l_item_type);
234: OKC_DEBUG.log('190: l_process ... '|| l_process);
235: END IF;
236:
237: --Launch The workflow to send notifications
230:
231: IF (l_debug = 'Y') THEN
232: OKC_DEBUG.log('170: l_item_key ... '|| l_item_key);
233: OKC_DEBUG.log('180: l_item_type ... '|| l_item_type);
234: OKC_DEBUG.log('190: l_process ... '|| l_process);
235: END IF;
236:
237: --Launch The workflow to send notifications
238: WF_ENGINE.CREATEPROCESS(L_ITEM_TYPE, L_ITEM_KEY, L_PROCESS);
237: --Launch The workflow to send notifications
238: WF_ENGINE.CREATEPROCESS(L_ITEM_TYPE, L_ITEM_KEY, L_PROCESS);
239:
240: IF (l_debug = 'Y') THEN
241: OKC_DEBUG.log('200: Launching the Workflow to send notification .....');
242: END IF;
243:
244: --set item attributes;
245: WF_ENGINE.Setitemattrtext(itemtype => l_item_type,
247: aname => 'TASK_NAME',
248: avalue => l_task_name);
249:
250: IF (l_debug = 'Y') THEN
251: OKC_DEBUG.log('210: Setting Item Attribute TASK_NAME with '|| l_task_name);
252: END IF;
253:
254: WF_ENGINE.Setitemattrtext(itemtype => l_item_type,
255: itemkey => l_item_key,
256: aname => 'TASK_OWNER',
257: avalue => l_owner_name);
258:
259: IF (l_debug = 'Y') THEN
260: OKC_DEBUG.log('220: Setting Item Attribute TASK_OWNER with '|| l_owner_name);
261: END IF;
262:
263: WF_ENGINE.Setitemattrdate(itemtype => l_item_type,
264: itemkey => l_item_key,
265: aname => 'DUE_DATE',
266: avalue => l_planned_end_date);
267:
268: IF (l_debug = 'Y') THEN
269: OKC_DEBUG.log('230: Setting Item Attribute DUE_DATE with '|| l_planned_end_date);
270: END IF;
271:
272: WF_ENGINE.Setitemattrtext(itemtype => l_item_type,
273: itemkey => l_item_key,
274: aname => 'ESCALATE_OWNER',
275: avalue => l_escalate_name);
276:
277: IF (l_debug = 'Y') THEN
278: OKC_DEBUG.log('240: Setting Item Attribute ESCALATE_OWNER with '|| l_escalate_name);
279: END IF;
280:
281: WF_ENGINE.Setitemattrtext(itemtype => l_item_type,
282: itemkey => l_item_key,
283: aname => 'DISPLAY_TASK_OWNER',
284: avalue => l_dummy);
285:
286: IF (l_debug = 'Y') THEN
287: OKC_DEBUG.log('250: Setting Item Attribute DISPLAY_TASK_OWNER with '|| l_dummy);
288: END IF;
289:
290: WF_ENGINE.Setitemattrnumber(itemtype => l_item_type,
291: itemkey => l_item_key,
292: aname => 'TASK_ID',
293: avalue => l_task_id);
294:
295: IF (l_debug = 'Y') THEN
296: OKC_DEBUG.log('260: Setting Item Attribute TASK_ID with '|| l_task_id);
297: END IF;
298:
299: WF_ENGINE.Setitemattrnumber(itemtype => l_item_type,
300: itemkey => l_item_key,
301: aname => 'CONTRACT_ID',
302: avalue => l_contract_id);
303:
304: IF (l_debug = 'Y') THEN
305: OKC_DEBUG.log('270: Setting Item Attribute CONTRACT_ID with '|| l_contract_id);
306: END IF;
307:
308: --Start the workflow process
309: WF_ENGINE.STARTPROCESS(l_item_type, l_item_key);
308: --Start the workflow process
309: WF_ENGINE.STARTPROCESS(l_item_type, l_item_key);
310:
311: IF (l_debug = 'Y') THEN
312: OKC_DEBUG.log('280: started workflow process .....');
313: END IF;
314:
315: -- commit;
316:
328: RAISE OKC_API.G_EXCEPTION_ERROR;
329: END IF;
330:
331: IF (l_debug = 'Y') THEN
332: OKC_DEBUG.log('290: before OKC_TASK_PUB.update_task .....');
333: END IF;
334:
335: --Update workflow_process_id in the tasks table
336: OKC_TASK_PUB.update_task(p_api_version => g_api_version,
343: x_msg_count => g_msg_count,
344: x_msg_data => g_msg_data);
345:
346: IF (l_debug = 'Y') THEN
347: OKC_DEBUG.log('300: after OKC_TASK_PUB.update_task return_status is '|| g_return_status );
348: END IF;
349:
350: IF (g_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
351: l_failure_count := l_failure_count + 1;
362: END IF;
363: EXCEPTION
364: WHEN OKC_API.G_EXCEPTION_ERROR THEN
365: IF (l_debug = 'Y') THEN
366: OKC_DEBUG.log(' 400:Exception Error in task_alert...', 2);
367: OKC_DEBUG.Reset_Indentation;
368: END IF;
369: FND_FILE.PUT_LINE( FND_FILE.LOG,'Task:'||l_task_number);
370: get_fnd_msg_stack(' Exception Error in task_alert is '||g_msg_data);
363: EXCEPTION
364: WHEN OKC_API.G_EXCEPTION_ERROR THEN
365: IF (l_debug = 'Y') THEN
366: OKC_DEBUG.log(' 400:Exception Error in task_alert...', 2);
367: OKC_DEBUG.Reset_Indentation;
368: END IF;
369: FND_FILE.PUT_LINE( FND_FILE.LOG,'Task:'||l_task_number);
370: get_fnd_msg_stack(' Exception Error in task_alert is '||g_msg_data);
371:
370: get_fnd_msg_stack(' Exception Error in task_alert is '||g_msg_data);
371:
372: WHEN OKC_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
373: IF (l_debug = 'Y') THEN
374: OKC_DEBUG.log(' 400:Unexcepted Error in task_alert...', 2);
375: OKC_DEBUG.Reset_Indentation;
376: END IF;
377: FND_FILE.PUT_LINE( FND_FILE.LOG,'Task:'||l_task_number);
378: get_fnd_msg_stack(' Unexpected error in task_alert is '||g_msg_data);
371:
372: WHEN OKC_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
373: IF (l_debug = 'Y') THEN
374: OKC_DEBUG.log(' 400:Unexcepted Error in task_alert...', 2);
375: OKC_DEBUG.Reset_Indentation;
376: END IF;
377: FND_FILE.PUT_LINE( FND_FILE.LOG,'Task:'||l_task_number);
378: get_fnd_msg_stack(' Unexpected error in task_alert is '||g_msg_data);
379:
378: get_fnd_msg_stack(' Unexpected error in task_alert is '||g_msg_data);
379:
380: WHEN OTHERS THEN
381: IF (l_debug = 'Y') THEN
382: OKC_DEBUG.log(' 400:Other Exception Error in task_alert...', 2);
383: OKC_DEBUG.Reset_Indentation;
384: END IF;
385: FND_FILE.PUT_LINE( FND_FILE.LOG,'Task:'||l_task_number);
386: retcode := 2;
379:
380: WHEN OTHERS THEN
381: IF (l_debug = 'Y') THEN
382: OKC_DEBUG.log(' 400:Other Exception Error in task_alert...', 2);
383: OKC_DEBUG.Reset_Indentation;
384: END IF;
385: FND_FILE.PUT_LINE( FND_FILE.LOG,'Task:'||l_task_number);
386: retcode := 2;
387: FND_FILE.PUT_LINE( FND_FILE.LOG,substr(sqlerrm,1,250));
391: END LOOP;
392: OKC_API.END_ACTIVITY(g_msg_count, g_msg_data);
393:
394: IF (l_debug = 'Y') THEN
395: OKC_DEBUG.log('400: Exiting task_alert...', 2);
396: OKC_DEBUG.Reset_Indentation;
397: END IF;
398: FND_FILE.PUT_LINE( FND_FILE.LOG,'Success Count:'||l_success_count);
399: FND_FILE.PUT_LINE( FND_FILE.LOG,'Failure Count:'||l_failure_count);
392: OKC_API.END_ACTIVITY(g_msg_count, g_msg_data);
393:
394: IF (l_debug = 'Y') THEN
395: OKC_DEBUG.log('400: Exiting task_alert...', 2);
396: OKC_DEBUG.Reset_Indentation;
397: END IF;
398: FND_FILE.PUT_LINE( FND_FILE.LOG,'Success Count:'||l_success_count);
399: FND_FILE.PUT_LINE( FND_FILE.LOG,'Failure Count:'||l_failure_count);
400:
400:
401: EXCEPTION
402: WHEN OKC_API.G_EXCEPTION_ERROR THEN
403: IF (l_debug = 'Y') THEN
404: OKC_DEBUG.log(' 400:Exception Error in task_alert...', 2);
405: OKC_DEBUG.Reset_Indentation;
406: END IF;
407: FND_FILE.PUT_LINE( FND_FILE.LOG,'Task:'||l_task_number);
408:
401: EXCEPTION
402: WHEN OKC_API.G_EXCEPTION_ERROR THEN
403: IF (l_debug = 'Y') THEN
404: OKC_DEBUG.log(' 400:Exception Error in task_alert...', 2);
405: OKC_DEBUG.Reset_Indentation;
406: END IF;
407: FND_FILE.PUT_LINE( FND_FILE.LOG,'Task:'||l_task_number);
408:
409: retcode := 2;
419: get_fnd_msg_stack(' Exception Error in task_alert is '||g_msg_data);
420:
421: WHEN OKC_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
422: IF (l_debug = 'Y') THEN
423: OKC_DEBUG.log(' 400:Unexcepted Error in task_alert...', 2);
424: OKC_DEBUG.Reset_Indentation;
425: END IF;
426: FND_FILE.PUT_LINE( FND_FILE.LOG,'Task:'||l_task_number);
427:
420:
421: WHEN OKC_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
422: IF (l_debug = 'Y') THEN
423: OKC_DEBUG.log(' 400:Unexcepted Error in task_alert...', 2);
424: OKC_DEBUG.Reset_Indentation;
425: END IF;
426: FND_FILE.PUT_LINE( FND_FILE.LOG,'Task:'||l_task_number);
427:
428: retcode := 2;
438: get_fnd_msg_stack(' Unexpected error in task_alert is '||g_msg_data);
439:
440: WHEN OTHERS THEN
441: IF (l_debug = 'Y') THEN
442: OKC_DEBUG.log(' 400:Other Exception Error in task_alert...', 2);
443: OKC_DEBUG.Reset_Indentation;
444: END IF;
445: FND_FILE.PUT_LINE( FND_FILE.LOG,'Task:'||l_task_number);
446:
439:
440: WHEN OTHERS THEN
441: IF (l_debug = 'Y') THEN
442: OKC_DEBUG.log(' 400:Other Exception Error in task_alert...', 2);
443: OKC_DEBUG.Reset_Indentation;
444: END IF;
445: FND_FILE.PUT_LINE( FND_FILE.LOG,'Task:'||l_task_number);
446:
447: retcode := 2;
533: l_failure_count NUMBER := 0;
534:
535: BEGIN
536: IF (l_debug = 'Y') THEN
537: OKC_DEBUG.set_indentation(l_api_name);
538: OKC_DEBUG.log('510: Entered task_escalation1', 2);
539: END IF;
540:
541: l_return_status := OKC_API.START_ACTIVITY(l_api_name,
534:
535: BEGIN
536: IF (l_debug = 'Y') THEN
537: OKC_DEBUG.set_indentation(l_api_name);
538: OKC_DEBUG.log('510: Entered task_escalation1', 2);
539: END IF;
540:
541: l_return_status := OKC_API.START_ACTIVITY(l_api_name,
542: G_PKG_NAME,
563: p_token2 => G_WF_P_NAME_TOKEN,
564: p_token2_value => P_WF_PROCESS);
565:
566: IF (l_debug = 'Y') THEN
567: OKC_DEBUG.log('520: WorkFlow Name OR Process Name do not exist ....');
568: OKC_DEBUG.log('530: WorkFlow Name ' || p_wf_name || ' OR Process Name '|| p_wf_process);
569: END IF;
570:
571: RAISE OKC_API.G_EXCEPTION_ERROR;
564: p_token2_value => P_WF_PROCESS);
565:
566: IF (l_debug = 'Y') THEN
567: OKC_DEBUG.log('520: WorkFlow Name OR Process Name do not exist ....');
568: OKC_DEBUG.log('530: WorkFlow Name ' || p_wf_name || ' OR Process Name '|| p_wf_process);
569: END IF;
570:
571: RAISE OKC_API.G_EXCEPTION_ERROR;
572: END IF;
578: FOR escalate_owner1_rec in escalate_owner1_cur LOOP
579: BEGIN
580:
581: IF (l_debug = 'Y') THEN
582: OKC_DEBUG.log('540: In the escalate_owner1_rec LOOP ....');
583: END IF;
584: savepoint task_alert_pvt;
585:
586: l_object_version_number := escalate_owner1_rec.object_version_number;
594: l_alarm_interval := escalate_owner1_rec.alarm_interval;
595: l_tve_id := escalate_owner1_rec.tve_id;
596:
597: IF (l_debug = 'Y') THEN
598: OKC_DEBUG.log('550: l_object_version_number is ... '|| escalate_owner1_rec.object_version_number);
599: OKC_DEBUG.log('560: l_task_id ... '|| escalate_owner1_rec.task_id);
600: OKC_DEBUG.log('570: l_task_number ... '|| escalate_owner1_rec.task_number);
601: OKC_DEBUG.log('580: l_task_name ... '|| escalate_owner1_rec.task_name);
602: OKC_DEBUG.log('590: l_source_object_id ... '|| escalate_owner1_rec.source_object_id);
595: l_tve_id := escalate_owner1_rec.tve_id;
596:
597: IF (l_debug = 'Y') THEN
598: OKC_DEBUG.log('550: l_object_version_number is ... '|| escalate_owner1_rec.object_version_number);
599: OKC_DEBUG.log('560: l_task_id ... '|| escalate_owner1_rec.task_id);
600: OKC_DEBUG.log('570: l_task_number ... '|| escalate_owner1_rec.task_number);
601: OKC_DEBUG.log('580: l_task_name ... '|| escalate_owner1_rec.task_name);
602: OKC_DEBUG.log('590: l_source_object_id ... '|| escalate_owner1_rec.source_object_id);
603: OKC_DEBUG.log('600: l_owner_id ... '|| escalate_owner1_rec.owner_id);
596:
597: IF (l_debug = 'Y') THEN
598: OKC_DEBUG.log('550: l_object_version_number is ... '|| escalate_owner1_rec.object_version_number);
599: OKC_DEBUG.log('560: l_task_id ... '|| escalate_owner1_rec.task_id);
600: OKC_DEBUG.log('570: l_task_number ... '|| escalate_owner1_rec.task_number);
601: OKC_DEBUG.log('580: l_task_name ... '|| escalate_owner1_rec.task_name);
602: OKC_DEBUG.log('590: l_source_object_id ... '|| escalate_owner1_rec.source_object_id);
603: OKC_DEBUG.log('600: l_owner_id ... '|| escalate_owner1_rec.owner_id);
604: OKC_DEBUG.log('610: l_planned_end_date ... '|| escalate_owner1_rec.planned_end_date);
597: IF (l_debug = 'Y') THEN
598: OKC_DEBUG.log('550: l_object_version_number is ... '|| escalate_owner1_rec.object_version_number);
599: OKC_DEBUG.log('560: l_task_id ... '|| escalate_owner1_rec.task_id);
600: OKC_DEBUG.log('570: l_task_number ... '|| escalate_owner1_rec.task_number);
601: OKC_DEBUG.log('580: l_task_name ... '|| escalate_owner1_rec.task_name);
602: OKC_DEBUG.log('590: l_source_object_id ... '|| escalate_owner1_rec.source_object_id);
603: OKC_DEBUG.log('600: l_owner_id ... '|| escalate_owner1_rec.owner_id);
604: OKC_DEBUG.log('610: l_planned_end_date ... '|| escalate_owner1_rec.planned_end_date);
605: OKC_DEBUG.log('615: l_actual_end_date ... '|| escalate_owner1_rec.actual_end_date);
598: OKC_DEBUG.log('550: l_object_version_number is ... '|| escalate_owner1_rec.object_version_number);
599: OKC_DEBUG.log('560: l_task_id ... '|| escalate_owner1_rec.task_id);
600: OKC_DEBUG.log('570: l_task_number ... '|| escalate_owner1_rec.task_number);
601: OKC_DEBUG.log('580: l_task_name ... '|| escalate_owner1_rec.task_name);
602: OKC_DEBUG.log('590: l_source_object_id ... '|| escalate_owner1_rec.source_object_id);
603: OKC_DEBUG.log('600: l_owner_id ... '|| escalate_owner1_rec.owner_id);
604: OKC_DEBUG.log('610: l_planned_end_date ... '|| escalate_owner1_rec.planned_end_date);
605: OKC_DEBUG.log('615: l_actual_end_date ... '|| escalate_owner1_rec.actual_end_date);
606: OKC_DEBUG.log('620: l_alarm_interval ... '|| escalate_owner1_rec.alarm_interval);
599: OKC_DEBUG.log('560: l_task_id ... '|| escalate_owner1_rec.task_id);
600: OKC_DEBUG.log('570: l_task_number ... '|| escalate_owner1_rec.task_number);
601: OKC_DEBUG.log('580: l_task_name ... '|| escalate_owner1_rec.task_name);
602: OKC_DEBUG.log('590: l_source_object_id ... '|| escalate_owner1_rec.source_object_id);
603: OKC_DEBUG.log('600: l_owner_id ... '|| escalate_owner1_rec.owner_id);
604: OKC_DEBUG.log('610: l_planned_end_date ... '|| escalate_owner1_rec.planned_end_date);
605: OKC_DEBUG.log('615: l_actual_end_date ... '|| escalate_owner1_rec.actual_end_date);
606: OKC_DEBUG.log('620: l_alarm_interval ... '|| escalate_owner1_rec.alarm_interval);
607: END IF;
600: OKC_DEBUG.log('570: l_task_number ... '|| escalate_owner1_rec.task_number);
601: OKC_DEBUG.log('580: l_task_name ... '|| escalate_owner1_rec.task_name);
602: OKC_DEBUG.log('590: l_source_object_id ... '|| escalate_owner1_rec.source_object_id);
603: OKC_DEBUG.log('600: l_owner_id ... '|| escalate_owner1_rec.owner_id);
604: OKC_DEBUG.log('610: l_planned_end_date ... '|| escalate_owner1_rec.planned_end_date);
605: OKC_DEBUG.log('615: l_actual_end_date ... '|| escalate_owner1_rec.actual_end_date);
606: OKC_DEBUG.log('620: l_alarm_interval ... '|| escalate_owner1_rec.alarm_interval);
607: END IF;
608:
601: OKC_DEBUG.log('580: l_task_name ... '|| escalate_owner1_rec.task_name);
602: OKC_DEBUG.log('590: l_source_object_id ... '|| escalate_owner1_rec.source_object_id);
603: OKC_DEBUG.log('600: l_owner_id ... '|| escalate_owner1_rec.owner_id);
604: OKC_DEBUG.log('610: l_planned_end_date ... '|| escalate_owner1_rec.planned_end_date);
605: OKC_DEBUG.log('615: l_actual_end_date ... '|| escalate_owner1_rec.actual_end_date);
606: OKC_DEBUG.log('620: l_alarm_interval ... '|| escalate_owner1_rec.alarm_interval);
607: END IF;
608:
609: -- If the current date is greater than planned end date + alarm interval
602: OKC_DEBUG.log('590: l_source_object_id ... '|| escalate_owner1_rec.source_object_id);
603: OKC_DEBUG.log('600: l_owner_id ... '|| escalate_owner1_rec.owner_id);
604: OKC_DEBUG.log('610: l_planned_end_date ... '|| escalate_owner1_rec.planned_end_date);
605: OKC_DEBUG.log('615: l_actual_end_date ... '|| escalate_owner1_rec.actual_end_date);
606: OKC_DEBUG.log('620: l_alarm_interval ... '|| escalate_owner1_rec.alarm_interval);
607: END IF;
608:
609: -- If the current date is greater than planned end date + alarm interval
610: -- and the task is incomplete then escalate the task to the manager
619: CLOSE escal_owner_id;
620: END IF;
621:
622: IF (l_debug = 'Y') THEN
623: OKC_DEBUG.log('630: l_escalation_owner1_id ... '|| l_escalation_owner1_id);
624: OKC_DEBUG.log('640: l_escalation_owner2_id ... '|| l_escalation_owner2_id);
625: OKC_DEBUG.log('650: l_contract_id ... '|| l_contract_id);
626: END IF;
627:
620: END IF;
621:
622: IF (l_debug = 'Y') THEN
623: OKC_DEBUG.log('630: l_escalation_owner1_id ... '|| l_escalation_owner1_id);
624: OKC_DEBUG.log('640: l_escalation_owner2_id ... '|| l_escalation_owner2_id);
625: OKC_DEBUG.log('650: l_contract_id ... '|| l_contract_id);
626: END IF;
627:
628: --Select the owner of the Task
621:
622: IF (l_debug = 'Y') THEN
623: OKC_DEBUG.log('630: l_escalation_owner1_id ... '|| l_escalation_owner1_id);
624: OKC_DEBUG.log('640: l_escalation_owner2_id ... '|| l_escalation_owner2_id);
625: OKC_DEBUG.log('650: l_contract_id ... '|| l_contract_id);
626: END IF;
627:
628: --Select the owner of the Task
629: IF NOT escal_owner_cur%ISOPEN THEN
633: CLOSE escal_owner_cur;
634: END IF;
635:
636: IF (l_debug = 'Y') THEN
637: OKC_DEBUG.log('651: l_owner_name ... '|| l_owner_name);
638: OKC_DEBUG.log('660: l_dummy ... '|| l_dummy);
639: END IF;
640:
641: --Get escalation owner1
634: END IF;
635:
636: IF (l_debug = 'Y') THEN
637: OKC_DEBUG.log('651: l_owner_name ... '|| l_owner_name);
638: OKC_DEBUG.log('660: l_dummy ... '|| l_dummy);
639: END IF;
640:
641: --Get escalation owner1
642: IF NOT escal_owner_cur%ISOPEN THEN
645: CLOSE escal_owner_cur;
646: END IF;
647:
648: IF (l_debug = 'Y') THEN
649: OKC_DEBUG.log('661: l_escalate_owner1 ... '|| l_escalate_owner1);
650: OKC_DEBUG.log('662: l_dummy ... '|| l_dummy);
651: END IF;
652:
653: --Get escalation owner2
646: END IF;
647:
648: IF (l_debug = 'Y') THEN
649: OKC_DEBUG.log('661: l_escalate_owner1 ... '|| l_escalate_owner1);
650: OKC_DEBUG.log('662: l_dummy ... '|| l_dummy);
651: END IF;
652:
653: --Get escalation owner2
654: IF NOT escal_owner_cur%ISOPEN THEN
657: CLOSE escal_owner_cur;
658: END IF;
659:
660: IF (l_debug = 'Y') THEN
661: OKC_DEBUG.log('663: l_escalate_owner2 ... '|| l_escalate_owner2);
662: OKC_DEBUG.log('664: l_escalate_name ... '|| l_escalate_name);
663: END IF;
664:
665: select okc_wf_notify_s1.nextval
658: END IF;
659:
660: IF (l_debug = 'Y') THEN
661: OKC_DEBUG.log('663: l_escalate_owner2 ... '|| l_escalate_owner2);
662: OKC_DEBUG.log('664: l_escalate_name ... '|| l_escalate_name);
663: END IF;
664:
665: select okc_wf_notify_s1.nextval
666: into l_item_key
670: l_item_type := p_wf_name;
671: l_process := p_wf_process;
672:
673: IF (l_debug = 'Y') THEN
674: OKC_DEBUG.log('670: l_item_key ... '|| l_item_key);
675: OKC_DEBUG.log('680: l_item_type ... '|| l_item_type);
676: OKC_DEBUG.log('690: l_process ... '|| l_process);
677: END IF;
678:
671: l_process := p_wf_process;
672:
673: IF (l_debug = 'Y') THEN
674: OKC_DEBUG.log('670: l_item_key ... '|| l_item_key);
675: OKC_DEBUG.log('680: l_item_type ... '|| l_item_type);
676: OKC_DEBUG.log('690: l_process ... '|| l_process);
677: END IF;
678:
679: --Launch the workflow to escalate the incomplete tasks to the manager
672:
673: IF (l_debug = 'Y') THEN
674: OKC_DEBUG.log('670: l_item_key ... '|| l_item_key);
675: OKC_DEBUG.log('680: l_item_type ... '|| l_item_type);
676: OKC_DEBUG.log('690: l_process ... '|| l_process);
677: END IF;
678:
679: --Launch the workflow to escalate the incomplete tasks to the manager
680: WF_ENGINE.CREATEPROCESS(L_ITEM_TYPE, L_ITEM_KEY, L_PROCESS);
679: --Launch the workflow to escalate the incomplete tasks to the manager
680: WF_ENGINE.CREATEPROCESS(L_ITEM_TYPE, L_ITEM_KEY, L_PROCESS);
681:
682: IF (l_debug = 'Y') THEN
683: OKC_DEBUG.log('700: Launching the Workflow to send notification .....');
684: END IF;
685:
686: --set item attributes;
687: WF_ENGINE.Setitemattrtext(itemtype => l_item_type,
689: aname => 'TASK_NAME',
690: avalue => l_task_name);
691:
692: IF (l_debug = 'Y') THEN
693: OKC_DEBUG.log('710: Setting Item Attribute TASK_NAME with '|| l_task_name);
694: END IF;
695:
696: WF_ENGINE.Setitemattrtext(itemtype => l_item_type,
697: itemkey => l_item_key,
698: aname => 'TASK_OWNER',
699: avalue => l_escalate_owner1);
700:
701: IF (l_debug = 'Y') THEN
702: OKC_DEBUG.log('720: Setting Item Attribute TASK_OWNER with '|| l_escalate_owner1);
703: END IF;
704:
705: WF_ENGINE.Setitemattrdate(itemtype => l_item_type,
706: itemkey => l_item_key,
707: aname => 'DUE_DATE',
708: avalue => l_planned_end_date);
709:
710: IF (l_debug = 'Y') THEN
711: OKC_DEBUG.log('730: Setting Item Attribute DUE_DATE with '|| l_planned_end_date);
712: END IF;
713:
714: WF_ENGINE.Setitemattrtext(itemtype => l_item_type,
715: itemkey => l_item_key,
716: aname => 'ESCALATE_OWNER',
717: avalue => l_escalate_name);
718:
719: IF (l_debug = 'Y') THEN
720: OKC_DEBUG.log('740: Setting Item Attribute ESCALATE_OWNER with '|| l_escalate_name);
721: END IF;
722:
723: WF_ENGINE.Setitemattrtext(itemtype => l_item_type,
724: itemkey => l_item_key,
725: aname => 'DISPLAY_TASK_OWNER',
726: avalue => l_owner_name);
727:
728: IF (l_debug = 'Y') THEN
729: OKC_DEBUG.log('750: Setting Item Attribute DISPLAY_TASK_OWNER with '|| l_owner_name);
730: END IF;
731:
732: WF_ENGINE.Setitemattrnumber(itemtype => l_item_type,
733: itemkey => l_item_key,
734: aname => 'TASK_ID',
735: avalue => l_task_id);
736:
737: IF (l_debug = 'Y') THEN
738: OKC_DEBUG.log('760: Setting Item Attribute TASK_ID with '|| l_task_id);
739: END IF;
740:
741: WF_ENGINE.Setitemattrnumber(itemtype => l_item_type,
742: itemkey => l_item_key,
743: aname => 'CONTRACT_ID',
744: avalue => l_contract_id);
745:
746: IF (l_debug = 'Y') THEN
747: OKC_DEBUG.log('770: Setting Item Attribute CONTRACT_ID with '|| l_contract_id);
748: END IF;
749: --Start the workflow
750: WF_ENGINE.STARTPROCESS(l_item_type, l_item_key);
751:
749: --Start the workflow
750: WF_ENGINE.STARTPROCESS(l_item_type, l_item_key);
751:
752: IF (l_debug = 'Y') THEN
753: OKC_DEBUG.log('780: started workflow process .....');
754: END IF;
755:
756: -- commit;
757:
768: RAISE OKC_API.G_EXCEPTION_ERROR;
769: END IF;
770:
771: IF (l_debug = 'Y') THEN
772: OKC_DEBUG.log('790: before OKC_TASK_PUB.update_task .....');
773: END IF;
774:
775: --Update workflow_process_id, alarm_fired_count in the tasks table
776: OKC_TASK_PUB.update_task(p_api_version => g_api_version,
784: x_msg_count => g_msg_count,
785: x_msg_data => g_msg_data);
786:
787: IF (l_debug = 'Y') THEN
788: OKC_DEBUG.log('800: after OKC_TASK_PUB.update_task return_status is '|| g_return_status);
789: END IF;
790:
791: IF (g_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
792: l_failure_count := l_failure_count + 1;
803: END IF;
804: EXCEPTION
805: WHEN OKC_API.G_EXCEPTION_ERROR THEN
806: IF (l_debug = 'Y') THEN
807: OKC_DEBUG.log(' 400:Exception Error in task_alert...', 2);
808: OKC_DEBUG.Reset_Indentation;
809: END IF;
810: FND_FILE.PUT_LINE( FND_FILE.LOG,'Task:'||l_task_number);
811: get_fnd_msg_stack(' Exception Error in task_alert is '||g_msg_data);
804: EXCEPTION
805: WHEN OKC_API.G_EXCEPTION_ERROR THEN
806: IF (l_debug = 'Y') THEN
807: OKC_DEBUG.log(' 400:Exception Error in task_alert...', 2);
808: OKC_DEBUG.Reset_Indentation;
809: END IF;
810: FND_FILE.PUT_LINE( FND_FILE.LOG,'Task:'||l_task_number);
811: get_fnd_msg_stack(' Exception Error in task_alert is '||g_msg_data);
812:
811: get_fnd_msg_stack(' Exception Error in task_alert is '||g_msg_data);
812:
813: WHEN OKC_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
814: IF (l_debug = 'Y') THEN
815: OKC_DEBUG.log(' 400:Unexcepted Error in task_alert...', 2);
816: OKC_DEBUG.Reset_Indentation;
817: END IF;
818: FND_FILE.PUT_LINE( FND_FILE.LOG,'Task:'||l_task_number);
819: get_fnd_msg_stack(' Unexpected error in task_alert is '||g_msg_data);
812:
813: WHEN OKC_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
814: IF (l_debug = 'Y') THEN
815: OKC_DEBUG.log(' 400:Unexcepted Error in task_alert...', 2);
816: OKC_DEBUG.Reset_Indentation;
817: END IF;
818: FND_FILE.PUT_LINE( FND_FILE.LOG,'Task:'||l_task_number);
819: get_fnd_msg_stack(' Unexpected error in task_alert is '||g_msg_data);
820:
819: get_fnd_msg_stack(' Unexpected error in task_alert is '||g_msg_data);
820:
821: WHEN OTHERS THEN
822: IF (l_debug = 'Y') THEN
823: OKC_DEBUG.log(' 400:Other Exception Error in task_alert...', 2);
824: OKC_DEBUG.Reset_Indentation;
825: END IF;
826: FND_FILE.PUT_LINE( FND_FILE.LOG,'Task:'||l_task_number);
827:
820:
821: WHEN OTHERS THEN
822: IF (l_debug = 'Y') THEN
823: OKC_DEBUG.log(' 400:Other Exception Error in task_alert...', 2);
824: OKC_DEBUG.Reset_Indentation;
825: END IF;
826: FND_FILE.PUT_LINE( FND_FILE.LOG,'Task:'||l_task_number);
827:
828: retcode := 2;
834: END LOOP;
835: OKC_API.END_ACTIVITY(g_msg_count, g_msg_data);
836:
837: IF (l_debug = 'Y') THEN
838: OKC_DEBUG.log('900: Exiting task_task_escalation1...', 2);
839: OKC_DEBUG.Reset_Indentation;
840: END IF;
841: FND_FILE.PUT_LINE( FND_FILE.LOG,'Success Count:'||l_success_count);
842: FND_FILE.PUT_LINE( FND_FILE.LOG,'Failure Count:'||l_failure_count);
835: OKC_API.END_ACTIVITY(g_msg_count, g_msg_data);
836:
837: IF (l_debug = 'Y') THEN
838: OKC_DEBUG.log('900: Exiting task_task_escalation1...', 2);
839: OKC_DEBUG.Reset_Indentation;
840: END IF;
841: FND_FILE.PUT_LINE( FND_FILE.LOG,'Success Count:'||l_success_count);
842: FND_FILE.PUT_LINE( FND_FILE.LOG,'Failure Count:'||l_failure_count);
843:
843:
844: EXCEPTION
845: WHEN OKC_API.G_EXCEPTION_ERROR THEN
846: IF (l_debug = 'Y') THEN
847: OKC_DEBUG.log(' 900:Exception Error in task_escalation1...', 2);
848: OKC_DEBUG.Reset_Indentation;
849: END IF;
850: FND_FILE.PUT_LINE( FND_FILE.LOG,'Task:'||l_task_number);
851:
844: EXCEPTION
845: WHEN OKC_API.G_EXCEPTION_ERROR THEN
846: IF (l_debug = 'Y') THEN
847: OKC_DEBUG.log(' 900:Exception Error in task_escalation1...', 2);
848: OKC_DEBUG.Reset_Indentation;
849: END IF;
850: FND_FILE.PUT_LINE( FND_FILE.LOG,'Task:'||l_task_number);
851:
852: retcode := 2;
862: get_fnd_msg_stack(' Exception Error in task_escalation1 is '||g_msg_data);
863:
864: WHEN OKC_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
865: IF (l_debug = 'Y') THEN
866: OKC_DEBUG.log(' 900:Unexcepted Error in task_escalation1...', 2);
867: OKC_DEBUG.Reset_Indentation;
868: END IF;
869: FND_FILE.PUT_LINE( FND_FILE.LOG,'Task:'||l_task_number);
870:
863:
864: WHEN OKC_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
865: IF (l_debug = 'Y') THEN
866: OKC_DEBUG.log(' 900:Unexcepted Error in task_escalation1...', 2);
867: OKC_DEBUG.Reset_Indentation;
868: END IF;
869: FND_FILE.PUT_LINE( FND_FILE.LOG,'Task:'||l_task_number);
870:
871: retcode := 2;
881: get_fnd_msg_stack(' Unexpected error in task_escaltion1 is '||g_msg_data);
882:
883: WHEN OTHERS THEN
884: IF (l_debug = 'Y') THEN
885: OKC_DEBUG.log(' 900:Other Exception Error in task_escalation1...', 2);
886: OKC_DEBUG.Reset_Indentation;
887: END IF;
888: FND_FILE.PUT_LINE( FND_FILE.LOG,'Task:'||l_task_number);
889:
882:
883: WHEN OTHERS THEN
884: IF (l_debug = 'Y') THEN
885: OKC_DEBUG.log(' 900:Other Exception Error in task_escalation1...', 2);
886: OKC_DEBUG.Reset_Indentation;
887: END IF;
888: FND_FILE.PUT_LINE( FND_FILE.LOG,'Task:'||l_task_number);
889:
890: retcode := 2;
976: l_failure_count NUMBER := 0;
977:
978: BEGIN
979: IF (l_debug = 'Y') THEN
980: OKC_DEBUG.set_indentation(l_api_name);
981: OKC_DEBUG.log('1010: Entered task_escalation2', 2);
982: END IF;
983:
984: l_return_status := OKC_API.START_ACTIVITY(l_api_name,
977:
978: BEGIN
979: IF (l_debug = 'Y') THEN
980: OKC_DEBUG.set_indentation(l_api_name);
981: OKC_DEBUG.log('1010: Entered task_escalation2', 2);
982: END IF;
983:
984: l_return_status := OKC_API.START_ACTIVITY(l_api_name,
985: G_PKG_NAME,
1006: p_token2 => G_WF_P_NAME_TOKEN,
1007: p_token2_value => P_WF_PROCESS);
1008:
1009: IF (l_debug = 'Y') THEN
1010: OKC_DEBUG.log('1020: WorkFlow Name OR Process Name do not exist ....');
1011: OKC_DEBUG.log('1030: WorkFlow Name ' || p_wf_name || ' OR Process Name '|| p_wf_process);
1012: END IF;
1013:
1014: RAISE OKC_API.G_EXCEPTION_ERROR;
1007: p_token2_value => P_WF_PROCESS);
1008:
1009: IF (l_debug = 'Y') THEN
1010: OKC_DEBUG.log('1020: WorkFlow Name OR Process Name do not exist ....');
1011: OKC_DEBUG.log('1030: WorkFlow Name ' || p_wf_name || ' OR Process Name '|| p_wf_process);
1012: END IF;
1013:
1014: RAISE OKC_API.G_EXCEPTION_ERROR;
1015: END IF;
1021: FOR escalate_owner2_rec in escalate_owner2_cur LOOP
1022: BEGIN
1023:
1024: IF (l_debug = 'Y') THEN
1025: OKC_DEBUG.log('1040: In the escalate_owner2_rec LOOP ....');
1026: END IF;
1027: savepoint task_alert_pvt;
1028:
1029: l_object_version_number := escalate_owner2_rec.object_version_number;
1037: l_alarm_interval := escalate_owner2_rec.alarm_interval;
1038: l_tve_id := escalate_owner2_rec.tve_id;
1039:
1040: IF (l_debug = 'Y') THEN
1041: OKC_DEBUG.log('1050: l_object_version_number is ... '|| escalate_owner2_rec.object_version_number);
1042: OKC_DEBUG.log('1060: l_task_id ... '|| escalate_owner2_rec.task_id);
1043: OKC_DEBUG.log('1070: l_task_number ... '|| escalate_owner2_rec.task_number);
1044: OKC_DEBUG.log('1080: l_task_name ... '|| escalate_owner2_rec.task_name);
1045: OKC_DEBUG.log('1090: l_source_object_id ... '|| escalate_owner2_rec.source_object_id);
1038: l_tve_id := escalate_owner2_rec.tve_id;
1039:
1040: IF (l_debug = 'Y') THEN
1041: OKC_DEBUG.log('1050: l_object_version_number is ... '|| escalate_owner2_rec.object_version_number);
1042: OKC_DEBUG.log('1060: l_task_id ... '|| escalate_owner2_rec.task_id);
1043: OKC_DEBUG.log('1070: l_task_number ... '|| escalate_owner2_rec.task_number);
1044: OKC_DEBUG.log('1080: l_task_name ... '|| escalate_owner2_rec.task_name);
1045: OKC_DEBUG.log('1090: l_source_object_id ... '|| escalate_owner2_rec.source_object_id);
1046: OKC_DEBUG.log('2000: l_owner_id ... '|| escalate_owner2_rec.owner_id);
1039:
1040: IF (l_debug = 'Y') THEN
1041: OKC_DEBUG.log('1050: l_object_version_number is ... '|| escalate_owner2_rec.object_version_number);
1042: OKC_DEBUG.log('1060: l_task_id ... '|| escalate_owner2_rec.task_id);
1043: OKC_DEBUG.log('1070: l_task_number ... '|| escalate_owner2_rec.task_number);
1044: OKC_DEBUG.log('1080: l_task_name ... '|| escalate_owner2_rec.task_name);
1045: OKC_DEBUG.log('1090: l_source_object_id ... '|| escalate_owner2_rec.source_object_id);
1046: OKC_DEBUG.log('2000: l_owner_id ... '|| escalate_owner2_rec.owner_id);
1047: OKC_DEBUG.log('2010: l_planned_end_date ... '|| escalate_owner2_rec.planned_end_date);
1040: IF (l_debug = 'Y') THEN
1041: OKC_DEBUG.log('1050: l_object_version_number is ... '|| escalate_owner2_rec.object_version_number);
1042: OKC_DEBUG.log('1060: l_task_id ... '|| escalate_owner2_rec.task_id);
1043: OKC_DEBUG.log('1070: l_task_number ... '|| escalate_owner2_rec.task_number);
1044: OKC_DEBUG.log('1080: l_task_name ... '|| escalate_owner2_rec.task_name);
1045: OKC_DEBUG.log('1090: l_source_object_id ... '|| escalate_owner2_rec.source_object_id);
1046: OKC_DEBUG.log('2000: l_owner_id ... '|| escalate_owner2_rec.owner_id);
1047: OKC_DEBUG.log('2010: l_planned_end_date ... '|| escalate_owner2_rec.planned_end_date);
1048: OKC_DEBUG.log('2015: l_actual_end_date ... '|| escalate_owner2_rec.actual_end_date);
1041: OKC_DEBUG.log('1050: l_object_version_number is ... '|| escalate_owner2_rec.object_version_number);
1042: OKC_DEBUG.log('1060: l_task_id ... '|| escalate_owner2_rec.task_id);
1043: OKC_DEBUG.log('1070: l_task_number ... '|| escalate_owner2_rec.task_number);
1044: OKC_DEBUG.log('1080: l_task_name ... '|| escalate_owner2_rec.task_name);
1045: OKC_DEBUG.log('1090: l_source_object_id ... '|| escalate_owner2_rec.source_object_id);
1046: OKC_DEBUG.log('2000: l_owner_id ... '|| escalate_owner2_rec.owner_id);
1047: OKC_DEBUG.log('2010: l_planned_end_date ... '|| escalate_owner2_rec.planned_end_date);
1048: OKC_DEBUG.log('2015: l_actual_end_date ... '|| escalate_owner2_rec.actual_end_date);
1049: OKC_DEBUG.log('2020: l_alarm_interval ... '|| escalate_owner2_rec.alarm_interval);
1042: OKC_DEBUG.log('1060: l_task_id ... '|| escalate_owner2_rec.task_id);
1043: OKC_DEBUG.log('1070: l_task_number ... '|| escalate_owner2_rec.task_number);
1044: OKC_DEBUG.log('1080: l_task_name ... '|| escalate_owner2_rec.task_name);
1045: OKC_DEBUG.log('1090: l_source_object_id ... '|| escalate_owner2_rec.source_object_id);
1046: OKC_DEBUG.log('2000: l_owner_id ... '|| escalate_owner2_rec.owner_id);
1047: OKC_DEBUG.log('2010: l_planned_end_date ... '|| escalate_owner2_rec.planned_end_date);
1048: OKC_DEBUG.log('2015: l_actual_end_date ... '|| escalate_owner2_rec.actual_end_date);
1049: OKC_DEBUG.log('2020: l_alarm_interval ... '|| escalate_owner2_rec.alarm_interval);
1050: END IF;
1043: OKC_DEBUG.log('1070: l_task_number ... '|| escalate_owner2_rec.task_number);
1044: OKC_DEBUG.log('1080: l_task_name ... '|| escalate_owner2_rec.task_name);
1045: OKC_DEBUG.log('1090: l_source_object_id ... '|| escalate_owner2_rec.source_object_id);
1046: OKC_DEBUG.log('2000: l_owner_id ... '|| escalate_owner2_rec.owner_id);
1047: OKC_DEBUG.log('2010: l_planned_end_date ... '|| escalate_owner2_rec.planned_end_date);
1048: OKC_DEBUG.log('2015: l_actual_end_date ... '|| escalate_owner2_rec.actual_end_date);
1049: OKC_DEBUG.log('2020: l_alarm_interval ... '|| escalate_owner2_rec.alarm_interval);
1050: END IF;
1051:
1044: OKC_DEBUG.log('1080: l_task_name ... '|| escalate_owner2_rec.task_name);
1045: OKC_DEBUG.log('1090: l_source_object_id ... '|| escalate_owner2_rec.source_object_id);
1046: OKC_DEBUG.log('2000: l_owner_id ... '|| escalate_owner2_rec.owner_id);
1047: OKC_DEBUG.log('2010: l_planned_end_date ... '|| escalate_owner2_rec.planned_end_date);
1048: OKC_DEBUG.log('2015: l_actual_end_date ... '|| escalate_owner2_rec.actual_end_date);
1049: OKC_DEBUG.log('2020: l_alarm_interval ... '|| escalate_owner2_rec.alarm_interval);
1050: END IF;
1051:
1052: --If current date is greater than or equal to planned date + twice the alarm interval then
1045: OKC_DEBUG.log('1090: l_source_object_id ... '|| escalate_owner2_rec.source_object_id);
1046: OKC_DEBUG.log('2000: l_owner_id ... '|| escalate_owner2_rec.owner_id);
1047: OKC_DEBUG.log('2010: l_planned_end_date ... '|| escalate_owner2_rec.planned_end_date);
1048: OKC_DEBUG.log('2015: l_actual_end_date ... '|| escalate_owner2_rec.actual_end_date);
1049: OKC_DEBUG.log('2020: l_alarm_interval ... '|| escalate_owner2_rec.alarm_interval);
1050: END IF;
1051:
1052: --If current date is greater than or equal to planned date + twice the alarm interval then
1053: --escalate the task to level 2(manager)
1060: CLOSE escal_owner_id;
1061: END IF;
1062:
1063: IF (l_debug = 'Y') THEN
1064: OKC_DEBUG.log('1030: l_escalation_owner1_id ... '|| l_escalation_owner1_id);
1065: OKC_DEBUG.log('1040: l_escalation_owner2_id ... '|| l_escalation_owner2_id);
1066: OKC_DEBUG.log('1050: l_contract_id ... '|| l_contract_id);
1067: END IF;
1068:
1061: END IF;
1062:
1063: IF (l_debug = 'Y') THEN
1064: OKC_DEBUG.log('1030: l_escalation_owner1_id ... '|| l_escalation_owner1_id);
1065: OKC_DEBUG.log('1040: l_escalation_owner2_id ... '|| l_escalation_owner2_id);
1066: OKC_DEBUG.log('1050: l_contract_id ... '|| l_contract_id);
1067: END IF;
1068:
1069: --Select the owner of the Task
1062:
1063: IF (l_debug = 'Y') THEN
1064: OKC_DEBUG.log('1030: l_escalation_owner1_id ... '|| l_escalation_owner1_id);
1065: OKC_DEBUG.log('1040: l_escalation_owner2_id ... '|| l_escalation_owner2_id);
1066: OKC_DEBUG.log('1050: l_contract_id ... '|| l_contract_id);
1067: END IF;
1068:
1069: --Select the owner of the Task
1070: IF NOT escal_owner_cur%ISOPEN THEN
1074: CLOSE escal_owner_cur;
1075: END IF;
1076:
1077: IF (l_debug = 'Y') THEN
1078: OKC_DEBUG.log('1051: l_owner_name ... '|| l_owner_name);
1079: OKC_DEBUG.log('1060: l_dummy ... '|| l_dummy);
1080: END IF;
1081:
1082: --Get escalation owner2
1075: END IF;
1076:
1077: IF (l_debug = 'Y') THEN
1078: OKC_DEBUG.log('1051: l_owner_name ... '|| l_owner_name);
1079: OKC_DEBUG.log('1060: l_dummy ... '|| l_dummy);
1080: END IF;
1081:
1082: --Get escalation owner2
1083: IF NOT escal_owner_cur%ISOPEN THEN
1086: CLOSE escal_owner_cur;
1087: END IF;
1088:
1089: IF (l_debug = 'Y') THEN
1090: OKC_DEBUG.log('1061: l_escalate_owner2 ... '|| l_escalate_owner2);
1091: OKC_DEBUG.log('1062: l_dummy ... '|| l_dummy);
1092: END IF;
1093:
1094: select okc_wf_notify_s1.nextval
1087: END IF;
1088:
1089: IF (l_debug = 'Y') THEN
1090: OKC_DEBUG.log('1061: l_escalate_owner2 ... '|| l_escalate_owner2);
1091: OKC_DEBUG.log('1062: l_dummy ... '|| l_dummy);
1092: END IF;
1093:
1094: select okc_wf_notify_s1.nextval
1095: into l_item_key
1099: l_item_type := p_wf_name;
1100: l_process := p_wf_process;
1101:
1102: IF (l_debug = 'Y') THEN
1103: OKC_DEBUG.log('1070: l_item_key ... '|| l_item_key);
1104: OKC_DEBUG.log('1080: l_item_type ... '|| l_item_type);
1105: OKC_DEBUG.log('1090: l_process ... '|| l_process);
1106: END IF;
1107:
1100: l_process := p_wf_process;
1101:
1102: IF (l_debug = 'Y') THEN
1103: OKC_DEBUG.log('1070: l_item_key ... '|| l_item_key);
1104: OKC_DEBUG.log('1080: l_item_type ... '|| l_item_type);
1105: OKC_DEBUG.log('1090: l_process ... '|| l_process);
1106: END IF;
1107:
1108: --Launch Workflow to escalate the task to level 2 (mananger)
1101:
1102: IF (l_debug = 'Y') THEN
1103: OKC_DEBUG.log('1070: l_item_key ... '|| l_item_key);
1104: OKC_DEBUG.log('1080: l_item_type ... '|| l_item_type);
1105: OKC_DEBUG.log('1090: l_process ... '|| l_process);
1106: END IF;
1107:
1108: --Launch Workflow to escalate the task to level 2 (mananger)
1109: WF_ENGINE.CREATEPROCESS(L_ITEM_TYPE, L_ITEM_KEY, L_PROCESS);
1108: --Launch Workflow to escalate the task to level 2 (mananger)
1109: WF_ENGINE.CREATEPROCESS(L_ITEM_TYPE, L_ITEM_KEY, L_PROCESS);
1110:
1111: IF (l_debug = 'Y') THEN
1112: OKC_DEBUG.log('2000: Launching the Workflow to send notification .....');
1113: END IF;
1114:
1115: --set item attributes;
1116: WF_ENGINE.Setitemattrtext(itemtype => l_item_type,
1118: aname => 'TASK_NAME',
1119: avalue => l_task_name);
1120:
1121: IF (l_debug = 'Y') THEN
1122: OKC_DEBUG.log('2010: Setting Item Attribute TASK_NAME with '|| l_task_name);
1123: END IF;
1124:
1125: WF_ENGINE.Setitemattrtext(itemtype => l_item_type,
1126: itemkey => l_item_key,
1127: aname => 'TASK_OWNER',
1128: avalue => l_escalate_owner2);
1129:
1130: IF (l_debug = 'Y') THEN
1131: OKC_DEBUG.log('2020: Setting Item Attribute TASK_OWNER with '|| l_escalate_owner2);
1132: END IF;
1133:
1134: WF_ENGINE.Setitemattrdate(itemtype => l_item_type,
1135: itemkey => l_item_key,
1136: aname => 'DUE_DATE',
1137: avalue => l_planned_end_date);
1138:
1139: IF (l_debug = 'Y') THEN
1140: OKC_DEBUG.log('2030: Setting Item Attribute DUE_DATE with '|| l_planned_end_date);
1141: END IF;
1142:
1143: WF_ENGINE.Setitemattrtext(itemtype => l_item_type,
1144: itemkey => l_item_key,
1145: aname => 'ESCALATE_OWNER',
1146: avalue => NULL);
1147:
1148: IF (l_debug = 'Y') THEN
1149: OKC_DEBUG.log('2040: Setting Item Attribute ESCALATE_OWNER with '|| NULL);
1150: END IF;
1151:
1152: WF_ENGINE.Setitemattrtext(itemtype => l_item_type,
1153: itemkey => l_item_key,
1154: aname => 'DISPLAY_TASK_OWNER',
1155: avalue => l_owner_name);
1156:
1157: IF (l_debug = 'Y') THEN
1158: OKC_DEBUG.log('2050: Setting Item Attribute DISPLAY_TASK_OWNER with '|| l_owner_name);
1159: END IF;
1160:
1161: WF_ENGINE.Setitemattrnumber(itemtype => l_item_type,
1162: itemkey => l_item_key,
1163: aname => 'TASK_ID',
1164: avalue => l_task_id);
1165:
1166: IF (l_debug = 'Y') THEN
1167: OKC_DEBUG.log('2060: Setting Item Attribute TASK_ID with '|| l_task_id);
1168: END IF;
1169:
1170: WF_ENGINE.Setitemattrnumber(itemtype => l_item_type,
1171: itemkey => l_item_key,
1172: aname => 'CONTRACT_ID',
1173: avalue => l_contract_id);
1174:
1175: IF (l_debug = 'Y') THEN
1176: OKC_DEBUG.log('2070: Setting Item Attribute CONTRACT_ID with '|| l_contract_id);
1177: END IF;
1178:
1179: --start the workflow
1180: WF_ENGINE.STARTPROCESS(l_item_type, l_item_key);
1179: --start the workflow
1180: WF_ENGINE.STARTPROCESS(l_item_type, l_item_key);
1181:
1182: IF (l_debug = 'Y') THEN
1183: OKC_DEBUG.log('2080: started workflow process .....');
1184: END IF;
1185:
1186: -- commit;
1187:
1198: RAISE OKC_API.G_EXCEPTION_ERROR;
1199: END IF;
1200:
1201: IF (l_debug = 'Y') THEN
1202: OKC_DEBUG.log('2090: before OKC_TASK_PUB.update_task .....');
1203: END IF;
1204:
1205: --Update alarm fired count, workflow_process_id in the tasks table
1206: OKC_TASK_PUB.update_task(p_api_version => g_api_version,
1214: x_msg_count => g_msg_count,
1215: x_msg_data => g_msg_data);
1216:
1217: IF (l_debug = 'Y') THEN
1218: OKC_DEBUG.log('3000: after OKC_TASK_PUB.update_task return_status is '|| g_return_status);
1219: END IF;
1220:
1221: IF (g_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
1222: l_failure_count := l_failure_count + 1;
1233: END IF;
1234: EXCEPTION
1235: WHEN OKC_API.G_EXCEPTION_ERROR THEN
1236: IF (l_debug = 'Y') THEN
1237: OKC_DEBUG.log(' 400:Exception Error in task_alert...', 2);
1238: OKC_DEBUG.Reset_Indentation;
1239: END IF;
1240: FND_FILE.PUT_LINE( FND_FILE.LOG,'Task:'||l_task_number);
1241: get_fnd_msg_stack(' Exception Error in task_alert is '||g_msg_data);
1234: EXCEPTION
1235: WHEN OKC_API.G_EXCEPTION_ERROR THEN
1236: IF (l_debug = 'Y') THEN
1237: OKC_DEBUG.log(' 400:Exception Error in task_alert...', 2);
1238: OKC_DEBUG.Reset_Indentation;
1239: END IF;
1240: FND_FILE.PUT_LINE( FND_FILE.LOG,'Task:'||l_task_number);
1241: get_fnd_msg_stack(' Exception Error in task_alert is '||g_msg_data);
1242:
1241: get_fnd_msg_stack(' Exception Error in task_alert is '||g_msg_data);
1242:
1243: WHEN OKC_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
1244: IF (l_debug = 'Y') THEN
1245: OKC_DEBUG.log(' 400:Unexcepted Error in task_alert...', 2);
1246: OKC_DEBUG.Reset_Indentation;
1247: END IF;
1248: FND_FILE.PUT_LINE( FND_FILE.LOG,'Task:'||l_task_number);
1249: get_fnd_msg_stack(' Unexpected error in task_alert is '||g_msg_data);
1242:
1243: WHEN OKC_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
1244: IF (l_debug = 'Y') THEN
1245: OKC_DEBUG.log(' 400:Unexcepted Error in task_alert...', 2);
1246: OKC_DEBUG.Reset_Indentation;
1247: END IF;
1248: FND_FILE.PUT_LINE( FND_FILE.LOG,'Task:'||l_task_number);
1249: get_fnd_msg_stack(' Unexpected error in task_alert is '||g_msg_data);
1250:
1249: get_fnd_msg_stack(' Unexpected error in task_alert is '||g_msg_data);
1250:
1251: WHEN OTHERS THEN
1252: IF (l_debug = 'Y') THEN
1253: OKC_DEBUG.log(' 400:Other Exception Error in task_alert...', 2);
1254: OKC_DEBUG.Reset_Indentation;
1255: END IF;
1256: FND_FILE.PUT_LINE( FND_FILE.LOG,'Task:'||l_task_number);
1257:
1250:
1251: WHEN OTHERS THEN
1252: IF (l_debug = 'Y') THEN
1253: OKC_DEBUG.log(' 400:Other Exception Error in task_alert...', 2);
1254: OKC_DEBUG.Reset_Indentation;
1255: END IF;
1256: FND_FILE.PUT_LINE( FND_FILE.LOG,'Task:'||l_task_number);
1257:
1258: retcode := 2;
1262: END LOOP;
1263: OKC_API.END_ACTIVITY(g_msg_count, g_msg_data);
1264:
1265: IF (l_debug = 'Y') THEN
1266: OKC_DEBUG.log('4000: Exiting task_task_escalation2...', 2);
1267: OKC_DEBUG.Reset_Indentation;
1268: END IF;
1269: FND_FILE.PUT_LINE( FND_FILE.LOG,'Success Count:'||l_success_count);
1270: FND_FILE.PUT_LINE( FND_FILE.LOG,'Failure Count:'||l_failure_count);
1263: OKC_API.END_ACTIVITY(g_msg_count, g_msg_data);
1264:
1265: IF (l_debug = 'Y') THEN
1266: OKC_DEBUG.log('4000: Exiting task_task_escalation2...', 2);
1267: OKC_DEBUG.Reset_Indentation;
1268: END IF;
1269: FND_FILE.PUT_LINE( FND_FILE.LOG,'Success Count:'||l_success_count);
1270: FND_FILE.PUT_LINE( FND_FILE.LOG,'Failure Count:'||l_failure_count);
1271:
1271:
1272: EXCEPTION
1273: WHEN OKC_API.G_EXCEPTION_ERROR THEN
1274: IF (l_debug = 'Y') THEN
1275: OKC_DEBUG.log(' 4000:Exception Error in task_escalation2...', 2);
1276: OKC_DEBUG.Reset_Indentation;
1277: END IF;
1278: FND_FILE.PUT_LINE( FND_FILE.LOG,'Task:'||l_task_name);
1279: retcode := 2;
1272: EXCEPTION
1273: WHEN OKC_API.G_EXCEPTION_ERROR THEN
1274: IF (l_debug = 'Y') THEN
1275: OKC_DEBUG.log(' 4000:Exception Error in task_escalation2...', 2);
1276: OKC_DEBUG.Reset_Indentation;
1277: END IF;
1278: FND_FILE.PUT_LINE( FND_FILE.LOG,'Task:'||l_task_name);
1279: retcode := 2;
1280: errbuf := substr(sqlerrm,1,250);
1289: get_fnd_msg_stack(' Exception Error in task_escaltion2 is '||g_msg_data);
1290:
1291: WHEN OKC_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
1292: IF (l_debug = 'Y') THEN
1293: OKC_DEBUG.log(' 4000:Unexcepted Error in task_escalation2...', 2);
1294: OKC_DEBUG.Reset_Indentation;
1295: END IF;
1296: FND_FILE.PUT_LINE( FND_FILE.LOG,'Task:'||l_task_name);
1297:
1290:
1291: WHEN OKC_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
1292: IF (l_debug = 'Y') THEN
1293: OKC_DEBUG.log(' 4000:Unexcepted Error in task_escalation2...', 2);
1294: OKC_DEBUG.Reset_Indentation;
1295: END IF;
1296: FND_FILE.PUT_LINE( FND_FILE.LOG,'Task:'||l_task_name);
1297:
1298: retcode := 2;
1308: get_fnd_msg_stack(' Unexpected Error in task_escalation2 is '||g_msg_data);
1309:
1310: WHEN OTHERS THEN
1311: IF (l_debug = 'Y') THEN
1312: OKC_DEBUG.log(' 4000:Other Exception Error in task_escalation2...', 2);
1313: OKC_DEBUG.Reset_Indentation;
1314: END IF;
1315: FND_FILE.PUT_LINE( FND_FILE.LOG,'Task:'||l_task_name);
1316:
1309:
1310: WHEN OTHERS THEN
1311: IF (l_debug = 'Y') THEN
1312: OKC_DEBUG.log(' 4000:Other Exception Error in task_escalation2...', 2);
1313: OKC_DEBUG.Reset_Indentation;
1314: END IF;
1315: FND_FILE.PUT_LINE( FND_FILE.LOG,'Task:'||l_task_name);
1316:
1317: retcode := 2;
1354:
1355: BEGIN
1356:
1357: IF (l_debug = 'Y') THEN
1358: OKC_DEBUG.set_indentation(l_api_name);
1359: OKC_DEBUG.log('5010: Entered okc_pdate_reach_pvt', 2);
1360: END IF;
1361:
1362: l_return_status := OKC_API.START_ACTIVITY(l_api_name,
1355: BEGIN
1356:
1357: IF (l_debug = 'Y') THEN
1358: OKC_DEBUG.set_indentation(l_api_name);
1359: OKC_DEBUG.log('5010: Entered okc_pdate_reach_pvt', 2);
1360: END IF;
1361:
1362: l_return_status := OKC_API.START_ACTIVITY(l_api_name,
1363: G_PKG_NAME,
1382:
1383: FOR planned_date_rec in planned_date_cur LOOP
1384:
1385: IF (l_debug = 'Y') THEN
1386: OKC_DEBUG.log('5020: In planned_date_rec LOOP .... ');
1387: END IF;
1388:
1389: l_planned_date := planned_date_rec.planned_end_date;
1390: l_source_object_id := planned_date_rec.source_object_id;
1389: l_planned_date := planned_date_rec.planned_end_date;
1390: l_source_object_id := planned_date_rec.source_object_id;
1391:
1392: IF (l_debug = 'Y') THEN
1393: OKC_DEBUG.log('5030: l_planned_date is '||l_planned_date );
1394: OKC_DEBUG.log('5040: l_source_object_id is '||l_source_object_id );
1395: END IF;
1396:
1397: --If current date equals planned date then call the action assembler
1390: l_source_object_id := planned_date_rec.source_object_id;
1391:
1392: IF (l_debug = 'Y') THEN
1393: OKC_DEBUG.log('5030: l_planned_date is '||l_planned_date );
1394: OKC_DEBUG.log('5040: l_source_object_id is '||l_source_object_id );
1395: END IF;
1396:
1397: --If current date equals planned date then call the action assembler
1398: IF trunc(sysdate) = trunc(l_planned_date) THEN
1397: --If current date equals planned date then call the action assembler
1398: IF trunc(sysdate) = trunc(l_planned_date) THEN
1399:
1400: IF (l_debug = 'Y') THEN
1401: OKC_DEBUG.log('5050: Before Calling the action assembler .... ');
1402: END IF;
1403:
1404: OKC_SCHR_PD_ASMBLR_PVT.acn_assemble(
1405: p_api_version => g_api_version,
1410: p_rtv_id => l_source_object_id,
1411: p_planned_date => l_planned_date);
1412:
1413: IF (l_debug = 'Y') THEN
1414: OKC_DEBUG.log('5060: After Calling the action assembler return_status is '||g_return_status);
1415: END IF;
1416:
1417: IF (g_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
1418: raise OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
1424: END IF;
1425: END LOOP;
1426:
1427: IF (l_debug = 'Y') THEN
1428: OKC_DEBUG.log('6000: Exiting okc_pdate_reach_pvt...', 2);
1429: OKC_DEBUG.Reset_Indentation;
1430: END IF;
1431:
1432: EXCEPTION
1425: END LOOP;
1426:
1427: IF (l_debug = 'Y') THEN
1428: OKC_DEBUG.log('6000: Exiting okc_pdate_reach_pvt...', 2);
1429: OKC_DEBUG.Reset_Indentation;
1430: END IF;
1431:
1432: EXCEPTION
1433: WHEN OKC_API.G_EXCEPTION_ERROR THEN
1431:
1432: EXCEPTION
1433: WHEN OKC_API.G_EXCEPTION_ERROR THEN
1434: IF (l_debug = 'Y') THEN
1435: OKC_DEBUG.log(' 6000:Exception Error in okc_pdate_reach_pvt...', 2);
1436: OKC_DEBUG.Reset_Indentation;
1437: END IF;
1438:
1439: retcode := 2;
1432: EXCEPTION
1433: WHEN OKC_API.G_EXCEPTION_ERROR THEN
1434: IF (l_debug = 'Y') THEN
1435: OKC_DEBUG.log(' 6000:Exception Error in okc_pdate_reach_pvt...', 2);
1436: OKC_DEBUG.Reset_Indentation;
1437: END IF;
1438:
1439: retcode := 2;
1440: errbuf := substr(sqlerrm,1,250);
1449: get_fnd_msg_stack(' Exception Error in okc_pdate_reach_pvt is '||g_msg_data);
1450:
1451: WHEN OKC_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
1452: IF (l_debug = 'Y') THEN
1453: OKC_DEBUG.log(' 6000:Unexcepted Error in okc_pdate_reach_pvt...', 2);
1454: OKC_DEBUG.Reset_Indentation;
1455: END IF;
1456:
1457: retcode := 2;
1450:
1451: WHEN OKC_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
1452: IF (l_debug = 'Y') THEN
1453: OKC_DEBUG.log(' 6000:Unexcepted Error in okc_pdate_reach_pvt...', 2);
1454: OKC_DEBUG.Reset_Indentation;
1455: END IF;
1456:
1457: retcode := 2;
1458: errbuf := substr(sqlerrm,1,250);
1467: get_fnd_msg_stack(' Unexpected Error in okc_pdate_reach_pvt is '||g_msg_data);
1468:
1469: WHEN OTHERS THEN
1470: IF (l_debug = 'Y') THEN
1471: OKC_DEBUG.log(' 6000:Other Exception Error in okc_pdate_reach_pvt...', 2);
1472: OKC_DEBUG.Reset_Indentation;
1473: END IF;
1474:
1475: retcode := 2;
1468:
1469: WHEN OTHERS THEN
1470: IF (l_debug = 'Y') THEN
1471: OKC_DEBUG.log(' 6000:Other Exception Error in okc_pdate_reach_pvt...', 2);
1472: OKC_DEBUG.Reset_Indentation;
1473: END IF;
1474:
1475: retcode := 2;
1476: errbuf := substr(sqlerrm,1,250);