DBA Data[Home] [Help]

APPS.OE_PURGE_WF dependencies on OE_DEBUG_PUB

Line 6: g_debug_level CONSTANT NUMBER := oe_debug_pub.g_debug_level;

2: /* $Header: OEXVPWFB.pls 120.0.12020000.2 2013/01/10 12:04:25 spothula ship $ */
3: g_purge_count NUMBER :=0;
4: g_commit_frequency NUMBER :=500;
5: g_age NUMBER :=0;
6: g_debug_level CONSTANT NUMBER := oe_debug_pub.g_debug_level;
7: /*----------------------------------------------------------------------------------
8: Procedure: Purge_Orphan_Errors
9: Description: This procedure is created to purge the orhan error flows. That is, the
10: error flowswhose parent information is missing, or the parent is no longer

Line 55: oe_debug_pub.add( 'Entering the procedure oe_purge_wf.purge_orphan_errors',1);

51: /*came up with the above cursor, to honour the attempt to close parameter, when
52: item type is passed as 'OMERROR' and a specific error key is passed*/
53: BEGIN
54: IF g_debug_level > 0 THEN
55: oe_debug_pub.add( 'Entering the procedure oe_purge_wf.purge_orphan_errors',1);
56: END IF ;
57: IF p_item_key IS NULL THEN
58: IF g_debug_level > 0 THEN
59: oe_debug_pub.add( 'Item key is not passed. Fetching all the orphan error flows.',2);

Line 59: oe_debug_pub.add( 'Item key is not passed. Fetching all the orphan error flows.',2);

55: oe_debug_pub.add( 'Entering the procedure oe_purge_wf.purge_orphan_errors',1);
56: END IF ;
57: IF p_item_key IS NULL THEN
58: IF g_debug_level > 0 THEN
59: oe_debug_pub.add( 'Item key is not passed. Fetching all the orphan error flows.',2);
60: END IF ;
61: OPEN errors;
62: LOOP
63: FETCH errors BULK COLLECT INTO l_errors_tbl LIMIT g_commit_frequency;

Line 70: oe_debug_pub.add( 'Setting the error parent to null and aborting the flow',5);

66: FOR i IN l_errors_tbl.first .. l_errors_tbl.last
67: LOOP
68: BEGIN
69: IF g_debug_level > 0 THEN
70: oe_debug_pub.add( 'Setting the error parent to null and aborting the flow',5);
71: END IF ;
72: WF_ITEM.Set_Item_Parent(l_errors_tbl(i).ITEM_TYPE,l_errors_tbl(i).ITEM_KEY,NULL,NULL,NULL);
73: wf_engine.abortprocess(itemtype =>l_errors_tbl(i).ITEM_TYPE, itemkey=>l_errors_tbl(i).item_key);
74: EXCEPTION

Line 82: oe_debug_pub.add( 'Purging the error flow for item_type and item_key'||l_errors_tbl(i).ITEM_TYPE||'and'||l_errors_tbl(i).ITEM_KEY,5);

78: WHERE item_type=l_errors_tbl(i).ITEM_TYPE
79: AND item_key =l_errors_tbl(i).item_key;
80: END;
81: IF g_debug_level > 0 THEN
82: oe_debug_pub.add( 'Purging the error flow for item_type and item_key'||l_errors_tbl(i).ITEM_TYPE||'and'||l_errors_tbl(i).ITEM_KEY,5);
83: END IF ;
84: wf_purge.items(itemtype => l_errors_tbl(i).ITEM_TYPE, itemkey => l_errors_tbl(i).ITEM_KEY, docommit => FALSE, force=>TRUE);
85: g_purge_count:=g_purge_count+1;
86: END LOOP ;

Line 95: oe_debug_pub.add( 'Item key is passed. Fetching the specific error flow for key:'||p_item_key,2);

