DBA Data[Home] [Help]

PACKAGE: APPS.HR_EMPLOYEE_APPLICANT_API

Source


1 PACKAGE hr_employee_applicant_api as
2 /* $Header: peemaapi.pkh 120.2.12000000.1 2007/01/21 22:09:15 appldev ship $ */
3 /*#
4  * This package contains employee applicant APIs.
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 -- ----------------------------------------------------------------------------
56 -- |------------------------< hire_to_employee_applicant >--------------------|
57 -- ----------------------------------------------------------------------------
58 --
59 -- {Start Of Comments}
60 /*#
61  * This API converts an applicant to an employee but lets them retain any
62  * remaining applicant assignments.
63  *
64  * This API converts a person of type Applicant to a person of type Employee
65  * (EMP).
66  *
67  * <p><b>Licensing</b><br>
68  * This API is licensed for use with Human Resources.
69  *
70  * <p><b>Prerequisites</b><br>
71  * The employee applicant (Internal Applicant) must exist in the relevant
72  * business group and have an applicant assignment with the assignment status
73  * Accepted. If person_type_id is supplied, it must have a corresponding system
74  * person type of EMP and must be active in the same business group as the
75  * applicant being changed to employee.
76  *
77  * <p><b>Post Success</b><br>
78  * The applicant has been successfully hired as an employee.
79  *
80  * <p><b>Post Failure</b><br>
81  * The API does not update the person, application, assignments, or period of
82  * service and an error is raised.
83  * @param p_validate If true, then validation alone will be performed and the
84  * database will remain unchanged. If false and all validation checks pass,
85  * then the database will be modified.
86  * @param p_hire_date Hire Date.
87  * @param p_person_id Person who is being hired.
88  * @param p_per_object_version_number Pass in the current version number of the
89  * person to be updated. When the API completes if p_validate is false, will be
90  * set to the new version number of the updated person. If p_validate is true
91  * will be set to the same value which was passed in.
92  * @param p_person_type_id Type of employee being created.
93  * @param p_hire_all_accepted_asgs Flag indicating whether to convert all
94  * accepted applicant assignments to employee assignments.
95  * @param p_assignment_id Assignment record into which a person is being hired.
96  * @param p_national_identifier Number by which a person is identified in a
97  * given legislation.
98  * @param p_employee_number The business group's employee number generation
99  * method determines when the API derives and passes out an employee number or
100  * when the calling program should pass in a value. When the API call completes
101  * if p_validate is false then will be set to the employee number. If
102  * p_validate is true then will be set to the passed value.
103  * @param p_per_effective_start_date If p_validate is false, then set to the
104  * effective start date on the updated person row which now exists as of the
105  * effective date. If p_validate is true, then set to null.
106  * @param p_per_effective_end_date If p_validate is false, then set to the
107  * effective end date on the updated person row which now exists as of the
108  * effective date. If p_validate is true, then set to null.
109  * @param p_assign_payroll_warning If set to true, then the date of birth is
110  * not entered. If set to false, then the date of birth has been entered.
111  * Indicates if it will be possible to set the payroll on any of this person's
112  * assignments.
113  * @param p_oversubscribed_vacancy_id Vacancy that was oversubscribed when the
114  * applicant was hired.
115  * @rep:displayname Hire To Employee Applicant
116  * @rep:category BUSINESS_ENTITY PER_EMPLOYEE
117  * @rep:category BUSINESS_ENTITY PER_APPLICANT
118  * @rep:category MISC_EXTENSIONS HR_USER_HOOKS
119  * @rep:scope public
120  * @rep:lifecycle active
121  * @rep:ihelp PER/@scalapi APIs in Oracle HRMS
122 */
123 --
124 -- {End Of Comments}
125 --
126 PROCEDURE hire_to_employee_applicant
127   (p_validate                     IN     BOOLEAN                                     DEFAULT FALSE
128   ,p_hire_date                    IN     DATE
129   ,p_person_id                    IN     per_all_people_f.person_id%TYPE
130   ,p_per_object_version_number    IN OUT NOCOPY per_all_people_f.object_version_number%TYPE
131   ,p_person_type_id               IN     per_person_types.person_type_id%TYPE        DEFAULT NULL
132   ,p_hire_all_accepted_asgs       IN     VARCHAR2
133   ,p_assignment_id                IN     per_all_assignments_f.assignment_id%TYPE    DEFAULT NULL
134   ,p_national_identifier          IN     per_all_people_f.national_identifier%TYPE   DEFAULT hr_api.g_varchar2
135   ,p_employee_number              IN OUT NOCOPY per_all_people_f.employee_number%TYPE
136   ,p_per_effective_start_date        OUT NOCOPY per_all_people_f.effective_start_date%TYPE
137   ,p_per_effective_end_date          OUT NOCOPY per_all_people_f.effective_end_date%TYPE
138   ,p_assign_payroll_warning          OUT NOCOPY BOOLEAN
139   ,p_oversubscribed_vacancy_id       out nocopy number
140   );
141 --
142 -- ----------------------------------------------------------------------------
143 -- |-------------------------< hire_employee_applicant >----------------------|
144 -- ----------------------------------------------------------------------------
145 --
146 -- This version of the API is now out-of-date however it has been provided to
147 -- you for backward compatibility support and will be removed in the future.
148 -- Oracle recommends you to modify existing calling programs in advance of the
149 -- support being withdrawn thus avoiding any potential disruption.
150 --
151 procedure hire_employee_applicant
152   (p_validate                  in      boolean   default false,
153    p_hire_date                 in      date,
154    p_person_id                 in      per_all_people_f.person_id%TYPE,
155    p_per_object_version_number in out nocopy  per_all_people_f.object_version_number%TYPE,
156    p_person_type_id            in      number   default null,
157    p_assignment_id             in      number   default null,
158    p_per_effective_start_date     out nocopy  date,
159    p_per_effective_end_date       out nocopy  date,
160    p_unaccepted_asg_del_warning   out nocopy  boolean,
161    p_assign_payroll_warning       out nocopy  boolean
162 );
163 --
164 -- ----------------------------------------------------------------------------
165 -- |-------------------------< hire_employee_applicant >----------------------|
166 -- ----------------------------------------------------------------------------
167 --
168 -- {Start Of Comments}
169 /*#
170  * This API converts an applicant to an employee.
171  *
172  * This API converts a person of type Applicant to a person of type Employee
173  * (EMP) and ends any remaining applicant assignments.
174  *
175  * <p><b>Licensing</b><br>
176  * This API is licensed for use with Human Resources.
177  *
178  * <p><b>Prerequisites</b><br>
179  * The employee applicant (internal applicant) must exist in the relevant
180  * business group and have an applicant assignment with the assignment status
181  * Accepted. If person_type_id is supplied, it must have a corresponding system
182  * person type of EMP and must be active in the same business group as the
183  * applicant being changed to employee.
184  *
185  * <p><b>Post Success</b><br>
186  * The applicant has been successfully hired as an employee.
187  *
188  * <p><b>Post Failure</b><br>
189  * The API does not update the person, application, assignments, or period of
190  * service and an error is raised.
191  * @param p_validate If true, then validation alone will be performed and the
192  * database will remain unchanged. If false and all validation checks pass,
193  * then the database will be modified.
194  * @param p_hire_date Hire Date.
195  * @param p_person_id Person who is being hired.
196  * @param p_primary_assignment_id Primary assignment record.
197  * @param p_person_type_id Type of employee being created.
198  * @param p_overwrite_primary Flag indicating whether the current primary
199  * assignment is to be replaced.
200  * @param p_per_object_version_number Pass in the current version number of the
201  * person to be updated. When the API completes if p_validate is false, will be
202  * set to the new version number of the updated person. If p_validate is true
203  * will be set to the same value which was passed in.
204  * @param p_per_effective_start_date If p_validate is false, then set to the
205  * effective start date on the updated person row which now exists as of the
206  * effective date. If p_validate is true, then set to null.
207  * @param p_per_effective_end_date If p_validate is false, then set to the
208  * effective end date on the updated person row which now exists as of the
209  * effective date. If p_validate is true, then set to null.
210  * @param p_unaccepted_asg_del_warning If set to true, then the unaccepted
211  * applicant assignments have been terminated.
212  * @param p_assign_payroll_warning If set to true, then the date of birth is
213  * not entered. If set to false, then the date of birth has been entered.
214  * Indicates if it will be possible to set the payroll on any of this person's
215  * assignments.
216  * @param p_oversubscribed_vacancy_id Vacancy that was oversubscribed when the
217  * applicant was hired.
218  * @rep:displayname Hire Employee Applicant
219  * @rep:category BUSINESS_ENTITY PER_APPLICANT
220  * @rep:category MISC_EXTENSIONS HR_USER_HOOKS
221  * @rep:scope public
222  * @rep:lifecycle active
223  * @rep:ihelp PER/@scalapi APIs in Oracle HRMS
224 */
225 --
226 -- {End Of Comments}
227 --
228 procedure hire_employee_applicant
229   (p_validate                  in      boolean   default false,
230    p_hire_date                 in      date,
231    p_person_id                 in      per_all_people_f.person_id%TYPE,
232    p_primary_assignment_id     in      number   default null,
233    p_person_type_id            in      number   default null,
234    p_overwrite_primary         in      varchar2 default 'N',
235    p_per_object_version_number in out nocopy  per_all_people_f.object_version_number%TYPE,
236    p_per_effective_start_date     out nocopy  date,
237    p_per_effective_end_date       out nocopy  date,
238    p_unaccepted_asg_del_warning   out nocopy  boolean,
239    p_assign_payroll_warning       out nocopy  boolean
240   ,p_oversubscribed_vacancy_id    out nocopy  number
241 );
242 --
243 --
244 -- #2264569: PL/SQL table to be used when hiring Applicants
245 -- Process Flag ==> (C)onvert, (R)etain, (E)nd Date (it can be null)
246 --
247    type rec_appl is record (
248       id per_all_assignments_f.assignment_id%TYPE,
249       process_flag varchar2(2)
250      );
251    type t_ApplTable is table of rec_appl index by binary_integer;
252 
253    T_EmptyAPPL t_ApplTable;
254 
255 --
256 -- routines to handle elements in table
257 --
258 function locate_element(p_table t_ApplTable
259                        ,p_id per_all_assignments_f.assignment_id%TYPE)
260    return binary_integer;
261 --
262 --
263 function locate_value(p_table t_ApplTable
264                      ,p_flag varchar2)
265    return binary_integer;
266 --
267 --
268 function end_date_exists(p_table t_ApplTable
269                               ,p_id per_all_assignments_f.assignment_id%TYPE)
270    return integer;
271 --
272 --
273 function is_convert(p_table t_ApplTable
274                    ,p_id per_all_assignments_f.assignment_id%TYPE)
275    return boolean;
276 --
277 --
278 function retain_exists(p_table t_ApplTable) return boolean;
279 --
280 --
281 function tab_is_empty(p_table t_ApplTable) return boolean;
282 --
283 --
284 function empty_table return t_ApplTable;
285 --
286 --
287 function retain_flag return varchar2;
288 --
289 function convert_flag return varchar2;
290 --
291 function end_date_flag return varchar2;
292 --
293 -- end #2264569
294 
295 END hr_employee_applicant_api;