1 Package irc_iid_shd AUTHID CURRENT_USER as
2 /* $Header: iriidrhi.pkh 120.1.12010000.1 2008/07/28 12:42:53 appldev ship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- | Global Record Type Specification |
6 -- ----------------------------------------------------------------------------
7 --
8 Type g_rec_type Is Record
9 (interview_details_id number(15)
10 ,status varchar2(30)
11 ,feedback varchar2(4000)
12 ,notes varchar2(4000)
13 ,notes_to_candidate varchar2(4000)
14 ,category varchar2(30)
15 ,result varchar2(150)
16 ,iid_information_category varchar2(30)
17 ,iid_information1 varchar2(150)
18 ,iid_information2 varchar2(150)
19 ,iid_information3 varchar2(150)
20 ,iid_information4 varchar2(150)
21 ,iid_information5 varchar2(150)
22 ,iid_information6 varchar2(150)
23 ,iid_information7 varchar2(150)
24 ,iid_information8 varchar2(150)
25 ,iid_information9 varchar2(150)
26 ,iid_information10 varchar2(150)
27 ,iid_information11 varchar2(150)
28 ,iid_information12 varchar2(150)
29 ,iid_information13 varchar2(150)
30 ,iid_information14 varchar2(150)
31 ,iid_information15 varchar2(150)
32 ,iid_information16 varchar2(150)
33 ,iid_information17 varchar2(150)
34 ,iid_information18 varchar2(150)
35 ,iid_information19 varchar2(150)
36 ,iid_information20 varchar2(150)
37 ,start_date date
38 ,end_date date
39 ,event_id number(15)
40 ,object_version_number number(9)
41 ,created_by number(15)
42 );
43 --
44 -- ----------------------------------------------------------------------------
45 -- | Global Definitions - Internal Development Use Only |
46 -- ----------------------------------------------------------------------------
47 --
48 g_old_rec g_rec_type; -- Global record definition
49 -- Global table name
50 g_tab_name constant varchar2(30) := 'IRC_INTERVIEW_DETAILS';
51 --
52 -- ----------------------------------------------------------------------------
53 -- |---------------------------< constraint_error >---------------------------|
54 -- ----------------------------------------------------------------------------
55 -- {Start Of Comments}
56 --
57 -- Description:
58 -- This procedure is called when a constraint has been violated (i.e.
59 -- The exception hr_api.check_integrity_violated,
60 -- hr_api.parent_integrity_violated, hr_api.child_integrity_violated or
61 -- hr_api.unique_integrity_violated has been raised).
62 -- The exceptions can only be raised as follows:
63 -- 1) A check constraint can only be violated during an INSERT or UPDATE
64 -- dml operation.
65 -- 2) A parent integrity constraint can only be violated during an
66 -- INSERT or UPDATE dml operation.
67 -- 3) A child integrity constraint can only be violated during an
68 -- DELETE dml operation.
69 -- 4) A unique integrity constraint can only be violated during INSERT or
70 -- UPDATE dml operation.
71 --
72 -- Prerequisites:
73 -- 1) Either hr_api.check_integrity_violated,
74 -- hr_api.parent_integrity_violated, hr_api.child_integrity_violated or
75 -- hr_api.unique_integrity_violated has been raised with the subsequent
76 -- stripping of the constraint name from the generated error message
77 -- text.
78 -- 2) Standalone validation test which corresponds with a constraint error.
79 --
80 -- In Parameter:
81 -- p_constraint_name is in upper format and is just the constraint name
82 -- (e.g. not prefixed by brackets, schema owner etc).
83 --
84 -- Post Success:
85 -- Development dependant.
86 --
87 -- Post Failure:
88 -- Developement dependant.
89 --
90 -- Developer Implementation Notes:
91 -- For each constraint being checked the hr system package failure message
92 -- has been generated as a template only. These system error messages should
93 -- be modified as required (i.e. change the system failure message to a user
94 -- friendly defined error message).
95 --
96 -- Access Status:
97 -- Internal Development Use Only.
98 --
99 -- {End Of Comments}
100 -- ----------------------------------------------------------------------------
101 Procedure constraint_error
102 (p_constraint_name in all_constraints.constraint_name%TYPE);
103 --
104 -- ----------------------------------------------------------------------------
105 -- |-----------------------------< api_updating >-----------------------------|
106 -- ----------------------------------------------------------------------------
107 -- {Start Of Comments}
108 --
109 -- Description:
110 -- This function is used to populate the g_old_rec record with the
111 -- current row from the database for the specified primary key
112 -- provided that the primary key exists and is valid and does not
113 -- already match the current g_old_rec. The function will always return
114 -- a TRUE value if the g_old_rec is populated with the current row.
115 -- A FALSE value will be returned if all of the primary key arguments
116 -- are null.
117 --
118 -- Prerequisites:
119 -- None.
120 --
121 -- In Parameters:
122 --
123 -- Post Success:
124 -- A value of TRUE will be returned indiciating that the g_old_rec
125 -- is current.
126 -- A value of FALSE will be returned if all of the primary key arguments
127 -- have a null value (this indicates that the row has not be inserted into
128 -- the Schema), and therefore could never have a corresponding row.
129 --
130 -- Post Failure:
131 -- A failure can only occur under two circumstances:
132 -- 1) The primary key is invalid (i.e. a row does not exist for the
133 -- specified primary key values).
134 -- 2) If an object_version_number exists but is NOT the same as the current
135 -- g_old_rec value.
136 --
137 -- Developer Implementation Notes:
138 -- None.
139 --
140 -- Access Status:
141 -- Internal Development Use Only.
142 --
143 -- {End Of Comments}
144 -- ----------------------------------------------------------------------------
145 Function api_updating
146 (p_effective_date in date
147 ,p_interview_details_id in number
148 ,p_object_version_number in number
149 ) Return Boolean;
150 --
151 -- ----------------------------------------------------------------------------
152 -- |----------------------------< upd_end_date >------------------------------|
153 -- ----------------------------------------------------------------------------
154 -- {Start Of Comments}
155 --
156 -- Description:
157 -- This procedure will update the specified datetrack row with the
158 -- specified new effective end date. The object version number is also
159 -- set to the next object version number. DateTrack modes which call
160 -- this procedure are: UPDATE, UPDATE_CHANGE_INSERT,
161 -- UPDATE_OVERRIDE, DELETE, FUTURE_CHANGE and DELETE_NEXT_CHANGE.
162 -- This is an internal datetrack maintenance procedure which should
163 -- not be modified in anyway.
164 --
165 -- Prerequisites:
166 -- None.
167 --
168 -- In Parameters:
169 -- p_new_effective_end_date
170 -- Specifies the new effective end date which will be set for the
171 -- row as of the effective date.
172 -- p_base_key_value
173 -- Specifies the primary key value for this datetrack entity.
174 -- (E.g. For this entity the assignment of the argument would be:
175 -- p_base_key_value = :attribute_id).
176 --
177 -- Post Success:
178 -- The specified row will be updated with the new effective end date and
179 -- object_version_number.
180 --
181 -- Post Failure:
182 -- Failure might occur if for the specified effective date and primary key
183 -- value a row doesn't exist.
184 --
185 -- Developer Implementation Notes:
186 -- This is an internal datetrack maintenance procedure which should
187 -- not be modified in anyway.
188 --
189 -- Access Status:
190 -- Internal Row Handler Use Only.
191 --
192 -- {End Of Comments}
193 -- ----------------------------------------------------------------------------
194 Procedure upd_end_date
195 (p_effective_date in date
196 ,p_interview_details_id in number
197 ,p_new_end_date in date
198 ,p_object_version_number out nocopy number
199 );
200 --
201 -- ----------------------------------------------------------------------------
202 -- |---------------------------------< lck >----------------------------------|
203 -- ----------------------------------------------------------------------------
204 -- {Start Of Comments}
205 --
206 -- Description:
207 -- The Lck process for datetrack is complicated and comprises of the
208 -- following processing
209 -- The processing steps are as follows:
210 -- 1) The row to be updated or deleted must be locked.
211 -- By locking this row, the g_old_rec record data type is populated.
212 -- 2) If a comment exists the text is selected from hr_comments.
213 -- 3) The datetrack mode is then validated to ensure the operation is
214 -- valid. If the mode is valid the validation start and end dates for
215 -- the mode will be derived and returned. Any required locking is
216 -- completed when the datetrack mode is validated.
217 --
218 -- Prerequisites:
219 -- When attempting to call the lck procedure the object version number,
220 -- primary key, effective date and datetrack mode must be specified.
221 --
222 -- In Parameters:
223 -- p_effective_date
224 -- Specifies the date of the datetrack update operation.
225 -- p_datetrack_mode
226 -- Determines the datetrack update or delete mode.
227 --
228 -- Post Success:
229 -- On successful completion of the Lck process the row to be updated or
230 -- deleted will be locked and selected into the global data structure
231 -- g_old_rec.
232 --
233 -- Post Failure:
234 -- The Lck process can fail for three reasons:
235 -- 1) When attempting to lock the row the row could already be locked by
236 -- another user. This will raise the HR_Api.Object_Locked exception.
237 -- 2) The row which is required to be locked doesn't exist in the HR Schema.
238 -- This error is trapped and reported using the message name
239 -- 'HR_7220_INVALID_PRIMARY_KEY'.
240 -- 3) The row although existing in the HR Schema has a different object
241 -- version number than the object version number specified.
242 -- This error is trapped and reported using the message name
243 -- 'HR_7155_OBJECT_INVALID'.
244 --
245 -- Developer Implementation Notes:
246 -- None.
247 --
248 -- Access Status:
249 -- Internal Development Use Only.
250 --
251 -- {End Of Comments}
252 -- ----------------------------------------------------------------------------
253 Procedure lck
254 (p_effective_date in date
255 ,p_datetrack_mode in varchar2
256 ,p_interview_details_id in number
257 ,p_object_version_number in number
258 ,p_validation_start_date out nocopy date
259 ,p_validation_end_date out nocopy date
260 );
261 --
262 -- ----------------------------------------------------------------------------
263 -- |-----------------------------< convert_args >-----------------------------|
264 -- ----------------------------------------------------------------------------
265 -- {Start Of Comments}
266 --
267 -- Description:
268 -- This function is used to turn attribute parameters into the record
269 -- structure parameter g_rec_type.
270 --
271 -- Prerequisites:
272 -- This is a private function and can only be called from the ins or upd
273 -- attribute processes.
274 --
275 -- In Parameters:
276 --
277 -- Post Success:
278 -- A returning record structure will be returned.
279 --
280 -- Post Failure:
281 -- No direct error handling is required within this function. Any possible
282 -- errors within this function will be a PL/SQL value error due to
283 -- conversion of datatypes or data lengths.
284 --
285 -- Developer Implementation Notes:
286 -- None.
287 --
288 -- Access Status:
289 -- Internal Row Handler Use Only.
290 --
291 -- {End Of Comments}
292 -- ----------------------------------------------------------------------------
293 Function convert_args
294 (p_interview_details_id in number
295 ,p_status in varchar2
296 ,p_feedback in varchar2
297 ,p_notes in varchar2
298 ,p_notes_to_candidate in varchar2
299 ,p_category in varchar2
300 ,p_result in varchar2
301 ,iid_information_category in varchar2
302 ,iid_information1 in varchar2
303 ,iid_information2 in varchar2
304 ,iid_information3 in varchar2
305 ,iid_information4 in varchar2
306 ,iid_information5 in varchar2
307 ,iid_information6 in varchar2
308 ,iid_information7 in varchar2
309 ,iid_information8 in varchar2
310 ,iid_information9 in varchar2
311 ,iid_information10 in varchar2
312 ,iid_information11 in varchar2
313 ,iid_information12 in varchar2
314 ,iid_information13 in varchar2
315 ,iid_information14 in varchar2
316 ,iid_information15 in varchar2
317 ,iid_information16 in varchar2
318 ,iid_information17 in varchar2
319 ,iid_information18 in varchar2
320 ,iid_information19 in varchar2
321 ,iid_information20 in varchar2
322 ,p_start_date in date
323 ,p_end_date in date
324 ,p_event_id in number
325 ,p_object_version_number in number
326 )
327 Return g_rec_type;
328 --
329 -- ----------------------------------------------------------------------------
330 -- |-----------------------------< get_object_version_number >----------------|
331 -- ----------------------------------------------------------------------------
332 -- {Start Of Comments}
333 --
334 -- Description:
335 -- This function is used to get the next object version number to be used
336 -- within datetrack for an insert or update dml operation. The returned
337 -- object version number will be determined by taking the maximum
338 -- object version number for the datetracked rows and then incrementing by 1.
339 --
340 --
341 -- Prerequisites:
342 -- This is a private function and can only be called from the ins or upd
343 -- attribute processes.
344 --
345 -- In Parameters:
346 --
347 --
348 -- Post Success:
349 --
350 --
351 -- Post Failure:
352 --
353 --
354 --
355 --
356 -- Developer Implementation Notes:
357 -- None.
358 --
359 -- Access Status:
360 -- Internal Row Handler Use Only.
361 --
362 -- {End Of Comments}
363 -- ----------------------------------------------------------------------------
364 Function get_object_version_number
365 (p_interview_details_id in number
366 )
367 Return number;
368 --
369 end irc_iid_shd;