1 Package per_pms_bus as
2 /* $Header: pepmsrhi.pkh 120.2.12010000.1 2008/07/28 05:23:05 appldev 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 -- ----------------------------------------------------------------------------
297 -- |---------------------< chk_auto_creator_type >----------------------------|
298 -- ----------------------------------------------------------------------------
299 -- {Start Of Comments}
300 --
301 -- Description:
302 -- This procedure checks if the creator type is 'AUTO'.
303 --
304 -- Pre Conditions:
305 -- None.
306 --
307 -- In Arguments:
308 --
309 --
310 -- Post Success:
311 -- The p_created_by_plan_warning is set accordingly.
312 --
313 -- Post Failure:
314 -- None.
315 --
316 -- {End Of Comments}
317 -- ----------------------------------------------------------------------------
318 Procedure chk_auto_creator_type
319 (p_creator_type IN varchar2
320 ,p_created_by_plan_warning OUT NOCOPY boolean);
321 --
322 -- ----------------------------------------------------------------------------
323 -- |---------------------< chk_no_objectives >--------------------------------|
324 -- ----------------------------------------------------------------------------
325 -- {Start Of Comments}
326 --
327 -- Description:
328 -- This procedure validates that the scorecard does not have any objectives
329 -- before it is deleted.
330 --
331 -- Pre Conditions:
332 -- None.
333 --
334 -- In Arguments:
335 --
336 --
337 -- Post Success:
338 -- Processing continues if the scorecard does not have any objectives.
339 --
340 -- Post Failure:
341 -- An application error is raised if the scorecard has objectives.
342 --
343 -- {End Of Comments}
344 -- ----------------------------------------------------------------------------
345 Procedure chk_no_objectives
346 (p_scorecard_id IN number);
347 --
348 -- ----------------------------------------------------------------------------
349 -- |---------------------------< insert_validate >----------------------------|
350 -- ----------------------------------------------------------------------------
351 -- {Start of comments}
352 --
353 -- Description:
354 -- This procedure controls the execution of all insert business rules
355 -- validation.
356 --
357 -- Prerequisites:
358 -- This private procedure is called from ins procedure.
359 --
360 -- In Parameters:
361 -- A Pl/Sql record structure.
362 --
363 -- Post Success:
364 -- Processing continues.
365 --
366 -- Post Failure:
367 -- If a business rules fails the error will not be handled by this procedure
368 -- unless explicity coded.
369 --
370 -- Developer Implementation Notes:
371 -- For insert, your business rules should be executed from this procedure
372 -- and should ideally (unless really necessary) just be straight procedure
373 -- or function calls. Try and avoid using conditional branching logic.
374 --
375 -- Access Status:
376 -- Internal Row Handler Use Only.
377 --
378 -- {End of comments}
379 -- ----------------------------------------------------------------------------
380 Procedure insert_validate
381 (p_effective_date in date
382 ,p_rec in per_pms_shd.g_rec_type
383 ,p_person_id out nocopy number
384 ,p_duplicate_name_warning out nocopy boolean
385 );
386 --
387 -- ----------------------------------------------------------------------------
388 -- |---------------------------< update_validate >----------------------------|
389 -- ----------------------------------------------------------------------------
390 -- {Start Of Comments}
391 --
392 -- Description:
393 -- This procedure controls the execution of all update business rules
394 -- validation.
395 --
396 -- Prerequisites:
397 -- This private procedure is called from upd procedure.
398 --
399 -- In Parameters:
400 -- A Pl/Sql record structure.
401 --
402 -- Post Success:
403 -- Processing continues.
404 --
405 -- Post Failure:
406 -- If a business rules fails the error will not be handled by this procedure
407 -- unless explicity coded.
408 --
409 -- Access Status:
410 -- Internal Row Handler Use Only.
411 --
412 -- {End Of Comments}
413 -- ----------------------------------------------------------------------------
414 Procedure update_validate
415 (p_effective_date in date
416 ,p_rec in per_pms_shd.g_rec_type
417 ,p_duplicate_name_warning out nocopy boolean
418 );
419 --
420 -- ----------------------------------------------------------------------------
421 -- |---------------------------< delete_validate >----------------------------|
422 -- ----------------------------------------------------------------------------
423 -- {Start Of Comments}
424 --
425 -- Description:
426 -- This procedure controls the execution of all delete business rules
427 -- validation.
428 --
429 -- Prerequisites:
430 -- This private procedure is called from del procedure.
431 --
432 -- In Parameters:
433 -- A Pl/Sql record structure.
434 --
435 -- Post Success:
436 -- Processing continues.
437 --
438 -- Post Failure:
439 -- If a business rules fails the error will not be handled by this procedure
440 -- unless explicity coded.
441 --
442 -- Developer Implementation Notes:
443 -- For delete, your business rules should be executed from this procedure
444 -- and should ideally (unless really necessary) just be straight procedure
445 -- or function calls. Try and avoid using conditional branching logic.
446 --
447 -- Access Status:
448 -- Internal Row Handler Use Only.
449 --
450 -- {End Of Comments}
451 -- ----------------------------------------------------------------------------
452 Procedure delete_validate
453 (p_rec in per_pms_shd.g_rec_type
454 ,p_created_by_plan_warning out nocopy boolean
455 );
456 --
457 end per_pms_bus;