DBA Data[Home] [Help]

PACKAGE: APPS.WF_PURGE

Source


1 package WF_PURGE AUTHID CURRENT_USER as
2 /* $Header: wfprgs.pls 120.6.12020000.2 2013/02/01 17:37:10 alsosa ship $ */
3 /*#
4  * Provides APIs to purge obsolete runtime data for
5  * completed items and processes, design information
6  * for obsolete activity versions that are no longer in
7  * use, and expired users and roles. Periodically purging
8  * obsolete data from your system increases performance.
9  * @rep:scope public
10  * @rep:product OWF
11  * @rep:displayname Workflow Purge
12  * @rep:lifecycle active
13  * @rep:compatibility S
14  * @rep:category BUSINESS_ENTITY WF_ENGINE
15  * @rep:category BUSINESS_ENTITY WF_NOTIFICATION
16  * @rep:category BUSINESS_ENTITY WF_USER
17  * @rep:ihelp FND/@wfpurge See the related online help
18  */
19 
20 --
21 -- Persistence Type Mode
22 -- Setting this variable to 'PERM' or 'TEMP' will affect the purging
23 -- routines to purge different persistence type objects.
24 --
25 persistence_type varchar2(8) := 'TEMP';
26 
27 --
28 -- Commit Frequency: Default - commit every 500 records.
29 -- This variable can be changed as needed to control rollback segment
30 -- growth against performance.
31 --
32 commit_frequency number := 1000;
33 
34 -- procedure Move_To_History
35 --   Move wf_item_activity_status rows for particular itemtype/key from
36 --   main table to history table.
37 -- IN:
38 --   itemtype - Item type to move, or null for all itemtypes
39 --   itemkey - Item key to move, or null for all itemkeys
40 --
41 
42 -- Global tables accessed by ECX, WF Purge APIs
43 TYPE itemtypeTAB IS TABLE OF VARCHAR2(8) INDEX BY BINARY_INTEGER;
44 TYPE itemkeyTAB IS TABLE OF VARCHAR2(240) INDEX BY BINARY_INTEGER;
45 TYPE enddateTAB IS TABLE OF DATE INDEX BY BINARY_INTEGER;
46 
47 l_itemtypeTAB itemtypeTAB;
48 l_itemkeyTAB  itemkeyTAB;
49 l_enddateTAB  enddateTAB;
50 
51 procedure Move_To_History(
52   itemtype in varchar2 default null,
53   itemkey in varchar2 default null);
54 
55 -- procedure Item_Activity_Statuses
56 --   Delete from wf_item_activity_statuses and wf_item_activity_statuses_h
57 --   where end_date before argument.
58 -- IN:
59 --   itemtype - Item type to delete, or null for all itemtypes
60 --   itemkey - Item key to delete, or null for all itemkeys
61 --   enddate - Date to obsolete to
62 --
63 procedure Item_Activity_Statuses(
64   itemtype in varchar2 default null,
65   itemkey in varchar2 default null,
66   enddate in date default sysdate);
67 
68 --
69 -- procedure Items
70 --   Delete items with end_time before argument.
71 -- IN:
72 --   itemtype - Item type to delete, or null for all itemtypes
73 --   itemkey - Item key to delete, or null for all itemkeys
74 --   enddate - Date to obsolete to
75 --   docommit- Do not commit if set to false
76 --   force - delete child records even if parent is not end dated
77 --   purgesigs- Do not delete digitally signed notifications if not set to 1
78 --
79 /*#
80  * Deletes all runtime data associated with completed
81  * items for the specified item type, item key, and
82  * end date, including process status information and
83  * notifications associated with those items.
84  * @param itemtype Item Type
85  * @param itemkey Item Key
86  * @param enddate End Date
87  * @param docommit Commit Data
88  * @param force Force Purge of Child Items
89  * @param purgesigs Purge Digitally Signed Notifications
90  * @rep:scope public
91  * @rep:lifecycle active
92  * @rep:displayname Purge Items
93  * @rep:ihelp FND/@wfpurge#a_items See the related online help
94  */
95 
96 procedure Items(
97   itemtype in varchar2 default null,
98   itemkey in varchar2 default null,
99   enddate in date default sysdate,
100   docommit in boolean default true,
101   force in boolean default false,
102   purgesigs in pls_integer default null);
103 
104 --
105 -- procedure Activities
106 --   Delete old activity versions with end_time before argument,
107 --   and that are not referenced by an existing item.
108 -- IN:
109 --   itemtype - Item type to delete, or null for all itemtypes
110 --   name - Activity to delete, or null for all activities
111 --   enddate - Date to obsolete to
112 -- NOTE:
113 --   It is recommended to purge Items before purging Activities to avoid
114 --   obsolete item references preventing obsolete activities from being
115 --   deleted.
116 --
117 /*#
118  * Deletes obsolete versions of activities that
119  * are associated with the specified item type,
120  * have an end date earlier than or equal to the
121  * specified end date, and are not referenced by
122  * an existing item as either a process or activity.
123  * @param itemtype Item Type
124  * @param name Activity Internal Name
125  * @param enddate End Date
126  * @rep:scope public
127  * @rep:lifecycle active
128  * @rep:displayname Purge Activity
129  * @rep:ihelp FND/@wfpurge#a_act See the related online help
130  */
131 
132 procedure Activities(
133   itemtype in varchar2 default null,
134   name in varchar2 default null,
135   enddate in date default sysdate);
136 
137 --
138 -- procedure Notifications
139 --   Delete old notifications with end_time before argument,
140 --   and that are not referenced by an existing item.
141 -- IN:
142 --   itemtype - Item type to delete, or null for all itemtypes
143 --   enddate - Date to obsolete to
144 --   docommit- Do not commit if set to false
145 --   purgesigs- Do not delete digitally signed notifications if not set to 1
146 -- NOTE:
147 --   It is recommended to purge Items before purging Notifications to avoid
148 --   obsolete item references preventing obsolete notifications from being
149 --   deleted.
150 --
151 /*#
152  * Deletes obsolete notifications that are associated
153  * with the specified item type, have an end date earlier
154  * than or equal to the specified end date,and are not
155  * referenced by an existing item.
156  * @param itemtype Item Type
157  * @param enddate End Date
158  * @param docommit Commit Data
159  * @param purgesigs Purge Digitally Signed Notifications
160  * @rep:scope public
161  * @rep:lifecycle active
162  * @rep:displayname Purge Notifications
163  * @rep:ihelp FND/@wfpurge#a_notif See the related online help
164  */
165 
166 procedure Notifications(
167   itemtype in varchar2 default null,
168   enddate in date default sysdate,
169   docommit in boolean default true,
170   purgesigs in pls_integer default null);
171 
172 --
173 -- procedure Item_Notifications
174 --   Delete notifications sent by a particular item with end_time
175 --   before argument.
176 -- IN:
177 --   itemtype - Item type to delete, or null for all itemtypes
178 --   itemkey - Item key to delete, or null for all itemkeys
179 --   enddate - Date to obsolete to
180 --   docommit- Do not commit if set to false
181 --
182 procedure Item_Notifications(
183   itemtype in varchar2 default null,
184   itemkey in varchar2 default null,
185   enddate in date default sysdate,
186   docommit in boolean default true);
187 
188 --
189 -- Total
190 --   Delete all obsolete runtime data with end_time before argument.
191 -- IN:
192 --   itemtype - Item type to delete, or null for all itemtypes
193 --   itemkey - Item key to delete, or null for all itemkeys
194 --   enddate - Date to obsolete to
195 --   docommit- Commit or no commit after each purge of entitiy
196 --   runtimeonly - Delete runtime data alone if set to true
197 --             else delete both design and runtime data
198 --   purgesigs- Do not delete digitally signed notifications if not set to 1
199 --
200 /*#
201  * Deletes all runtime data associated with
202  * completed items for the specified item type,
203  * item key, and XML Gateway transaction type
204  * and subtype,with an end date earlier than or
205  * equal to the specified end date. By default,
206  * the procedure also purges expired ad hoc users
207  * and roles, obsolete activity versions, and obsolete
208  * runtime data for notifications and XML Gateway
209  * transactions that are not associated with a work item.
210  * You can optionally restrict the procedure to purge
211  * only runtime data associated with work items.
212  * @param itemtype Item Type
213  * @param itemkey Item Key
214  * @param enddate End Date
215  * @param docommit Commit Data
216  * @param runtimeonly Purge Work Item Data Only
217  * @param purgesigs Purge Digitally Signed Notifications
218  * @rep:scope public
219  * @rep:lifecycle active
220  * @rep:displayname Total Purge
221  * @rep:ihelp FND/@wfpurge#a_total See the related online help
222  */
223 
224 procedure Total(
225   itemtype in varchar2 default null,
226   itemkey in varchar2 default null,
227   enddate in date default sysdate,
228   docommit in boolean default true,
229   runtimeonly  in boolean default null,
230   purgesigs in pls_integer default null,
231   purgeCacheData in boolean default false
232 );
233 
234 -- procedure entity_changes
235 --   Purges data from table WF_ENTITY_CHANGES as per the AGE parameter passed
236 --   to concurrent program FNDWFPRG. Introduced as per bug 9394309
237 -- IN: enddate - anything before this date is to be removed
238 --
239 procedure entity_changes(p_enddate date);
240 
241 --
242 -- TotalPERM
243 --   Delete all obsolete runtime data that is of persistence type 'PERM'
244 --   and with end_time before argument.
245 -- IN:
246 --   itemtype - Item type to delete, or null for all itemtypes
247 --   itemkey - Item key to delete, or null for all itemkeys
248 --   enddate - Date to obsolete to
249 --   docommit- Commit or no commit after each purge of entitiy
250 --   runtimeonly - Delete runtime data alone if set to true
251 --                 else delete both design and runtime data
252 --   purgesigs- Do not delete digitally signed notifications if not set to 1
253 --
254 --
255 /*#
256  * Deletes all runtime data associated with
257  * completed items for the specified item type
258  * and item key that have a persistence type of
259  * Permanent ('PERM') and an end date earlier
260  * than or equal to the specified end date. By
261  * default, the procedure also purges expired
262  * ad hoc users and roles, obsolete activity versions,
263  * and obsolete runtime data for notifications and XML
264  * Gateway transactions that are not associated with
265  * a work item. You can optionally restrict the procedure
266  * to purge only runtime data associated with work items.
267  * @param itemtype Item Type
268  * @param itemkey Item Key
269  * @param enddate End Date
270  * @param docommit Commit Data
271  * @param runtimeonly Purge Work Item Data Only
272  * @param purgesigs Purge Digitally Signed Notifications
273  * @rep:scope public
274  * @rep:lifecycle active
275  * @rep:displayname Total Purge
276  * @rep:ihelp FND/@wfpurge#a_totprm See the related online help
277  */
278 
279 procedure TotalPERM(
280   itemtype in varchar2 default null,
281   itemkey in varchar2 default null,
282   enddate in date default sysdate,
283   docommit in boolean default true,
284   runtimeonly in boolean default null,
285   purgesigs in pls_integer default null);
286 
287 --
288 -- TotalConcurrent
289 --   Concurrent Program version of Total
290 -- IN:
291 --   errbuf - CPM error message
292 --   retcode - CPM return code (0 = success, 1 = warning, 2 = error)
293 --   itemtype - Item type to delete, or null for all itemtypes
294 --   itemkey - Item key to delete, or null for all itemkeys
295 --   age - Minimum age of data to purge (in days)
296 --   x_persistence_type - Persistence Type to be purged: 'TEMP' or 'PERM'
297 --   purgesigs- Do not delete digitally signed notifications if not set to Y
298 --
299 procedure TotalConcurrent(
300   errbuf out NOCOPY varchar2,
301   retcode out NOCOPY varchar2,
302   itemtype in varchar2 default null,
303   itemkey in varchar2 default null,
304   age in varchar2 default '0',
305   x_persistence_type in varchar2 default 'TEMP',
306   runtimeonly  in varchar2 default 'N',
307   x_commit_frequency in number default 500,
308   purgesigs in varchar2 default null,
309   purgeCacheData in varchar2 default null
310   );
311 
312 --
313 -- Directory
314 --   Purge all WF_LOCAL_* tables based on expiration date
315 -- IN:
316 --   end_date - Date to purge to
317 --
318 /*#
319  * Purges all users and roles in the Workflow
320  * local directory service tables whose expiration
321  * date is earlier than or equal to the specified
322  * end date and that are not referenced in
323  * any notification. If parameter autocommit is passed
324  * the DML operations will be commited every certain
325  * number fo rows.
326  * @param end_date End Date
327  * @param orig_system Originating System
328  * @param autocommit Auto commit
329  * @rep:scope public
330  * @rep:lifecycle active
331  * @rep:displayname Purge Roles
332  * @rep:ihelp FND/@wfpurge#a_prgdir See the related online help
333  */
334 
335 procedure Directory(
336   end_date in date default sysdate,
337   orig_system in varchar2 default null,
338   autocommit in boolean default false);
339 
340 --
341 -- AdHocDirectory
342 --   Purge all WF_LOCAL_* tables based on expiration date
343 --   Call procedure Directory instead
344 -- IN:
345 --   end_date - Date to purge to
346 --
347 procedure AdHocDirectory(
348   end_date in date default sysdate);
349 
350 
351  --
352  -- GetPurgeableCount
353  --   Returns the count of purgeable items for a specific itemType.
354  -- IN:
355  --   p_itemType  in VARCHAR2
356  --
357  function GetPurgeableCount (p_itemType in varchar2) return number;
358 
359  --
360  -- AbortErrorProcess
361  -- Abort the WFERROR process if activity is COMPLETE
362  -- IN:
363  -- itemtype - Item type to move, or null for all itemtypes
364  --   itemkey - Item key to move, or null for all itemkeys
365  procedure AbortErrorProcess(itemtype in varchar2 default null,
366                             itemkey in varchar2 default null);
367 
368 
369 
370 end WF_PURGE;