DBA Data[Home] [Help]

PACKAGE: APPS.BEN_DCE_SHD

Source


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