91: END LOOP ;
92: CLOSE errors;
93: ELSE
94: IF g_debug_level > 0 THEN
95: oe_debug_pub.add( 'Item key is passed. Fetching the specific error flow for key:'||p_item_key,2);
96: END IF ;
97: OPEN specific_error(p_item_key);
98: LOOP
99: FETCH specific_error BULK COLLECT INTO l_errors_tbl LIMIT g_commit_frequency;

Line 106: oe_debug_pub.add( 'Setting the error parent to null and aborting the flow for the specific key',5);

102: FOR i IN l_errors_tbl.first .. l_errors_tbl.last
103: LOOP
104: BEGIN
105: IF g_debug_level > 0 THEN
106: oe_debug_pub.add( 'Setting the error parent to null and aborting the flow for the specific key',5);
107: END IF ;
108: WF_ITEM.Set_Item_Parent(l_errors_tbl(i).ITEM_TYPE,l_errors_tbl(i).ITEM_KEY,NULL,NULL,NULL);
109: wf_engine.abortprocess(itemtype =>l_errors_tbl(i).ITEM_TYPE, itemkey=>l_errors_tbl(i).item_key);
110: EXCEPTION

Line 118: oe_debug_pub.add( 'Purging the error flow for item_type and item_key'||l_errors_tbl(i).ITEM_TYPE||'and'||l_errors_tbl(i).ITEM_KEY,5);

114: WHERE item_type=l_errors_tbl(i).ITEM_TYPE
115: AND item_key =l_errors_tbl(i).item_key;
116: END;
117: IF g_debug_level > 0 THEN
118: oe_debug_pub.add( 'Purging the error flow for item_type and item_key'||l_errors_tbl(i).ITEM_TYPE||'and'||l_errors_tbl(i).ITEM_KEY,5);
119: END IF ;
120: wf_purge.items(itemtype => l_errors_tbl(i).ITEM_TYPE, itemkey => l_errors_tbl(i).ITEM_KEY, docommit => FALSE, force=>TRUE);
121: g_purge_count:=g_purge_count+1;
122: END LOOP ;

Line 131: oe_debug_pub.add( 'Exiting oe_purge_wf.purge_orphan_errors',1);

127: END LOOP ;
128: CLOSE specific_error;
129: END IF ;
130: IF g_debug_level > 0 THEN
131: oe_debug_pub.add( 'Exiting oe_purge_wf.purge_orphan_errors',1);
132: END IF ;
133: EXCEPTION
134: WHEN OTHERS THEN
135: IF g_debug_level > 0 THEN

Line 136: oe_debug_pub.add( 'In others exception of oe_purge_wf.purge_orphan_errors',1);

132: END IF ;
133: EXCEPTION
134: WHEN OTHERS THEN
135: IF g_debug_level > 0 THEN
136: oe_debug_pub.add( 'In others exception of oe_purge_wf.purge_orphan_errors',1);
137: END IF ;
138: oe_debug_pub.add( sqlerrm);
139: l_errors_tbl.DELETE ;
140: IF errors%isopen THEN

Line 138: oe_debug_pub.add( sqlerrm);

134: WHEN OTHERS THEN
135: IF g_debug_level > 0 THEN
136: oe_debug_pub.add( 'In others exception of oe_purge_wf.purge_orphan_errors',1);
137: END IF ;
138: oe_debug_pub.add( sqlerrm);
139: l_errors_tbl.DELETE ;
140: IF errors%isopen THEN
141: CLOSE errors;
142: END IF;

Line 162: g_debug_level CONSTANT NUMBER := oe_debug_pub.g_debug_level;

158: IS
159: l_wf_details_tbl wf_details_tbl_type;
160: l_error_tbl wf_tbl_type;
161: l_result VARCHAR2(30);
162: g_debug_level CONSTANT NUMBER := oe_debug_pub.g_debug_level;
163: CURSOR TO_CLOSE
164: IS
165: SELECT P.INSTANCE_LABEL,
166: WAS.ITEM_KEY,

Line 217: oe_debug_pub.ADD('Entering oe_purge_wf.attempt_to_close',1 ) ;

