DBA Data[Home] [Help]

PACKAGE: APPS.BEN_PTP_SHD

Source


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