1 Package per_apr_shd as
2 /* $Header: peaprrhi.pkh 120.2 2007/06/20 07:45:00 rapandi ship $*/
3
4 -- ---------------------------------------------------------------------------+
5 -- | Global Record Type Specification |
6 -- ---------------------------------------------------------------------------+
7
8 Type g_rec_type Is Record
9 (
10 appraisal_id number(15),
11 business_group_id number(15),
12 object_version_number number(9),
13 appraisal_template_id number(15),
14 appraisee_person_id number(15),
15 appraiser_person_id number(15),
16 appraisal_date date,
17 appraisal_period_end_date date,
18 appraisal_period_start_date date,
19 type varchar2(30),
20 next_appraisal_date date,
21 status varchar2(30),
22 group_date date,
23 group_initiator_id number(9),
24 comments varchar2(2000), -- pseudo column
25 overall_performance_level_id number(15),
26 open varchar2(30),
27 attribute_category varchar2(30),
28 attribute1 varchar2(150),
29 attribute2 varchar2(150),
30 attribute3 varchar2(150),
31 attribute4 varchar2(150),
32 attribute5 varchar2(150),
33 attribute6 varchar2(150),
34 attribute7 varchar2(150),
35 attribute8 varchar2(150),
36 attribute9 varchar2(150),
37 attribute10 varchar2(150),
38 attribute11 varchar2(150),
39 attribute12 varchar2(150),
40 attribute13 varchar2(150),
41 attribute14 varchar2(150),
42 attribute15 varchar2(150),
43 attribute16 varchar2(150),
44 attribute17 varchar2(150),
45 attribute18 varchar2(150),
46 attribute19 varchar2(150),
47 attribute20 varchar2(150),
48 system_type varchar2(60),
49 system_params varchar2(500),
50 appraisee_access varchar2(30),
51 main_appraiser_id number(15),
52 assignment_id number(10),
53 assignment_start_date date,
54 assignment_business_group_id number(15),
55 assignment_organization_id number(15),
56 assignment_job_id number(15),
57 assignment_position_id number(15),
58 assignment_grade_id number(15),
59 appraisal_system_status varchar2(30),
60 potential_readiness_level varchar2(30),
61 potential_short_term_workopp varchar2(240),
62 potential_long_term_workopp varchar2(240),
63 potential_details varchar2(2000),
64 event_id number(15),
65 show_competency_ratings varchar2(30),
66 show_objective_ratings varchar2(30),
67 show_questionnaire_info varchar2(30),
68 show_participant_details varchar2(30),
69 show_participant_ratings varchar2(30),
70 show_participant_names varchar2(30),
71 show_overall_ratings varchar2(30),
72 show_overall_comments varchar2(30),
73 update_appraisal varchar2(30),
74 provide_overall_feedback varchar2(30),
75 appraisee_comments varchar2(2000),
76 plan_id number(15),
77 offline_status varchar2(30)
78 );
79
80 -- ---------------------------------------------------------------------------+
81 -- | Global Definitions - Internal Development Use Only |
82 -- ---------------------------------------------------------------------------+
83
84 g_old_rec g_rec_type; -- Global record definition
85 g_tab_nam constant varchar2(30) :='PER_APPRAISALS';
86 -- ---------------------------------------------------------------------------+
87 -- |---------------------------< constraint_error >---------------------------|
88 -- ---------------------------------------------------------------------------+
89 -- {Start Of Comments}
90
91 -- Description:
92 -- This procedure is called when a constraint has been violated (i.e.
93 -- The exception hr_api.check_integrity_violated,
94 -- hr_api.parent_integrity_violated, hr_api.child_integrity_violated or
95 -- hr_api.unique_integrity_violated has been raised).
96 -- The exceptions can only be raised as follows:
97 -- 1) A check constraint can only be violated during an INSERT or UPDATE
98 -- dml operation.
99 -- 2) A parent integrity constraint can only be violated during an
100 -- INSERT or UPDATE dml operation.
101 -- 3) A child integrity constraint can only be violated during an
102 -- DELETE dml operation.
103 -- 4) A unique integrity constraint can only be violated during INSERT or
104 -- UPDATE dml operation.
105
106 -- Pre Conditions:
107 -- 1) Either 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 with the subsequent
110 -- stripping of the constraint name from the generated error message
111 -- text.
112 -- 2) Standalone validation test which corresponds with a constraint error.
113
114 -- In Parameter:
115 -- p_constraint_name is in upper format and is just the constraint name
116 -- (e.g. not prefixed by brackets, schema owner etc).
117
118 -- Post Success:
119 -- Development dependant.
120
121 -- Post Failure:
122 -- Developement dependant.
123
124 -- Developer Implementation Notes:
125 -- For each constraint being checked the hr system package failure message
126 -- has been generated as a template only. These system error messages should
127 -- be modified as required (i.e. change the system failure message to a user
128 -- friendly defined error message).
129
130 -- Access Status:
131 -- Internal Development Use Only.
132
133 -- {End Of Comments}
134 -- ---------------------------------------------------------------------------+
135 Procedure constraint_error
136 (p_constraint_name in all_constraints.constraint_name%TYPE);
137
138 -- ---------------------------------------------------------------------------+
139 -- |-----------------------------< api_updating >-----------------------------|
140 -- ---------------------------------------------------------------------------+
141 -- {Start Of Comments}
142
143 -- Description:
144 -- This function is used to populate the g_old_rec record with the
145 -- current row from the database for the specified primary key
146 -- provided that the primary key exists and is valid and does not
147 -- already match the current g_old_rec. The function will always return
148 -- a TRUE value if the g_old_rec is populated with the current row.
149 -- A FALSE value will be returned if all of the primary key arguments
150 -- are null.
151
152 -- Pre Conditions:
153 -- None.
154
155 -- In Parameters:
156
157 -- Post Success:
158 -- A value of TRUE will be returned indiciating that the g_old_rec
159 -- is current.
160 -- A value of FALSE will be returned if all of the primary key arguments
161 -- have a null value (this indicates that the row has not be inserted into
162 -- the Schema), and therefore could never have a corresponding row.
163
164 -- Post Failure:
165 -- A failure can only occur under two circumstances:
166 -- 1) The primary key is invalid (i.e. a row does not exist for the
167 -- specified primary key values).
168 -- 2) If an object_version_number exists but is NOT the same as the current
169 -- g_old_rec value.
170
171 -- Developer Implementation Notes:
172 -- None.
173
174 -- Access Status:
175 -- Internal Development Use Only.
176
177 -- {End Of Comments}
178 -- ---------------------------------------------------------------------------+
179 Function api_updating
180 (
181 p_appraisal_id in number,
182 p_object_version_number in number
183 ) Return Boolean;
184
185 -- ---------------------------------------------------------------------------+
186 -- |---------------------------------< lck >----------------------------------|
187 -- ---------------------------------------------------------------------------+
188 -- {Start Of Comments}
189
190 -- Description:
191 -- The Lck process has two main functions to perform. Firstly, the row to be
192 -- updated or deleted must be locked. The locking of the row will only be
193 -- successful if the row is not currently locked by another user.
194 -- Secondly, during the locking of the row, the row is selected into
195 -- the g_old_rec data structure which enables the current row values from the
196 -- server to be available to the api.
197
198 -- Pre Conditions:
199 -- When attempting to call the lock the object version number (if defined)
200 -- is mandatory.
201
202 -- In Parameters:
203 -- The arguments to the Lck process are the primary key(s) which uniquely
204 -- identify the row and the object version number of row.
205
206 -- Post Success:
207 -- On successful completion of the Lck process the row to be updated or
208 -- deleted will be locked and selected into the global data structure
209 -- g_old_rec.
210
211 -- Post Failure:
212 -- The Lck process can fail for three reasons:
213 -- 1) When attempting to lock the row the row could already be locked by
214 -- another user. This will raise the HR_Api.Object_Locked exception.
215 -- 2) The row which is required to be locked doesn't exist in the HR Schema.
216 -- This error is trapped and reported using the message name
217 -- 'HR_7220_INVALID_PRIMARY_KEY'.
218 -- 3) The row although existing in the HR Schema has a different object
219 -- version number than the object version number specified.
220 -- This error is trapped and reported using the message name
221 -- 'HR_7155_OBJECT_INVALID'.
222
223 -- Developer Implementation Notes:
224 -- For each primary key and the object version number arguments add a
225 -- call to hr_api.mandatory_arg_error procedure to ensure that these
226 -- argument values are not null.
227
228 -- Access Status:
229 -- Internal Development Use Only.
230
231 -- {End Of Comments}
232 -- ---------------------------------------------------------------------------+
233 Procedure lck
234 (
235 p_appraisal_id in number,
236 p_object_version_number in number
237 );
238
239 -- ---------------------------------------------------------------------------+
240 -- |-----------------------------< convert_args >-----------------------------|
241 -- ---------------------------------------------------------------------------+
242 -- {Start Of Comments}
243
244 -- Description:
245 -- This function is used to turn attribute parameters into the record
246 -- structure parameter g_rec_type.
247
248 -- Pre Conditions:
249 -- This is a private function and can only be called from the ins or upd
250 -- attribute processes.
251
252 -- In Parameters:
253
254 -- Post Success:
255 -- A returning record structure will be returned.
256
257 -- Post Failure:
258 -- No direct error handling is required within this function. Any possible
259 -- errors within this function will be a PL/SQL value error due to conversion
260 -- of datatypes or data lengths.
261
262 -- Developer Implementation Notes:
263 -- None.
264
265 -- Access Status:
266 -- Internal Table Handler Use Only.
267
268 -- {End Of Comments}
269 -- ---------------------------------------------------------------------------+
270 Function convert_args
271 (
272 p_appraisal_id in number,
273 p_business_group_id in number,
274 p_object_version_number in number,
275 p_appraisal_template_id in number,
276 p_appraisee_person_id in number,
277 p_appraiser_person_id in number,
278 p_appraisal_date in date,
279 p_appraisal_period_end_date in date,
280 p_appraisal_period_start_date in date,
281 p_type in varchar2,
282 p_next_appraisal_date in date,
283 p_status in varchar2,
284 p_group_date in date,
285 p_group_initiator_id in number,
286 p_comments in varchar2,
287 p_overall_performance_level_id in number,
288 p_open in varchar2,
289 p_attribute_category in varchar2,
290 p_attribute1 in varchar2,
291 p_attribute2 in varchar2,
292 p_attribute3 in varchar2,
293 p_attribute4 in varchar2,
294 p_attribute5 in varchar2,
295 p_attribute6 in varchar2,
296 p_attribute7 in varchar2,
297 p_attribute8 in varchar2,
298 p_attribute9 in varchar2,
299 p_attribute10 in varchar2,
300 p_attribute11 in varchar2,
301 p_attribute12 in varchar2,
302 p_attribute13 in varchar2,
303 p_attribute14 in varchar2,
304 p_attribute15 in varchar2,
305 p_attribute16 in varchar2,
306 p_attribute17 in varchar2,
307 p_attribute18 in varchar2,
308 p_attribute19 in varchar2,
309 p_attribute20 in varchar2,
310 p_system_type in varchar2,
311 p_system_params in varchar2,
312 p_appraisee_access in varchar2,
313 p_main_appraiser_id in number,
314 p_assignment_id in number,
315 p_assignment_start_date in date,
316 p_asg_business_group_id in number,
317 p_assignment_organization_id in number,
318 p_assignment_job_id in number,
319 p_assignment_position_id in number,
320 p_assignment_grade_id in number,
321 p_appraisal_system_status in varchar2,
322 p_potential_readiness_level in varchar2,
323 p_potential_short_term_workopp in varchar2,
324 p_potential_long_term_workopp in varchar2,
325 p_potential_details in varchar2,
326 p_event_id in number,
327 p_show_competency_ratings in varchar2,
328 p_show_objective_ratings in varchar2,
329 p_show_questionnaire_info in varchar2,
330 p_show_participant_details in varchar2,
331 p_show_participant_ratings in varchar2,
332 p_show_participant_names in varchar2,
333 p_show_overall_ratings in varchar2,
337 p_appraisee_comments in varchar2,
334 p_show_overall_comments in varchar2,
335 p_update_appraisal in varchar2,
336 p_provide_overall_feedback in varchar2,
338 p_plan_id in number,
339 p_offline_status in varchar2
340 )
341 Return g_rec_type;
342
343 end per_apr_shd;