213: AND I.PARENT_ITEM_KEY = TO_CHAR(c_header_id)
214: AND I.END_DATE IS NULL FOR UPDATE NOWAIT;
215: BEGIN
216: IF g_debug_level > 0 THEN
217: oe_debug_pub.ADD('Entering oe_purge_wf.attempt_to_close',1 ) ;
218: END IF;
219: IF p_item_key IS NOT NULL THEN
220: IF g_debug_level > 0 THEN
221: oe_debug_pub.ADD('Header id is passed. Fetching the specific header.',1 ) ;

Line 221: oe_debug_pub.ADD('Header id is passed. Fetching the specific header.',1 ) ;

217: oe_debug_pub.ADD('Entering oe_purge_wf.attempt_to_close',1 ) ;
218: END IF;
219: IF p_item_key IS NOT NULL THEN
220: IF g_debug_level > 0 THEN
221: oe_debug_pub.ADD('Header id is passed. Fetching the specific header.',1 ) ;
222: END IF;
223: OPEN close_specific(p_item_key);
224: LOOP
225: FETCH close_specific BULK COLLECT

Line 233: oe_debug_pub.ADD('Fetching the error flows associated with the header:'||p_item_key,2 ) ;

229: FOR i IN l_wf_details_tbl.first .. l_wf_details_tbl.last
230: LOOP
231: BEGIN
232: IF g_debug_level > 0 THEN
233: oe_debug_pub.ADD('Fetching the error flows associated with the header:'||p_item_key,2 ) ;
234: END IF;
235: OPEN ERRORS(To_Number(l_wf_details_tbl(i).item_key));
236: LOOP
237: FETCH ERRORS BULK COLLECT INTO l_error_tbl LIMIT g_commit_frequency;

Line 244: oe_debug_pub.ADD('Clearing the parent info from the error and aborting the error flow.',1 ) ;

240: FOR j IN l_error_tbl.first .. l_error_tbl.last
241: LOOP
242: BEGIN
243: IF g_debug_level > 0 THEN
244: oe_debug_pub.ADD('Clearing the parent info from the error and aborting the error flow.',1 ) ;
245: END IF;
246: WF_ITEM.Set_Item_Parent(l_error_tbl(j).ITEM_TYPE,l_error_tbl(j).ITEM_KEY,NULL,NULL,NULL);
247: WF_ENGINE.ABORTPROCESS(ITEMTYPE =>l_error_tbl(j).ITEM_TYPE, ITEMKEY=>l_error_tbl(j).ITEM_KEY);
248: EXCEPTION

Line 256: oe_debug_pub.ADD('Purging the error item_type and error item_key'||l_error_tbl(j).ITEM_TYPE||'and'||l_error_tbl(j).ITEM_KEY,1 ) ;

252: WHERE item_type=l_error_tbl(j).ITEM_TYPE
253: AND item_key =l_error_tbl(j).ITEM_KEY;
254: END;
255: IF g_debug_level > 0 THEN
256: oe_debug_pub.ADD('Purging the error item_type and error item_key'||l_error_tbl(j).ITEM_TYPE||'and'||l_error_tbl(j).ITEM_KEY,1 ) ;
257: END IF;
258: WF_PURGE.ITEMS(ITEMTYPE =>l_error_tbl(j).ITEM_TYPE, ITEMKEY=>l_error_tbl(j).ITEM_KEY, DOCOMMIT=>FALSE, FORCE=>TRUE);
259: g_purge_count:=g_purge_count+1;
260: END LOOP; --looping in the error table

Line 268: oe_debug_pub.ADD('Done with the error flows. Setting the context.',2 ) ;

264: WHEN ERRORS%NOTFOUND ;
265: END LOOP ; --error cursor
266: CLOSE errors;
267: IF g_debug_level > 0 THEN
268: oe_debug_pub.ADD('Done with the error flows. Setting the context.',2 ) ;
269: END IF;
270: BEGIN
271: OE_Standard_WF.OEOH_SELECTOR (p_itemtype => 'OEOH' ,p_itemkey => l_wf_details_tbl(i).item_key ,p_actid => 12345 ,p_funcmode => 'SET_CTX' ,p_result => l_result );
272: EXCEPTION

