DBA Data[Home] [Help]

APPS.WF_PURGE dependencies on WF_ITEM

Line 9: -- Move wf_item_activity_status rows for particular itemtype/key from

5: l_docommit boolean;
6: l_runtimeonly boolean;
7:
8: -- procedure Move_To_History
9: -- Move wf_item_activity_status rows for particular itemtype/key from
10: -- main table to history table.
11: -- IN:
12: -- itemtype - Item type to move, or null for all itemtypes
13: -- itemkey - Item key to move, or null for all itemkeys

Line 25: -- Delete from wf_item_activity_statuses and wf_item_activity_statuses_h

21: end Move_To_History;
22:
23: --
24: -- procedure Item_Activity_Statuses
25: -- Delete from wf_item_activity_statuses and wf_item_activity_statuses_h
26: -- where end_date before argument.
27: -- IN:
28: -- itemtype - Item type to delete, or null for all itemtypes
29: -- itemkey - Item key to delete, or null for all itemkeys

Line 79: FROM WF_ITEM_TYPES

75:
76: cursor item2purge is
77: SELECT WI.ITEM_TYPE, WI.ITEM_KEY
78: FROM (SELECT PERSISTENCE_DAYS, NAME
79: FROM WF_ITEM_TYPES
80: WHERE PERSISTENCE_TYPE = Wf_Purge.persistence_type and NAME=itemtype) WIT, WF_ITEMS WI
81: WHERE WI.ITEM_TYPE = WIT.NAME
82: AND WI.END_DATE <= enddate-nvl(WIT.PERSISTENCE_DAYS,0)
83: AND WI.END_DATE > xenddate

Line 80: WHERE PERSISTENCE_TYPE = Wf_Purge.persistence_type and NAME=itemtype) WIT, WF_ITEMS WI

76: cursor item2purge is
77: SELECT WI.ITEM_TYPE, WI.ITEM_KEY
78: FROM (SELECT PERSISTENCE_DAYS, NAME
79: FROM WF_ITEM_TYPES
80: WHERE PERSISTENCE_TYPE = Wf_Purge.persistence_type and NAME=itemtype) WIT, WF_ITEMS WI
81: WHERE WI.ITEM_TYPE = WIT.NAME
82: AND WI.END_DATE <= enddate-nvl(WIT.PERSISTENCE_DAYS,0)
83: AND WI.END_DATE > xenddate
84: AND NOT EXISTS

Line 86: FROM WF_ITEMS WI2

