DBA Data[Home] [Help]

PACKAGE: APPS.BEN_ADS_SHD

Source


1 Package ben_ads_shd as
2 /* $Header: beadsrhi.pkh 120.0.12010000.1 2008/07/29 10:48:42 appldev ship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                    Global Record Type Specification                      |
6 -- ----------------------------------------------------------------------------
7 --
8 Type g_rec_type Is Record
9   (
10   acty_rt_ded_sched_id              number(15),
11   effective_start_date              date,
12   effective_end_date                date,
13   business_group_id                 number(15),
14   ded_sched_py_freq_id              number(15),
15   acty_base_rt_id                   number(15),
16   ded_sched_rl                      number(15),
17   ded_sched_cd                      varchar2(30),
18   ads_attribute_category            varchar2(30),
19   ads_attribute1                    varchar2(150),
20   ads_attribute2                    varchar2(150),
21   ads_attribute3                    varchar2(150),
22   ads_attribute4                    varchar2(150),
23   ads_attribute5                    varchar2(150),
24   ads_attribute6                    varchar2(150),
25   ads_attribute7                    varchar2(150),
26   ads_attribute8                    varchar2(150),
27   ads_attribute9                    varchar2(150),
28   ads_attribute10                   varchar2(150),
29   ads_attribute11                   varchar2(150),
30   ads_attribute12                   varchar2(150),
31   ads_attribute13                   varchar2(150),
32   ads_attribute14                   varchar2(150),
33   ads_attribute15                   varchar2(150),
34   ads_attribute16                   varchar2(150),
35   ads_attribute17                   varchar2(150),
36   ads_attribute18                   varchar2(150),
37   ads_attribute19                   varchar2(150),
38   ads_attribute20                   varchar2(150),
39   ads_attribute21                   varchar2(150),
40   ads_attribute22                   varchar2(150),
41   ads_attribute23                   varchar2(150),
42   ads_attribute24                   varchar2(150),
43   ads_attribute25                   varchar2(150),
44   ads_attribute26                   varchar2(150),
45   ads_attribute27                   varchar2(150),
46   ads_attribute28                   varchar2(150),
47   ads_attribute29                   varchar2(150),
48   ads_attribute30                   varchar2(150),
49   object_version_number             number(9)
50   );
51 --
52 -- ----------------------------------------------------------------------------
53 -- |           Global Definitions - Internal Development Use Only             |
54 -- ----------------------------------------------------------------------------
55 --
56 g_old_rec  g_rec_type;                            -- Global record definition
57 g_api_dml  boolean;                               -- Global api dml status
58 --
59 -- ----------------------------------------------------------------------------
60 -- |------------------------< return_api_dml_status >-------------------------|
61 -- ----------------------------------------------------------------------------
62 -- {Start Of Comments}
63 --
64 -- Description:
65 --   This function will return the current g_api_dml private global
66 --   boolean status.
67 --   The g_api_dml status determines if at the time of the function
68 --   being executed if a dml statement (i.e. INSERT, UPDATE or DELETE)
69 --   is being issued from within an api.
70 --   If the status is TRUE then a dml statement is being issued from
71 --   within this entity api.
72 --   This function is primarily to support database triggers which
73 --   need to maintain the object_version_number for non-supported
74 --   dml statements (i.e. dml statement issued outside of the api layer).
75 --
76 -- Prerequisites:
77 --   None.
78 --
79 -- In Parameters:
80 --   None.
81 --
82 -- Post Success:
83 --   Processing continues.
84 --   If the function returns a TRUE value then, dml is being executed from
85 --   within this api.
86 --
87 -- Post Failure:
88 --   None.
89 --
90 -- Access Status:
91 --   Internal Row Handler Use Only.
92 --
93 -- {End Of Comments}
94 -- ----------------------------------------------------------------------------
95 Function return_api_dml_status Return Boolean;
96 --
97 -- ----------------------------------------------------------------------------
98 -- |---------------------------< constraint_error >---------------------------|
99 -- ----------------------------------------------------------------------------
100 -- {Start Of Comments}
101 --
102 -- Description:
103 --   This procedure is called when a constraint has been violated (i.e.
104 --   The exception hr_api.check_integrity_violated,
105 --   hr_api.parent_integrity_violated, hr_api.child_integrity_violated or
106 --   hr_api.unique_integrity_violated has been raised).
107 --   The exceptions can only be raised as follows:
108 --   1) A check constraint can only be violated during an INSERT or UPDATE
109 --      dml operation.
110 --   2) A parent integrity constraint can only be violated during an
111 --      INSERT or UPDATE dml operation.
112 --   3) A child integrity constraint can only be violated during an
113 --      DELETE dml operation.
114 --   4) A unique integrity constraint can only be violated during INSERT or
115 --      UPDATE dml operation.
116 --
117 -- Prerequisites:
118 --   1) Either hr_api.check_integrity_violated,
119 --      hr_api.parent_integrity_violated, hr_api.child_integrity_violated or
120 --      hr_api.unique_integrity_violated has been raised with the subsequent
121 --      stripping of the constraint name from the generated error message
122 --      text.
123 --   2) Standalone validation test which corresponds with a constraint error.
124 --
125 -- In Parameter:
126 --   p_constraint_name is in upper format and is just the constraint name
127 --   (e.g. not prefixed by brackets, schema owner etc).
128 --
129 -- Post Success:
130 --   Development dependant.
131 --
132 -- Post Failure:
133 --   Developement dependant.
134 --
135 -- Developer Implementation Notes:
136 --   For each constraint being checked the hr system package failure message
137 --   has been generated as a template only. These system error messages should
138 --   be modified as required (i.e. change the system failure message to a user
139 --   friendly defined error message).
140 --
141 -- Access Status:
142 --   Internal Development Use Only.
143 --
144 -- {End Of Comments}
145 -- ----------------------------------------------------------------------------
146 Procedure constraint_error
147             (p_constraint_name in all_constraints.constraint_name%TYPE);
148 --
149 -- ----------------------------------------------------------------------------
150 -- |-----------------------------< api_updating >-----------------------------|
151 -- ----------------------------------------------------------------------------
152 -- {Start Of Comments}
153 --
154 -- Description:
155 --   This function is used to populate the g_old_rec record with the current
156 --   row from the database for the specified primary key provided that the
157 --   primary key exists, and is valid, and does not already match the current
158 --   g_old_rec.
159 --   The function will always return a TRUE value if the g_old_rec is
160 --   populated with the current row. A FALSE value will be returned if all of
161 --   the primary key arguments are null.
162 --
163 -- Prerequisites:
164 --   None.
165 --
166 -- In Parameters:
167 --
168 -- Post Success:
169 --   A value of TRUE will be returned indiciating that the g_old_rec is
170 --   current.
171 --   A value of FALSE will be returned if all of the primary key arguments
172 --   have a null value (this indicates that the row has not be inserted into
173 --   the Schema), and therefore could never have a corresponding row.
174 --
175 -- Post Failure:
176 --   A failure can only occur under two circumstances:
177 --   1) The primary key is invalid (i.e. a row does not exist for the
178 --      specified primary key values).
179 --   2) If an object_version_number exists but is NOT the same as the current
180 --      g_old_rec value.
181 --
182 -- Developer Implementation Notes:
183 --   None.
184 --
185 -- Access Status:
186 --   Internal Development Use Only.
187 --
188 -- {End Of Comments}
189 -- ----------------------------------------------------------------------------
190 Function api_updating
191   (p_effective_date		in date,
192    p_acty_rt_ded_sched_id		in number,
193    p_object_version_number	in number
194   ) Return Boolean;
195 --
196 -- ----------------------------------------------------------------------------
197 -- |--------------------------< find_dt_del_modes >---------------------------|
198 -- ----------------------------------------------------------------------------
199 -- {Start Of Comments}
200 --
201 -- Description:
202 --   This procedure is used to determine what datetrack delete modes are
203 --   allowed as of the effective date for this entity. The procedure will
204 --   return a corresponding Boolean value for each of the delete modes
205 --   available where TRUE indicates that the corresponding delete mode is
206 --   available.
207 --
208 -- Prerequisites:
209 --   None.
210 --
211 -- In Parameters:
212 --   p_effective_date
213 --     Specifies the date at which the datetrack modes will be operated on.
214 --   p_base_key_value
215 --     Specifies the primary key value for this datetrack entity.
216 --     (E.g. For this entity the assignment of the argument would be:
217 --           p_base_key_value = :acty_rt_ded_sched_id).
218 --
219 -- Post Success:
220 --   Processing continues.
221 --
222 -- Post Failure:
223 --   Failure might occur if for the specified effective date and primary key
224 --   value a row doesn't exist.
225 --
226 -- Developer Implementation Notes:
227 --   This procedure could require changes if this entity has any sepcific
228 --   delete restrictions.
229 --   For example, this entity might disallow the datetrack delete mode of
230 --   ZAP. To implement this you would have to set and return a Boolean value
231 --   of FALSE after the call to the dt_api.find_dt_del_modes procedure.
232 --
233 -- Access Status:
234 --   Internal Development Use Only.
235 --
236 -- {End Of Comments}
237 -- ----------------------------------------------------------------------------
238 Procedure find_dt_del_modes
239 	(p_effective_date	in  date,
240 	 p_base_key_value	in  number,
241 	 p_zap		 out nocopy boolean,
242 	 p_delete	 out nocopy boolean,
243 	 p_future_change out nocopy boolean,
244 	 p_delete_next_change out nocopy boolean);
245 --
246 -- ----------------------------------------------------------------------------
247 -- |--------------------------< find_dt_upd_modes >---------------------------|
248 -- ----------------------------------------------------------------------------
249 -- {Start Of Comments}
250 --
251 -- Description:
252 --   This procedure is used to determine what datetrack update modes are
253 --   allowed as of the effective date for this entity. The procedure will
254 --   return a corresponding Boolean value for each of the update modes
255 --   available where TRUE indicates that the corresponding update mode
256 --   is available.
257 --
258 -- Prerequisites:
259 --   None.
260 --
261 -- In Parameters:
262 --   p_effective_date
263 --     Specifies the date at which the datetrack modes will be operated on.
264 --   p_base_key_value
265 --     Specifies the primary key value for this datetrack entity.
266 --     (E.g. For this entity the assignment of the argument would be:
267 --           p_base_key_value = :acty_rt_ded_sched_id).
268 --
269 -- Post Success:
270 --   Processing continues.
271 --
272 -- Post Failure:
273 --   Failure might occur if for the specified effective date and primary key
274 --   value a row doesn't exist.
275 --
276 -- Developer Implementation Notes:
277 --   This procedure could require changes if this entity has any sepcific
278 --   delete restrictions.
279 --   For example, this entity might disallow the datetrack update mode of
280 --   UPDATE. To implement this you would have to set and return a Boolean
281 --   value of FALSE after the call to the dt_api.find_dt_upd_modes procedure.
282 --
283 -- Access Status:
284 --   Internal Development Use Only.
285 --
286 -- {End Of Comments}
287 -- ----------------------------------------------------------------------------
288 Procedure find_dt_upd_modes
289 	(p_effective_date	in  date,
290 	 p_base_key_value	in  number,
291 	 p_correction	 out nocopy boolean,
292 	 p_update	 out nocopy boolean,
293 	 p_update_override out nocopy boolean,
294 	 p_update_change_insert out nocopy boolean);
295 --
296 -- ----------------------------------------------------------------------------
297 -- |------------------------< upd_effective_end_date >------------------------|
298 -- ----------------------------------------------------------------------------
299 -- {Start Of Comments}
300 --
301 -- Description:
302 --   This procedure will update the specified datetrack row with the
303 --   specified new effective end date. The object version number is also
304 --   set to the next object version number. DateTrack modes which call
305 --   this procedure are: UPDATE, UPDATE_CHANGE_INSERT,
306 --   UPDATE_OVERRIDE, DELETE, FUTURE_CHANGE and DELETE_NEXT_CHANGE.
307 --   This is an internal datetrack maintenance procedure which should
308 --   not be modified in anyway.
309 --
310 -- Prerequisites:
311 --   None.
312 --
313 -- In Parameters:
314 --   p_new_effective_end_date
315 --     Specifies the new effective end date which will be set for the
316 --     row as of the effective date.
317 --   p_base_key_value
318 --     Specifies the primary key value for this datetrack entity.
319 --     (E.g. For this entity the assignment of the argument would be:
320 --           p_base_key_value = :acty_rt_ded_sched_id).
321 --
322 -- Post Success:
323 --   The specified row will be updated with the new effective end date and
324 --   object_version_number.
325 --
326 -- Post Failure:
327 --   Failure might occur if for the specified effective date and primary key
328 --   value a row doesn't exist.
329 --
330 -- Developer Implementation Notes:
331 --   This is an internal datetrack maintenance procedure which should
332 --   not be modified in anyway.
333 --
334 -- Access Status:
335 --   Internal Row Handler Use Only.
336 --
337 -- {End Of Comments}
338 -- ----------------------------------------------------------------------------
339 Procedure upd_effective_end_date
340 	(p_effective_date		in date,
341 	 p_base_key_value		in number,
342 	 p_new_effective_end_date	in date,
343 	 p_validation_start_date	in date,
344 	 p_validation_end_date		in date,
345          p_object_version_number       out nocopy number);
346 --
347 -- ----------------------------------------------------------------------------
351 --
348 -- |---------------------------------< lck >----------------------------------|
349 -- ----------------------------------------------------------------------------
350 -- {Start Of Comments}
352 -- Description:
353 --   The Lck process for datetrack is complicated and comprises of the
354 --   following processing
355 --   The processing steps are as follows:
356 --   1) The row to be updated or deleted must be locked.
357 --      By locking this row, the g_old_rec record data type is populated.
358 --   2) If a comment exists the text is selected from hr_comments.
359 --   3) The datetrack mode is then validated to ensure the operation is
360 --      valid. If the mode is valid the validation start and end dates for
361 --      the mode will be derived and returned. Any required locking is
362 --      completed when the datetrack mode is validated.
363 --
364 -- Prerequisites:
365 --   When attempting to call the lck procedure the object version number,
366 --   primary key, effective date and datetrack mode must be specified.
367 --
368 -- In Parameters:
369 --   p_effective_date
370 --     Specifies the date of the datetrack update operation.
371 --   p_datetrack_mode
372 --     Determines the datetrack update or delete mode.
373 --
374 -- Post Success:
375 --   On successful completion of the Lck process the row to be updated or
376 --   deleted will be locked and selected into the global data structure
377 --   g_old_rec.
378 --
379 -- Post Failure:
380 --   The Lck process can fail for three reasons:
381 --   1) When attempting to lock the row the row could already be locked by
382 --      another user. This will raise the HR_Api.Object_Locked exception.
383 --   2) The row which is required to be locked doesn't exist in the HR Schema.
384 --      This error is trapped and reported using the message name
385 --      'HR_7220_INVALID_PRIMARY_KEY'.
386 --   3) The row although existing in the HR Schema has a different object
387 --      version number than the object version number specified.
388 --      This error is trapped and reported using the message name
389 --      'HR_7155_OBJECT_INVALID'.
390 --
391 -- Developer Implementation Notes:
392 --   None.
393 --
394 -- Access Status:
395 --   Internal Development Use Only.
396 --
397 -- {End Of Comments}
398 -- ----------------------------------------------------------------------------
399 Procedure lck
400 	(p_effective_date	 in  date,
401 	 p_datetrack_mode	 in  varchar2,
402 	 p_acty_rt_ded_sched_id	 in  number,
403 	 p_object_version_number in  number,
404 	 p_validation_start_date out nocopy date,
405 	 p_validation_end_date	 out nocopy date);
406 --
407 -- ----------------------------------------------------------------------------
408 -- |-----------------------------< convert_args >-----------------------------|
409 -- ----------------------------------------------------------------------------
410 -- {Start Of Comments}
411 --
412 -- Description:
413 --   This function is used to turn attribute parameters into the record
414 --   structure parameter g_rec_type.
415 --
416 -- Prerequisites:
417 --   This is a private function and can only be called from the ins or upd
418 --   attribute processes.
419 --
420 -- In Parameters:
421 --
422 -- Post Success:
423 --   A returning record structure will be returned.
424 --
425 -- Post Failure:
426 --   No direct error handling is required within this function. Any possible
427 --   errors within this function will be a PL/SQL value error due to conversion
428 --   of datatypes or data lengths.
429 --
430 -- Developer Implementation Notes:
431 --   None.
432 --
433 -- Access Status:
434 --   Internal Row Handler Use Only.
435 --
436 -- {End Of Comments}
437 -- ----------------------------------------------------------------------------
438 Function convert_args
439 	(
440 	p_acty_rt_ded_sched_id          in number,
441 	p_effective_start_date          in date,
442 	p_effective_end_date            in date,
443 	p_business_group_id             in number,
444 	p_ded_sched_py_freq_id          in number,
445 	p_acty_base_rt_id               in number,
446 	p_ded_sched_rl                  in number,
447 	p_ded_sched_cd                  in varchar2,
448 	p_ads_attribute_category        in varchar2,
449 	p_ads_attribute1                in varchar2,
450 	p_ads_attribute2                in varchar2,
451 	p_ads_attribute3                in varchar2,
452 	p_ads_attribute4                in varchar2,
453 	p_ads_attribute5                in varchar2,
454 	p_ads_attribute6                in varchar2,
455 	p_ads_attribute7                in varchar2,
456 	p_ads_attribute8                in varchar2,
457 	p_ads_attribute9                in varchar2,
458 	p_ads_attribute10               in varchar2,
459 	p_ads_attribute11               in varchar2,
460 	p_ads_attribute12               in varchar2,
461 	p_ads_attribute13               in varchar2,
462 	p_ads_attribute14               in varchar2,
463 	p_ads_attribute15               in varchar2,
464 	p_ads_attribute16               in varchar2,
465 	p_ads_attribute17               in varchar2,
466 	p_ads_attribute18               in varchar2,
467 	p_ads_attribute19               in varchar2,
468 	p_ads_attribute20               in varchar2,
469 	p_ads_attribute21               in varchar2,
470 	p_ads_attribute22               in varchar2,
471 	p_ads_attribute23               in varchar2,
472 	p_ads_attribute24               in varchar2,
473 	p_ads_attribute25               in varchar2,
474 	p_ads_attribute26               in varchar2,
475 	p_ads_attribute27               in varchar2,
476 	p_ads_attribute28               in varchar2,
477 	p_ads_attribute29               in varchar2,
478 	p_ads_attribute30               in varchar2,
479 	p_object_version_number         in number
480 	)
481 	Return g_rec_type;
482 --
483 end ben_ads_shd;