Line 278: oe_debug_pub.ADD('Retrying the close_wait_for_l activity',2 ) ;

274: FND_CLIENT_INFO.SET_ORG_CONTEXT(l_wf_details_tbl(i).org_id);
275: FND_PROFILE.PUT('ORG_ID', TO_CHAR(l_wf_details_tbl(i).org_id));
276: END;
277: IF g_debug_level > 0 THEN
278: oe_debug_pub.ADD('Retrying the close_wait_for_l activity',2 ) ;
279: END IF;
280: WF_ENGINE.HANDLEERROR('OEOH', l_wf_details_tbl(i).item_key, l_wf_details_tbl(i).INSTANCE_LABEL, 'RETRY',NULL);
281: EXCEPTION
282: WHEN OTHERS THEN

Line 294: oe_debug_pub.ADD('Header id is not passed. Fetching all the stuck headers.',1 ) ;

290: END LOOP ;
291: CLOSE close_specific;
292: ELSE
293: IF g_debug_level > 0 THEN
294: oe_debug_pub.ADD('Header id is not passed. Fetching all the stuck headers.',1 ) ;
295: END IF;
296: OPEN to_close;
297: LOOP
298: FETCH to_close BULK COLLECT INTO l_wf_details_tbl LIMIT g_commit_frequency;

Line 304: oe_debug_pub.ADD('Getting the error flows associated with the specific headers.',2 ) ;

300: IF l_wf_details_tbl.Count >0 THEN
301: FOR i IN l_wf_details_tbl.first .. l_wf_details_tbl.last
302: LOOP
303: IF g_debug_level > 0 THEN
304: oe_debug_pub.ADD('Getting the error flows associated with the specific headers.',2 ) ;
305: END IF;
306:
307: BEGIN
308: OPEN ERRORS(To_Number(l_wf_details_tbl(i).item_key));

Line 317: oe_debug_pub.ADD('Removing the parent reference and aborting the error flow',1 ) ;

313: FOR j IN l_error_tbl.first .. l_error_tbl.last
314: LOOP
315: BEGIN
316: IF g_debug_level > 0 THEN
317: oe_debug_pub.ADD('Removing the parent reference and aborting the error flow',1 ) ;
318: END IF;
319: WF_ITEM.Set_Item_Parent(l_error_tbl(j).ITEM_TYPE,l_error_tbl(j).ITEM_KEY,NULL,NULL,NULL);
320: WF_ENGINE.ABORTPROCESS(ITEMTYPE =>l_error_tbl(j).ITEM_TYPE, ITEMKEY=>l_error_tbl(j).ITEM_KEY);
321: EXCEPTION

Line 329: oe_debug_pub.ADD('Purging the error item type and error item key'||l_error_tbl(j).ITEM_TYPE||'and'||l_error_tbl(j).ITEM_KEY,3) ;

325: WHERE item_type=l_error_tbl(j).ITEM_TYPE
326: AND item_key =l_error_tbl(j).ITEM_KEY;
327: END;
328: IF g_debug_level > 0 THEN
329: oe_debug_pub.ADD('Purging the error item type and error item key'||l_error_tbl(j).ITEM_TYPE||'and'||l_error_tbl(j).ITEM_KEY,3) ;
330: END IF;
331: WF_PURGE.ITEMS(ITEMTYPE =>l_error_tbl(j).ITEM_TYPE, ITEMKEY=>l_error_tbl(j).ITEM_KEY, DOCOMMIT=>FALSE, FORCE=>TRUE);
332: g_purge_count:=g_purge_count+1;
333: END LOOP; --error table count

Line 342: oe_debug_pub.ADD('Done with error flows. Setting the context for the header',2) ;

