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