1 PACKAGE HR_SUPERVISOR_SS
2 /* $Header: hrsupwrs.pkh 120.1 2005/09/22 10:04:19 svittal noship $*/
3 AUTHID CURRENT_USER AS
4
5 -- declare a table for storing txn steps
6 gtt_transaction_steps hr_transaction_ss.transaction_table ;
7
8 TYPE lrt_direct_reports is RECORD (
9 last_name per_people_f.last_name%type DEFAULT NULL,
10 first_name per_people_f.first_name%type ,
11 person_id per_people_f.person_id%type ,
12 full_name per_people_f.full_name%type ,
13 assignment_id per_assignments_f.assignment_id%type,
14 supervisor_id per_people_f.person_id%type,
15 -- Assignment Security
16 supervisor_assignment_id per_assignments_f.supervisor_assignment_id%type,
17
18 supervisor_name per_people_f.full_name%type ,
19 effective_date VARCHAR2(20) DEFAULT NULL,
20 error_code VARCHAR2(10) );
21
22 TYPE ltt_direct_reports is table of lrt_direct_reports
23 INDEX BY BINARY_INTEGER ;
24
25 /*
26 ||===========================================================================
27 || FUNCTION: update_object_version
28 || DESCRIPTION: Update the object version number in the transaction step
29 || to pass the invalid object api error for Save for Later.
30 ||=======================================================================
31 */
32 PROCEDURE update_object_version
33 (p_transaction_step_id in number
34 ,p_login_person_id in number);
35
36 /*
37 ||===========================================================================
38 || PROCEDURE: branch_on_cost_center_mgr
39 || DESCRIPTION:
40 || This procedure will read the CURRENT_PERSON_ID item level
41 || attribute value and then find out nocopy if the employee to be terminated
42 || is a cost center manager or not. If yes, it will set the WF item
43 || attribute HR_TERM_COST_CENTER_MGR_FLAG to 'Y' and the WF result code
44 || will be set to "Y". In doing so, workflow will transition to the
45 || Cost Center page accordingly.
46 || This procedure will set the wf transition code as follows:
47 || (Y/N)
48 || For 'Y' => branch to Cost Center page
49 || 'N' => do not branch to Cost Center page
50 ||=======================================================================
51 */
52 PROCEDURE branch_on_cost_center_mgr
53 (itemtype in varchar2
54 ,itemkey in varchar2
55 ,actid in number
56 ,funcmode in varchar2
57 ,resultout out nocopy varchar2);
58
59 /*
60 ||===========================================================================
61 || PROCEDURE: create_transaction
62 || DESCRIPTION: Create transaction and transaction steps.
63 ||===========================================================================
64 */
65
66 PROCEDURE Create_transaction(
67 p_item_type IN WF_ITEMS.ITEM_TYPE%TYPE ,
68 p_item_key IN WF_ITEMS.ITEM_KEY%TYPE ,
69 p_act_id IN NUMBER ,
70 p_transaction_id IN OUT NOCOPY NUMBER ,
71 p_transaction_step_id IN OUT NOCOPY NUMBER,
72 p_login_person_id IN NUMBER ,
73 p_review_proc_call IN VARCHAR2 ,
74 p_no_of_direct_reports IN NUMBER DEFAULT 0,
75 p_no_of_emps IN NUMBER DEFAULT 0 ,
76 p_selected_emp_name IN VARCHAR2 DEFAULT NULL,
77 p_single_supervisor_name IN VARCHAR2 DEFAULT NULL ,
78 p_single_effective_date IN DATE DEFAULT NULL,
79 p_term_flag IN VARCHAR2,
80 p_selected_emp_id IN NUMBER,
81 p_rptg_grp_id IN VARCHAR2 DEFAULT NULL,
82 p_plan_id IN VARCHAR2 DEFAULT NULL,
83 p_effective_date_option IN VARCHAR2 DEFAULT NULL );
84
85
86 /*
87 ||===========================================================================
88 || PROCEDURE: process_api
89 || DESCRIPTION:
90 ||
91 ||===========================================================================
92 */
93
94 PROCEDURE process_api (
95 p_transaction_step_id IN
96 hr_api_transaction_steps.transaction_step_id%type,
97 p_validate BOOLEAN default FALSE,
98 p_effective_date IN VARCHAR2 default NULL) ;
99
100
101 /*
102 ||===========================================================================
103 || PROCEDURE: write_transaction
104 || DESCRIPTION:
105 ||
106 ||===========================================================================
107 */
108
109 PROCEDURE write_transaction (
110 p_old_sup_id NUMBER default NULL,
111 p_old_sup_asg_id NUMBER default NULL,
112 p_new_sup_id NUMBER default NULL,
113 -- Assignment Security
114 p_new_sup_asg_id NUMBER default NULL,
115
116 p_old_sup_name per_people_f.full_name%type default NULL,
117 p_new_sup_name per_people_f.full_name%type,
118 p_emp_name per_people_f.full_name%type,
119 p_emp_id per_people_f.person_id%type default NULL,
120 p_effective_date Date ,
121 p_assignment_id NUMBER ,
122 p_section_code IN VARCHAR2,
123 p_row_num NUMBER DEFAULT 0,
124 p_transaction_step_id NUMBER,
125 p_login_person_id IN NUMBER);
126
127 /*
128 ||===========================================================================
129 || PROCEDURE: update_asg
130 || DESCRIPTION:
131 ||
132 ||===========================================================================
133 */
134
135 procedure update_asg
136 (p_validate in NUMBER default 0
137 ,p_effective_date in date
138 ,p_attribute_update_mode in varchar2
139 ,p_assignment_id in number
140 ,p_object_version_number in out nocopy number
141 ,p_supervisor_id in number default null
142 -- Assignment Secuirty
143 ,p_supervisor_assignment_id in number default null
144
145 ,p_assignment_number in varchar2 default null
146 ,p_change_reason in varchar2 default null
147 ,p_comments in varchar2 default null
148 ,p_date_probation_end in date default null
149 ,p_default_code_comb_id in number default null
150 ,p_frequency in varchar2 default null
151 ,p_internal_address_line in varchar2 default null
152 ,p_manager_flag in varchar2 default null
153 ,p_normal_hours in number default null
154 ,p_perf_review_period in number default null
155 ,p_perf_review_period_frequency in varchar2 default null
156 ,p_probation_period in number default null
157 ,p_probation_unit in varchar2 default null
158 ,p_sal_review_period in number default null
159 ,p_sal_review_period_frequency in varchar2 default null
160 ,p_set_of_books_id in number default null
161 ,p_source_type in varchar2 default null
162 ,p_time_normal_finish in varchar2 default null
163 ,p_time_normal_start in varchar2 default null
164 ,p_ass_attribute_category in varchar2 default null
165 ,p_title in varchar2 default null
166 ,p_comment_id out nocopy number
167 ,p_effective_start_date out nocopy date
168 ,p_effective_end_date out nocopy date
169 ,p_no_managers_warning out nocopy NUMBER
170 ,p_other_manager_warning out nocopy NUMBER
171 ,p_item_type in varchar2 default null
172 ,p_item_key in varchar2 default null
173 ,p_actid in varchar2 default null
174 ,p_error_message_appl out nocopy varchar2
175 ,p_error_message_name out nocopy varchar2
176 ,p_error_message out nocopy long
177 );
178
179
180 /*
181 ||===========================================================================
182 || PROCEDURE: update_asg
183 || DESCRIPTION: This procedure takes all region rows in change manager page
184 || as a table type structure in out parameter. Iterates through
185 || the table type rows and calls the overloaded update_asg.
186 || Success: After successfull validation of all rows, writes data into
187 || transaction tables
188 || Failure: If any of the rows error in validating, then does not write into
189 || transaction tables and returns the row level error
190 ||
191 ||===========================================================================
192 */
193
194 procedure update_asg
195 (p_validate in number default 0
196 ,p_attribute_update_mode in varchar2
197 ,p_manager_details_tab in out nocopy SSHR_MANAGER_DETAILS_TAB_TYP
198 ,p_item_type in varchar2 default null
199 ,p_item_key in varchar2 default null
200 ,p_actid in varchar2 default null
201 ,p_rptg_grp_id in varchar2 default null
202 ,p_plan_id in varchar2 default null
203 ,p_effective_date_option in varchar2 default null
204 ,p_num_of_direct_reports in number default 0
205 ,p_num_of_new_direct_reports in number default 0
206 ,p_selected_person_id in number
207 ,p_selected_person_name in varchar2
208 ,p_term_sup_flag in varchar2
209 ,p_login_person_id in number
210 ,p_save_for_later in varchar2 default 'SAVE'
211 ,p_transaction_step_id in out nocopy number
212 );
213
214
215
216 END ;