1 Package per_job_bus as
2 /* $Header: pejobrhi.pkh 120.0 2005/05/31 10:48:07 appldev noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |---------------------------< insert_validate >----------------------------|
6 -- ----------------------------------------------------------------------------
7 -- {Start Of Comments}
8 --
9 -- Description:
10 -- This procedure controls the execution of all insert business rules
11 -- validation.
12 --
13 -- Pre Conditions:
14 -- This private procedure is called from ins procedure.
15 --
16 -- In Parameters:
17 -- A Pl/Sql record structre.
18 --
19 -- Post Success:
20 -- Processing continues.
21 --
22 -- Post Failure:
23 -- If a business rules fails the error will not be handled by this procedure
24 -- unless explicity coded.
25 --
26 -- Developer Implementation Notes:
27 -- For insert, your business rules should be executed from this procedure and
28 -- should ideally (unless really necessary) just be straight procedure or
29 -- function calls. Try and avoid using conditional branching logic.
30 --
31 -- Access Status:
32 -- Internal Table Handler Use Only.
33 --
34 -- {End Of Comments}
35 -- ----------------------------------------------------------------------------
36 Procedure insert_validate(p_rec in per_job_shd.g_rec_type);
37 --
38 -- ----------------------------------------------------------------------------
39 -- |---------------------------< update_validate >----------------------------|
40 -- ----------------------------------------------------------------------------
41 -- {Start Of Comments}
42 --
43 -- Description:
44 -- This procedure controls the execution of all update business rules
45 -- validation.
46 --
47 -- Pre Conditions:
48 -- This private procedure is called from upd procedure.
49 --
50 -- In Parameters:
51 -- A Pl/Sql record structre.
52 --
53 -- Post Success:
54 -- Processing continues.
55 --
56 -- Post Failure:
57 -- If a business rules fails the error will not be handled by this procedure
58 -- unless explicity coded.
59 --
60 -- Developer Implementation Notes:
61 -- For update, your business rules should be executed from this procedure and
62 -- should ideally (unless really necessary) just be straight procedure or
63 -- function calls. Try and avoid using conditional branching logic.
64 --
65 -- Access Status:
66 -- Internal Table Handler Use Only.
67 --
68 -- {End Of Comments}
69 -- ----------------------------------------------------------------------------
70 Procedure update_validate(p_rec in per_job_shd.g_rec_type);
71 --
72 -- ----------------------------------------------------------------------------
73 -- |---------------------------< delete_validate >----------------------------|
74 -- ----------------------------------------------------------------------------
75 -- {Start Of Comments}
76 --
77 -- Description:
78 -- This procedure controls the execution of all delete business rules
79 -- validation.
80 --
81 -- Pre Conditions:
82 -- This private procedure is called from del procedure.
83 --
84 -- In Parameters:
85 -- A Pl/Sql record structre.
86 --
87 -- Post Success:
88 -- Processing continues.
89 --
90 -- Post Failure:
91 -- If a business rules fails the error will not be handled by this procedure
92 -- unless explicity coded.
93 --
94 -- Developer Implementation Notes:
95 -- For delete, your business rules should be executed from this procedure and
96 -- should ideally (unless really necessary) just be straight procedure or
97 -- function calls. Try and avoid using conditional branching logic.
98 --
99 -- Access Status:
100 -- Internal Table Handler Use Only.
101 --
102 -- {End Of Comments}
103 -- ----------------------------------------------------------------------------
104 Procedure delete_validate(p_rec in per_job_shd.g_rec_type);
105 --
106 --
107 -- ---------------------------------------------------------------------------
108 -- |---------------------< return_legislation_code >-------------------------|
109 -- ---------------------------------------------------------------------------
110 --
111 -- Description:
112 -- Return the legislation code for a specific job
113 --
114 -- Prerequisites:
115 -- The job identified by p_job_id already exists.
116 --
117 -- In Arguments:
118 -- p_assignment_id
119 --
120 -- Post Success:
121 -- If the job is found this function will return the job's business
122 -- group legislation code.
123 --
124 -- Post Failure:
125 -- An error is raised if the job does not exist.
126 --
127 -- Access Status:
128 -- Internal Development Use Only.
129 --
130 function return_legislation_code
131 (p_job_id in number
132 ) return varchar2;
133 --
134 -- ----------------------------------------------------------------------------
135 -- |-----------------------< chk_non_updateable_args >------------------------|
136 -- ----------------------------------------------------------------------------
137 -- {Start Of Comments}
138 --
139 -- Description:
140 -- This procedure is used to ensure that non updateable attributes have
141 -- not been updated. If an attribute has been updated an error is generated.
142 --
143 -- Pre Conditions:
144 -- g_old_rec has been populated with details of the values currently in
145 -- the database.
146 --
147 -- In Arguments:
148 -- p_rec has been populated with the updated values the user would like the
149 -- record set to.
150 --
151 -- Post Success:
152 -- Processing continues if all the non updateable attributes have not
153 -- changed.
154 --
155 -- Post Failure:
156 -- An application error is raised if any of the non updatable attributes
157 -- have been altered.
158 --
159 -- {End Of Comments}
160 --
161 ----------------------------------------------------------------------------
162
163 Procedure chk_non_updateable_args
164 (p_date_from in date
165 ,p_rec in per_job_shd.g_rec_type
166 ) ;
167 --
168 -- -------------------------------------------------------------------------+
169 -- |------------------------< chk_emp_rights_flag >-------------------------|
170 -- -------------------------------------------------------------------------+
171 -- {Start Of Comments}
172 --
173 -- Description:
174 -- Validates that the employee_rights_flag is either set to 'Y' or 'N'
175 -- or is null
176 --
177 -- Prerequisites:
178 --
179 -- In Arguments:
180 --
181 -- emp_rights_flag VARCHAR2 employee rights flag
182 -- p_rec
183 --
184 -- Post Success:
185 --
186 -- If the employee rights flag is set and the value is
187 -- set to either Y, N or null, the insert or update continues
188 --
189 -- Post Failure:
190 --
191 -- On failure the procedure will raise an application error
192 --
193 -- Access Status:
194 --
195 -- Public
196 --
197 -- {End Of Comments}
198 --
199 ---------------------------------------------------------------------------+
200 procedure chk_emp_rights_flag
201 (p_emp_rights_flag in per_jobs.emp_rights_flag%TYPE
202 ,p_rec in per_job_shd.g_rec_type);
203 --
204 -- -------------------------------------------------------------------------+
205 -- |--------------------------< chk_job_group_id >--------------------------|
206 -- -------------------------------------------------------------------------+
207 -- {Start Of Comments}
208 --
209 -- Description:
210 --
211 -- Validates the job group id entered. It first checks that the job
212 -- group id exists in the business group and then it checks if it is
213 -- global
214 --
215 -- Prerequisites:
216 --
217 -- In Arguments:
218 --
219 -- job_group_id number job group id
220 -- business_group_id number business group id
221 --
222 -- Post Success:
223 --
224 -- If the job group id is found, procedure continues
225 --
226 -- Post Failure:
227 --
228 -- On failure the procedure will raise an application error
229 --
230 -- Access Status:
231 --
232 -- Public
233 --
234 -- {End Of Comments}
235 --
236 --
237 ---------------------------------------------------------------------------+
238 procedure chk_job_group_id
239 (p_job_group_id in per_jobs.job_group_id%TYPE
240 ,p_business_group_id in per_jobs.business_group_id%TYPE
241 );
242 --
243 -- -------------------------------------------------------------------------+
244 -- |-----------------------< chk_approval_authority >-----------------------|
245 -- -------------------------------------------------------------------------+
246 -- {Start Of Comments}
247 --
248 -- Description:
249 -- Checks that the value of approval authority is not a negative number
250 --
251 -- Prerequisites:
252 -- approval authority must be enabled
253 --
254 -- In Arguments:
255 -- p_approval_authority varchar approval authority
256 -- p_rec
257 --
258 -- Post Success:
259 -- Insert or update process continues
260 --
261 -- Post Failure:
262 -- On failure the procedure will raise an application error
263 --
264 -- Access Status:
265 -- Public
266 --
267 -- {End Of Comments}
268 --
269 --
270 ---------------------------------------------------------------------------+
271 procedure chk_approval_authority
272 (p_approval_authority in per_jobs.approval_authority%TYPE
273 ,p_rec in per_job_shd.g_rec_type);
274 --
275 -- -------------------------------------------------------------------------+
276 -- |-----------------------< chk_benchmark_job_flag >-----------------------|
277 -- -------------------------------------------------------------------------+
278 -- {Start Of Comments}
279 --
280 -- Description:
281 -- Checks that benchmark job id and benchmark job flag are not
282 -- both being used.
283 --
284 -- Prerequisites:
285 -- benchmark job id and benchmark job flag must be populated and
286 -- enabled
287 --
288 -- In Arguments:
289 -- benchmark_job_id number benchmark job id
290 -- benchmark_job_flag varchar benchmark job flag
291 -- p_rec
292 --
293 -- Post Success:
294 -- Insert or update continues
295 --
296 -- Post Failure:
297 -- On failure the procedure will raise an application error
298 --
299 -- Access Status:
300 -- Public
301 --
302 -- {End Of Comments}
303 --
304 --
305 ---------------------------------------------------------------------------+
306 procedure chk_benchmark_job_flag
307 (p_benchmark_job_flag in per_jobs.benchmark_job_flag%TYPE
308 ,p_benchmark_job_id in per_jobs.benchmark_job_id%TYPE
309 ,p_rec in per_job_shd.g_rec_type);
310 --
311 -- --------------------------------------------------------------------------+
312 -- |------------------------< chk_benchmark_job_id >-------------------------|
313 -- --------------------------------------------------------------------------+
314 -- {Start Of Comments}
315 --
316 -- Description:
317 -- Validate that benchmark job id being used actually exists for the
318 -- business group and does not have the same job id as the job being
319 -- created or updated
320 --
321 -- Prerequisites:
322 -- benchmark job id must be populated and enabled
323 --
324 -- In Arguments:
325 -- p_benchmark_job_id
326 -- job_id
327 -- business_group_id
328 -- p_rec
329 --
330 -- Post Success:
331 -- Insert or update process continues
332 --
333 -- Post Failure:
334 -- On failure the procedure will raise an application error
335 --
336 -- Access Status:
337 -- Public
338 --
339 -- {End Of Comments}
340 --
341 --
342 ---------------------------------------------------------------------------+
343 procedure chk_benchmark_job_id
344 (p_benchmark_job_id in per_jobs.benchmark_job_id%TYPE
345 ,p_job_id in per_jobs.job_id%TYPE
346 ,p_business_group_id in per_jobs.business_group_id%TYPE
347 ,p_rec in per_job_shd.g_rec_type);
348 --
349
350 -- --------------------------------------------------------------------------+
351 -- |------------------------< check_unique_name >-------------------------|
352 -- --------------------------------------------------------------------------+
353 -- {Start Of Comments}
354 --
355 -- Description:
356 -- This procedure will ensure the uniqueness of job name for a
357 -- given business group
358 --
359 -- Prerequisites:
360 -- A valid business group must be existing
361 --
362 -- In Arguments:
363 -- p_job_id
364 -- p_business_group_id
365 -- p_name
366 --
367 -- Post Success:
368 -- Appropriate message will be shown to the user, if a duplicate
369 -- job name is found for the given business group
370 --
371 -- Post Failure:
372 -- None
373 --
374 -- Access Status:
375 -- Public
376 --
377 -- {End Of Comments}
378 --
379 ---------------------------------------------------------------------------+
380 procedure check_unique_name(p_job_id in number,
381 p_business_group_id in number,
382 p_name in varchar2);
383 --
384 -- --------------------------------------------------------------------------+
385 -- |------------------------< check_date_from >-------------------------|
386 -- --------------------------------------------------------------------------+
387 -- {Start Of Comments}
388 --
389 -- Description:
390 -- If the date from item in the jobs block is greater than
391 -- the date from item in the grades block then raise an error
392 --
393 -- Prerequisites:
394 -- A valid job must be existing
395 --
396 -- In Arguments:
397 -- p_job_id
398 -- p_date_from
399 --
400 -- Post Success:
401 -- Appropriate message will be shown to the user
402 --
403 -- Post Failure:
404 -- None
405 --
406 -- Access Status:
407 -- Public
408 --
409 -- {End Of Comments}
410 --
411 ---------------------------------------------------------------------------+
412 procedure check_date_from(p_job_id in number,
413 p_date_from in date);
414 --
415 -- --------------------------------------------------------------------------+
416 -- |------------------------< check_altered_end_date >-----------------------|
417 -- --------------------------------------------------------------------------+
418 -- {Start Of Comments}
419 --
420 -- Description:
421 -- This procedure will check for valid grades associated for a given job
422 -- and Business group, while end dating a job definition.
423 --
424 -- Prerequisites:
425 -- A valid job and business group must be existing
426 --
427 -- In Arguments:
428 -- p_business_group_id
429 -- p_job_id
430 -- p_end_of_time
431 -- p_date_to
432 -- p_date_from
433 --
434 -- Post Success:
435 -- Returns TRUE for p_early_date_to if the grades end date is greater than
436 -- the proposed end date for the job definition
437 -- Returns TRUE for p_early_date_from if the grades from date is greater
438 -- than the proposed end date for the job definition
439 --
440 -- Post Failure:
441 -- None
442 --
443 -- Access Status:
444 -- Public
445 --
446 -- {End Of Comments}
447 --
451 p_end_of_time date,
448 ---------------------------------------------------------------------------+
449 procedure check_altered_end_date(p_business_group_id number,
450 p_job_id number,
452 p_date_to date,
453 p_early_date_to in out nocopy boolean,
454 p_early_date_from in out nocopy boolean);
455 --
456 -- --------------------------------------------------------------------------+
457 -- |------------------------< check_delete_record >--------------------------|
458 -- --------------------------------------------------------------------------+
459 -- {Start Of Comments}
460 --
461 -- Description:
462 -- Check there are no values in per_valid_grades, per_job_requirements,
463 -- per_job_evaluations, per_career_path_elements (check on parent and
464 -- subordinate id), hr_all_positions_f, per_budget_elements,
465 -- PER_all_assignments, per_vacancies_f, per_element_links_f
466 --
467 -- Prerequisites:
468 -- A valid job and business group must be existing
469 --
470 -- In Arguments:
471 -- p_business_group_id
472 -- p_job_id
473 --
474 -- Post Success:
475 -- Appropriate message will be shown to the user, if data is existing in
476 -- any of the above mentioned table for the given job and business group
477 --
478 -- Post Failure:
479 -- None
480 --
481 -- Access Status:
482 -- Public
483 --
484 -- {End Of Comments}
485 --
486 ---------------------------------------------------------------------------+
487 procedure check_delete_record(p_job_id number,
488 p_business_group_id number);
489 --
490 -- ----------------------------------------------------------------------------
491 -- |---------------------------< check_evaluation_dates >---------------------|
492 -- ----------------------------------------------------------------------------
493 -- {Start Of Comments}
494 --
495 -- Description:
496 -- This procedure will check for the valid evaluations exists outside
497 -- the effective period, when the user is end dating a job for a given
498 -- job id.
499 -- Prerequisites:
500 -- A valid job must be existing
501 --
502 -- In Parameters:
503 -- Name
504 -- p_jobid
505 -- p_job_date_from
506 -- p_job_date_to
507 --
508 -- Post Success:
509 -- User will be stopped from end dating the job, if any evaluation is
510 -- existing outside the effective end date of the job,for the given job id.
511 -- and a suitable message will be shown to the user.
512 --
513 -- Post Failure:
514 -- None.
515 --
516 -- Access Status:
517 -- Public
518 --
519 -- {End Of Comments}
520 --
521 -- ----------------------------------------------------------------------------
522 procedure check_evaluation_dates(p_jobid in number,
523 p_job_date_from in date,
524 p_job_date_to in date);
525 --
526 end per_job_bus;