338: END LOOP ; --error cursor fetch.
339: CLOSE errors;
340: BEGIN
341: IF g_debug_level > 0 THEN
342: oe_debug_pub.ADD('Done with error flows. Setting the context for the header',2) ;
343: END IF;
344: OE_Standard_WF.OEOH_SELECTOR (p_itemtype => 'OEOH' ,p_itemkey => l_wf_details_tbl(i).item_key ,p_actid => 12345 ,p_funcmode => 'SET_CTX' ,p_result => l_result );
345: EXCEPTION
346: WHEN NO_DATA_FOUND THEN

Line 351: oe_debug_pub.ADD('Retrying close_wait_for_l activity for the header',2) ;

347: FND_CLIENT_INFO.SET_ORG_CONTEXT(l_wf_details_tbl(i).org_id);
348: FND_PROFILE.PUT('ORG_ID', TO_CHAR(l_wf_details_tbl(i).org_id));
349: END;
350: IF g_debug_level > 0 THEN
351: oe_debug_pub.ADD('Retrying close_wait_for_l activity for the header',2) ;
352: END IF;
353: WF_ENGINE.HANDLEERROR('OEOH', l_wf_details_tbl(i).item_key, l_wf_details_tbl(i).INSTANCE_LABEL, 'RETRY',NULL);
354: EXCEPTION
355: WHEN OTHERS THEN

Line 367: oe_debug_pub.add( 'Exiting oe_purge_wf.attempt_to_close',1 ) ;

363: END LOOP ;
364: CLOSE to_close;
365: END IF ; --item key check
366: IF g_debug_level > 0 THEN
367: oe_debug_pub.add( 'Exiting oe_purge_wf.attempt_to_close',1 ) ;
368: END IF;
369: EXCEPTION
370: WHEN OTHERS THEN
371: l_wf_details_tbl.DELETE ;

Line 383: oe_debug_pub.add( SQLERRM ) ;

