1 PACKAGE hr_perf_mgmt_plan_internal AUTHID CURRENT_USER AS
2 /* $Header: pepmpbsi.pkh 120.16.12020000.2 2013/03/18 10:41:24 schowdhu ship $ */
3 --
4 -- Package global constants.
5 --
6 g_no_debug CONSTANT NUMBER := 0;
7 g_pipe CONSTANT NUMBER := 1;
8 g_fnd_log CONSTANT NUMBER := 2;
9 --
10 g_regular_log CONSTANT NUMBER := 1;
11 g_debug_log CONSTANT NUMBER := 2;
12 --
13 success CONSTANT NUMBER := 0;
14 warning CONSTANT NUMBER := 1;
15 error CONSTANT NUMBER := 2;
16 --
17 -- Package global variables.
18 --
19 g_errbuf VARCHAR2 (2000);
20 g_retcode NUMBER;
21
22 --bug14046867 .. adding global variable for source_plan_id
23 g_src_plan_id NUMBER;
24 --bug14046867
25 /*
26 function get_appraisal_config_params(p_appr_initiator_code in per_appraisal_periods.initiator_code%TYPE,
27 p_function_id in out nocopy fnd_form_functions.function_id%TYPE,
28 p_function_name in out nocopy fnd_form_functions.function_name%TYPE,
29 p_func_parameters in out nocopy fnd_form_functions.parameters%TYPE,
30 p_appraisal_sys_type in out nocopy per_appraisals.appraisal_system_status%TYPE)
31 return boolean;
32 */
33
34 --
35 -- ----------------------------------------------------------------------------
36 -- |---------------------------< get_plan_action >----------------------------|
37 -- ----------------------------------------------------------------------------
38 -- {Start Of Comments}
39 --
40 -- Description: Publish Performance Management Plan workflow process calls this
41 -- function to read the WPM_PLAN_ACTION attribute value.
42 --
43 --
44 -- Prerequisites:
45 --
46 --
47 -- In Parameters:
48 -- Name Reqd Type Description
49 --
50 --
51 -- Post Success:
52 --
53 --
54 -- Name Type Description
55 --
56 -- Post Failure:
57 --
58 --
59 -- Access Status:
60 -- Internal Development Use Only.
61 --
62 -- {End Of Comments}
63 --
64 PROCEDURE get_plan_action (
65 itemtype IN VARCHAR2,
66 itemkey IN VARCHAR2,
67 actid IN NUMBER,
68 funcmode IN VARCHAR2,
69 resultout OUT NOCOPY VARCHAR2
70 );
71
72 --
73 --
74 -- ----------------------------------------------------------------------------
75 -- |---------------------------< get_plan_method >----------------------------|
76 -- ----------------------------------------------------------------------------
77 -- {Start Of Comments}
78 --
79 -- Description: Publish Performance Management Plan workflow process calls this
80 -- function to read the WPM_PLAN_METHOD attribute value.
81 --
82 --
83 -- Prerequisites:
84 --
85 --
86 -- In Parameters:
87 -- Name Reqd Type Description
88 --
89 --
90 -- Post Success:
91 --
92 --
93 -- Name Type Description
94 --
95 -- Post Failure:
96 --
97 --
98 -- Access Status:
99 -- Internal Development Use Only.
100 --
101 -- {End Of Comments}
102 --
103 PROCEDURE get_plan_method (
104 itemtype IN VARCHAR2,
105 itemkey IN VARCHAR2,
106 actid IN NUMBER,
107 funcmode IN VARCHAR2,
108 resultout OUT NOCOPY VARCHAR2
109 );
110
111 --
112 --
113 -- ----------------------------------------------------------------------------
114 -- |----------------------< populate_plan_members_cache >---------------------|
115 -- ----------------------------------------------------------------------------
116 -- {Start Of Comments}
117 --
118 -- Description: Publish Performance Management Plan workflow process calls this
119 -- function to populate the plan population in plsql cache.
120 --
121 --
122 -- Prerequisites:
123 --
124 --
125 -- In Parameters:
126 -- Name Reqd Type Description
127 --
128 --
129 -- Post Success:
130 --
131 --
132 -- Name Type Description
133 --
134 -- Post Failure:
135 --
136 --
137 -- Access Status:
138 -- Internal Development Use Only.
139 --
140 -- {End Of Comments}
141 --
142 PROCEDURE populate_plan_members_cache (
143 itemtype IN VARCHAR2,
144 itemkey IN VARCHAR2,
145 actid IN NUMBER,
146 funcmode IN VARCHAR2,
147 resultout OUT NOCOPY VARCHAR2
148 );
149
150 --
151 --
152 -- ----------------------------------------------------------------------------
153 -- |---------------------------< get_plan_member >----------------------------|
154 -- ----------------------------------------------------------------------------
155 -- {Start Of Comments}
156 --
157 -- Description: Publish Performance Management Plan workflow process calls this
158 -- function to get first or next the plan member.
159 --
160 --
161 -- Prerequisites:
162 --
163 --
164 -- In Parameters:
165 -- Name Reqd Type Description
166 --
167 --
168 -- Post Success:
169 --
170 --
171 -- Name Type Description
172 --
173 -- Post Failure:
174 --
175 --
176 -- Access Status:
177 -- Internal Development Use Only.
178 --
179 -- {End Of Comments}
180 --
181 PROCEDURE get_plan_member (
182 itemtype IN VARCHAR2,
183 itemkey IN VARCHAR2,
184 actid IN NUMBER,
185 funcmode IN VARCHAR2,
186 resultout OUT NOCOPY VARCHAR2
187 );
188
189 --
190 --
191 -- ----------------------------------------------------------------------------
192 -- |------------------------< get_top_plan_member >--------------------------|
193 -- ----------------------------------------------------------------------------
194 -- {Start Of Comments}
195 --
196 -- Description: Publish Performance Management Plan workflow process calls this
197 -- function to get first or next the plan member from top of the
198 -- plan population hierarchy.
199 --
200 --
201 -- Prerequisites:
202 --
203 --
204 -- In Parameters:
205 -- Name Reqd Type Description
206 --
207 --
208 -- Post Success:
209 --
210 --
211 -- Name Type Description
212 --
213 -- Post Failure:
214 --
215 --
216 -- Access Status:
217 -- Internal Development Use Only.
218 --
219 -- {End Of Comments}
220 --
221 PROCEDURE get_top_plan_member (
222 itemtype IN VARCHAR2,
223 itemkey IN VARCHAR2,
224 actid IN NUMBER,
225 funcmode IN VARCHAR2,
226 resultout OUT NOCOPY VARCHAR2
227 );
228
229 --
230 --
231 -- ----------------------------------------------------------------------------
232 -- |----------------------< get_non_top_plan_member >-------------------------|
233 -- ----------------------------------------------------------------------------
234 -- {Start Of Comments}
235 --
236 -- Description: Publish Performance Management Plan workflow process calls this
237 -- function to get first or next the plan member that is does not
238 -- exist in top population of the plan population hierarchy.
239 --
240 --
241 -- Prerequisites:
242 --
243 --
244 -- In Parameters:
245 -- Name Reqd Type Description
246 --
247 --
248 -- Post Success:
249 --
250 --
251 -- Name Type Description
252 --
253 -- Post Failure:
254 --
255 --
256 -- Access Status:
257 -- Internal Development Use Only.
258 --
259 -- {End Of Comments}
260 --
261 PROCEDURE get_non_top_plan_member (
262 itemtype IN VARCHAR2,
263 itemkey IN VARCHAR2,
264 actid IN NUMBER,
265 funcmode IN VARCHAR2,
266 resultout OUT NOCOPY VARCHAR2
267 );
268
269 --
270 -- ----------------------------------------------------------------------------
271 -- |---------------------< submit_publish_plan_cp >---------------------------|
272 -- ----------------------------------------------------------------------------
273 -- {Start Of Comments}
274 --
275 -- Description: The procedure submits Publish Performance Management Plan
276 -- concurrent program and updated the plan status to SUBMITTED.
277 --
278 --
279 -- Prerequisites:
280 --
281 --
282 -- In Parameters:
283 -- Name Reqd Type Description
284 --
285 --
286 -- Post Success:
287 --
288 --
289 -- Name Type Description
290 --
291 -- Post Failure:
292 --
293 --
294 -- Access Status:
295 -- Internal Development Use Only.
296 --
297 -- {End Of Comments}
298 --
299 PROCEDURE submit_publish_plan_cp (
300 p_effective_date IN VARCHAR2,
301 p_plan_id IN NUMBER,
302 p_reverse_mode IN VARCHAR2,
303 p_item_type IN VARCHAR2,
304 p_wf_process IN VARCHAR2,
305 p_object_version_number IN OUT NOCOPY NUMBER,
306 p_status_code IN OUT NOCOPY VARCHAR2
307 );
308
309 --
310 --
311 -- ----------------------------------------------------------------------------
312 -- |---------------------------< publish_plan_cp >----------------------------|
313 -- ----------------------------------------------------------------------------
314 -- {Start Of Comments}
315 --
316 -- Description: Publish Performance Management Plan concurrent program calls
317 -- procedure.
318 --
319 --
320 -- Prerequisites:
321 --
322 --
323 -- In Parameters:
324 -- Name Reqd Type Description
325 --
326 --
327 -- Post Success:
328 --
329 --
330 -- Name Type Description
331 --
332 -- Post Failure:
333 --
334 --
335 -- Access Status:
336 -- Internal Development Use Only.
337 --
338 -- {End Of Comments}
339 --
340 PROCEDURE publish_plan_cp (
341 errbuf OUT NOCOPY VARCHAR2,
342 retcode OUT NOCOPY NUMBER,
343 p_effective_date IN VARCHAR2,
344 p_plan_id IN NUMBER,
345 p_reverse_mode IN VARCHAR2 DEFAULT 'N',
346 p_what_if IN VARCHAR2 DEFAULT 'N',
347 p_log_output IN VARCHAR2 DEFAULT 'N',
348 p_action_parameter_group_id IN NUMBER DEFAULT NULL,
349 p_item_type IN VARCHAR2 DEFAULT 'HRWPM',
350 p_wf_process IN VARCHAR2 DEFAULT 'HR_NOTIFY_WPM_PLAN_POP_PRC'
351 );
352
353 --
354 --
355 -- ----------------------------------------------------------------------------
356 -- |-----------------------------< publish_plan >-----------------------------|
357 -- ----------------------------------------------------------------------------
358 -- {Start Of Comments}
359 --
360 -- Description: Publish Performance Management Plan APIs and concurrent program
361 -- calls this procedure.
362 --
363 --
364 -- Prerequisites:
368 -- Name Reqd Type Description
365 --
366 --
367 -- In Parameters:
369 --
370 --
371 -- Post Success:
372 --
373 --
374 -- Name Type Description
375 --
376 -- Post Failure:
377 --
378 --
379 -- Access Status:
380 -- Internal Development Use Only.
381 --
382 -- {End Of Comments}
383 --
384 PROCEDURE publish_plan (
385 p_effective_date IN DATE,
386 p_plan_id IN NUMBER,
387 p_object_version_number IN OUT NOCOPY NUMBER,
388 p_reverse_mode IN VARCHAR2 DEFAULT 'N',
389 p_what_if IN VARCHAR2 DEFAULT 'N',
390 p_log_output IN VARCHAR2 DEFAULT 'N',
391 p_action_parameter_group_id IN NUMBER DEFAULT NULL,
392 p_item_type IN VARCHAR2 DEFAULT 'HRWPM',
393 p_wf_process IN VARCHAR2 DEFAULT 'HR_NOTIFY_WPM_PLAN_POP_PRC'
394 );
395
396 --
397 -- ----------------------------------------------------------------------------
398 -- |----------------------------< send_fyi_ntf >------------------------------|
399 -- ----------------------------------------------------------------------------
400 --
401 PROCEDURE send_fyi_ntf (
402 itemtype IN VARCHAR2,
403 itemkey IN VARCHAR2,
404 actid IN NUMBER,
405 funcmode IN VARCHAR2,
406 resultout OUT NOCOPY VARCHAR2
407 );
408
409 --
410 -- ----------------------------------------------------------------------------
411 -- |--------------------------< send_fyi_ntf_admin >--------------------------|
412 -- ----------------------------------------------------------------------------
413 --
414 PROCEDURE send_fyi_ntf_admin (
415 itemtype IN VARCHAR2,
416 itemkey IN VARCHAR2,
417 actid IN NUMBER,
418 funcmode IN VARCHAR2,
419 resultout OUT NOCOPY VARCHAR2
420 );
421
422 --
423 PROCEDURE send_fyi_admin (p_plan_rec IN per_perf_mgmt_plans%ROWTYPE, p_status IN VARCHAR2, p_request_id IN NUMBER);
424
425 -- ----------------------------------------------------------------------------
426 -- |----------------------------< copy_past_objectives >----------------------|
427 -- ----------------------------------------------------------------------------
428 -- {Start Of Comments}
429 --
430 -- Description:
431 -- Copy objectives from previous plan to the current plan being published.
432 --
433 -- Prerequisites:
434 -- None.
435 --
436 -- In Arguments:
437 --
438 --
439 -- Post Success:
440 -- Processing continues if objective(s) is created.
441 --
442 -- Post Failure:
443 -- An application error is raised if objective is not created.
444 --
445 -- Access Status:
446 -- Internal Only.
447 --
448 -- {End Of Comments}
449 -- ----------------------------------------------------------------------------
450 PROCEDURE copy_past_objectives (
451 p_effective_date IN DATE,
452 p_business_group_id IN NUMBER,
453 p_person_id IN NUMBER,
454 p_scorecard_id IN NUMBER,
455 p_start_date IN DATE,
456 p_end_date IN DATE,
457 p_target_date IN DATE DEFAULT NULL,
458 p_assignemnt_id IN NUMBER,
459 p_prev_plan_id IN NUMBER,
460 p_curr_plan_id IN NUMBER
461 );
462
463 -- ----------------------------------------------------------------------------
464 -- |----------------------------< is_supervisor_in_org >----------------------|
465 ---------------------------------------------------------------------
466 --{Start Of Comments}
467 --
468 -- Description:
469 -- return true if the person is the topmost supervisor
470 --
471 -- Prerequisites:
472 -- None.
473 --
474 -- In Arguments:
475 --
476 --
477 -- Post Success:
478 -- signifies that this is the top supervisor in the organization.
479 --
480 -- Post Failure:
481 --
482 --
483 -- Access Status:
484 -- Internal Only.
485 --
486 -- {End Of Comments}
487 ---------------------------------------------------------------------
488 FUNCTION is_supervisor_in_org (p_top_organization_id IN NUMBER, p_person_id IN NUMBER)
489 RETURN NUMBER;
490
491 -- ----------------------------------------------------------------------------
492 -- |----------------------------< change_plan_active_status >----------------------|
493 ---------------------------------------------------------------------
494 --{Start Of Comments}
495 --
496 -- Description:
497 -- updates the plan status and swaps the status to Inactive/published if teh current status is published/inactive
498 --
499 -- Prerequisites:
500 -- None.
501 --
502 -- In Arguments:
503 -- Plan ID
504 --
505 -- Post Success:
506 -- Plan status updated to Inactive/Published
507 --
508 -- Post Failure:
509 --
510 --
511 -- Access Status:
512 -- Internal Only.
513 --
514 -- {End Of Comments}
515 ---------------------------------------------------------------------
516 PROCEDURE change_plan_active_status (p_plan_id IN NUMBER);
517
518 -- ----------------------------------------------------------------------------
519 -- |--------------------------< backout_perf_mgmt_plan>----------------------|
523 -- Description:
520 -- ----------------------------------------------------------------------------
521 -- {Start Of Comments}
522 --
524 -- This procedure backs out the Performance Management Plan that is
525 -- published to a given population. Deletes all the score cards, appraisals
526 -- that are created during the plan publish. This is an irreversible process.
527 -- Prerequisites:
528 -- None.
529 --
530 -- In Arguments:
531 --
532 --
533 -- Post Success:
534 -- All data that is created as part of the plan publish. The plan will be set
535 -- to status Draft, so that the further updates can be made to the plan and
536 -- the same can be republished.
537 --
538 -- Post Failure:
539 -- Plan data will be intact.
540 --
541 -- Access Status:
542 -- Internal Only.
543 --
544 -- {End Of Comments}
545 -- ----------------------------------------------------------------------------
546 PROCEDURE backout_perf_mgmt_plan (
547 errbuf OUT NOCOPY VARCHAR2,
548 retcode OUT NOCOPY NUMBER,
549 p_effective_date IN VARCHAR2,
550 p_plan_id IN NUMBER,
551 p_report_only IN VARCHAR2 DEFAULT 'Y'
552 );
553
554 --
555 -- -----------------------------------------------------------------------
556 -- |----------< backout_perf_mgmt_plan_cp>----------------------|
557 -- ----------------------------------------------------------------------------
558 -- {Start Of Comments}
559 --
560 -- Description:
561 -- This function submit the concurrent job that backs out the Performance
562 -- Management Plan that is published to a given population. Deletes all the
563 -- score cards, appraisals that are created during the plan publish. This is
564 -- an irreversible process.
565 -- Prerequisites:
566 -- None.
567 --
568 -- In Arguments:
569 --
570 --
571 -- Post Success:
572 -- Returns the request_id of the concurrent request that is submitted.
573 --
574 -- Post Failure:
575 -- Plan will not be backed out.
576 --
577 -- Access Status:
578 -- Internal Only.
579 --
580 -- {End Of Comments}
581 -- ----------------------------------------------------------------------------
582 FUNCTION backout_perf_mgmt_plan_cp (p_effective_date IN DATE, p_plan_id IN NUMBER, p_report_only IN VARCHAR2 DEFAULT 'Y')
583 RETURN NUMBER;
584
585 --
586 -- ----------------------------------------------------------------------------
587 -- |--------------------------< plan_admin_actions_cp>----------------------|
588 -- ----------------------------------------------------------------------------
589 -- {Start Of Comments}
590 --
591 -- Description:
592 -- This function submits the concurrent job that performs the selected
593 -- task on the given list of employees. This is used in the new
594 -- plan administration area for Performance Mgmt administrators.
595 -- Prerequisites:
596 -- None.
597 --
598 -- In Arguments:
599 --
600 --
601 -- Post Success:
602 -- Returns the request_id of the concurrent request that is submitted.
603 --
604 -- Post Failure:
605 -- No request will be returned and error raised
606 --
607 -- Access Status:
608 -- Internal Only.
609 --
610 -- {End Of Comments}
611 -- ----------------------------------------------------------------------------
612 FUNCTION plan_admin_actions_cp (
613 p_effective_date IN DATE,
614 p_plan_id IN NUMBER,
615 p_selected_entities_list IN VARCHAR2,
616 p_task_code IN VARCHAR2
617 )
618 RETURN NUMBER;
619
620 -- ----------------------------------------------------------------------------
621 -- |--------------------------< plan_admin_actions>----------------------|
622 -- ----------------------------------------------------------------------------
623 -- {Start Of Comments}
624 --
625 -- Description:
626 -- This procedure performs the selected task on the given list of employees.
627 -- This is used in the new plan administration area for Performance Mgmt
628 -- administrators.
629 -- Prerequisites:
630 -- None.
631 --
632 -- In Arguments:
633 --
634 --
635 -- Post Success:
636 -- Performs the requested action all the selected persons..
637 --
638 -- Post Failure:
639 -- No action would be performed and appropriate error message(s) logged.
640 --
641 -- Access Status:
642 -- Internal Only.
643 --
644 -- {End Of Comments}
645 -- ----------------------------------------------------------------------------
646 PROCEDURE plan_admin_actions (
647 errbuf OUT NOCOPY VARCHAR2,
648 retcode OUT NOCOPY NUMBER,
649 p_effective_date IN VARCHAR2,
650 p_plan_id IN NUMBER,
651 p_selected_entities_list IN VARCHAR2,
652 p_task_code IN VARCHAR2
653 );
654
655 PROCEDURE send_message_notification (
656 p_person_id IN NUMBER,
657 p_message VARCHAR2,
658 p_plan_id per_perf_mgmt_plans.plan_id%TYPE DEFAULT NULL,
659 p_full_name per_all_people_f.full_name%TYPE
660 );
661
662 FUNCTION get_manager_id (
663 p_person_id IN per_all_assignments_f.person_id%TYPE,
664 p_assignment_id per_all_assignments_f.assignment_id%TYPE
665 )
666 RETURN NUMBER;
667
668 -- ----------------------------------------------------------------------------
669 -- |----------------------------< notify_plan_population >----------------------|
670 ---------------------------------------------------------------------
671 --{Start Of Comments}
672 --
673 -- Description:
674 -- New procedure to notify the entire plan population (for a parallel plan)
675 --
676 -- Prerequisites:
677 -- None.
678 --
679 -- In Arguments:
680 --
681 --
682 -- Post Success:
683 -- notifies the plan population
684 --
685 -- Post Failure:
686 --
687 --
688 -- Access Status:
689 -- Internal Only.
690 --
691 -- {End Of Comments}
692 ---------------------------------------------------------------------
693 PROCEDURE notify_plan_population (
694 itemtype IN VARCHAR2,
695 itemkey IN VARCHAR2,
696 actid IN NUMBER,
697 funcmode IN VARCHAR2,
698 resultout OUT NOCOPY VARCHAR2
699 );
700
701 PROCEDURE submit_publish_plan_rep_cp (
702 p_effective_date IN DATE,
703 p_plan_id IN NUMBER,
704 p_object_version_number IN OUT NOCOPY NUMBER,
705 p_reverse_mode IN VARCHAR2 DEFAULT 'N',
706 p_what_if IN VARCHAR2 DEFAULT 'N',
707 p_log_output IN VARCHAR2 DEFAULT 'N',
708 p_action_parameter_group_id IN NUMBER DEFAULT NULL,
709 p_item_type IN VARCHAR2 DEFAULT 'HRWPM',
710 p_wf_process IN VARCHAR2 DEFAULT 'HR_NOTIFY_WPM_PLAN_POP_PRC',
711 p_status_code IN OUT NOCOPY VARCHAR2,
712 p_republish_values IN VARCHAR2
713 );
714
715 PROCEDURE plan_republish (
716 errbuf OUT NOCOPY VARCHAR2,
717 retcode OUT NOCOPY NUMBER,
718 p_effective_date IN VARCHAR2,
719 p_plan_id IN NUMBER,
720 p_object_version_number IN NUMBER DEFAULT NULL,
721 p_reverse_mode IN VARCHAR2 DEFAULT 'N',
722 p_what_if IN VARCHAR2 DEFAULT 'N',
723 p_log_output IN VARCHAR2 DEFAULT 'N',
724 p_action_parameter_group_id IN NUMBER DEFAULT NULL,
725 p_item_type IN VARCHAR2 DEFAULT 'HRWPM',
726 p_wf_process IN VARCHAR2 DEFAULT 'HR_NOTIFY_WPM_PLAN_POP_PRC',
727 p_status_code IN VARCHAR2 DEFAULT NULL,
728 p_republish_values IN VARCHAR2
729 );
730 END hr_perf_mgmt_plan_internal;