DBA Data[Home] [Help]

PACKAGE: APPS.HR_LIP_SHD

Source


1 Package hr_lip_shd AUTHID CURRENT_USER as
2 /* $Header: hrliprhi.pkh 120.0 2005/05/31 01:17:20 appldev noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                    Global Record Type Specification                      |
6 -- ----------------------------------------------------------------------------
7 --
8 Type g_rec_type Is Record
9   (liability_premiums_id           number(15)
10   ,organization_link_id            number(15)
11   ,effective_start_date            date
12   ,effective_end_date              date
13   ,std_percentage                  number(16,5)      -- Increased length
14   ,calculation_method              varchar2(30)
15   ,std_working_hours_per_year      number(15)
16   ,max_remuneration                number(15)
17   ,attribute_category              varchar2(30)
18   ,attribute1                      varchar2(150)
19   ,attribute2                      varchar2(150)
20   ,attribute3                      varchar2(150)
21   ,attribute4                      varchar2(150)
22   ,attribute5                      varchar2(150)
23   ,attribute6                      varchar2(150)
24   ,attribute7                      varchar2(150)
25   ,attribute8                      varchar2(150)
26   ,attribute9                      varchar2(150)
27   ,attribute10                     varchar2(150)
28   ,attribute11                     varchar2(150)
29   ,attribute12                     varchar2(150)
30   ,attribute13                     varchar2(150)
31   ,attribute14                     varchar2(150)
32   ,attribute15                     varchar2(150)
33   ,attribute16                     varchar2(150)
34   ,attribute17                     varchar2(150)
35   ,attribute18                     varchar2(150)
36   ,attribute19                     varchar2(150)
37   ,attribute20                     varchar2(150)
38   ,object_version_number           number(9)
39   );
40 --
41 -- ----------------------------------------------------------------------------
42 -- |           Global Definitions - Internal Development Use Only             |
43 -- ----------------------------------------------------------------------------
44 --
45 g_old_rec  g_rec_type;                            -- Global record definition
46 --
47 -- ----------------------------------------------------------------------------
48 -- |---------------------------< constraint_error >---------------------------|
49 -- ----------------------------------------------------------------------------
50 -- {Start Of Comments}
51 --
52 -- Description:
53 --   This procedure is called when a constraint has been violated (i.e.
54 --   The exception hr_api.check_integrity_violated,
55 --   hr_api.parent_integrity_violated, hr_api.child_integrity_violated or
56 --   hr_api.unique_integrity_violated has been raised).
57 --   The exceptions can only be raised as follows:
58 --   1) A check constraint can only be violated during an INSERT or UPDATE
59 --      dml operation.
60 --   2) A parent integrity constraint can only be violated during an
61 --      INSERT or UPDATE dml operation.
62 --   3) A child integrity constraint can only be violated during an
63 --      DELETE dml operation.
64 --   4) A unique integrity constraint can only be violated during INSERT or
65 --      UPDATE dml operation.
66 --
67 -- Prerequisites:
68 --   1) Either hr_api.check_integrity_violated,
69 --      hr_api.parent_integrity_violated, hr_api.child_integrity_violated or
70 --      hr_api.unique_integrity_violated has been raised with the subsequent
71 --      stripping of the constraint name from the generated error message
72 --      text.
73 --   2) Standalone validation test which corresponds with a constraint error.
74 --
75 -- In Parameter:
76 --   p_constraint_name is in upper format and is just the constraint name
77 --   (e.g. not prefixed by brackets, schema owner etc).
78 --
79 -- Post Success:
80 --   Development dependant.
81 --
82 -- Post Failure:
83 --   Developement dependant.
84 --
85 -- Developer Implementation Notes:
86 --   For each constraint being checked the hr system package failure message
87 --   has been generated as a template only. These system error messages should
88 --   be modified as required (i.e. change the system failure message to a user
89 --   friendly defined error message).
90 --
91 -- Access Status:
92 --   Internal Development Use Only.
93 --
94 -- {End Of Comments}
95 -- ----------------------------------------------------------------------------
96 Procedure constraint_error
97   (p_constraint_name in all_constraints.constraint_name%TYPE);
98 --
99 -- ----------------------------------------------------------------------------
100 -- |-----------------------------< api_updating >-----------------------------|
101 -- ----------------------------------------------------------------------------
102 --  {Start Of Comments}
103 --
104 -- Description:
105 --   This function is used to populate the g_old_rec record with the
106 --   current row from the database for the specified primary key
107 --   provided that the primary key exists and is valid and does not
108 --   already match the current g_old_rec. The function will always return
109 --   a TRUE value if the g_old_rec is populated with the current row.
110 --   A FALSE value will be returned if all of the primary key arguments
111 --   are null.
112 --
113 -- Prerequisites:
114 --   None.
115 --
116 -- In Parameters:
117 --
118 -- Post Success:
119 --   A value of TRUE will be returned indiciating that the g_old_rec
120 --   is current.
121 --   A value of FALSE will be returned if all of the primary key arguments
122 --   have a null value (this indicates that the row has not be inserted into
123 --   the Schema), and therefore could never have a corresponding row.
124 --
125 -- Post Failure:
126 --   A failure can only occur under two circumstances:
127 --   1) The primary key is invalid (i.e. a row does not exist for the
128 --      specified primary key values).
129 --   2) If an object_version_number exists but is NOT the same as the current
130 --      g_old_rec value.
131 --
132 -- Developer Implementation Notes:
133 --   None.
134 --
135 -- Access Status:
136 --   Internal Development Use Only.
137 --
138 -- {End Of Comments}
139 -- ----------------------------------------------------------------------------
140 Function api_updating
141   (p_effective_date                   in date
142   ,p_liability_premiums_id            in number
143   ,p_object_version_number            in number
144   ) Return Boolean;
145 --
146 -- ----------------------------------------------------------------------------
147 -- |---------------------------< find_dt_upd_modes >--------------------------|
148 -- ----------------------------------------------------------------------------
149 -- {Start Of Comments}
150 --
151 -- Description:
152 --   This procedure is used to determine what datetrack update modes are
153 --   allowed as of the effective date for this entity. The procedure will
154 --   return a corresponding Boolean value for each of the update modes
155 --   available where TRUE indicates that the corresponding update mode
156 --   is available.
157 --
158 -- Prerequisites:
159 --   None.
160 --
161 -- In Parameters:
162 --   p_effective_date
163 --     Specifies the date at which the datetrack modes will be operated on.
164 --   p_base_key_value
165 --     Specifies the primary key value for this datetrack entity.
166 --     (E.g. For this entity the assignment of the argument would be:
167 --           p_base_key_value = :liability_premiums_id).
168 --
169 -- Post Success:
170 --   Processing continues.
171 --
172 -- Post Failure:
173 --   Failure might occur if for the specified effective date and primary key
174 --   value a row doesn't exist.
175 --
176 -- Developer Implementation Notes:
177 --   This procedure could require changes if this entity has any sepcific
178 --   delete restrictions.
179 --   For example, this entity might disallow the datetrack update mode of
180 --   UPDATE. To implement this you would have to set and return a Boolean
181 --   value of FALSE after the call to the dt_api.find_dt_upd_modes procedure.
182 --
183 -- Access Status:
184 --   Internal Development Use Only.
185 --
186 -- {End Of Comments}
187 -- ----------------------------------------------------------------------------
188 Procedure find_dt_upd_modes
189   (p_effective_date         in date
190   ,p_base_key_value         in number
191   ,p_correction             out nocopy boolean
192   ,p_update                 out nocopy boolean
193   ,p_update_override        out nocopy boolean
194   ,p_update_change_insert   out nocopy boolean
195   );
196 --
197 -- ----------------------------------------------------------------------------
198 -- |---------------------------< find_dt_del_modes >--------------------------|
199 -- ----------------------------------------------------------------------------
200 -- {Start Of Comments}
201 --
202 -- Description:
203 --   This procedure is used to determine what datetrack delete modes are
204 --   allowed as of the effective date for this entity. The procedure will
205 --   return a corresponding Boolean value for each of the delete modes
206 --   available where TRUE indicates that the corresponding delete mode is
207 --   available.
208 --
209 -- Prerequisites:
210 --   None.
211 --
212 -- In Parameters:
213 --   p_effective_date
214 --     Specifies the date at which the datetrack modes will be operated on.
215 --   p_base_key_value
216 --     Specifies the primary key value for this datetrack entity.
217 --     (E.g. For this entity the assignment of the argument would be:
218 --           p_base_key_value = :liability_premiums_id).
219 --
220 -- Post Success:
221 --   Processing continues.
222 --
223 -- Post Failure:
224 --   Failure might occur if for the specified effective date and primary key
225 --   value a row doesn't exist.
226 --
227 -- Developer Implementation Notes:
228 --   This procedure could require changes if this entity has any sepcific
229 --   delete restrictions.
230 --   For example, this entity might disallow the datetrack delete mode of
231 --   ZAP. To implement this you would have to set and return a Boolean value
232 --   of FALSE after the call to the dt_api.find_dt_del_modes procedure.
233 --
234 -- Access Status:
235 --   Internal Development Use Only.
236 --
237 -- {End Of Comments}
238 -- ----------------------------------------------------------------------------
239 Procedure find_dt_del_modes
240   (p_effective_date        in date
241   ,p_base_key_value        in number
242   ,p_zap                   out nocopy boolean
243   ,p_delete                out nocopy boolean
244   ,p_future_change         out nocopy boolean
245   ,p_delete_next_change    out nocopy boolean
246   );
247 --
248 -- ----------------------------------------------------------------------------
249 -- |-----------------------< upd_effective_end_date >-------------------------|
250 -- ----------------------------------------------------------------------------
251 -- {Start Of Comments}
252 --
253 -- Description:
254 --   This procedure will update the specified datetrack row with the
255 --   specified new effective end date. The object version number is also
256 --   set to the next object version number. DateTrack modes which call
257 --   this procedure are: UPDATE, UPDATE_CHANGE_INSERT,
258 --   UPDATE_OVERRIDE, DELETE, FUTURE_CHANGE and DELETE_NEXT_CHANGE.
259 --   This is an internal datetrack maintenance procedure which should
260 --   not be modified in anyway.
261 --
262 -- Prerequisites:
263 --   None.
264 --
265 -- In Parameters:
266 --   p_new_effective_end_date
267 --     Specifies the new effective end date which will be set for the
268 --     row as of the effective date.
269 --   p_base_key_value
270 --     Specifies the primary key value for this datetrack entity.
271 --     (E.g. For this entity the assignment of the argument would be:
272 --           p_base_key_value = :liability_premiums_id).
273 --
274 -- Post Success:
275 --   The specified row will be updated with the new effective end date and
276 --   object_version_number.
277 --
278 -- Post Failure:
279 --   Failure might occur if for the specified effective date and primary key
280 --   value a row doesn't exist.
281 --
282 -- Developer Implementation Notes:
283 --   This is an internal datetrack maintenance procedure which should
284 --   not be modified in anyway.
285 --
286 -- Access Status:
287 --   Internal Row Handler Use Only.
288 --
289 -- {End Of Comments}
290 -- ----------------------------------------------------------------------------
291 Procedure upd_effective_end_date
292   (p_effective_date         in date
293   ,p_base_key_value         in number
294   ,p_new_effective_end_date in date
295   ,p_validation_start_date  in date
296   ,p_validation_end_date    in date
297   ,p_object_version_number  out nocopy number
298   );
299 --
300 -- ----------------------------------------------------------------------------
301 -- |---------------------------------< lck >----------------------------------|
302 -- ----------------------------------------------------------------------------
303 -- {Start Of Comments}
304 --
305 -- Description:
306 --   The Lck process for datetrack is complicated and comprises of the
307 --   following processing
308 --   The processing steps are as follows:
309 --   1) The row to be updated or deleted must be locked.
310 --      By locking this row, the g_old_rec record data type is populated.
311 --   2) If a comment exists the text is selected from hr_comments.
312 --   3) The datetrack mode is then validated to ensure the operation is
313 --      valid. If the mode is valid the validation start and end dates for
314 --      the mode will be derived and returned. Any required locking is
315 --      completed when the datetrack mode is validated.
316 --
317 -- Prerequisites:
318 --   When attempting to call the lck procedure the object version number,
319 --   primary key, effective date and datetrack mode must be specified.
320 --
321 -- In Parameters:
322 --   p_effective_date
323 --     Specifies the date of the datetrack update operation.
324 --   p_datetrack_mode
325 --     Determines the datetrack update or delete mode.
326 --
327 -- Post Success:
328 --   On successful completion of the Lck process the row to be updated or
329 --   deleted will be locked and selected into the global data structure
330 --   g_old_rec.
331 --
332 -- Post Failure:
333 --   The Lck process can fail for three reasons:
334 --   1) When attempting to lock the row the row could already be locked by
335 --      another user. This will raise the HR_Api.Object_Locked exception.
336 --   2) The row which is required to be locked doesn't exist in the HR Schema.
337 --      This error is trapped and reported using the message name
338 --      'HR_7220_INVALID_PRIMARY_KEY'.
339 --   3) The row although existing in the HR Schema has a different object
340 --      version number than the object version number specified.
341 --      This error is trapped and reported using the message name
342 --      'HR_7155_OBJECT_INVALID'.
343 --
344 -- Developer Implementation Notes:
345 --   None.
346 --
347 -- Access Status:
348 --   Internal Development Use Only.
349 --
350 -- {End Of Comments}
351 -- ----------------------------------------------------------------------------
352 Procedure lck
353   (p_effective_date                   in date
354   ,p_datetrack_mode                   in varchar2
355   ,p_liability_premiums_id            in number
356   ,p_object_version_number            in number
357   ,p_validation_start_date            out nocopy date
358   ,p_validation_end_date              out nocopy date
359   );
360 --
361 -- ----------------------------------------------------------------------------
362 -- |-----------------------------< convert_args >-----------------------------|
363 -- ----------------------------------------------------------------------------
364 -- {Start Of Comments}
365 --
366 -- Description:
367 --   This function is used to turn attribute parameters into the record
368 --   structure parameter g_rec_type.
369 --
370 -- Prerequisites:
371 --   This is a private function and can only be called from the ins or upd
372 --   attribute processes.
373 --
374 -- In Parameters:
375 --
376 -- Post Success:
377 --   A returning record structure will be returned.
378 --
379 -- Post Failure:
380 --   No direct error handling is required within this function.  Any possible
381 --   errors within this function will be a PL/SQL value error due to
382 --   conversion of datatypes or data lengths.
383 --
384 -- Developer Implementation Notes:
385 --   None.
386 --
387 -- Access Status:
388 --   Internal Row Handler Use Only.
389 --
390 -- {End Of Comments}
391 -- ----------------------------------------------------------------------------
392 Function convert_args
393   (p_liability_premiums_id          in number
394   ,p_organization_link_id           in number
395   ,p_effective_start_date           in date
396   ,p_effective_end_date             in date
397   ,p_std_percentage                 in number
398   ,p_calculation_method             in varchar2
399   ,p_std_working_hours_per_year     in number
400   ,p_max_remuneration               in number
401   ,p_attribute_category             in varchar2
402   ,p_attribute1                     in varchar2
403   ,p_attribute2                     in varchar2
404   ,p_attribute3                     in varchar2
405   ,p_attribute4                     in varchar2
406   ,p_attribute5                     in varchar2
407   ,p_attribute6                     in varchar2
408   ,p_attribute7                     in varchar2
409   ,p_attribute8                     in varchar2
410   ,p_attribute9                     in varchar2
411   ,p_attribute10                    in varchar2
412   ,p_attribute11                    in varchar2
413   ,p_attribute12                    in varchar2
414   ,p_attribute13                    in varchar2
415   ,p_attribute14                    in varchar2
416   ,p_attribute15                    in varchar2
417   ,p_attribute16                    in varchar2
418   ,p_attribute17                    in varchar2
419   ,p_attribute18                    in varchar2
420   ,p_attribute19                    in varchar2
421   ,p_attribute20                    in varchar2
425 --
422   ,p_object_version_number          in number
423   )
424   Return g_rec_type;
426 end hr_lip_shd;