379: IF close_specific%isopen THEN
380: CLOSE close_specific;
381: END IF ;
382: IF g_debug_level > 0 THEN
383: oe_debug_pub.add( SQLERRM ) ;
384: END IF;
385: END attempt_to_close ;
386: /*----------------------------------------------------------------------------------
387: Procedure: Purge_Item_Type

Line 395: g_debug_level CONSTANT NUMBER := oe_debug_pub.g_debug_level;

391: PROCEDURE purge_item_type
392: (
393: p_item_type IN VARCHAR2 )
394: IS
395: g_debug_level CONSTANT NUMBER := oe_debug_pub.g_debug_level;
396: l_purge_tbl wf_tbl_type;
397: CURSOR to_purge
398: IS
399: SELECT item_type,

Line 406: oe_debug_pub.add( 'Entering oe_purge_wf.purge_item_type:'||p_item_type ,1) ;

402: WHERE item_type=p_item_type
403: AND end_date <= (SYSDATE-g_age);
404: BEGIN
405: IF g_debug_level > 0 THEN
406: oe_debug_pub.add( 'Entering oe_purge_wf.purge_item_type:'||p_item_type ,1) ;
407: END IF;
408: OPEN to_purge ;
409: LOOP
410: FETCH to_purge BULK COLLECT INTO l_purge_tbl limit g_commit_frequency;

Line 415: oe_debug_pub.add( l_purge_tbl(i).item_key);

411: --EXIT WHEN to_purge%NOTFOUND ;
412: IF l_purge_tbl.COUNT>0 THEN
413: FOR i IN l_purge_tbl.first .. l_purge_tbl.last
414: LOOP
415: oe_debug_pub.add( l_purge_tbl(i).item_key);
416: BEGIN
417: IF g_debug_level > 0 THEN
418: oe_debug_pub.add( 'Before purging the item_key:'||l_purge_tbl(i).item_key ,1) ;
419: END IF;

Line 418: oe_debug_pub.add( 'Before purging the item_key:'||l_purge_tbl(i).item_key ,1) ;

414: LOOP
415: oe_debug_pub.add( l_purge_tbl(i).item_key);
416: BEGIN
417: IF g_debug_level > 0 THEN
418: oe_debug_pub.add( 'Before purging the item_key:'||l_purge_tbl(i).item_key ,1) ;
419: END IF;
420: WF_PURGE.ITEMS(ITEMTYPE =>l_purge_tbl(i).item_type, ITEMKEY=>l_purge_tbl(i).item_key, DOCOMMIT=>FALSE, FORCE=>TRUE);
421: g_purge_count:=g_purge_count+1;
422: EXCEPTION

Line 435: oe_debug_pub.add( 'Exiting oe_purge_wf.purge_item_type',1 ) ;

431: WHEN to_purge%NOTFOUND ;
432: END LOOP ;
433: CLOSE to_purge ;
434: IF g_debug_level > 0 THEN
435: oe_debug_pub.add( 'Exiting oe_purge_wf.purge_item_type',1 ) ;
436: END IF;
437: EXCEPTION
438: WHEN OTHERS THEN
439: oe_debug_pub.add(FND_FILE.OUTPUT,sqlerrm);

Line 439: oe_debug_pub.add(FND_FILE.OUTPUT,sqlerrm);

435: oe_debug_pub.add( 'Exiting oe_purge_wf.purge_item_type',1 ) ;
436: END IF;
437: EXCEPTION
438: WHEN OTHERS THEN
439: oe_debug_pub.add(FND_FILE.OUTPUT,sqlerrm);
440: l_purge_tbl.DELETE ;
441: IF to_purge%isopen THEN
442: CLOSE to_purge;
443: END IF ;

Line 472: oe_debug_pub.add( 'Entering oe_purge_wf.purge_om_flows',1) ;

468: WHERE end_date <= (SYSDATE-g_age)
469: AND item_type IN ('OEOH','OEOL','OENH','OEBH','OMERROR','OEAME'); -- AME ER 16084377
470: BEGIN
471: IF g_debug_level > 0 THEN
472: oe_debug_pub.add( 'Entering oe_purge_wf.purge_om_flows',1) ;
473: oe_debug_pub.add( 'Item type passed is:'||p_item_type,1);
474: oe_debug_pub.add( 'Item key passed is:'||p_item_key,1);
475: oe_debug_pub.add( 'Attempt to close passed is:'||p_attempt_to_close,1);
476: oe_debug_pub.add( 'Elapsed days After closure passed is:'||p_age,1);

Line 473: oe_debug_pub.add( 'Item type passed is:'||p_item_type,1);

469: AND item_type IN ('OEOH','OEOL','OENH','OEBH','OMERROR','OEAME'); -- AME ER 16084377
470: BEGIN
471: IF g_debug_level > 0 THEN
472: oe_debug_pub.add( 'Entering oe_purge_wf.purge_om_flows',1) ;
473: oe_debug_pub.add( 'Item type passed is:'||p_item_type,1);
474: oe_debug_pub.add( 'Item key passed is:'||p_item_key,1);
475: oe_debug_pub.add( 'Attempt to close passed is:'||p_attempt_to_close,1);
476: oe_debug_pub.add( 'Elapsed days After closure passed is:'||p_age,1);
477: oe_debug_pub.add( 'Commit frequency passed is:'||p_commit_frequency,1);

Line 474: oe_debug_pub.add( 'Item key passed is:'||p_item_key,1);

470: BEGIN
471: IF g_debug_level > 0 THEN
472: oe_debug_pub.add( 'Entering oe_purge_wf.purge_om_flows',1) ;
473: oe_debug_pub.add( 'Item type passed is:'||p_item_type,1);
474: oe_debug_pub.add( 'Item key passed is:'||p_item_key,1);
475: oe_debug_pub.add( 'Attempt to close passed is:'||p_attempt_to_close,1);
476: oe_debug_pub.add( 'Elapsed days After closure passed is:'||p_age,1);
477: oe_debug_pub.add( 'Commit frequency passed is:'||p_commit_frequency,1);
478: END IF;

Line 475: oe_debug_pub.add( 'Attempt to close passed is:'||p_attempt_to_close,1);

471: IF g_debug_level > 0 THEN
472: oe_debug_pub.add( 'Entering oe_purge_wf.purge_om_flows',1) ;
473: oe_debug_pub.add( 'Item type passed is:'||p_item_type,1);
474: oe_debug_pub.add( 'Item key passed is:'||p_item_key,1);
475: oe_debug_pub.add( 'Attempt to close passed is:'||p_attempt_to_close,1);
476: oe_debug_pub.add( 'Elapsed days After closure passed is:'||p_age,1);
477: oe_debug_pub.add( 'Commit frequency passed is:'||p_commit_frequency,1);
478: END IF;
479: l_item_type := p_item_type;

Line 476: oe_debug_pub.add( 'Elapsed days After closure passed is:'||p_age,1);

472: oe_debug_pub.add( 'Entering oe_purge_wf.purge_om_flows',1) ;
473: oe_debug_pub.add( 'Item type passed is:'||p_item_type,1);
474: oe_debug_pub.add( 'Item key passed is:'||p_item_key,1);
475: oe_debug_pub.add( 'Attempt to close passed is:'||p_attempt_to_close,1);
476: oe_debug_pub.add( 'Elapsed days After closure passed is:'||p_age,1);
477: oe_debug_pub.add( 'Commit frequency passed is:'||p_commit_frequency,1);
478: END IF;
479: l_item_type := p_item_type;
480: IF l_item_type='ALL' THEN

Line 477: oe_debug_pub.add( 'Commit frequency passed is:'||p_commit_frequency,1);

473: oe_debug_pub.add( 'Item type passed is:'||p_item_type,1);
474: oe_debug_pub.add( 'Item key passed is:'||p_item_key,1);
475: oe_debug_pub.add( 'Attempt to close passed is:'||p_attempt_to_close,1);
476: oe_debug_pub.add( 'Elapsed days After closure passed is:'||p_age,1);
477: oe_debug_pub.add( 'Commit frequency passed is:'||p_commit_frequency,1);
478: END IF;
479: l_item_type := p_item_type;
480: IF l_item_type='ALL' THEN
481: l_item_type:= NULL ;

Line 504: oe_debug_pub.add( 'end date is not null');

500: /*Added the AND condition, just to ensure that a workflow will not get purged,
501: if its age is small, even though it is end dated and both item type and item key
502: are passed.*/
503: IF g_debug_level > 0 THEN
504: oe_debug_pub.add( 'end date is not null');
505: END IF ;
506: WF_PURGE.ITEMS(ITEMTYPE =>l_item_type, ITEMKEY=>p_item_key, DOCOMMIT=>FALSE, FORCE=>TRUE);
507: g_purge_count:=g_purge_count+1;
508: ELSIF l_end_date IS NULL THEN

