DBA Data[Home] [Help]

PACKAGE: APPS.WF_PURGE

Source


1 package WF_PURGE as
2 /* $Header: wfprgs.pls 120.4.12000000.2 2007/08/08 11:52:54 hgandiko 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 );
232 
233 --
234 -- TotalPERM
235 --   Delete all obsolete runtime data that is of persistence type 'PERM'
236 --   and with end_time before argument.
237 -- IN:
238 --   itemtype - Item type to delete, or null for all itemtypes
239 --   itemkey - Item key to delete, or null for all itemkeys
240 --   enddate - Date to obsolete to
241 --   docommit- Commit or no commit after each purge of entitiy
242 --   runtimeonly - Delete runtime data alone if set to true
243 --                 else delete both design and runtime data
244 --   purgesigs- Do not delete digitally signed notifications if not set to 1
245 --
246 --
247 /*#
248  * Deletes all runtime data associated with
249  * completed items for the specified item type
250  * and item key that have a persistence type of
251  * Permanent ('PERM') and an end date earlier
252  * than or equal to the specified end date. By
253  * default, the procedure also purges expired
254  * ad hoc users and roles, obsolete activity versions,
255  * and obsolete runtime data for notifications and XML
256  * Gateway transactions that are not associated with
257  * a work item. You can optionally restrict the procedure
258  * to purge only runtime data associated with work items.
259  * @param itemtype Item Type
260  * @param itemkey Item Key
261  * @param enddate End Date
262  * @param docommit Commit Data
263  * @param runtimeonly Purge Work Item Data Only
264  * @param purgesigs Purge Digitally Signed Notifications
265  * @rep:scope public
266  * @rep:lifecycle active
267  * @rep:displayname Total Purge
268  * @rep:ihelp FND/@wfpurge#a_totprm See the related online help
269  */
270 
271 procedure TotalPERM(
272   itemtype in varchar2 default null,
273   itemkey in varchar2 default null,
274   enddate in date default sysdate,
275   docommit in boolean default true,
276   runtimeonly in boolean default null,
277   purgesigs in pls_integer default null);
278 
279 --
280 -- TotalConcurrent
281 --   Concurrent Program version of Total
282 -- IN:
283 --   errbuf - CPM error message
284 --   retcode - CPM return code (0 = success, 1 = warning, 2 = error)
285 --   itemtype - Item type to delete, or null for all itemtypes
286 --   itemkey - Item key to delete, or null for all itemkeys
287 --   age - Minimum age of data to purge (in days)
288 --   x_persistence_type - Persistence Type to be purged: 'TEMP' or 'PERM'
289 --   purgesigs- Do not delete digitally signed notifications if not set to Y
290 --
291 procedure TotalConcurrent(
292   errbuf out NOCOPY varchar2,
293   retcode out NOCOPY varchar2,
294   itemtype in varchar2 default null,
295   itemkey in varchar2 default null,
296   age in varchar2 default '0',
297   x_persistence_type in varchar2 default 'TEMP',
298   runtimeonly  in varchar2 default 'N',
299   x_commit_frequency in number default 500,
300   purgesigs in varchar2 default null
301   );
302 
303 --
304 -- Directory
305 --   Purge all WF_LOCAL_* tables based on expiration date
306 -- IN:
307 --   end_date - Date to purge to
308 --
309 /*#
310  * Purges all users and roles in the Workflow
311  * local directory service tables whose expiration
312  * date is earlier than or equal to the specified
313  * end date and that are not referenced in
314  * any notification.
315  * @param end_date End Date
316  * @param orig_system Originating System
317  * @rep:scope public
318  * @rep:lifecycle active
319  * @rep:displayname Purge Roles
320  * @rep:ihelp FND/@wfpurge#a_prgdir See the related online help
321  */
322 
323 procedure Directory(
324   end_date in date default sysdate,
325   orig_system in varchar2 default null);
326 
327 --
328 -- AdHocDirectory
329 --   Purge all WF_LOCAL_* tables based on expiration date
330 --   Call procedure Directory instead
331 -- IN:
332 --   end_date - Date to purge to
333 --
334 procedure AdHocDirectory(
335   end_date in date default sysdate);
336 
337 
338  --
339  -- GetPurgeableCount
340  --   Returns the count of purgeable items for a specific itemType.
341  -- IN:
342  --   p_itemType  in VARCHAR2
343  --
344  function GetPurgeableCount (p_itemType in varchar2) return number;
345 
346  --
347  -- AbortErrorProcess
348  -- Abort the WFERROR process if activity is COMPLETE
349  -- IN:
350  -- itemtype - Item type to move, or null for all itemtypes
351  --   itemkey - Item key to move, or null for all itemkeys
352  procedure AbortErrorProcess(itemtype in varchar2 default null,
353                             itemkey in varchar2 default null);
354 
355 
356 
357 end WF_PURGE;