DBA Data[Home] [Help]

PACKAGE: APPS.BEN_ECP_SHD

Source


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