82: AND WI.END_DATE <= enddate-nvl(WIT.PERSISTENCE_DAYS,0)
83: AND WI.END_DATE > xenddate
84: AND NOT EXISTS
85: (SELECT NULL
86: FROM WF_ITEMS WI2
87: WHERE WI2.END_DATE IS NULL
88: START WITH WI2.ITEM_TYPE = WI.ITEM_TYPE
89: AND WI2.ITEM_KEY = WI.ITEM_KEY
90: CONNECT BY PRIOR WI2.ITEM_TYPE = WI2.PARENT_ITEM_TYPE

Line 94: FROM WF_ITEMS WI2

90: CONNECT BY PRIOR WI2.ITEM_TYPE = WI2.PARENT_ITEM_TYPE
91: AND PRIOR WI2.ITEM_KEY = WI2.PARENT_ITEM_KEY )
92: AND NOT EXISTS
93: (SELECT NULL
94: FROM WF_ITEMS WI2
95: WHERE WI2.END_DATE IS NULL
96: START WITH WI2.ITEM_TYPE = WI.ITEM_TYPE
97: AND WI2.ITEM_KEY = WI.ITEM_KEY
98: CONNECT BY PRIOR WI2.PARENT_ITEM_TYPE = WI2.ITEM_TYPE

Line 106: from WF_ITEMS WI

102:
103: -- JWSMITH bug 2070056 - add new cursor for performance
104: cursor item3purge is
105: select WI.ITEM_TYPE, WI.ITEM_KEY
106: from WF_ITEMS WI
107: where WI.ITEM_TYPE = itemtype
108: and WI.ITEM_KEY = itemkey
109: and WI.end_date <= enddate
110: and exists

Line 112: from WF_ITEM_TYPES WIT

108: and WI.ITEM_KEY = itemkey
109: and WI.end_date <= enddate
110: and exists
111: (select null
112: from WF_ITEM_TYPES WIT
113: where WI.END_DATE+nvl(WIT.PERSISTENCE_DAYS,0)<=enddate
114: and WI.ITEM_TYPE = WIT.NAME
115: and WIT.PERSISTENCE_TYPE = Wf_Purge.persistence_type)
116: and not exists

Line 118: from WF_ITEMS WI2

114: and WI.ITEM_TYPE = WIT.NAME
115: and WIT.PERSISTENCE_TYPE = Wf_Purge.persistence_type)
116: and not exists
117: (select null
118: from WF_ITEMS WI2
119: WHERE WI2.END_DATE IS NULL
120: START WITH WI2.ITEM_TYPE = WI.ITEM_TYPE
121: AND WI2.ITEM_KEY = WI.ITEM_KEY
122: CONNECT BY PRIOR WI2.ITEM_TYPE = WI2.PARENT_ITEM_TYPE

Line 126: from WF_ITEMS WI2

122: CONNECT BY PRIOR WI2.ITEM_TYPE = WI2.PARENT_ITEM_TYPE
123: AND PRIOR WI2.ITEM_KEY = WI2.PARENT_ITEM_KEY
124: UNION ALL
125: select null
126: from WF_ITEMS WI2
127: WHERE WI2.END_DATE IS NULL
128: START WITH WI2.ITEM_TYPE = WI.ITEM_TYPE
129: AND WI2.ITEM_KEY = WI.ITEM_KEY
130: CONNECT BY PRIOR WI2.PARENT_ITEM_TYPE = WI2.ITEM_TYPE

Line 137: from WF_ITEMS WI

133: -- CTILLEY bug 2642057 - added new cursor for use when FORCE
134: -- arg is TRUE.
135: cursor item4purge is
136: select WI.ITEM_TYPE, WI.ITEM_KEY
137: from WF_ITEMS WI
138: where WI.ITEM_KEY = itemkey
139: and WI.ITEM_TYPE = itemtype
140: and WI.end_date <= enddate;
141:

Line 147: select /*+ first_rows index(WI,WF_ITEMS_N3) */

143: -- of using like condition. We will no longer support passing partial values
144: -- for item type or item key.
145:
146: cursor item5purge is
147: select /*+ first_rows index(WI,WF_ITEMS_N3) */
148: WI.ITEM_TYPE, WI.ITEM_KEY
149: from WF_ITEMS WI
150: where WI.END_DATE <= enddate
151: and WI.END_DATE > xenddate

Line 149: from WF_ITEMS WI

145:
146: cursor item5purge is
147: select /*+ first_rows index(WI,WF_ITEMS_N3) */
148: WI.ITEM_TYPE, WI.ITEM_KEY
149: from WF_ITEMS WI
150: where WI.END_DATE <= enddate
151: and WI.END_DATE > xenddate
152: and exists
153: (select null

Line 154: from WF_ITEM_TYPES WIT

150: where WI.END_DATE <= enddate
151: and WI.END_DATE > xenddate
152: and exists
153: (select null
154: from WF_ITEM_TYPES WIT
155: where WI.END_DATE+nvl(WIT.PERSISTENCE_DAYS,0)<=enddate
156: and WI.ITEM_TYPE = WIT.NAME
157: and WIT.PERSISTENCE_TYPE = Wf_Purge.persistence_type)
158: and not exists

Line 160: from WF_ITEMS WI2

156: and WI.ITEM_TYPE = WIT.NAME
157: and WIT.PERSISTENCE_TYPE = Wf_Purge.persistence_type)
158: and not exists
159: (select null
160: from WF_ITEMS WI2
161: WHERE WI2.END_DATE IS NULL
162: START WITH WI2.ITEM_TYPE = WI.ITEM_TYPE
163: AND WI2.ITEM_KEY = WI.ITEM_KEY
164: CONNECT BY PRIOR WI2.ITEM_TYPE = WI2.PARENT_ITEM_TYPE

Line 168: from WF_ITEMS WI2

164: CONNECT BY PRIOR WI2.ITEM_TYPE = WI2.PARENT_ITEM_TYPE
165: AND PRIOR WI2.ITEM_KEY = WI2.PARENT_ITEM_KEY
166: UNION ALL
167: select null
168: from WF_ITEMS WI2
169: WHERE WI2.END_DATE IS NULL
170: START WITH WI2.ITEM_TYPE = WI.ITEM_TYPE
171: AND WI2.ITEM_KEY = WI.ITEM_KEY
172: CONNECT BY PRIOR WI2.PARENT_ITEM_TYPE = WI2.ITEM_TYPE

Line 288: if ( not (wf_item.acquire_lock(l_itemtypeTAB(j), l_itemkeyTAB(j), FALSE))) then

284:
285: -- If we cannot lock current item, try to lock the last item on the index table.
286: -- If we cannot acquire lock on the last item, delete last item and get the
287: -- next last item on the index table until we can acquire a lock.
288: if ( not (wf_item.acquire_lock(l_itemtypeTAB(j), l_itemkeyTAB(j), FALSE))) then
289: <>
290: loop
291: if (l_itemkeyTAB.COUNT < j ) then
292: exit outer_lock_loop;

Line 294: elsif (wf_item.acquire_lock(l_itemtypeTAB(l_itemtypeTAB.LAST),

290: loop
291: if (l_itemkeyTAB.COUNT < j ) then
292: exit outer_lock_loop;
293:
294: elsif (wf_item.acquire_lock(l_itemtypeTAB(l_itemtypeTAB.LAST),
295: l_itemkeyTAB(l_itemkeyTAB.LAST), FALSE)) then
296:
297: -- Once we acquired a lock on a last item, copy the last time to
298: -- the current index so that we have a dense index table.

Line 318: from WF_ITEM_ACTIVITY_STATUSES WIAS,

314: FOR j IN l_itemkeyTAB.FIRST..l_itemkeyTAB.LAST loop
315: begin
316: select WN.NOTIFICATION_ID
317: BULK COLLECT into l_tempListTAB
318: from WF_ITEM_ACTIVITY_STATUSES WIAS,
319: WF_NOTIFICATIONS WN
320: where WIAS.ITEM_TYPE = l_itemtypeTAB(j)
321: and WIAS.ITEM_KEY = l_itemkeyTAB(j)
322: and WIAS.NOTIFICATION_ID = WN.GROUP_ID

Line 331: from WF_ITEM_ACTIVITY_STATUSES_H WIASH,

327: where SIG_OBJ_TYPE = 'WF_NTF'
328: and SIG_OBJ_ID = WN.NOTIFICATION_ID))
329: union all
330: select WN.NOTIFICATION_ID
331: from WF_ITEM_ACTIVITY_STATUSES_H WIASH,
332: WF_NOTIFICATIONS WN
333: where WIASH.ITEM_TYPE = l_itemtypeTAB(j)
334: and WIASH.ITEM_KEY = l_itemkeyTAB(j)
335: and WIASH.NOTIFICATION_ID = WN.GROUP_ID

Line 410: delete from WF_ITEM_ACTIVITY_STATUSES_H

406:
407: begin
408: --delete all status history.
409: FORALL j IN l_itemkeyTAB.FIRST..l_itemkeyTAB.LAST
410: delete from WF_ITEM_ACTIVITY_STATUSES_H
411: where ITEM_TYPE = l_itemtypeTAB(j)
412: and ITEM_KEY = l_itemkeyTAB(j);
413:
414: --delete all statuses.

Line 416: delete from WF_ITEM_ACTIVITY_STATUSES

412: and ITEM_KEY = l_itemkeyTAB(j);
413:
414: --delete all statuses.
415: FORALL j IN l_itemkeyTAB.FIRST..l_itemkeyTAB.LAST
416: delete from WF_ITEM_ACTIVITY_STATUSES
417: where ITEM_TYPE = l_itemtypeTAB(j)
418: and ITEM_KEY = l_itemkeyTAB(j);
419:
420: --delete item attributes

Line 422: delete from WF_ITEM_ATTRIBUTE_VALUES

418: and ITEM_KEY = l_itemkeyTAB(j);
419:
420: --delete item attributes
421: FORALL j IN l_itemkeyTAB.FIRST..l_itemkeyTAB.LAST
422: delete from WF_ITEM_ATTRIBUTE_VALUES
423: where ITEM_TYPE = l_itemtypeTAB(j)
424: and ITEM_KEY = l_itemkeyTAB(j);
425:
426: -- 3966635 Workflwo Provisioning Project

Line 435: delete from WF_ITEMS

431: -- and source = 'WORKFLOW';
432: --
433: --finally delete the item itself.
434: FORALL j IN l_itemkeyTAB.FIRST..l_itemkeyTAB.LAST
435: delete from WF_ITEMS
436: where ITEM_TYPE = l_itemtypeTAB(j)
437: and ITEM_KEY = l_itemkeyTAB(j);
438:
439: exception

Line 512: Wf_Item.ClearCache;

508: close item5purge;
509: end if;
510:
511: -- Clear engine runtime cache for convenience
512: Wf_Item.ClearCache;
513:
514: exception
515: when others then
516: if (item2purge%ISOPEN) then

Line 617: from WF_ITEM_TYPES WIT

613: where WA.ITEM_TYPE = acttype
614: and WA.NAME = actname
615: and exists
616: (select null
617: from WF_ITEM_TYPES WIT
618: where WA.END_DATE+nvl(WIT.PERSISTENCE_DAYS,0)<=enddate
619: and WA.ITEM_TYPE = WIT.NAME
620: and WIT.PERSISTENCE_TYPE = Wf_Purge.persistence_type);
621:

Line 626: from WF_ITEMS WI

622: --Use itemcurs1 if the rootname is 'ROOT'
623: cursor itemcurs1(begdate in date, enddate in date,
624: roottype in varchar2, rootname in varchar2) is
625: select WI.ITEM_TYPE, WI.ITEM_KEY, WI.ROOT_ACTIVITY, WI.BEGIN_DATE
626: from WF_ITEMS WI
627: where WI.BEGIN_DATE between begdate and nvl(enddate, WI.BEGIN_DATE)
628: and WI.ITEM_TYPE = roottype;
629:
630: --Use itemcurs2 for other rootnames

Line 634: from WF_ITEMS WI

630: --Use itemcurs2 for other rootnames
631: cursor itemcurs2(begdate in date, enddate in date,
632: roottype in varchar2, rootname in varchar2) is
633: select WI.ITEM_TYPE, WI.ITEM_KEY, WI.ROOT_ACTIVITY, WI.BEGIN_DATE
634: from WF_ITEMS WI
635: where WI.BEGIN_DATE between begdate and nvl(enddate, WI.BEGIN_DATE)
636: and WI.ITEM_TYPE = roottype
637: and WI.ROOT_ACTIVITY = rootname ;
638:

Line 1036: from WF_ITEM_ACTIVITY_STATUSES WIAS

1032: from WF_NOTIFICATIONS WN
1033: where WN.MESSAGE_TYPE = itemtype
1034: and not exists
1035: (select NULL
1036: from WF_ITEM_ACTIVITY_STATUSES WIAS
1037: where WIAS.NOTIFICATION_ID = WN.GROUP_ID)
1038: and not exists
1039: (select NULL
1040: from WF_ITEM_ACTIVITY_STATUSES_H WIAS

Line 1040: from WF_ITEM_ACTIVITY_STATUSES_H WIAS

1036: from WF_ITEM_ACTIVITY_STATUSES WIAS
1037: where WIAS.NOTIFICATION_ID = WN.GROUP_ID)
1038: and not exists
1039: (select NULL
1040: from WF_ITEM_ACTIVITY_STATUSES_H WIAS
1041: where WIAS.NOTIFICATION_ID = WN.GROUP_ID)
1042: and (
1043: exists(
1044: select null

Line 1045: from WF_ITEM_TYPES WIT

1041: where WIAS.NOTIFICATION_ID = WN.GROUP_ID)
1042: and (
1043: exists(
1044: select null
1045: from WF_ITEM_TYPES WIT
1046: where WN.END_DATE+nvl(WIT.PERSISTENCE_DAYS,0) <= enddate
1047: and WN.MESSAGE_TYPE = WIT.NAME
1048: and WIT.PERSISTENCE_TYPE = Wf_Purge.persistence_type)
1049: or not exists(

Line 1051: from WF_ITEM_TYPES WIT

1047: and WN.MESSAGE_TYPE = WIT.NAME
1048: and WIT.PERSISTENCE_TYPE = Wf_Purge.persistence_type)
1049: or not exists(
1050: select null
1051: from WF_ITEM_TYPES WIT
1052: where WN.MESSAGE_TYPE = WIT.NAME))
1053: and(
1054: (purgesigs = 1)
1055: or not exists

Line 1066: from WF_ITEM_ACTIVITY_STATUSES WIAS

1062: select WN.NOTIFICATION_ID
1063: from WF_NOTIFICATIONS WN
1064: where not exists
1065: (select NULL
1066: from WF_ITEM_ACTIVITY_STATUSES WIAS
1067: where WIAS.NOTIFICATION_ID = WN.GROUP_ID)
1068: and not exists
1069: (select NULL
1070: from WF_ITEM_ACTIVITY_STATUSES_H WIAS

Line 1070: from WF_ITEM_ACTIVITY_STATUSES_H WIAS

1066: from WF_ITEM_ACTIVITY_STATUSES WIAS
1067: where WIAS.NOTIFICATION_ID = WN.GROUP_ID)
1068: and not exists
1069: (select NULL
1070: from WF_ITEM_ACTIVITY_STATUSES_H WIAS
1071: where WIAS.NOTIFICATION_ID = WN.GROUP_ID)
1072: and (
1073: exists(
1074: select null

Line 1075: from WF_ITEM_TYPES WIT

1071: where WIAS.NOTIFICATION_ID = WN.GROUP_ID)
1072: and (
1073: exists(
1074: select null
1075: from WF_ITEM_TYPES WIT
1076: where WN.END_DATE+nvl(WIT.PERSISTENCE_DAYS,0) <= enddate
1077: and WN.MESSAGE_TYPE = WIT.NAME
1078: and WIT.PERSISTENCE_TYPE = Wf_Purge.persistence_type)
1079: or not exists(

Line 1081: from WF_ITEM_TYPES WIT

1077: and WN.MESSAGE_TYPE = WIT.NAME
1078: and WIT.PERSISTENCE_TYPE = Wf_Purge.persistence_type)
1079: or not exists(
1080: select null
1081: from WF_ITEM_TYPES WIT
1082: where WN.MESSAGE_TYPE = WIT.NAME))
1083: and(
1084: (purgesigs = 1)
1085: or not exists

Line 1119: FROM wf_item_activity_statuses wias

1115: UPDATE wf_notifications wn
1116: SET end_date = nvl(begin_date, to_date('2002/08/01','YYYY/MM/DD')) + 1
1117: WHERE NOT EXISTS
1118: (SELECT NULL
1119: FROM wf_item_activity_statuses wias
1120: WHERE wias.notification_id = wn.group_id)
1121: AND NOT EXISTS
1122: (SELECT NULL
1123: FROM wf_item_activity_statuses_h wiash

Line 1123: FROM wf_item_activity_statuses_h wiash

1119: FROM wf_item_activity_statuses wias
1120: WHERE wias.notification_id = wn.group_id)
1121: AND NOT EXISTS
1122: (SELECT NULL
1123: FROM wf_item_activity_statuses_h wiash
1124: WHERE wiash.notification_id = wn.group_id)
1125: AND wn.end_date is null
1126: AND wn.begin_date <= enddate
1127: AND rownum < Wf_Purge.Commit_Frequency;

Line 1334: Wf_Item.ClearCache;

1330: end if;
1331: end if;
1332:
1333: -- Clear engine runtime cache for convenience
1334: Wf_Item.ClearCache;
1335:
1336: -- Purge orphan notifications only if runtimeonly is false
1337: if (not nvl(runtimeonly, TRUE)) then
1338: --Bug 6759163 : 'docommit' parameter passed to Notifications() as well

Line 1571: from WF_ITEMS wi

1567: where wn.RECIPIENT_ROLE = local.NAME
1568: or wn.ORIGINAL_RECIPIENT = local.NAME)
1569: and not exists
1570: (select NULL
1571: from WF_ITEMS wi
1572: where wi.OWNER_ROLE = local.NAME);
1573:
1574: -- Bug 8204723. These two cursors are used to remove expired associations regardles
1575: -- of whether the role is expired or not.

Line 1843: from WF_ITEMS WI

1839: l_purgeable number ;
1840: BEGIN
1841: --Get all records for the itemtype
1842: select Count(*) into l_purgeable
1843: from WF_ITEMS WI
1844: where WI.ITEM_TYPE = p_itemType
1845: and WI.END_DATE <= sysdate
1846: and exists
1847: (select null

Line 1848: from WF_ITEM_TYPES WIT

1844: where WI.ITEM_TYPE = p_itemType
1845: and WI.END_DATE <= sysdate
1846: and exists
1847: (select null
1848: from WF_ITEM_TYPES WIT
1849: where WI.END_DATE+nvl(WIT.PERSISTENCE_DAYS,0)<=sysdate
1850: and WI.ITEM_TYPE = WIT.NAME
1851: )
1852: and not exists

Line 1854: from WF_ITEMS WI2

1850: and WI.ITEM_TYPE = WIT.NAME
1851: )
1852: and not exists
1853: (select null
1854: from WF_ITEMS WI2
1855: WHERE WI2.END_DATE IS NULL
1856: START WITH WI2.ITEM_TYPE = WI.ITEM_TYPE
1857: AND WI2.ITEM_KEY = WI.ITEM_KEY
1858: CONNECT BY PRIOR WI2.ITEM_TYPE = WI2.PARENT_ITEM_TYPE

Line 1862: from WF_ITEMS WI2

1858: CONNECT BY PRIOR WI2.ITEM_TYPE = WI2.PARENT_ITEM_TYPE
1859: AND PRIOR WI2.ITEM_KEY = WI2.PARENT_ITEM_KEY
1860: UNION ALL
1861: select null
1862: from WF_ITEMS WI2
1863: WHERE WI2.END_DATE IS NULL
1864: START WITH WI2.ITEM_TYPE = WI.ITEM_TYPE
1865: AND WI2.ITEM_KEY = WI.ITEM_KEY
1866: CONNECT BY PRIOR WI2.PARENT_ITEM_TYPE = WI2.ITEM_TYPE

Line 1893: from wf_item_activity_statuses wias, wf_items wi

1889:
1890: -- Bug 11728665, added null statement to improve performance of c_errorX cursors.
1891: cursor c_error1 is
1892: select wi.item_key
1893: from wf_item_activity_statuses wias, wf_items wi
1894: where wi.item_type = 'WFERROR'
1895: and parent_item_type = itemtype
1896: and wi.parent_item_type = wias.item_type
1897: and wi.parent_item_key = wias.item_key

Line 1904: from wf_item_activity_statuses wias, wf_items wi

1900: and wias.activity_status = 'COMPLETE';
1901:
1902: cursor c_error2 is
1903: select wi.item_key
1904: from wf_item_activity_statuses wias, wf_items wi
1905: where wi.item_type = 'WFERROR'
1906: and parent_item_type = itemtype
1907: and parent_item_key = itemkey
1908: and wi.parent_item_type = wias.item_type

Line 1916: from wf_item_activity_statuses wias, wf_items wi

1912: and wias.activity_status = 'COMPLETE';
1913:
1914: cursor c_error3 is
1915: select wi.item_key
1916: from wf_item_activity_statuses wias, wf_items wi
1917: where wi.item_type = 'WFERROR'
1918: and wi.parent_item_type = wias.item_type
1919: and wi.parent_item_key = wias.item_key
1920: and wi.parent_context = wias.process_activity