4 * This package contains employee applicant APIs.
1 PACKAGE hr_employee_applicant_api AUTHID CURRENT_USER as
2 /* $Header: peemaapi.pkh 120.6.12020000.3 2013/02/04 10:45:14 sidsaxen ship $ */
3 /*#
5 * @rep:scope public
6 * @rep:product per
7 * @rep:displayname Employee Applicant
8 */
9 --
10 -- ----------------------------------------------------------------------------
11 -- |------------------------< hire_to_employee_applicant >--------------------|
12 -- ----------------------------------------------------------------------------
13 --
14 -- This version of the API is now out-of-date however it has been provided to
15 -- you for backward compatibility support and will be removed in the future.
16 -- Oracle recommends you to modify existing calling programs in advance of the
17 -- support being withdrawn thus avoiding any potential disruption.
18 --
19 PROCEDURE hire_to_employee_applicant
20 (p_validate IN BOOLEAN DEFAULT FALSE
21 ,p_hire_date IN DATE
22 ,p_person_id IN per_all_people_f.person_id%TYPE
23 ,p_per_object_version_number IN OUT NOCOPY per_all_people_f.object_version_number%TYPE
24 ,p_person_type_id IN per_person_types.person_type_id%TYPE DEFAULT NULL
25 ,p_assignment_id IN per_all_assignments_f.assignment_id%TYPE DEFAULT NULL
26 ,p_employee_number IN OUT NOCOPY per_all_people_f.employee_number%TYPE
27 ,p_per_effective_start_date OUT NOCOPY per_all_people_f.effective_start_date%TYPE
28 ,p_per_effective_end_date OUT NOCOPY per_all_people_f.effective_end_date%TYPE
29 ,p_assign_payroll_warning OUT NOCOPY BOOLEAN
30 );
31 --
32 -- ----------------------------------------------------------------------------
33 -- |------------------------< hire_to_employee_applicant >--------------------|
34 -- ----------------------------------------------------------------------------
35 --
36 -- This version of the API is now out-of-date however it has been provided to
37 -- you for backward compatibility support and will be removed in the future.
38 -- Oracle recommends you to modify existing calling programs in advance of the
39 -- support being withdrawn thus avoiding any potential disruption.
40 --
41 PROCEDURE hire_to_employee_applicant
42 (p_validate IN BOOLEAN DEFAULT FALSE
43 ,p_hire_date IN DATE
44 ,p_person_id IN per_all_people_f.person_id%TYPE
45 ,p_per_object_version_number IN OUT NOCOPY per_all_people_f.object_version_number%TYPE
46 ,p_person_type_id IN per_person_types.person_type_id%TYPE DEFAULT NULL
47 ,p_assignment_id IN per_all_assignments_f.assignment_id%TYPE DEFAULT NULL
48 ,p_employee_number IN OUT NOCOPY per_all_people_f.employee_number%TYPE
49 ,p_per_effective_start_date OUT NOCOPY per_all_people_f.effective_start_date%TYPE
50 ,p_per_effective_end_date OUT NOCOPY per_all_people_f.effective_end_date%TYPE
51 ,p_assign_payroll_warning OUT NOCOPY BOOLEAN
52 ,p_oversubscribed_vacancy_id out nocopy number
53 );
54
55 -- Start changes for bug 9879782
56 -- ----------------------------------------------------------------------------
57 -- |------------------------< hire_to_employee_applicant >--------------------|
58 -- ----------------------------------------------------------------------------
59 --
60 -- This version of the API is now out-of-date however it has been provided to
61 -- you for backward compatibility support and will be removed in the future.
62 -- Oracle recommends you to modify existing calling programs in advance of the
63 -- support being withdrawn thus avoiding any potential disruption.
64 --
65 PROCEDURE hire_to_employee_applicant
66 (p_validate IN BOOLEAN DEFAULT FALSE
67 ,p_hire_date IN DATE
68 ,p_person_id IN per_all_people_f.person_id%TYPE
69 ,p_per_object_version_number IN OUT NOCOPY per_all_people_f.object_version_number%TYPE
70 ,p_person_type_id IN per_person_types.person_type_id%TYPE DEFAULT NULL
71 ,p_hire_all_accepted_asgs IN VARCHAR2
72 ,p_assignment_id IN per_all_assignments_f.assignment_id%TYPE DEFAULT NULL
73 ,p_national_identifier IN per_all_people_f.national_identifier%TYPE DEFAULT hr_api.g_varchar2
74 ,p_employee_number IN OUT NOCOPY per_all_people_f.employee_number%TYPE
75 ,p_per_effective_start_date OUT NOCOPY per_all_people_f.effective_start_date%TYPE
76 ,p_per_effective_end_date OUT NOCOPY per_all_people_f.effective_end_date%TYPE
77 ,p_assign_payroll_warning OUT NOCOPY BOOLEAN
78 ,p_oversubscribed_vacancy_id out nocopy number
79 );
80 -- End changes for bug 9879782
81
82 --
83 -- ----------------------------------------------------------------------------
84 -- |------------------------< hire_to_employee_applicant >--------------------|
85 -- ----------------------------------------------------------------------------
86 --
87 -- {Start Of Comments}
88 /*#
89 * This API converts an applicant to an employee but lets them retain any
90 * remaining applicant assignments.
91 *
92 * This API converts a person of type Applicant to a person of type Employee
93 * (EMP).
94 *
95 * <p><b>Licensing</b><br>
96 * This API is licensed for use with Human Resources.
97 *
98 * <p><b>Prerequisites</b><br>
99 * The employee applicant (Internal Applicant) must exist in the relevant
100 * business group and have an applicant assignment with the assignment status
101 * Accepted. If person_type_id is supplied, it must have a corresponding system
102 * person type of EMP and must be active in the same business group as the
103 * applicant being changed to employee.
104 *
105 * <p><b>Post Success</b><br>
106 * The applicant has been successfully hired as an employee.
107 *
108 * <p><b>Post Failure</b><br>
109 * The API does not update the person, application, assignments, or period of
110 * service and an error is raised.
111 * @param p_validate If true, then validation alone will be performed and the
112 * database will remain unchanged. If false and all validation checks pass,
113 * then the database will be modified.
114 * @param p_hire_date Hire Date.
115 * @param p_person_id Person who is being hired.
116 * @param p_per_object_version_number Pass in the current version number of the
117 * person to be updated. When the API completes if p_validate is false, will be
118 * set to the new version number of the updated person. If p_validate is true
119 * will be set to the same value which was passed in.
120 * @param p_person_type_id Type of employee being created.
121 * @param p_hire_all_accepted_asgs Flag indicating whether to convert all
122 * accepted applicant assignments to employee assignments.
123 * @param p_assignment_id Assignment record into which a person is being hired.
124 * @param p_national_identifier Number by which a person is identified in a
125 * given legislation.
126 * @param p_employee_number The business group's employee number generation
127 * method determines when the API derives and passes out an employee number or
128 * when the calling program should pass in a value. When the API call completes
129 * if p_validate is false then will be set to the employee number. If
130 * p_validate is true then will be set to the passed value.
131 * @param p_per_effective_start_date If p_validate is false, then set to the
132 * effective start date on the updated person row which now exists as of the
133 * effective date. If p_validate is true, then set to null.
134 * @param p_per_effective_end_date If p_validate is false, then set to the
135 * effective end date on the updated person row which now exists as of the
136 * effective date. If p_validate is true, then set to null.
137 * @param p_assign_payroll_warning If set to true, then the date of birth is
138 * not entered. If set to false, then the date of birth has been entered.
139 * Indicates if it will be possible to set the payroll on any of this person's
140 * assignments.
141 * @param p_oversubscribed_vacancy_id Vacancy that was oversubscribed when the
142 * applicant was hired.
143 * @param p_upload_irec_docs is used to specify whether the iRecruitment documents
144 should be uploaded or not.
145 * @rep:displayname Hire To Employee Applicant
146 * @rep:category BUSINESS_ENTITY PER_EMPLOYEE
147 * @rep:category BUSINESS_ENTITY PER_APPLICANT
148 * @rep:category MISC_EXTENSIONS HR_USER_HOOKS
149 * @rep:scope public
150 * @rep:lifecycle active
151 * @rep:ihelp PER/@scalapi APIs in Oracle HRMS
152 */
153 --
154 -- {End Of Comments}
155 --
156 PROCEDURE hire_to_employee_applicant
157 (p_validate IN BOOLEAN DEFAULT FALSE
158 ,p_hire_date IN DATE
159 ,p_person_id IN per_all_people_f.person_id%TYPE
160 ,p_per_object_version_number IN OUT NOCOPY per_all_people_f.object_version_number%TYPE
161 ,p_person_type_id IN per_person_types.person_type_id%TYPE DEFAULT NULL
162 ,p_hire_all_accepted_asgs IN VARCHAR2
163 ,p_assignment_id IN per_all_assignments_f.assignment_id%TYPE DEFAULT NULL
164 ,p_national_identifier IN per_all_people_f.national_identifier%TYPE DEFAULT hr_api.g_varchar2
165 ,p_employee_number IN OUT NOCOPY per_all_people_f.employee_number%TYPE
166 ,p_per_effective_start_date OUT NOCOPY per_all_people_f.effective_start_date%TYPE
167 ,p_per_effective_end_date OUT NOCOPY per_all_people_f.effective_end_date%TYPE
168 ,p_assign_payroll_warning OUT NOCOPY BOOLEAN
169 ,p_oversubscribed_vacancy_id out nocopy number
170 ,p_upload_irec_docs IN VARCHAR2 -- Added for bug 9879782
171 );
172 --
173 -- ----------------------------------------------------------------------------
174 -- |-------------------------< hire_employee_applicant >----------------------|
175 -- ----------------------------------------------------------------------------
176 --
177 -- This version of the API is now out-of-date however it has been provided to
178 -- you for backward compatibility support and will be removed in the future.
179 -- Oracle recommends you to modify existing calling programs in advance of the
180 -- support being withdrawn thus avoiding any potential disruption.
181 --
182 procedure hire_employee_applicant
183 (p_validate in boolean default false,
184 p_hire_date in date,
185 p_person_id in per_all_people_f.person_id%TYPE,
186 p_per_object_version_number in out nocopy per_all_people_f.object_version_number%TYPE,
187 p_person_type_id in number default null,
188 p_assignment_id in number default null,
189 p_per_effective_start_date out nocopy date,
190 p_per_effective_end_date out nocopy date,
191 p_unaccepted_asg_del_warning out nocopy boolean,
192 p_assign_payroll_warning out nocopy boolean
193 );
194
195 -- Start changes for bug 9879782
196 -- ----------------------------------------------------------------------------
197 -- |-------------------------< hire_employee_applicant >----------------------|
198 -- ----------------------------------------------------------------------------
199 --
200 -- This version of the API is now out-of-date however it has been provided to
201 -- you for backward compatibility support and will be removed in the future.
202 -- Oracle recommends you to modify existing calling programs in advance of the
203 -- support being withdrawn thus avoiding any potential disruption.
204 --
205 procedure hire_employee_applicant
206 (p_validate in boolean default false,
207 p_hire_date in date,
208 p_person_id in per_all_people_f.person_id%TYPE,
209 p_primary_assignment_id in number default null,
210 p_person_type_id in number default null,
211 p_overwrite_primary in varchar2 default 'N',
212 p_per_object_version_number in out nocopy per_all_people_f.object_version_number%TYPE,
213 p_per_effective_start_date out nocopy date,
214 p_per_effective_end_date out nocopy date,
215 p_unaccepted_asg_del_warning out nocopy boolean,
216 p_assign_payroll_warning out nocopy boolean
217 ,p_oversubscribed_vacancy_id out nocopy number
218 );
219 -- End changes for bug 9879782
220 --
221 -- ----------------------------------------------------------------------------
222 -- |-------------------------< hire_employee_applicant >----------------------|
223 -- ----------------------------------------------------------------------------
224 --
225 -- {Start Of Comments}
226 /*#
227 * This API converts an applicant to an employee.
228 *
229 * This API converts a person of type Applicant to a person of type Employee
230 * (EMP) and ends any remaining applicant assignments.
231 *
232 * <p><b>Licensing</b><br>
233 * This API is licensed for use with Human Resources.
234 *
235 * <p><b>Prerequisites</b><br>
236 * The employee applicant (internal applicant) must exist in the relevant
237 * business group and have an applicant assignment with the assignment status
238 * Accepted. If person_type_id is supplied, it must have a corresponding system
239 * person type of EMP and must be active in the same business group as the
240 * applicant being changed to employee.
241 *
242 * <p><b>Post Success</b><br>
243 * The applicant has been successfully hired as an employee.
244 *
245 * <p><b>Post Failure</b><br>
246 * The API does not update the person, application, assignments, or period of
247 * service and an error is raised.
248 * @param p_validate If true, then validation alone will be performed and the
249 * database will remain unchanged. If false and all validation checks pass,
250 * then the database will be modified.
251 * @param p_hire_date Hire Date.
252 * @param p_person_id Person who is being hired.
253 * @param p_primary_assignment_id Primary assignment record.
254 * @param p_person_type_id Type of employee being created.
255 * @param p_overwrite_primary Flag indicating whether the current primary
256 * assignment is to be replaced.
257 * @param p_per_object_version_number Pass in the current version number of the
258 * person to be updated. When the API completes if p_validate is false, will be
259 * set to the new version number of the updated person. If p_validate is true
260 * will be set to the same value which was passed in.
261 * @param p_per_effective_start_date If p_validate is false, then set to the
262 * effective start date on the updated person row which now exists as of the
263 * effective date. If p_validate is true, then set to null.
264 * @param p_per_effective_end_date If p_validate is false, then set to the
265 * effective end date on the updated person row which now exists as of the
266 * effective date. If p_validate is true, then set to null.
267 * @param p_unaccepted_asg_del_warning If set to true, then the unaccepted
268 * applicant assignments have been terminated.
269 * @param p_assign_payroll_warning If set to true, then the date of birth is
270 * not entered. If set to false, then the date of birth has been entered.
271 * Indicates if it will be possible to set the payroll on any of this person's
272 * assignments.
273 * @param p_oversubscribed_vacancy_id Vacancy that was oversubscribed when the
274 * applicant was hired.
275 * @param p_upload_irec_docs is used to specify whether the iRecruitment documents
276 should be uploaded or not.
277 * @rep:displayname Hire Employee Applicant
278 * @rep:category BUSINESS_ENTITY PER_APPLICANT
279 * @rep:category MISC_EXTENSIONS HR_USER_HOOKS
280 * @rep:scope public
281 * @rep:lifecycle active
282 * @rep:ihelp PER/@scalapi APIs in Oracle HRMS
283 */
284 --
285 -- {End Of Comments}
286 --
287 procedure hire_employee_applicant
288 (p_validate in boolean default false,
289 p_hire_date in date,
290 p_person_id in per_all_people_f.person_id%TYPE,
291 p_primary_assignment_id in number default null,
292 p_person_type_id in number default null,
293 p_overwrite_primary in varchar2 default 'N',
294 p_per_object_version_number in out nocopy per_all_people_f.object_version_number%TYPE,
295 p_per_effective_start_date out nocopy date,
296 p_per_effective_end_date out nocopy date,
297 p_unaccepted_asg_del_warning out nocopy boolean,
298 p_assign_payroll_warning out nocopy boolean,
299 p_oversubscribed_vacancy_id out nocopy number,
300 p_upload_irec_docs in varchar2 -- Added for bug 9879782
301 );
302 --
303 -- ----------------------------------------------------------------------------
304 -- |-------------------------< hire_employee_applicant >----------------------|
305 -- ----------------------------------------------------------------------------
306 --
307 -- This version of the API is for Self Service Human Resources(SSHR) use only.
308 -- This API converts a person of type Employee.Applicant to a person of type
309 -- Employee if there is only one Application at the time of hiring or the API
310 -- will hire the Employee.Applicant into the selected Application assignment
311 -- and wont close the other Application assignments leaving the person in
312 -- Employee.Applicant person type.
313 --
314 procedure hire_employee_applicant
315 (p_validate in boolean default false,
316 p_hire_date in date,
317 p_asg_rec in out nocopy per_all_assignments_f%rowtype,
318 p_person_id in per_all_people_f.person_id%TYPE,
319 p_primary_assignment_id in number default null,
320 p_person_type_id in number default null,
321 p_overwrite_primary in varchar2 default 'N',
322 p_per_object_version_number in out nocopy per_all_people_f.object_version_number%TYPE,
323 p_per_effective_start_date out nocopy date,
324 p_per_effective_end_date out nocopy date,
325 p_unaccepted_asg_del_warning out nocopy boolean,
326 p_assign_payroll_warning out nocopy boolean
327 ,p_oversubscribed_vacancy_id out nocopy number
328 ,p_called_from in varchar2
329 );
330 --
331 --
332 -- #2264569: PL/SQL table to be used when hiring Applicants
333 -- Process Flag ==> (C)onvert, (R)etain, (E)nd Date (it can be null)
334 --
335 type rec_appl is record (
336 id per_all_assignments_f.assignment_id%TYPE,
337 process_flag varchar2(2)
338 );
339 type t_ApplTable is table of rec_appl index by binary_integer;
340
341 T_EmptyAPPL t_ApplTable;
342
343 --
344 -- routines to handle elements in table
345 --
346 function locate_element(p_table t_ApplTable
347 ,p_id per_all_assignments_f.assignment_id%TYPE)
348 return binary_integer;
349 --
350 --
351 function locate_value(p_table t_ApplTable
352 ,p_flag varchar2)
353 return binary_integer;
354 --
355 --
356 function end_date_exists(p_table t_ApplTable
357 ,p_id per_all_assignments_f.assignment_id%TYPE)
358 return integer;
359 --
360 --
361 function is_convert(p_table t_ApplTable
362 ,p_id per_all_assignments_f.assignment_id%TYPE)
363 return boolean;
364 --
365 --
366 function retain_exists(p_table t_ApplTable) return boolean;
367 --
368 --
369 function tab_is_empty(p_table t_ApplTable) return boolean;
370 --
371 --
372 function empty_table return t_ApplTable;
373 --
374 --
375 function retain_flag return varchar2;
376 --
377 function convert_flag return varchar2;
378 --
379 function end_date_flag return varchar2;
380 --
381 -- end #2264569
382
383 END hr_employee_applicant_api;