Line 513: oe_debug_pub.add( 'Before calling attempt to close');

509:
510: IF p_attempt_to_close='Y'THEN
511:
512: IF g_debug_level > 0 THEN
513: oe_debug_pub.add( 'Before calling attempt to close');
514: END IF ;
515: IF l_item_type = 'OEOH' THEN
516: attempt_to_close(p_item_key);
517:

Line 536: oe_debug_pub.add( 'Before Purging');

532: END ;
533:
534: IF l_end_date IS NOT NULL THEN
535: IF g_debug_level > 0 THEN
536: oe_debug_pub.add( 'Before Purging');
537: END IF ;
538: WF_PURGE.ITEMS(ITEMTYPE =>l_item_type, ITEMKEY=>p_item_key, DOCOMMIT=>FALSE, FORCE=>TRUE);
539: g_purge_count:=g_purge_count+1;
540: END IF ;

Line 546: oe_debug_pub.add( 'Before calling attempt to close');

542: END IF ;
543: ELSIF l_item_type ='OEOH' THEN
544: IF p_attempt_to_close='Y' THEN
545: IF g_debug_level > 0 THEN
546: oe_debug_pub.add( 'Before calling attempt to close');
547: END IF ;
548: attempt_to_close;
549: COMMIT;
550: END IF ;

Line 552: oe_debug_pub.add( 'Before purging');

