DBA Data[Home] [Help]

PACKAGE: APPS.BEN_CWB_AUDIT_API

Source


1 Package BEN_CWB_AUDIT_API AUTHID CURRENT_USER as
2 /* $Header: beaudapi.pkh 120.4 2006/10/27 10:52:17 steotia noship $ */
3 /*#
4  * This package contains API to generate audit log for data changes in
5  * Compensation Workbench tables.
6  * The Audit log table contains records of every change event that occurs
7  * within a compensation Workbench user session, such as changing an amount,
8  * changing eligibility, or reassigning an employee. The purpose of this
9  * information is for audit reporting.
10  * @rep:scope public
11  * @rep:product PER
12  * @rep:displayname Compensation Workbench Audit Log
13 */
14 TYPE code_flag IS RECORD (
15   code   hr_lookups.lookup_code%type,
16   flag   hr_lookups.enabled_flag%type
17 );
18 TYPE g_validity_table_type IS TABLE OF code_flag;
19 
20 --
21 -- ----------------------------------------------------------------------------
22 -- |----------------------------< create_per_record >-------------------------|
23 -- ----------------------------------------------------------------------------
24 --
25 -- {Start Of Comments}
26 /*#
27  * This package contains API to create a record when a transaction occurs
28  * within Compensation Workbench.
29  *
30  * Upon a Compensation Workbench action, the action and related information are
31  * recorded for purposes of an audit reporting. This API creates audit log for
32  * persons when a compensation event for them begins.
33  *
34  * <p><b>Licensing</b><br>
35  * This API is licensed for use with Human Resources.
36  *
37  * <p><b>Prerequisites</b><br>
38  * The person in life event reason record should exist.
39  *
40  * <p><b>Post Success</b><br>
41  * The audit record will be prepared for insertion.
42  *
43  * <p><b>Post Failure</b><br>
44  * The record will not be created.
45  *
46  * @param p_per_in_ler_id {@rep:casecolumn BEN_PER_IN_LER.PER_IN_LER_ID}
47  * @rep:displayname Prepare Audit Record
48  * @rep:category BUSINESS_ENTITY BEN_CWB_AUDIT
49  * @rep:lifecycle active
50  * @rep:category MISC_EXTENSIONS HR_USER_HOOKS
51  * @rep:scope public
52  * @rep:ihelp PER/@scalapi APIs in Oracle HRMS
53 */
54 --
55 -- {End Of Comments}
56 --
57 procedure create_per_record
58   (p_per_in_ler_id       in number
59   );
60 --
61 -- ----------------------------------------------------------------------------
62 -- |----------------------------< update_per_record >-------------------------|
63 -- ----------------------------------------------------------------------------
64 --
65 -- {Start Of Comments}
66 /*#
67  * This package contains API to create a record when a transaction occurs
68  * within Compensation Workbench.
69  *
70  * Upon a Compensation Workbench action, the action and related information are
71  * recorded for purposes of an audit reporting. This API creates audit log for
72  * a person when compensation event occurs such back out event or employee
73  * reassignment.
74  *
75  * <p><b>Licensing</b><br>
76  * This API is licensed for use with Human Resources.
77  *
78  * <p><b>Prerequisites</b><br>
79  * The person in life event reason record should exist.
80  *
81  * <p><b>Post Success</b><br>
82  * The audit record will have been prepared for insertion.
83  *
84  * <p><b>Post Failure</b><br>
85  * The record will not be created.
86  *
87  * @param p_per_in_ler_id {@rep:casecolumn BEN_PER_IN_LER.PER_IN_LER_ID}
88  * @param p_old_val The old value before updating data.
89  * @param p_audit_type_cd The valid values defined by 'BEN_CWB_AUDIT_TYPE'
90  * lookup type.
91  * @rep:displayname Prepare Audit Record
92  * @rep:category BUSINESS_ENTITY BEN_CWB_AUDIT
93  * @rep:lifecycle active
94  * @rep:category MISC_EXTENSIONS HR_USER_HOOKS
95  * @rep:scope public
96  * @rep:ihelp PER/@scalapi APIs in Oracle HRMS
97 */
98 --
99 -- {End Of Comments}
100 --
101 procedure update_per_record
102   (p_per_in_ler_id      in number
103   ,p_old_val            in varchar2
104   ,p_audit_type_cd      in varchar2
105   );
106 --
107 -- ----------------------------------------------------------------------------
108 -- |----------------------------< update_per_record >-------------------------|
109 -- ----------------------------------------------------------------------------
110 --
111 -- This version of the API is now out-of-date however it has been provided to
112 -- you for backward compatibility support and will be removed in the future.
113 -- Oracle recommends you to modify existing calling programs in advance of the
114 -- support being withdrawn thus avoiding any potential disruption.
115 --
116 procedure update_per_record
117   (p_per_in_ler_id           in     ben_per_in_ler.per_in_ler_id%type
118   );
119 --
120 -- ----------------------------------------------------------------------------
121 -- |----------------------------< create_audit_entry >------------------------|
122 -- ----------------------------------------------------------------------------
123 --
124 -- {Start Of Comments}
125 /*#
126  * This package contains API to insert an audit record in the database.
127  *
128  * This created record is shown in the Audit Report page of the Compensation
129  * Workbench pages. Upon a Compensation Workbench action, the action and
130  * related information is recorded for purposes of an audit reporting.
131  *
132  * <p><b>Licensing</b><br>
133  * This API is licensed for use with Human Resources.
134  *
135  * <p><b>Prerequisites</b><br>
136  * The person in life event reason record should exist.
137  *
138  * <p><b>Post Success</b><br>
139  * The audit record will have been inserted in the database.
140  *
141  * <p><b>Post Failure</b><br>
142  * The record will not be inserted and an error will be raised.
143  *
144  * @param p_validate If true, then validation alone will be performed and the
145  * database will remain unchanged. If false and all validation checks pass,
146  * then the database will be modified.
147  * @param p_group_per_in_ler_id {@rep:casecolumn BEN_PER_IN_LER.PER_IN_LER_ID}
148  * @param p_group_pl_id {@rep:casecolumn BEN_CWB_PL_DSGN.GROUP_PL_ID}
149  * @param p_lf_evt_ocrd_dt {@rep:casecolumn BEN_PER_IN_LER.LF_EVT_OCRD_DT}
150  * @param p_pl_id This parameter specifies the Compensation Workbench Plan for
151  * which the audit record is generated.
152  * @param p_group_oipl_id {@rep:casecolumn BEN_CWB_PL_DSGN.GROUP_OIPL_ID}
153  * @param p_audit_type_cd Audit type. Valid values defined by
154  * 'BEN_CWB_AUDIT_TYPE' lookup.
155  * @param p_old_val_varchar Old value(varchar).
156  * @param p_new_val_varchar New value(varchar).
157  * @param p_old_val_number Old value(number).
158  * @param p_new_val_number New value(number).
159  * @param p_old_val_date Old value(date).
160  * @param p_new_val_date New value(date).
161  * @param p_date_stamp Datestamp of record insertion.
162  * @param p_change_made_by_person_id Person ID of the logged in person.
163  * @param p_supporting_information Miscellaneous information for record.
164  * @param p_request_id When the API is executed from a concurrent program set
165  * to the concurrent request identifier.
166  * @param p_cwb_audit_id Sequence generated primary key.
167  * @param p_object_version_number If p_validate is false, then set to the
168  * version number of the created audit record. If p_validate is true, then the
169  * value will be null.
170  * @rep:displayname Create Audit Record in the Database
171  * @rep:category BUSINESS_ENTITY BEN_CWB_AUDIT
172  * @rep:lifecycle active
173  * @rep:category MISC_EXTENSIONS HR_USER_HOOKS
174  * @rep:scope public
175  * @rep:ihelp PER/@scalapi APIs in Oracle HRMS
176 */
177 --
178 -- {End Of Comments}
179 --
180 procedure create_audit_entry
181   (p_validate                      in     boolean    default false
182   ,p_group_per_in_ler_id           in     number
183   ,p_group_pl_id                   in     number
184   ,p_lf_evt_ocrd_dt                in     date
185   ,p_pl_id                         in     number
186   ,p_group_oipl_id                 in     number     default null
187   ,p_audit_type_cd                 in     varchar2
188   ,p_old_val_varchar               in     varchar2   default null
189   ,p_new_val_varchar               in     varchar2   default null
190   ,p_old_val_number                in     number     default null
191   ,p_new_val_number                in     number     default null
192   ,p_old_val_date                  in     date       default null
193   ,p_new_val_date                  in     date       default null
194   ,p_date_stamp                    in     date       default null
195   ,p_change_made_by_person_id      in     number     default null
196   ,p_supporting_information        in     varchar2   default null
197   ,p_request_id                    in     number     default null
198   ,p_cwb_audit_id                  out nocopy     number
199   ,p_object_version_number         out nocopy     number
200   );
201 --
202 -- ----------------------------------------------------------------------------
203 -- |----------------------------< update_audit_entry >------------------------|
204 -- ----------------------------------------------------------------------------
205 --
206 -- {Start Of Comments}
207 /*#
208  * This package contains API to update an audit record in the database.
209  *
210  * This updated record is shown in the Audit Report page of the Compensation
211  * Workbench pages. Upon a Compensation Workbench action, the action and
212  * related information is recorded for purposes of an audit reporting.
213  *
214  * <p><b>Licensing</b><br>
215  * This API is licensed for use with Human Resources.
216  *
217  * <p><b>Prerequisites</b><br>
218  * The person in life event reason record should exist.
219  *
220  * <p><b>Post Success</b><br>
221  * The audit record will have been updated in the database.
222  *
223  * <p><b>Post Failure</b><br>
224  * The record will not be updated and an error will be raised.
225  *
226  * @param p_validate If true, then validation alone will be performed and the
227  * database will remain unchanged. If false and all validation checks pass,
228  * then the database will be modified.
229  * @param p_cwb_audit_id Sequence generated primary key.
230  * @param p_group_per_in_ler_id {@rep:casecolumn BEN_PER_IN_LER.PER_IN_LER_ID}
231  * @param p_group_pl_id {@rep:casecolumn BEN_CWB_PL_DSGN.GROUP_PL_ID}
232  * @param p_lf_evt_ocrd_dt {@rep:casecolumn BEN_PER_IN_LER.LF_EVT_OCRD_DT}
233  * @param p_pl_id This parameter specifies the Compensation Workbench Plan for
234  * which the audit record is generated.
235  * @param p_group_oipl_id {@rep:casecolumn BEN_CWB_PL_DSGN.GROUP_OIPL_ID}
236  * @param p_audit_type_cd Audit type. Valid values defined by
237  * 'BEN_CWB_AUDIT_TYPE' lookup type.
238  * @param p_old_val_varchar Old value(varchar).
239  * @param p_new_val_varchar New value(varchar).
240  * @param p_old_val_number Old value(number).
241  * @param p_new_val_number New value(number).
242  * @param p_old_val_date Old value(date).
243  * @param p_new_val_date New value(date).
244  * @param p_date_stamp Datestamp of record insertion.
245  * @param p_change_made_by_person_id Person ID of the logged in person.
246  * @param p_supporting_information Miscellaneous information for record.
247  * @param p_request_id When the API is executed from a concurrent program set
248  * to the concurrent request identifier.
249  * @param p_object_version_number Pass in the current version number of the
250  * audit record to be updated. When the API completes if p_validate is false,
251  * will be set to the new version number of the updated audit record. If
252  * p_validate is true will be set to the same value which was passed in.
253  * @rep:displayname Update Audit Record in the Database
254  * @rep:category BUSINESS_ENTITY BEN_CWB_AUDIT
255  * @rep:lifecycle active
256  * @rep:category MISC_EXTENSIONS HR_USER_HOOKS
257  * @rep:scope public
258  * @rep:ihelp PER/@scalapi APIs in Oracle HRMS
259 */
260 --
261 -- {End Of Comments}
262 --
263 procedure update_audit_entry
264   (p_validate                      in     boolean  default false
265   ,p_cwb_audit_id                  in     number
266   ,p_group_per_in_ler_id           in     number
267   ,p_group_pl_id                   in     number
268   ,p_lf_evt_ocrd_dt                in     date
269   ,p_pl_id                         in     number
270   ,p_group_oipl_id                 in     number   default hr_api.g_number
271   ,p_audit_type_cd                 in     varchar2
272   ,p_old_val_varchar               in     varchar2 default hr_api.g_varchar2
273   ,p_new_val_varchar               in     varchar2 default hr_api.g_varchar2
274   ,p_old_val_number                in     number   default hr_api.g_number
275   ,p_new_val_number                in     number   default hr_api.g_number
276   ,p_old_val_date                  in     date     default hr_api.g_date
277   ,p_new_val_date                  in     date     default hr_api.g_date
278   ,p_date_stamp                    in     date     default hr_api.g_date
279   ,p_change_made_by_person_id      in     number   default hr_api.g_number
280   ,p_supporting_information        in     varchar2 default hr_api.g_varchar2
281   ,p_request_id                    in     number   default hr_api.g_number
282   ,p_object_version_number         in out nocopy   number
283   );
284 --
285 -- ----------------------------------------------------------------------------
286 -- |----------------------------< delete_audit_entry >------------------------|
287 -- ----------------------------------------------------------------------------
288 --
289 -- {Start Of Comments}
290 /*#
291  * This package contains API to delete an audit record in the database.
292  *
293  * This deleted record will not display in the Audit Report pages of
294  * Compensation Workbench pages.
295  *
296  * <p><b>Licensing</b><br>
297  * This API is licensed for use with Human Resources.
298  *
299  * <p><b>Prerequisites</b><br>
300  * The audit record must exist.
301  *
302  * <p><b>Post Success</b><br>
303  * The audit record will have been deleted from the database.
304  *
305  * <p><b>Post Failure</b><br>
306  * The record will not be updated and an error will be raised.
307  *
308  * @param p_validate If true, then validation alone will be performed and the
309  * database will remain unchanged. If false and all validation checks pass,
310  * then the database will be modified.
311  * @param p_cwb_audit_id Sequence generated primary key.
312  * @param p_object_version_number If p_validate is false, then set to the
313  * version number of the created person. If p_validate is true, then the value
314  * will be null.
315  * @rep:displayname Delete Audit Record in the Database
316  * @rep:category BUSINESS_ENTITY BEN_CWB_AUDIT
317  * @rep:lifecycle active
318  * @rep:category MISC_EXTENSIONS HR_USER_HOOKS
319  * @rep:scope public
320  * @rep:ihelp PER/@scalapi APIs in Oracle HRMS
321 */
322 --
323 -- {End Of Comments}
324 --
325 procedure delete_audit_entry
326   (p_validate                      in     boolean  default false
327   ,p_cwb_audit_id                  in     number
328   ,p_object_version_number         in out nocopy   number
329   );
330 --
331 -- ----------------------------------------------------------------------------
332 -- |----------------------------< return_column_code >------------------------|
333 -- ----------------------------------------------------------------------------
334 --
335 -- {Start Of Comments}
336 /*#
337  * The API returns 1 for char, 2 for number and 3 for date type.
338  *
339  * The return data type is used for mapping the audit type to the relevant
340  * datatype of value modified. This information is used to pick the matching
341  * attribute from the BEN_CWB_AUDIT table into the Audit Report in Compensation
342  * Workbench pages.
343  *
344  * <p><b>Licensing</b><br>
345  * This API is licensed for use with Human Resources.
346  *
347  * <p><b>Prerequisites</b><br>
348  * The lookup code should be a valid audit type defined in the
349  * 'BEN_CWB_AUDIT_TYPE' lookup.
350  *
351  * <p><b>Post Success</b><br>
352  * A non null number will be returned.
353  *
354  * <p><b>Post Failure</b><br>
355  * A Null number will be returned.
356  *
357  * @param p_lookup_code Audit type. Valid values defined by
358  * 'BEN_CWB_AUDIT_TYPE' lookup type.
359  * @return The API returns a code to identify the datatype of the attribute whose change triggered the audit event. The API returns 1 for character, 2 for number and 3 for date type.
360  * @rep:displayname Return Datatype of Audited Value
361  * @rep:category BUSINESS_ENTITY BEN_CWB_AUDIT
362  * @rep:lifecycle active
363  * @rep:category MISC_EXTENSIONS HR_USER_HOOKS
364  * @rep:scope public
365 */
366 --
367 -- {End Of Comments}
368 --
369 function return_column_code
370   (p_lookup_code                in     varchar2
371   )return number;
372 --
373 -- ----------------------------------------------------------------------------
374 -- |--------------------------< return_lookup_validity >----------------------|
375 -- ----------------------------------------------------------------------------
376 --
377 -- {Start Of Comments}
378 /*#
379  * Returns true if audit triggering event is not end dated or is disabled,
380  * otherwise returns false.
381  *
382  * The validity of audit triggering events are controlled by the state of
383  * lookup codes in 'BEN_CWB_AUDIT_TYPE' lookup. The API queries the database
384  * and returns this state. Only on the return value being true is further
385  * processing performed for insertion of audit record.
386  *
387  * <p><b>Licensing</b><br>
388  * This API is licensed for use with Human Resources.
389  *
390  * <p><b>Prerequisites</b><br>
391  * Lookup code should be defined in 'BEN_CWB_AUDIT_TYPE' Lookup
392  *
393  * <p><b>Post Success</b><br>
394  * Returns true if lookup_code is not end dated or disabled and false if
395  * otherwise
396  *
397  * <p><b>Post Failure</b><br>
398  * Returns false
399  *
400  * @param p_lookup_code lookup code.
401  * @return The API returns the validity of triggered audit event. If valid it returns true otherwise false.
402  * @rep:displayname Return Validity of Audit Event
403  * @rep:category BUSINESS_ENTITY BEN_CWB_AUDIT
404  * @rep:lifecycle active
405  * @rep:category MISC_EXTENSIONS HR_USER_HOOKS
406  * @rep:scope public
407 */
408 --
409 -- {End Of Comments}
410 --
411 function return_lookup_validity
412   (p_lookup_code                in     varchar2
413   )return boolean;
414 end BEN_CWB_AUDIT_API;