1 Package per_pms_bus AUTHID CURRENT_USER as
2 /* $Header: pepmsrhi.pkh 120.3.12020000.2 2012/07/05 03:40:53 amnaraya ship $ */
3 --
4 -- ---------------------------------------------------------------------------
5 -- |----------------------< set_security_group_id >--------------------------|
6 -- ---------------------------------------------------------------------------
7 -- {Start Of Comments}
8 --
9 -- Description:
10 -- Sets the security_group_id in CLIENT_INFO for the appropriate business
11 -- group context.
12 --
13 -- Prerequisites:
14 -- The primary key identified by p_scorecard_id
15 -- already exists.
16 --
17 -- In Arguments:
18 -- p_scorecard_id
19 --
20 --
21 -- Post Success:
22 -- The security_group_id will be set in CLIENT_INFO.
23 --
24 -- Post Failure:
25 -- An error is raised if the value does not exist.
26 --
27 -- Access Status:
28 -- Internal Development Use Only.
29 --
30 -- {End Of Comments}
31 -- ---------------------------------------------------------------------------
32 procedure set_security_group_id
33 (p_scorecard_id in number
34 ,p_associated_column1 in varchar2 default null
35 );
36 --
37 --
38 -- ---------------------------------------------------------------------------
39 -- |---------------------< return_legislation_code >-------------------------|
40 -- ---------------------------------------------------------------------------
41 -- {Start Of Comments}
42 --
43 -- Description:
44 -- Return the legislation code for a specific primary key value
45 --
46 -- Prerequisites:
47 -- The primary key identified by p_scorecard_id
48 -- already exists.
49 --
50 -- In Arguments:
51 -- p_scorecard_id
52 --
53 --
54 -- Post Success:
55 -- The business group's legislation code will be returned.
56 --
57 -- Post Failure:
58 -- An error is raised if the value does not exist.
59 --
60 -- Access Status:
61 -- Internal Development Use Only.
62 --
63 -- {End Of Comments}
64 -- ---------------------------------------------------------------------------
65 FUNCTION return_legislation_code
66 (p_scorecard_id in number
67 ) RETURN varchar2;
68 --
69 --
70 -- ----------------------------------------------------------------------------
71 -- |-----------------------< chk_assignment_id >------------------------------|
72 -- ----------------------------------------------------------------------------
73 -- {Start Of Comments}
74 --
75 -- Description:
76 -- This procedure is used to ensure that the specified assignment exists
77 -- and that it is not a Benefits ('B') assignment.
78 --
79 -- Pre Conditions:
80 -- The assignment must already exist.
81 --
82 -- In Arguments:
83 --
84 --
85 -- Post Success:
86 -- Processing continues if the assignment is valid.
87 --
88 -- Post Failure:
89 -- An application error is raised if the assignment does not exist
90 -- or is a Benefits assignment.
91 --
92 -- Access Status:
93 -- Internal Development Use Only.
94 --
95 -- {End Of Comments}
96 -- ----------------------------------------------------------------------------
97 Procedure chk_assignment_id
98 (p_scorecard_id IN number
99 ,p_object_version_number IN number
100 ,p_assignment_id IN number
101 ,p_person_id OUT nocopy number);
102 --
103 -- ----------------------------------------------------------------------------
104 -- |-----------------------< chk_plan_id >------------------------------------|
105 -- ----------------------------------------------------------------------------
106 -- {Start Of Comments}
107 --
108 -- Description:
109 -- This procedure is used to validate that the specified performance
110 -- management plan exists.
111 --
112 -- Pre Conditions:
113 -- The plan must already exist.
114 --
115 -- In Arguments:
116 --
117 --
118 -- Post Success:
119 -- Processing continues if the plan is valid.
120 --
121 -- Post Failure:
122 -- An application error is raised if the plan does not exist.
123 --
124 -- Access Status:
125 -- Internal Development Use Only.
126 --
127 -- {End Of Comments}
128 -- ----------------------------------------------------------------------------
129 Procedure chk_plan_id
130 (p_scorecard_id IN number
131 ,p_object_version_number IN number
132 ,p_plan_id IN number);
133 --
134 -- ----------------------------------------------------------------------------
135 -- |-----------------------< chk_duplicate >----------------------------------|
136 -- ----------------------------------------------------------------------------
137 -- {Start Of Comments}
138 --
139 -- Description:
140 -- This procedure is used to validate that a personal scorecard does not
141 -- already exist for the given assignment and given plan.
142 --
143 -- Pre Conditions:
144 -- The plan and assignment must exist and have been validated.
145 --
146 -- In Arguments:
147 --
148 --
149 -- Post Success:
150 -- Processing continues if the scorecard is not a duplicate.
151 --
152 -- Post Failure:
153 -- An application error is raised if the scorecard is a duplicate.
154 --
155 -- Access Status:
156 -- Internal Development Use Only.
157 --
158 -- {End Of Comments}
159 -- ----------------------------------------------------------------------------
160 Procedure chk_duplicate
161 (p_scorecard_id IN number
162 ,p_object_version_number IN number
163 ,p_plan_id IN number
164 ,p_assignment_id IN number);
165 --
166 -- ----------------------------------------------------------------------------
167 -- |-----------------------< chk_dates >--------------------------------------|
168 -- ----------------------------------------------------------------------------
169 -- {Start Of Comments}
170 --
171 -- Description:
172 -- This procedure checks the start and end date of the scorecard. It
173 -- first checks that the start date is earlier than the end date and
174 -- then it checks that the scorecard dates are within the dates of the
175 -- performance management plan.
176 --
177 -- Pre Conditions:
178 -- Where used, the plan must exist and have been validated.
179 --
180 -- In Arguments:
181 --
182 --
183 -- Post Success:
184 -- Processing continues if the dates are valid.
185 --
186 -- Post Failure:
187 -- An application error is raised if the dates are invalid.
188 --
189 -- Access Status:
190 -- Internal Development Use Only.
191 --
192 -- {End Of Comments}
193 -- ----------------------------------------------------------------------------
194 Procedure chk_dates
195 (p_scorecard_id IN number
196 ,p_object_version_number IN number
197 ,p_plan_id IN number
198 ,p_start_date IN date
199 ,p_end_date IN date);
200 --
201 --
202 -- ----------------------------------------------------------------------------
203 -- |-----------------------< chk_scorecard_name >-----------------------------|
204 -- ----------------------------------------------------------------------------
205 -- {Start Of Comments}
206 --
207 -- Description:
208 -- This procedure checks that the specified assignment does not already
209 -- have a scorecard with a duplicate name.
210 --
211 -- Pre Conditions:
212 -- None.
213 --
214 -- In Arguments:
215 --
216 --
217 -- Post Success:
218 -- Processing continues if the scorecard name is unique for the given
219 -- assignment and the p_duplicate_name_warning is set accordingly
220 -- (true if the name already exists; false if it does not).
221 --
222 -- Post Failure:
223 -- An error is raised if an unhandled exception occurs.
224 --
225 -- Access Status:
226 -- Internal Development Use Only.
227 --
228 -- {End Of Comments}
229 -- ----------------------------------------------------------------------------
230 Procedure chk_scorecard_name
231 (p_scorecard_id IN number
232 ,p_object_version_number IN number
233 ,p_assignment_id IN number
234 ,p_scorecard_name IN varchar2
235 ,p_duplicate_name_warning OUT NOCOPY boolean);
236 --
237 -- ----------------------------------------------------------------------------
238 -- |-----------------------< chk_creator_type >-------------------------------|
239 -- ----------------------------------------------------------------------------
240 -- {Start Of Comments}
241 --
242 -- Description:
243 -- This procedure checks the creator type is 'MANUAL' or 'AUTO'.
244 --
245 -- Pre Conditions:
246 -- None.
247 --
248 -- In Arguments:
249 --
250 --
251 -- Post Success:
252 -- Processing continues if p_creator_type is valid.
253 --
254 -- Post Failure:
255 -- An application error is raised if the creator_type is not valid.
256 --
257 -- Access Status:
258 -- Internal Development Use Only.
259 --
260 -- {End Of Comments}
261 -- ----------------------------------------------------------------------------
262 Procedure chk_creator_type
263 (p_creator_type IN varchar2);
264 --
265 -- ----------------------------------------------------------------------------
266 -- |-----------------------< chk_status_code >--------------------------------|
267 -- ----------------------------------------------------------------------------
268 -- {Start Of Comments}
269 --
270 -- Description:
271 -- This procedure checks the status code is a valid lookup.
272 --
273 -- Pre Conditions:
274 -- The lookup needs to exist and enabled.
275 --
276 -- In Arguments:
277 --
278 --
279 -- Post Success:
280 -- Processing continues if the status code is valid.
281 --
282 -- Post Failure:
283 -- An application error is raised if the status code is not valid.
284 --
285 -- Access Status:
286 -- Internal Development Use Only.
287 --
288 -- {End Of Comments}
289 -- ----------------------------------------------------------------------------
290 Procedure chk_status_code
291 (p_effective_date IN date
292 ,p_scorecard_id IN number
293 ,p_object_version_number IN number
294 ,p_status_code IN varchar2);
295 --
296 -- Bug#13943955 sussuman
297 -- ----------------------------------------------------------------------------
298 -- |-----------------------< chk_obj_setting_deadline >------------------------|
299 -- ----------------------------------------------------------------------------
300 -- {Start Of Comments}
301 --
302 -- Description:
303 -- This procedure checks if the Objective Setting Dealdine date is not an ambiguous date.
304 --
305 -- Pre Conditions:
306 -- The Objective Setting Deadline must not be alterable beyond the appraisal creation.
307 --
308 -- In Arguments:
309 --
310 --
311 -- Post Success:
312 -- Processing continues if the status code is valid.
313 --
314 -- Post Failure:
315 -- An application error is raised if the status code is not valid.
316 --
317 -- {End Of Comments}
318 -- ----------------------------------------------------------------------------
319 Procedure chk_obj_setting_deadline
320 (p_obj_setting_deadline IN date
321 ,p_scorecard_id IN number);
322
323 -- Bug#13943955 sussuman
324 --
325 -- ----------------------------------------------------------------------------
326 -- |---------------------< chk_auto_creator_type >----------------------------|
327 -- ----------------------------------------------------------------------------
328 -- {Start Of Comments}
329 --
330 -- Description:
331 -- This procedure checks if the creator type is 'AUTO'.
332 --
333 -- Pre Conditions:
334 -- None.
335 --
336 -- In Arguments:
337 --
338 --
339 -- Post Success:
340 -- The p_created_by_plan_warning is set accordingly.
341 --
342 -- Post Failure:
343 -- None.
344 --
345 -- {End Of Comments}
346 -- ----------------------------------------------------------------------------
347 Procedure chk_auto_creator_type
348 (p_creator_type IN varchar2
349 ,p_created_by_plan_warning OUT NOCOPY boolean);
350 --
351 -- ----------------------------------------------------------------------------
352 -- |---------------------< chk_no_objectives >--------------------------------|
353 -- ----------------------------------------------------------------------------
354 -- {Start Of Comments}
355 --
356 -- Description:
357 -- This procedure validates that the scorecard does not have any objectives
358 -- before it is deleted.
359 --
360 -- Pre Conditions:
361 -- None.
362 --
363 -- In Arguments:
364 --
365 --
366 -- Post Success:
367 -- Processing continues if the scorecard does not have any objectives.
368 --
369 -- Post Failure:
370 -- An application error is raised if the scorecard has objectives.
371 --
372 -- {End Of Comments}
373 -- ----------------------------------------------------------------------------
374 Procedure chk_no_objectives
375 (p_scorecard_id IN number);
376 --
377 -- ----------------------------------------------------------------------------
378 -- |---------------------------< insert_validate >----------------------------|
379 -- ----------------------------------------------------------------------------
380 -- {Start of comments}
381 --
382 -- Description:
383 -- This procedure controls the execution of all insert business rules
384 -- validation.
385 --
386 -- Prerequisites:
387 -- This private procedure is called from ins procedure.
388 --
389 -- In Parameters:
390 -- A Pl/Sql record structure.
391 --
392 -- Post Success:
393 -- Processing continues.
394 --
395 -- Post Failure:
396 -- If a business rules fails the error will not be handled by this procedure
397 -- unless explicity coded.
398 --
399 -- Developer Implementation Notes:
400 -- For insert, your business rules should be executed from this procedure
401 -- and should ideally (unless really necessary) just be straight procedure
402 -- or function calls. Try and avoid using conditional branching logic.
403 --
404 -- Access Status:
405 -- Internal Row Handler Use Only.
406 --
407 -- {End of comments}
408 -- ----------------------------------------------------------------------------
409 Procedure insert_validate
410 (p_effective_date in date
411 ,p_rec in per_pms_shd.g_rec_type
412 ,p_person_id out nocopy number
413 ,p_duplicate_name_warning out nocopy boolean
414 );
415 --
416 -- ----------------------------------------------------------------------------
417 -- |---------------------------< update_validate >----------------------------|
418 -- ----------------------------------------------------------------------------
419 -- {Start Of Comments}
420 --
421 -- Description:
422 -- This procedure controls the execution of all update business rules
423 -- validation.
424 --
425 -- Prerequisites:
426 -- This private procedure is called from upd procedure.
427 --
431 -- Post Success:
428 -- In Parameters:
429 -- A Pl/Sql record structure.
430 --
432 -- Processing continues.
433 --
434 -- Post Failure:
435 -- If a business rules fails the error will not be handled by this procedure
436 -- unless explicity coded.
437 --
438 -- Access Status:
439 -- Internal Row Handler Use Only.
440 --
441 -- {End Of Comments}
442 -- ----------------------------------------------------------------------------
443 Procedure update_validate
444 (p_effective_date in date
445 ,p_rec in per_pms_shd.g_rec_type
446 ,p_duplicate_name_warning out nocopy boolean
447 );
448 --
449 -- ----------------------------------------------------------------------------
450 -- |---------------------------< delete_validate >----------------------------|
451 -- ----------------------------------------------------------------------------
452 -- {Start Of Comments}
453 --
454 -- Description:
455 -- This procedure controls the execution of all delete business rules
456 -- validation.
457 --
458 -- Prerequisites:
459 -- This private procedure is called from del procedure.
460 --
461 -- In Parameters:
462 -- A Pl/Sql record structure.
463 --
464 -- Post Success:
465 -- Processing continues.
466 --
467 -- Post Failure:
468 -- If a business rules fails the error will not be handled by this procedure
469 -- unless explicity coded.
470 --
471 -- Developer Implementation Notes:
472 -- For delete, your business rules should be executed from this procedure
473 -- and should ideally (unless really necessary) just be straight procedure
474 -- or function calls. Try and avoid using conditional branching logic.
475 --
476 -- Access Status:
477 -- Internal Row Handler Use Only.
478 --
479 -- {End Of Comments}
480 -- ----------------------------------------------------------------------------
481 Procedure delete_validate
482 (p_rec in per_pms_shd.g_rec_type
483 ,p_created_by_plan_warning out nocopy boolean
484 );
485 --
486 end per_pms_bus;