1 Package per_per_upd as
2 /* $Header: peperrhi.pkh 120.2.12010000.1 2008/07/28 05:14:29 appldev ship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |---------------------------------< upd >----------------------------------|
6 -- ----------------------------------------------------------------------------
7 -- {Start Of Comments}
8 --
9 -- Description:
10 -- This procedure is the record interface for the update business
11 -- process for the specified entity. The role of this process is
12 -- to perform the datetrack update mode, fully validating the row
13 -- for the HR schema passing back to the calling process, any system
14 -- generated values (e.g. object version number attribute). This process
15 -- is the main backbone of the upd business process. The processing of
16 -- this procedure is as follows:
17 -- 1) Ensure that the datetrack update mode is valid.
18 -- 2) If the p_validate argument has been set to true then a savepoint
19 -- is issued.
20 -- 3) The row to be updated is then locked and selected into the record
21 -- structure g_old_rec.
22 -- 4) Because on update arguments which are not part of the update do not
23 -- have to be defaulted, we need to build up the updated row by
24 -- converting any system defaulted arguments to their corresponding
25 -- value.
26 -- 5) The controlling validation process update_validate is then executed
27 -- which will execute all private and public validation business rule
28 -- processes.
29 -- 6) The pre_update business process is then executed which enables any
30 -- logic to be processed before the update dml process is executed.
31 -- 7) The update_dml process will physical perform the update dml into the
32 -- specified entity.
33 -- 8) The post_update business process is then executed which enables any
34 -- logic to be processed after the update dml process.
35 -- 9) If the p_validate argument has been set to true an exception is
36 -- raised which is handled and processed by performing a rollback to
37 -- the savepoint which was issued at the beginning of the upd process.
38 --
39 -- Pre Conditions:
40 -- The main arguments to the business process have to be in the record
41 -- format.
42 --
43 -- In Arguments:
44 -- p_effective_date
45 -- Specifies the date of the datetrack update operation.
46 -- p_datetrack_mode
47 -- Determines the datetrack update mode.
48 -- p_validate
49 -- Determines if the business process is to be validated. Setting this
50 -- boolean value to true will invoke the process to be validated. The
51 -- default is false. The validation is controlled by a savepoint and
52 -- rollback mechanism. The savepoint is issued at the beginning of the
53 -- business process and is rollbacked at the end of the business process
54 -- when all the processing has been completed. The rollback is controlled
55 -- by raising and handling the exception hr_api.validate_enabled. We use
56 -- the exception because, by raising the exception with the business
57 -- process, we can exit successfully without having any of the 'OUT'
58 -- arguments being set.
59 -- p_rec
60 -- Contains the attributes of the person record
61 --
62 -- Post Success:
63 -- The specified row will be fully validated and datetracked updated for
64 -- the specified entity without being committed for the datetrack mode. If
65 -- the p_validate argument has been set to true then all the work will be
66 -- rolled back.
67 --
68 -- Post Failure:
69 -- If an error has occurred, an error message will be supplied with the work
70 -- rolled back.
71 -- A failure will occur if any of the following conditions are found:
72 -- 1) Any of the mandatory arguments have not been set
73 -- 2) If date of birth > the effective start date then
74 -- 3) If system person type is 'EMP', 'EX_EMP', 'EMP_APL' or 'EX_EMP_APL' and
75 -- employee number is null
76 -- 4) If system person type is anything other than 'EMP', 'EX_EMP', 'EMP_APL'
77 -- or 'EX_EMP_APL' and employee number is not null
78 -- 5) If the employee number is not unique within the business group
79 -- 6) If a marital status value does not exist in hr_lookups
80 -- where lookup_type = 'MAR_STATUS'
81 -- 7) If the national identifier is not valid
82 -- 8) If a nationality value does not exist in hr_lookups
83 -- where lookup_type = 'NATIONALITY'
84 -- 9) If per_information_category is 'GB' and
85 -- the following conditions are true then
86 -- a) per_information1 value does not exist in hr_lookups
87 -- where lookup_type = 'ETH_TYPE'
88 -- b) per_information2 does not exist in hr_lookups
89 -- where lookup_type = 'YES_NO'
90 -- c) per_information4 does not exist in hr_lookups
91 -- d) per_information5 is a greater than 30 characters long or lower case
92 -- e) per_information3 or per_information6 to 20 values are not null
93 -- 10) person_type_id does not exist in per_person_types for the business
94 -- group
95 -- 11) system_person_type is anything other than 'EMP' or 'EX_EMP'
96 -- 12) system_person_type changes from 'EMP' to anything other than 'EX_EMP'
97 -- or from 'EX_EMP' to anything other than 'EMP'
98 -- 13) The value of system_person_type is not consistent with the values of
99 -- current_employee_flag and current_emp_or_apl_flag
100 -- 14) The value of system_person_type has changed and the
101 -- datetrack mode is correction, update_override or update_change_insert
102 -- 15) The value of system_person_type has not changed and the
103 -- datetrack mode is update_override or update_change_insert
104 -- 16) If a sex value does not exist in hr_lookups
105 -- where lookup_type = 'SEX' then
106 -- 17) If a title value does not exist in hr_lookups
107 -- where lookup_type = 'TITLE' then
108 -- 18) If a sex value is 'M'
109 -- and the title value is 'MISS.','MRS.', 'MS.' then
110 -- 19) If a sex value is 'F'
111 -- and the title value is 'MR.'
112 -- 20) If the related system person type is 'EMP' or 'EX-EMP' then
113 -- if a sex value is null then
114 -- 21) If a start date is not the same as the effective start date when the
115 -- system person type is 'EMP' or 'EX-EMP'
116 --
117 -- Developer Implementation Notes:
118 -- None.
119 --
120 -- Access Status:
121 -- Internal Development Use Only.
122 --
123 -- {End Of Comments}
124 -- ----------------------------------------------------------------------------
125 Procedure upd
126 (
127 p_rec in out nocopy per_per_shd.g_rec_type,
128 p_effective_date in date,
129 p_datetrack_mode in varchar2,
130 p_validate in boolean default false,
131 p_name_combination_warning out nocopy boolean,
132 p_dob_null_warning out nocopy boolean,
133 p_orig_hire_warning out nocopy boolean
134 );
135 --
136 -- ----------------------------------------------------------------------------
137 -- |---------------------------------< upd >----------------------------------|
138 -- ----------------------------------------------------------------------------
139 -- {Start Of Comments}
140 --
141 -- Description:
142 -- This procedure is the attribute interface for the datetrack update
143 -- business process for the specified entity and is the outermost layer.
144 -- The role of this process is to update a fully validated row into the
145 -- HR schema passing back to the calling process, any system generated
146 -- values (e.g. object version number attributes).The processing of this
147 -- procedure is as follows:
148 -- 1) The attributes are converted into a local record structure by
149 -- calling the convert_defs procedure.
150 -- 2) After the conversion has taken place, the corresponding record upd
151 -- interface business process is executed.
152 -- 3) OUT arguments are then set to their corresponding record arguments.
153 --
154 -- Pre Conditions:
155 --
156 -- In Arguments:
157 -- p_effective_date
158 -- Specifies the date of the datetrack update operation.
159 -- p_datetrack_mode
160 -- Determines the datetrack update mode.
161 -- p_validate
162 -- Determines if the business process is to be validated. Setting this
163 -- Boolean value to true will invoke the process to be validated.
164 -- The default is false.
165 --
166 -- Post Success:
167 -- A fully validated row will be updated for the specified entity
168 -- without being committed (or rollbacked depending on the p_validate
169 -- status).
170 --
171 -- Post Failure:
172 -- If an error has occurred, an error message will be supplied with the work
173 -- rolled back. Refer to the upd record interface for details of possible
174 -- failures
175 --
176 -- Developer Implementation Notes:
177 -- None.
178 --
179 -- Access Status:
180 -- Internal Development Use Only.
181 --
182 -- {End Of Comments}
183 -- ----------------------------------------------------------------------------
184 Procedure upd
185 (
186 p_person_id in number,
187 p_effective_start_date out nocopy date,
188 p_effective_end_date out nocopy date,
189 p_person_type_id in number default hr_api.g_number,
190 p_last_name in varchar2 default hr_api.g_varchar2,
191 p_start_date in date default hr_api.g_date,
192 p_applicant_number in out nocopy varchar2,
193 p_comment_id out nocopy number,
194 p_comments in varchar2 default hr_api.g_varchar2,
195 p_current_applicant_flag out nocopy varchar2,
196 p_current_emp_or_apl_flag out nocopy varchar2,
197 p_current_employee_flag out nocopy varchar2,
198 p_date_employee_data_verified in date default hr_api.g_date,
199 p_date_of_birth in date default hr_api.g_date,
200 p_email_address in varchar2 default hr_api.g_varchar2,
201 p_employee_number in out nocopy varchar2,
202 p_expense_check_send_to_addres in varchar2 default hr_api.g_varchar2,
203 p_first_name in varchar2 default hr_api.g_varchar2,
204 p_full_name out nocopy varchar2,
205 p_known_as in varchar2 default hr_api.g_varchar2,
206 p_marital_status in varchar2 default hr_api.g_varchar2,
207 p_middle_names in varchar2 default hr_api.g_varchar2,
208 p_nationality in varchar2 default hr_api.g_varchar2,
209 p_national_identifier in varchar2 default hr_api.g_varchar2,
210 p_previous_last_name in varchar2 default hr_api.g_varchar2,
211 p_registered_disabled_flag in varchar2 default hr_api.g_varchar2,
212 p_sex in varchar2 default hr_api.g_varchar2,
213 p_title in varchar2 default hr_api.g_varchar2,
214 p_vendor_id in number default hr_api.g_number,
215 p_work_telephone in varchar2 default hr_api.g_varchar2,
216 p_request_id in number default hr_api.g_number,
217 p_program_application_id in number default hr_api.g_number,
218 p_program_id in number default hr_api.g_number,
219 p_program_update_date in date default hr_api.g_date,
220 p_attribute_category in varchar2 default hr_api.g_varchar2,
221 p_attribute1 in varchar2 default hr_api.g_varchar2,
222 p_attribute2 in varchar2 default hr_api.g_varchar2,
223 p_attribute3 in varchar2 default hr_api.g_varchar2,
224 p_attribute4 in varchar2 default hr_api.g_varchar2,
225 p_attribute5 in varchar2 default hr_api.g_varchar2,
226 p_attribute6 in varchar2 default hr_api.g_varchar2,
227 p_attribute7 in varchar2 default hr_api.g_varchar2,
228 p_attribute8 in varchar2 default hr_api.g_varchar2,
229 p_attribute9 in varchar2 default hr_api.g_varchar2,
230 p_attribute10 in varchar2 default hr_api.g_varchar2,
231 p_attribute11 in varchar2 default hr_api.g_varchar2,
232 p_attribute12 in varchar2 default hr_api.g_varchar2,
233 p_attribute13 in varchar2 default hr_api.g_varchar2,
234 p_attribute14 in varchar2 default hr_api.g_varchar2,
235 p_attribute15 in varchar2 default hr_api.g_varchar2,
236 p_attribute16 in varchar2 default hr_api.g_varchar2,
237 p_attribute17 in varchar2 default hr_api.g_varchar2,
238 p_attribute18 in varchar2 default hr_api.g_varchar2,
239 p_attribute19 in varchar2 default hr_api.g_varchar2,
240 p_attribute20 in varchar2 default hr_api.g_varchar2,
241 p_attribute21 in varchar2 default hr_api.g_varchar2,
242 p_attribute22 in varchar2 default hr_api.g_varchar2,
243 p_attribute23 in varchar2 default hr_api.g_varchar2,
244 p_attribute24 in varchar2 default hr_api.g_varchar2,
245 p_attribute25 in varchar2 default hr_api.g_varchar2,
246 p_attribute26 in varchar2 default hr_api.g_varchar2,
247 p_attribute27 in varchar2 default hr_api.g_varchar2,
248 p_attribute28 in varchar2 default hr_api.g_varchar2,
249 p_attribute29 in varchar2 default hr_api.g_varchar2,
250 p_attribute30 in varchar2 default hr_api.g_varchar2,
251 p_per_information_category in varchar2 default hr_api.g_varchar2,
252 p_per_information1 in varchar2 default hr_api.g_varchar2,
253 p_per_information2 in varchar2 default hr_api.g_varchar2,
254 p_per_information3 in varchar2 default hr_api.g_varchar2,
255 p_per_information4 in varchar2 default hr_api.g_varchar2,
256 p_per_information5 in varchar2 default hr_api.g_varchar2,
257 p_per_information6 in varchar2 default hr_api.g_varchar2,
258 p_per_information7 in varchar2 default hr_api.g_varchar2,
259 p_per_information8 in varchar2 default hr_api.g_varchar2,
260 p_per_information9 in varchar2 default hr_api.g_varchar2,
261 p_per_information10 in varchar2 default hr_api.g_varchar2,
262 p_per_information11 in varchar2 default hr_api.g_varchar2,
263 p_per_information12 in varchar2 default hr_api.g_varchar2,
264 p_per_information13 in varchar2 default hr_api.g_varchar2,
265 p_per_information14 in varchar2 default hr_api.g_varchar2,
266 p_per_information15 in varchar2 default hr_api.g_varchar2,
267 p_per_information16 in varchar2 default hr_api.g_varchar2,
268 p_per_information17 in varchar2 default hr_api.g_varchar2,
269 p_per_information18 in varchar2 default hr_api.g_varchar2,
270 p_per_information19 in varchar2 default hr_api.g_varchar2,
271 p_per_information20 in varchar2 default hr_api.g_varchar2,
275 p_BACKGROUND_DATE_CHECK in date default hr_api.g_date,
272 p_suffix in varchar2 default hr_api.g_varchar2,
273 p_DATE_OF_DEATH in date default hr_api.g_date,
274 p_BACKGROUND_CHECK_STATUS in varchar2 default hr_api.g_varchar2,
276 p_BLOOD_TYPE in varchar2 default hr_api.g_varchar2,
277 p_CORRESPONDENCE_LANGUAGE in varchar2 default hr_api.g_varchar2,
278 p_FAST_PATH_EMPLOYEE in varchar2 default hr_api.g_varchar2,
279 p_FTE_CAPACITY in number default hr_api.g_number,
280 p_HOLD_APPLICANT_DATE_UNTIL in date default hr_api.g_date,
281 p_HONORS in varchar2 default hr_api.g_varchar2,
282 p_INTERNAL_LOCATION in varchar2 default hr_api.g_varchar2,
283 p_LAST_MEDICAL_TEST_BY in varchar2 default hr_api.g_varchar2,
284 p_LAST_MEDICAL_TEST_DATE in date default hr_api.g_date,
285 p_MAILSTOP in varchar2 default hr_api.g_varchar2,
286 p_OFFICE_NUMBER in varchar2 default hr_api.g_varchar2,
287 p_ON_MILITARY_SERVICE in varchar2 default hr_api.g_varchar2,
288 p_ORDER_NAME in varchar2 default hr_api.g_varchar2,
289 p_PRE_NAME_ADJUNCT in varchar2 default hr_api.g_varchar2,
290 p_PROJECTED_START_DATE in date default hr_api.g_date,
291 p_REHIRE_AUTHORIZOR in varchar2 default hr_api.g_varchar2,
292 p_REHIRE_RECOMMENDATION in varchar2 default hr_api.g_varchar2,
293 p_RESUME_EXISTS in varchar2 default hr_api.g_varchar2,
294 p_RESUME_LAST_UPDATED in date default hr_api.g_date,
295 p_SECOND_PASSPORT_EXISTS in varchar2 default hr_api.g_varchar2,
296 p_STUDENT_STATUS in varchar2 default hr_api.g_varchar2,
297 p_WORK_SCHEDULE in varchar2 default hr_api.g_varchar2,
298 p_PER_INFORMATION21 in varchar2 default hr_api.g_varchar2,
299 p_PER_INFORMATION22 in varchar2 default hr_api.g_varchar2,
300 p_PER_INFORMATION23 in varchar2 default hr_api.g_varchar2,
301 p_PER_INFORMATION24 in varchar2 default hr_api.g_varchar2,
302 p_PER_INFORMATION25 in varchar2 default hr_api.g_varchar2,
303 p_PER_INFORMATION26 in varchar2 default hr_api.g_varchar2,
304 p_PER_INFORMATION27 in varchar2 default hr_api.g_varchar2,
305 p_PER_INFORMATION28 in varchar2 default hr_api.g_varchar2,
306 p_PER_INFORMATION29 in varchar2 default hr_api.g_varchar2,
307 p_PER_INFORMATION30 in varchar2 default hr_api.g_varchar2,
308 p_REHIRE_REASON in varchar2 default hr_api.g_varchar2,
309 p_benefit_group_id in number default hr_api.g_number,
310 p_receipt_of_death_cert_date in date default hr_api.g_date,
311 p_coord_ben_med_pln_no in varchar2 default hr_api.g_varchar2,
312 p_coord_ben_no_cvg_flag in varchar2 default hr_api.g_varchar2,
313 p_coord_ben_med_ext_er in varchar2 default hr_api.g_varchar2,
314 p_coord_ben_med_pl_name in varchar2 default hr_api.g_varchar2,
315 p_coord_ben_med_insr_crr_name in varchar2 default hr_api.g_varchar2,
316 p_coord_ben_med_insr_crr_ident in varchar2 default hr_api.g_varchar2,
317 p_coord_ben_med_cvg_strt_dt in date default hr_api.g_date,
318 p_coord_ben_med_cvg_end_dt in date default hr_api.g_date,
319 p_uses_tobacco_flag in varchar2 default hr_api.g_varchar2,
320 p_dpdnt_adoption_date in date default hr_api.g_date,
321 p_dpdnt_vlntry_svce_flag in varchar2 default hr_api.g_varchar2,
322 p_original_date_of_hire in date default hr_api.g_date,
323 p_town_of_birth in varchar2 default hr_api.g_varchar2,
324 p_region_of_birth in varchar2 default hr_api.g_varchar2,
325 p_country_of_birth in varchar2 default hr_api.g_varchar2,
326 p_global_person_id in varchar2 default hr_api.g_varchar2,
327 p_party_id in number default hr_api.g_number,
328 p_npw_number in out nocopy varchar2,
329 p_current_npw_flag in varchar2 default hr_api.g_varchar2,
330 p_object_version_number in out nocopy number,
331 p_effective_date in date,
332 p_datetrack_mode in varchar2,
333 p_validate in boolean default false,
334 p_name_combination_warning out nocopy boolean,
338 --
335 p_dob_null_warning out nocopy boolean,
336 p_orig_hire_warning out nocopy boolean
337 );
339 end per_per_upd;