1 Package per_asg_shd AUTHID CURRENT_USER as
2 /* $Header: peasgrhi.pkh 120.7 2011/03/08 09:20:38 sidsaxen ship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- | Global Record Type Specification |
6 -- ----------------------------------------------------------------------------
7 --
8 Type g_rec_type Is Record
9 (
10 assignment_id per_all_assignments_f.assignment_id%TYPE,
11 effective_start_date date,
12 effective_end_date date,
13 business_group_id number(15),
14 recruiter_id per_all_assignments_f.recruiter_id%TYPE,
15 grade_id number(15),
16 position_id number(15),
17 job_id number(15),
18 assignment_status_type_id number(9),
19 payroll_id number(9),
20 location_id number(15),
21 person_referred_by_id per_all_assignments_f.person_referred_by_id%TYPE,
22 supervisor_id per_all_assignments_f.supervisor_id%TYPE,
23 special_ceiling_step_id number(15),
24 person_id per_all_assignments_f.person_id%TYPE,
25 recruitment_activity_id number(15),
26 source_organization_id number(15),
27 organization_id number(15),
28 people_group_id number(15),
29 soft_coding_keyflex_id number(15),
30 vacancy_id number(15),
31 pay_basis_id number(9),
32 assignment_sequence number(15),
33 assignment_type varchar2(9), -- Increased length
34 primary_flag varchar2(30),
35 application_id number(15),
36 assignment_number varchar2(30),
37 change_reason varchar2(30),
38 comment_id number(15),
39 comment_text varchar2(2000), -- pseudo column
40 date_probation_end date,
41 default_code_comb_id number(15),
42 employment_category varchar2(30),
43 frequency varchar2(30),
44 internal_address_line varchar2(80),
45 manager_flag varchar2(30),
46 normal_hours number(22,3),
47 perf_review_period number(15),
48 perf_review_period_frequency varchar2(30),
49 period_of_service_id number(15),
50 probation_period number(22,2),
51 probation_unit varchar2(30),
52 sal_review_period number(15),
53 sal_review_period_frequency varchar2(30),
54 set_of_books_id number(15),
55 source_type varchar2(30),
56 time_normal_finish varchar2(9), -- Increased length
57 time_normal_start varchar2(9), -- Increased length
58 bargaining_unit_code varchar2(30),
59 labour_union_member_flag varchar2(30),
60 hourly_salaried_code varchar2(30),
61 request_id number(15),
62 program_application_id number(15),
63 program_id number(15),
64 program_update_date date,
65 ass_attribute_category varchar2(30),
66 ass_attribute1 varchar2(150),
67 ass_attribute2 varchar2(150),
68 ass_attribute3 varchar2(150),
69 ass_attribute4 varchar2(150),
70 ass_attribute5 varchar2(150),
71 ass_attribute6 varchar2(150),
72 ass_attribute7 varchar2(150),
73 ass_attribute8 varchar2(150),
74 ass_attribute9 varchar2(150),
75 ass_attribute10 varchar2(150),
76 ass_attribute11 varchar2(150),
77 ass_attribute12 varchar2(150),
78 ass_attribute13 varchar2(150),
79 ass_attribute14 varchar2(150),
80 ass_attribute15 varchar2(150),
81 ass_attribute16 varchar2(150),
82 ass_attribute17 varchar2(150),
83 ass_attribute18 varchar2(150),
84 ass_attribute19 varchar2(150),
85 ass_attribute20 varchar2(150),
86 ass_attribute21 varchar2(150),
87 ass_attribute22 varchar2(150),
88 ass_attribute23 varchar2(150),
89 ass_attribute24 varchar2(150),
90 ass_attribute25 varchar2(150),
91 ass_attribute26 varchar2(150),
92 ass_attribute27 varchar2(150),
93 ass_attribute28 varchar2(150),
94 ass_attribute29 varchar2(150),
95 ass_attribute30 varchar2(150),
96 title varchar2(30),
97 object_version_number number(9),
98 contract_id number(15),
99 establishment_id number(15),
100 collective_agreement_id number(15),
101 cagr_grade_def_id number(15),
102 cagr_id_flex_num number(15),
103 notice_period number(15),
104 notice_period_uom varchar2(30),
105 employee_category varchar2(30),
106 work_at_home varchar2(30),
107 job_post_source_name varchar2(240),
108 posting_content_id number(15),
109 period_of_placement_date_start date,
110 vendor_id number(15),
111 vendor_employee_number varchar2(30),
112 vendor_assignment_number varchar2(30),
113 assignment_category varchar2(30),
114 project_title varchar2(30),
115 applicant_rank number(15),
116 grade_ladder_pgm_id number(15),
117 supervisor_assignment_id number(15),
118 vendor_site_id number(15),
119 po_header_id number(15),
120 po_line_id number(15),
121 projected_assignment_end date
122 );
123 --
124 -- ----------------------------------------------------------------------------
125 -- | Global Definitions - Internal Development Use Only |
126 -- ----------------------------------------------------------------------------
127 --
128 g_old_rec g_rec_type; -- Global record definition
129 g_tab_nam constant varchar2(30) := 'PER_ALL_ASSIGNMENTS_F';
130 g_api_dml boolean; -- Global api dml status
131 --
132 -- ----------------------------------------------------------------------------
133 -- |------------------------< return_api_dml_status >-------------------------|
134 -- ----------------------------------------------------------------------------
135 -- {Start Of Comments}
136 --
137 -- Description:
138 -- This function will return the current g_api_dml private global
139 -- boolean status.
140 -- The g_api_dml status determines if at the time of the function
141 -- being executed if a dml statement (i.e. INSERT, UPDATE or DELETE)
142 -- is being issued from within an api.
143 -- If the status is TRUE then a dml statement is being issued from
144 -- within this entity api.
145 -- This function is primarily to support database triggers which
146 -- need to maintain the object_version_number for non-supported
147 -- dml statements (i.e. dml statement issued outside of the api layer).
148 --
149 -- Pre Conditions:
150 -- None.
151 --
152 -- In Arguments:
153 -- None.
154 --
155 -- Post Success:
156 -- Processing continues.
157 -- If the function returns a TRUE value then, dml is being executed from
158 -- within this api.
159 --
160 -- Post Failure:
161 -- None.
162 --
163 -- Access Status:
164 -- Internal Table Handler Use Only.
165 --
166 -- {End Of Comments}
167 -- ----------------------------------------------------------------------------
168 Function return_api_dml_status Return Boolean;
169 --
170 -- ----------------------------------------------------------------------------
171 -- |---------------------------< constraint_error >---------------------------|
172 -- ----------------------------------------------------------------------------
173 -- {Start Of Comments}
174 --
175 -- Description:
176 -- This procedure is called when a constraint has been violated (i.e.
177 -- The exception hr_api.check_integrity_violated,
178 -- hr_api.parent_integrity_violated, hr_api.child_integrity_violated or
179 -- hr_api.unique_integrity_violated has been raised).
180 -- The exceptions can only be raised as follows:
181 -- 1) A check constraint can only be violated during an INSERT or UPDATE
182 -- dml operation.
183 -- 2) A parent integrity constraint can only be violated during an
184 -- INSERT or UPDATE dml operation.
185 -- 3) A child integrity constraint can only be violated during an
186 -- DELETE dml operation.
187 -- 4) A unique integrity constraint can only be violated during INSERT or
188 -- UPDATE dml operation.
189 --
190 -- Pre Conditions:
191 -- 1) Either hr_api.check_integrity_violated,
192 -- hr_api.parent_integrity_violated, hr_api.child_integrity_violated or
193 -- hr_api.unique_integrity_violated has been raised with the subsequent
194 -- stripping of the constraint name from the generated error message
195 -- text.
196 -- 2) Standalone validation test which correspond with a constraint error.
197 --
198 -- In Arguments:
199 -- p_constraint_name is in upper format and is just the constraint name
200 -- (e.g. not prefixed by brackets, schema owner etc).
201 --
202 -- Post Success:
203 -- Development dependant.
204 --
205 -- Post Failure:
206 -- Developement dependant.
207 --
208 -- Developer Implementation Notes:
209 -- For each constraint being checked the hr system package failure message
210 -- has been generated as a template only. These system error messages should
211 -- be modified as required (i.e. change the system failure message to a user
212 -- friendly defined error message).
213 --
214 -- Access Status:
215 -- Internal Development Use Only.
216 --
217 -- {End Of Comments}
218 -- ----------------------------------------------------------------------------
219 Procedure constraint_error
220 (p_constraint_name in all_constraints.constraint_name%TYPE);
221 --
222 -- ----------------------------------------------------------------------------
223 -- |-----------------------------< api_updating >-----------------------------|
224 -- ----------------------------------------------------------------------------
225 -- {Start Of Comments}
226 --
227 -- Description:
228 -- This function is used to populate the g_old_rec record with the current
229 -- row from the database for the specified primary key provided that the
230 -- primary key exists and is valid and does not already match the current
231 -- g_old_rec.
232 -- The function will always return a TRUE value if the g_old_rec is
233 -- populated with the current row. A FALSE value will be returned if all of
234 -- the primary key arguments are null.
235 --
236 -- Pre Conditions:
237 -- None.
238 --
239 -- In Arguments:
240 --
241 -- Post Success:
242 -- A value of TRUE will be returned indiciating that the g_old_rec is
243 -- current.
244 -- A value of FALSE will be returned if all of the primary key arguments
245 -- have a null value (this indicates that the row has not be inserted into
246 -- the Schema), and therefore could never have a corresponding row.
247 --
248 -- Post Failure:
249 -- A failure can only occur under two circumstances:
250 -- 1) The primary key is invalid (i.e. a row does not exist for the
251 -- specified primary key values).
252 -- 2) If an object_version_number exists but is NOT the same as the current
253 -- g_old_rec value.
254 --
255 -- Developer Implementation Notes:
256 -- None.
257 --
258 -- Access Status:
259 -- Internal Development Use Only.
260 --
261 -- {End Of Comments}
262 -- ----------------------------------------------------------------------------
263 Function api_updating
264 (p_effective_date in date,
265 p_assignment_id in number,
266 p_object_version_number in number
267 ) Return Boolean;
268 --
269 -- ----------------------------------------------------------------------------
270 -- |--------------------------< find_dt_del_modes >---------------------------|
271 -- ----------------------------------------------------------------------------
272 -- {Start Of Comments}
273 --
274 -- Description:
275 -- This procedure is used to determine what datetrack delete modes are
276 -- allowed as of the effective date for this entity. The procedure will
277 -- return a corresponding Boolean value for each of the delete modes
278 -- available where TRUE indicates that the corresponding delete mode is
279 -- available.
280 --
281 -- Pre Conditions:
282 -- None.
283 --
284 -- In Arguments:
285 -- p_effective_date
286 -- Specifies the date at which the datetrack modes will be operated on.
287 -- p_base_key_value
288 -- Specifies the primary key value for this datetrack entity.
289 -- (E.g. For this entity the assignment of the argument would be:
290 -- p_base_key_value = :assignment_id).
291 --
292 -- Post Success:
293 -- Processing continues.
294 --
295 -- Post Failure:
296 -- Failure might occur if for the specified effective date and primary key
297 -- value a row doesn't exist.
298 --
299 -- Developer Implementation Notes:
300 -- This procedure could require changes if this entity has any sepcific
301 -- delete restrictions.
302 -- For example, this entity might disallow the datetrack delete mode of
303 -- ZAP. To implement this you would have to set and return a Boolean value
304 -- of FALSE after the call to the dt_api.find_dt_del_modes procedure.
305 --
306 -- Access Status:
307 -- Internal Development Use Only.
308 --
309 -- {End Of Comments}
310 -- ----------------------------------------------------------------------------
311 Procedure find_dt_del_modes
312 (p_effective_date in date,
313 p_base_key_value in number,
314 p_zap out nocopy boolean,
315 p_delete out nocopy boolean,
316 p_future_change out nocopy boolean,
317 p_delete_next_change out nocopy boolean);
318 --
319 -- ----------------------------------------------------------------------------
320 -- |--------------------------< find_dt_upd_modes >---------------------------|
321 -- ----------------------------------------------------------------------------
322 -- {Start Of Comments}
323 --
324 -- Description:
325 -- This procedure is used to determine what datetrack update modes are
326 -- allowed as of the effective date for this entity. The procedure will
327 -- return a corresponding Boolean value for each of the update modes
328 -- available where TRUE indicates that the corresponding update mode
329 -- is available.
330 --
331 -- Pre Conditions:
332 -- None.
333 --
334 -- In Arguments:
335 -- p_effective_date
336 -- Specifies the date at which the datetrack modes will be operated on.
337 -- p_base_key_value
338 -- Specifies the primary key value for this datetrack entity.
339 -- (E.g. For this entity the assignment of the argument would be:
340 -- p_base_key_value = :assignment_id).
341 --
342 -- Post Success:
343 -- Processing continues.
344 --
345 -- Post Failure:
346 -- Failure might occur if for the specified effective date and primary key
347 -- value a row doesn't exist.
348 --
349 -- Developer Implementation Notes:
350 -- This procedure could require changes if this entity has any sepcific
351 -- delete restrictions.
355 --
352 -- For example, this entity might disallow the datetrack update mode of
353 -- UPDATE. To implement this you would have to set and return a Boolean
354 -- value of FALSE after the call to the dt_api.find_dt_upd_modes procedure.
356 -- Access Status:
357 -- Internal Development Use Only.
358 --
359 -- {End Of Comments}
360 -- ----------------------------------------------------------------------------
361 Procedure find_dt_upd_modes
362 (p_effective_date in date,
363 p_base_key_value in number,
364 p_correction out nocopy boolean,
365 p_update out nocopy boolean,
366 p_update_override out nocopy boolean,
367 p_update_change_insert out nocopy boolean);
368 --
369 -- ----------------------------------------------------------------------------
370 -- |------------------------< upd_effective_end_date >------------------------|
371 -- ----------------------------------------------------------------------------
372 -- {Start Of Comments}
373 --
374 -- Description:
375 -- This procedure will update the specified datetrack row with the
376 -- specified new effective end date. The object version number is also
377 -- set to the next object version number. DateTrack modes which call
378 -- this procedure are: UPDATE, UPDATE_CHANGE_INSERT,
379 -- UPDATE_OVERRIDE, DELETE, FUTURE_CHANGE and DELETE_NEXT_CHANGE.
380 -- This is an internal datetrack maintenance procedure which should
381 -- not be modified in anyway.
382 --
383 -- Pre Conditions:
384 -- None.
385 --
386 -- In Arguments:
387 -- p_new_effective_end_date
388 -- Specifies the new effective end date which will be set for the
389 -- row as of the effective date.
390 -- p_base_key_value
391 -- Specifies the primary key value for this datetrack entity.
392 -- (E.g. For this entity the assignment of the argument would be:
393 -- p_base_key_value = :assignment_id).
394 --
395 -- Post Success:
396 -- The specified row will be updated with the new effective end date and
397 -- object_version_number.
398 --
399 -- Post Failure:
400 -- Failure might occur if for the specified effective date and primary key
401 -- value a row doesn't exist.
402 --
403 -- Developer Implementation Notes:
404 -- This is an internal datetrack maintenance procedure which should
405 -- not be modified in anyway.
406 --
407 -- Access Status:
408 -- Internal Table Handler Use Only.
409 --
410 -- {End Of Comments}
411 -- ----------------------------------------------------------------------------
412 Procedure upd_effective_end_date
413 (p_effective_date in date,
414 p_base_key_value in number,
415 p_new_effective_end_date in date,
416 p_validation_start_date in date,
417 p_validation_end_date in date,
418 p_object_version_number out nocopy number);
419 --
420 -- ---------------------------------------------------------------------------+
421 -- |---------------------------------< lck >----------------------------------|
422 -- ---------------------------------------------------------------------------+
423 -- {Start Of Comments}
424 --
425 -- Description:
426 -- The Lck process for datetrack is complicated and comprises of the
427 -- following processing
428 -- The processing steps are as follows:
429 -- 1) The row to be updated or deleted must be locked.
430 -- By locking this row, the g_old_rec record data type is populated.
431 -- 2) If a comment exists the text is selected from hr_comments.
432 -- 3) The datetrack mode is then validated to ensure the operation is
433 -- valid. If the mode is valid the validation start and end dates for
434 -- the mode will be derived and returned. Any required locking is
435 -- completed when the datetrack mode is validated.
436 --
437 -- Pre Conditions:
438 -- When attempting to call the lck procedure the object version number,
439 -- primary key, effective date and datetrack mode must be specified.
440 --
441 -- In Arguments:
442 -- p_effective_date
443 -- Specifies the date of the datetrack update operation.
444 -- p_datetrack_mode
445 -- Determines the datetrack update or delete mode.
446 --
447 -- Post Success:
448 -- On successful completion of the Lck process the row to be updated or
449 -- deleted will be locked and selected into the global data structure
450 -- g_old_rec.
451 --
452 -- Post Failure:
453 -- The Lck process can fail for three reasons:
454 -- 1) When attempting to lock the row the row could already be locked by
455 -- another user. This will raise the HR_Api.Object_Locked exception.
456 -- 2) The row which is required to be locked doesn't exist in the HR Schema.
457 -- This error is trapped and reported using the message name
458 -- 'HR_7220_INVALID_PRIMARY_KEY'.
459 -- 3) The row although existing in the HR Schema has a different object
460 -- version number than the object version number specified.
461 -- This error is trapped and reported using the message name
462 -- 'HR_7155_OBJECT_INVALID'.
463 --
464 -- Developer Implementation Notes:
465 -- None.
466 --
467 -- Access Status:
468 -- Internal Development Use Only.
469 --
470 -- {End Of Comments}
474 p_datetrack_mode in varchar2,
471 -- ---------------------------------------------------------------------------+
472 Procedure lck
473 (p_effective_date in date,
475 p_assignment_id in number,
476 p_object_version_number in number,
477 p_validation_start_date out nocopy date,
478 p_validation_end_date out nocopy date);
479 --
480 -- ----------------------------------------------------------------------------
481 -- |-----------------------------< convert_args >-----------------------------|
482 -- ----------------------------------------------------------------------------
483 -- {Start Of Comments}
484 --
485 -- Description:
486 -- This function is used to turn attribute arguments into the record
487 -- structure g_rec_type.
488 --
489 -- Pre Conditions:
490 -- This is a private function and can only be called from the ins or upd
491 -- attribute processes.
492 --
493 -- In Arguments:
494 --
495 -- Post Success:
496 -- A returning record structure will be returned.
497 --
498 -- Post Failure:
499 -- No direct error handling is required within this function. Any possible
500 -- errors within this function will be a PL/SQL value error due to conversion
501 -- of datatypes or data lengths.
502 --
503 -- Developer Implementation Notes:
504 -- None.
505 --
506 -- Access Status:
507 -- Internal Table Handler Use Only.
508 --
509 -- {End Of Comments}
510 -- ----------------------------------------------------------------------------
511 Function convert_args
512 (
513 p_assignment_id in number,
514 p_effective_start_date in date,
515 p_effective_end_date in date,
516 p_business_group_id in number,
517 p_recruiter_id in number,
518 p_grade_id in number,
519 p_position_id in number,
520 p_job_id in number,
521 p_assignment_status_type_id in number,
522 p_payroll_id in number,
523 p_location_id in number,
524 p_person_referred_by_id in number,
525 p_supervisor_id in number,
526 p_special_ceiling_step_id in number,
527 p_person_id in number,
528 p_recruitment_activity_id in number,
529 p_source_organization_id in number,
530 p_organization_id in number,
531 p_people_group_id in number,
532 p_soft_coding_keyflex_id in number,
533 p_vacancy_id in number,
534 p_pay_basis_id in number,
535 p_assignment_sequence in number,
536 p_assignment_type in varchar2,
537 p_primary_flag in varchar2,
538 p_application_id in number,
539 p_assignment_number in varchar2,
540 p_change_reason in varchar2,
541 p_comment_id in number,
542 --
543 -- 70.2 change b start.
544 --
545 p_comments in varchar2,
546 --
547 -- 70.2 change b end.
548 --
549 p_date_probation_end in date,
550 p_default_code_comb_id in number,
551 p_employment_category in varchar2,
552 p_frequency in varchar2,
553 p_internal_address_line in varchar2,
554 p_manager_flag in varchar2,
555 p_normal_hours in number,
556 p_perf_review_period in number,
557 p_perf_review_period_frequency in varchar2,
558 p_period_of_service_id in number,
559 p_probation_period in number,
560 p_probation_unit in varchar2,
561 p_sal_review_period in number,
562 p_sal_review_period_frequency in varchar2,
563 p_set_of_books_id in number,
564 p_source_type in varchar2,
565 p_time_normal_finish in varchar2,
566 p_time_normal_start in varchar2,
567 p_bargaining_unit_code in varchar2,
568 p_labour_union_member_flag in varchar2,
569 p_hourly_salaried_code in varchar2,
570 p_request_id in number,
571 p_program_application_id in number,
572 p_program_id in number,
573 p_program_update_date in date,
574 p_ass_attribute_category in varchar2,
575 p_ass_attribute1 in varchar2,
576 p_ass_attribute2 in varchar2,
577 p_ass_attribute3 in varchar2,
578 p_ass_attribute4 in varchar2,
579 p_ass_attribute5 in varchar2,
580 p_ass_attribute6 in varchar2,
581 p_ass_attribute7 in varchar2,
582 p_ass_attribute8 in varchar2,
583 p_ass_attribute9 in varchar2,
584 p_ass_attribute10 in varchar2,
585 p_ass_attribute11 in varchar2,
586 p_ass_attribute12 in varchar2,
587 p_ass_attribute13 in varchar2,
588 p_ass_attribute14 in varchar2,
589 p_ass_attribute15 in varchar2,
590 p_ass_attribute16 in varchar2,
591 p_ass_attribute17 in varchar2,
592 p_ass_attribute18 in varchar2,
593 p_ass_attribute19 in varchar2,
594 p_ass_attribute20 in varchar2,
595 p_ass_attribute21 in varchar2,
596 p_ass_attribute22 in varchar2,
597 p_ass_attribute23 in varchar2,
598 p_ass_attribute24 in varchar2,
599 p_ass_attribute25 in varchar2,
600 p_ass_attribute26 in varchar2,
601 p_ass_attribute27 in varchar2,
602 p_ass_attribute28 in varchar2,
603 p_ass_attribute29 in varchar2,
604 p_ass_attribute30 in varchar2,
605 p_title in varchar2,
606 p_object_version_number in number,
607 p_contract_id in number,
608 p_establishment_id in number,
609 p_collective_agreement_id in number,
610 p_cagr_grade_def_id in number,
611 p_cagr_id_flex_num in number,
612 p_notice_period in number,
613 p_notice_period_uom in varchar2,
614 p_employee_category in varchar2,
615 p_work_at_home in varchar2,
616 p_job_post_source_name in varchar2,
617 p_posting_content_id in number,
618 p_placement_date_start in date,
619 p_vendor_id in number,
620 p_vendor_employee_number in varchar2,
621 p_vendor_assignment_number in varchar2,
622 p_assignment_category in varchar2,
623 p_project_title in varchar2,
624 p_applicant_rank in number,
625 p_grade_ladder_pgm_id in number,
626 p_supervisor_assignment_id in number,
627 p_vendor_site_id in number,
628 p_po_header_id in number,
629 p_po_line_id in number,
630 p_projected_assignment_end in date)
631 Return g_rec_type;
632 --
633 end per_asg_shd;