548: attempt_to_close;
549: COMMIT;
550: END IF ;
551: IF g_debug_level > 0 THEN
552: oe_debug_pub.add( 'Before purging');
553: END IF ;
554: purge_item_type(l_item_type);
555: ELSIF l_item_type ='OMERROR' THEN
556: IF p_attempt_to_close='Y' THEN

Line 558: oe_debug_pub.add( 'Before calling Purge orphan errors');

554: purge_item_type(l_item_type);
555: ELSIF l_item_type ='OMERROR' THEN
556: IF p_attempt_to_close='Y' THEN
557: IF g_debug_level > 0 THEN
558: oe_debug_pub.add( 'Before calling Purge orphan errors');
559: END IF ;
560: purge_orphan_errors;
561: COMMIT ;
562: END IF;

Line 564: oe_debug_pub.add( 'Before calling purge item type');

560: purge_orphan_errors;
561: COMMIT ;
562: END IF;
563: IF g_debug_level > 0 THEN
564: oe_debug_pub.add( 'Before calling purge item type');
565: END IF ;
566: purge_item_type(l_item_type);
567: ELSE
568: IF g_debug_level > 0 THEN

Line 569: oe_debug_pub.add( 'item type passed is neither OMERROR nor OEOH');

565: END IF ;
566: purge_item_type(l_item_type);
567: ELSE
568: IF g_debug_level > 0 THEN
569: oe_debug_pub.add( 'item type passed is neither OMERROR nor OEOH');
570: END IF ;
571: purge_item_type(l_item_type);
572: END IF ; --end item key is not null
573: ELSIF l_item_type IS NULL THEN --item type is null

Line 575: oe_debug_pub.add( 'item type passed is all item types');

571: purge_item_type(l_item_type);
572: END IF ; --end item key is not null
573: ELSIF l_item_type IS NULL THEN --item type is null
574: IF g_debug_level > 0 THEN
575: oe_debug_pub.add( 'item type passed is all item types');
576: END IF ;
577: IF p_item_key IS NOT NULL THEN
578: fnd_file.put_line(FND_FILE.OUTPUT,'Item type cannot be null when item key is not null. ' ) ;
579: IF g_debug_level > 0 THEN

Line 580: oe_debug_pub.add( 'Item type cannot be null when item key is not null. ' ) ;

576: END IF ;
577: IF p_item_key IS NOT NULL THEN
578: fnd_file.put_line(FND_FILE.OUTPUT,'Item type cannot be null when item key is not null. ' ) ;
579: IF g_debug_level > 0 THEN
580: oe_debug_pub.add( 'Item type cannot be null when item key is not null. ' ) ;
581: END IF;
582: ELSE
583: IF p_attempt_to_close='Y' THEN
584: attempt_to_close;

Line 597: oe_debug_pub.add( 'Before purging for item_type and item_key'||l_purge_tbl(i).item_type||','||l_purge_tbl(i).item_key );

593: FOR i IN l_purge_tbl.first .. l_purge_tbl.last
594: LOOP
595: BEGIN
596: IF g_debug_level > 0 THEN
597: oe_debug_pub.add( 'Before purging for item_type and item_key'||l_purge_tbl(i).item_type||','||l_purge_tbl(i).item_key );
598: END IF ;
599: WF_PURGE.ITEMS(ITEMTYPE =>l_purge_tbl(i).item_type, ITEMKEY=>l_purge_tbl(i).item_key, DOCOMMIT=>FALSE, FORCE=>TRUE);
600: g_purge_count:=g_purge_count+1;
601: EXCEPTION

Line 624: oe_debug_pub.add(FND_FILE.OUTPUT,sqlerrm);

620: NULL;
621: WHEN OTHERS THEN
622: g_age :=0;
623: g_commit_frequency:=500;
624: oe_debug_pub.add(FND_FILE.OUTPUT,sqlerrm);
625: retcode := 2;
626: errbuf := sqlerrm;
627: l_purge_tbl.DELETE ;
628: IF purge_all%isopen THEN