DBA Data[Home] [Help]

PACKAGE BODY: APPS.HR_ASSIGNMENT_SWI

Source


1 Package Body hr_assignment_swi As
2 /* $Header: hrasgswi.pkb 120.0.12010000.2 2008/08/14 10:24:37 ubhat ship $ */
3 --
4 -- Package variables
5 --
6 g_package  varchar2(33) := 'hr_assignment_swi.';
7 --
8 -- ----------------------------------------------------------------------------
9 -- |-------------------< chg_in_sys_status_to_term_apl >----------------------|
10 -- ----------------------------------------------------------------------------
11 function chg_in_sys_status_to_term_apl
12   (p_effective_date            in       date
13   ,p_datetrack_update_mode     in out nocopy   varchar2
14   ,p_assignment_status_type_id in       number
15   ,p_assignment_id             in       number
16   ,p_change_reason             in       varchar2  default hr_api.g_varchar2
17   ,p_object_version_number     in out nocopy   number
18   ,p_effective_start_date         out nocopy   date
19   ,p_effective_end_date           out nocopy   date
20   ) RETURN BOOLEAN is
21 --
22 -- Internal variables
23 --
24   l_proc        varchar2(72) := g_package ||'chg_in_sys_status_to_term_apl';
25   l_old_per_system_status
26              per_assignment_status_types.per_system_status%type;
27   l_new_per_system_status
28              per_assignment_status_types.per_system_status%type;
29   l_assignment_status_type_id
30              per_assignment_status_types.assignment_status_type_id%type;
31   l_person_id per_all_people_f.person_id%TYPE;
32   l_ovn      per_all_people_f.object_version_number%TYPE;
33   l_effective_date       date;
34   l_num_asg              number;
35   l_ias_status_id        irc_assignment_statuses.assignment_status_id%TYPE;
36   l_ias_ovn              irc_assignment_statuses.object_version_number%TYPE;
37   l_ias_date             irc_assignment_statuses.status_change_date%TYPE;
38   L_ACTIVATE_APL_ASG   constant  varchar2(30) := 'ACTIVE_APL';
39   L_OFFER_APL_ASG      constant  varchar2(30) := 'OFFER';
40   L_ACCEPT_APL_ASG     constant  varchar2(30) := 'ACCEPTED';
41   L_INTERVIEW1_APL_ASG constant  varchar2(30) := 'INTERVIEW1';
42   L_INTERVIEW2_APL_ASG constant  varchar2(30) := 'INTERVIEW2';
43   L_TERM_APL           constant  varchar2(30) := 'TERM_APL';
44   l_warning            boolean; -- 4066579
45 --
46 -- Local cursors
47 --
48   Cursor csr_sys_status is
49     select olds.per_system_status
50           ,news.per_system_status
51           ,olds.assignment_status_type_id
52           ,asg.person_id
53     from   per_assignment_status_types olds
54           ,per_assignment_status_types news
55           ,per_all_assignments_f       asg
56     where asg.assignment_id=p_assignment_id
57     and   p_effective_date between
58           asg.effective_start_date and asg.effective_end_date
59     and   olds.assignment_status_type_id=asg.assignment_status_type_id
60     and   news.assignment_status_type_id=p_assignment_status_type_id;
61 
62 
63 -- count the number of applicant assignments tomorrow, i.e. the number
64 -- that have not been terminated yet.
65 
66   Cursor csr_count(p_person_id per_all_people_f.person_id%type) is
67     SELECT count(*)
68     FROM per_all_assignments_f asg
69     WHERE asg.person_id=p_person_id
70     AND asg.assignment_type='A'
71     AND trunc(p_effective_date)+1 between asg.effective_start_date and asg.effective_end_date;
72 
73   Cursor csr_ovn_person is
74     Select object_version_number
75       from per_people_f
76      where person_id = l_person_id
77        and l_effective_date between
78            effective_start_date and effective_end_date;
79 
80   cursor csr_last_irc_assignment is
81    select ias.assignment_status_id
82          ,ias.object_version_number
83 	 ,ias.status_change_date
84      from irc_assignment_statuses ias
85     where ias.assignment_id = p_assignment_id
86       and not exists(select null
87                        from irc_assignment_statuses
88                       where assignment_id = p_assignment_id
89                         and assignment_status_id > ias.assignment_status_id
90                  );
91 --
92 Begin
93   hr_utility.set_location(' Entering:' || l_proc,10);
94   --
95   -- Initialise local variable
96   --
97   l_effective_date := trunc(p_effective_date);
98   --
99   open csr_sys_status;
100   --
101   fetch csr_sys_status into
102      l_old_per_system_status
103     ,l_new_per_system_status
104     ,l_assignment_status_type_id
105     ,l_person_id;
106   --
107   close csr_sys_status;
108   --
109   if l_old_per_system_status <> l_new_per_system_status  then
110   --
111   --
112 
113   open csr_count(l_person_id);
114   fetch csr_count into l_num_asg;
115   close csr_count;
116 
117   open csr_ovn_person;
118   fetch csr_ovn_person into l_ovn;
119   close csr_ovn_person;
120   --
121     IF l_new_per_system_status = L_TERM_APL THEN
122       If l_num_asg = 1 Then
123         hr_applicant_api.terminate_applicant
124           (p_effective_date        => p_effective_date
125           ,p_person_id             => l_person_id
126           ,p_object_version_number => l_ovn
127           ,p_effective_start_date  => p_effective_start_date
128           ,p_effective_end_date    => p_effective_end_date
129           ,p_assignment_status_type_id  => p_assignment_status_type_id --7228702
130 	  ,p_change_reason         => p_change_reason --4066579
131           ,p_remove_fut_asg_warning => l_warning -- 4066579
132           );
133         -- Fix for bug 3308428. This is a work round fix until
134         -- hr_applicant_api.terminate_applicant is modified to
135         -- accept assginment_status_type_id as parameter
136        -- open csr_last_irc_assignment;
137        -- fetch csr_last_irc_assignment into
138 	--     l_ias_status_id
139 	 --   ,l_ias_ovn
140 	  --  ,l_ias_date;
141         --close csr_last_irc_assignment;
142         --irc_ias_upd.upd
143         --(
144          --p_assignment_status_id       => l_ias_status_id
145         --,p_object_version_number      => l_ias_ovn
146         --,p_assignment_status_type_id  => p_assignment_status_type_id
147         --,p_status_change_date         => l_ias_date
148         --);
149       Else
150         hr_assignment_api.terminate_apl_asg
151           (p_effective_date               => p_effective_date
152           ,p_assignment_id                => p_assignment_id
153           ,p_assignment_status_type_id    => p_assignment_status_type_id
154           ,p_object_version_number        => p_object_version_number
155           ,p_effective_start_date         => p_effective_start_date
156           ,p_effective_end_date           => p_effective_end_date
157 	  ,p_change_reason                => p_change_reason -- 4066579
158           );
159       End if;
160       hr_utility.set_location(' Leaving:' || l_proc,15);
161       Return TRUE;
162     END IF;
163   --
164     If l_new_per_system_status = L_ACTIVATE_APL_ASG then
165         hr_assignment_api.activate_apl_asg
166           (p_effective_date               => l_effective_date
167           ,p_datetrack_update_mode        => p_datetrack_update_mode
168           ,p_assignment_id                => p_assignment_id
169           ,p_object_version_number        => p_object_version_number
170           ,p_assignment_status_type_id    => p_assignment_status_type_id
171           ,p_change_reason                => p_change_reason
172           ,p_effective_start_date         => p_effective_start_date
173           ,p_effective_end_date           => p_effective_end_date
174           );
175           p_datetrack_update_mode := 'CORRECTION';
176     elsif l_new_per_system_status = L_OFFER_APL_ASG then
177           hr_assignment_api.offer_apl_asg
178             (p_effective_date               => l_effective_date
179             ,p_datetrack_update_mode        => p_datetrack_update_mode
180             ,p_assignment_id                => p_assignment_id
181             ,p_object_version_number        => p_object_version_number
182             ,p_assignment_status_type_id    => p_assignment_status_type_id
183             ,p_change_reason                => p_change_reason
184             ,p_effective_start_date         => p_effective_start_date
185             ,p_effective_end_date           => p_effective_end_date
186             );
187           p_datetrack_update_mode := 'CORRECTION';
188     elsif l_new_per_system_status = L_ACCEPT_APL_ASG then
189           hr_assignment_api.accept_apl_asg
190             (p_effective_date               => l_effective_date
191             ,p_datetrack_update_mode        => p_datetrack_update_mode
192             ,p_assignment_id                => p_assignment_id
193             ,p_object_version_number        => p_object_version_number
194             ,p_assignment_status_type_id    => p_assignment_status_type_id
195             ,p_change_reason                => p_change_reason
196             ,p_effective_start_date         => p_effective_start_date
197             ,p_effective_end_date           => p_effective_end_date
198             );
199           p_datetrack_update_mode := 'CORRECTION';
200     elsif l_new_per_system_status = L_INTERVIEW1_APL_ASG then
201           hr_assignment_api.interview1_apl_asg
202             (p_effective_date               => l_effective_date
203             ,p_datetrack_update_mode        => p_datetrack_update_mode
204             ,p_assignment_id                => p_assignment_id
205             ,p_object_version_number        => p_object_version_number
206             ,p_assignment_status_type_id    => p_assignment_status_type_id
207             ,p_change_reason                => p_change_reason
208             ,p_effective_start_date         => p_effective_start_date
209             ,p_effective_end_date           => p_effective_end_date
210             );
211           p_datetrack_update_mode := 'CORRECTION';
212     elsif l_new_per_system_status = L_INTERVIEW2_APL_ASG then
213           hr_assignment_api.interview2_apl_asg
214             (p_effective_date               => l_effective_date
215             ,p_datetrack_update_mode        => p_datetrack_update_mode
216             ,p_assignment_id                => p_assignment_id
217             ,p_object_version_number        => p_object_version_number
218             ,p_assignment_status_type_id    => p_assignment_status_type_id
219             ,p_change_reason                => p_change_reason
220             ,p_effective_start_date         => p_effective_start_date
221             ,p_effective_end_date           => p_effective_end_date
222             );
223           p_datetrack_update_mode := 'CORRECTION';
224     end if;
225   --
226     hr_utility.set_location(' Leaving:' || l_proc,18);
227     RETURN FALSE;
228   --
229   end if;
230   --
231   hr_utility.set_location(' Leaving:' || l_proc,20);
232   RETURN FALSE;
233 End chg_in_sys_status_to_term_apl;
234 --
235 -- ----------------------------------------------------------------------------
236 -- |-----------------------< create_secondary_apl_asg >-----------------------|
237 -- ----------------------------------------------------------------------------
238 PROCEDURE create_secondary_apl_asg
239   (p_validate                     in     number    default hr_api.g_false_num
240   ,p_effective_date               in     date
241   ,p_person_id                    in     number
242   ,p_organization_id              in     number
243   ,p_recruiter_id                 in     number    default null
244   ,p_grade_id                     in     number    default null
245   ,p_position_id                  in     number    default null
246   ,p_job_id                       in     number    default null
247   ,p_assignment_status_type_id    in     number    default null
248   ,p_payroll_id                   in     number    default null
249   ,p_location_id                  in     number    default null
250   ,p_person_referred_by_id        in     number    default null
251   ,p_supervisor_id                in     number    default null
252   ,p_special_ceiling_step_id      in     number    default null
253   ,p_recruitment_activity_id      in     number    default null
254   ,p_source_organization_id       in     number    default null
255   ,p_vacancy_id                   in     number    default null
256   ,p_pay_basis_id                 in     number    default null
257   ,p_change_reason                in     varchar2  default null
258   ,p_comments                     in     varchar2  default null
259   ,p_date_probation_end           in     date      default null
260   ,p_default_code_comb_id         in     number    default null
261   ,p_employment_category          in     varchar2  default null
262   ,p_frequency                    in     varchar2  default null
263   ,p_internal_address_line        in     varchar2  default null
264   ,p_manager_flag                 in     varchar2  default null
265   ,p_normal_hours                 in     number    default null
266   ,p_perf_review_period           in     number    default null
267   ,p_perf_review_period_frequency in     varchar2  default null
268   ,p_probation_period             in     number    default null
269   ,p_probation_unit               in     varchar2  default null
270   ,p_sal_review_period            in     number    default null
271   ,p_sal_review_period_frequency  in     varchar2  default null
272   ,p_set_of_books_id              in     number    default null
273   ,p_source_type                  in     varchar2  default null
274   ,p_time_normal_finish           in     varchar2  default null
275   ,p_time_normal_start            in     varchar2  default null
276   ,p_bargaining_unit_code         in     varchar2  default null
277   ,p_ass_attribute_category       in     varchar2  default null
278   ,p_ass_attribute1               in     varchar2  default null
279   ,p_ass_attribute2               in     varchar2  default null
280   ,p_ass_attribute3               in     varchar2  default null
281   ,p_ass_attribute4               in     varchar2  default null
282   ,p_ass_attribute5               in     varchar2  default null
283   ,p_ass_attribute6               in     varchar2  default null
284   ,p_ass_attribute7               in     varchar2  default null
285   ,p_ass_attribute8               in     varchar2  default null
286   ,p_ass_attribute9               in     varchar2  default null
287   ,p_ass_attribute10              in     varchar2  default null
288   ,p_ass_attribute11              in     varchar2  default null
289   ,p_ass_attribute12              in     varchar2  default null
290   ,p_ass_attribute13              in     varchar2  default null
291   ,p_ass_attribute14              in     varchar2  default null
292   ,p_ass_attribute15              in     varchar2  default null
293   ,p_ass_attribute16              in     varchar2  default null
294   ,p_ass_attribute17              in     varchar2  default null
295   ,p_ass_attribute18              in     varchar2  default null
296   ,p_ass_attribute19              in     varchar2  default null
297   ,p_ass_attribute20              in     varchar2  default null
298   ,p_ass_attribute21              in     varchar2  default null
299   ,p_ass_attribute22              in     varchar2  default null
300   ,p_ass_attribute23              in     varchar2  default null
301   ,p_ass_attribute24              in     varchar2  default null
302   ,p_ass_attribute25              in     varchar2  default null
303   ,p_ass_attribute26              in     varchar2  default null
304   ,p_ass_attribute27              in     varchar2  default null
305   ,p_ass_attribute28              in     varchar2  default null
306   ,p_ass_attribute29              in     varchar2  default null
307   ,p_ass_attribute30              in     varchar2  default null
308   ,p_title                        in     varchar2  default null
309   ,p_concatenated_segments           out nocopy varchar2
310   ,p_contract_id                  in     number    default null
311   ,p_establishment_id             in     number    default null
312   ,p_collective_agreement_id      in     number    default null
313   ,p_notice_period                in     number    default null
314   ,p_notice_period_uom            in     varchar2  default null
315   ,p_employee_category            in     varchar2  default null
316   ,p_work_at_home                 in     varchar2  default null
317   ,p_job_post_source_name         in     varchar2  default null
318   ,p_applicant_rank               in     number    default null
319   ,p_posting_content_id           in     number    default null
320   ,p_cagr_grade_def_id            in out nocopy number
321   ,p_cagr_concatenated_segments      out nocopy varchar2
322   ,p_group_name                      out nocopy varchar2
323   ,p_assignment_id                in     number
324   ,p_people_group_id              in out nocopy number
325   ,p_soft_coding_keyflex_id       in out nocopy number
326   ,p_comment_id                      out nocopy number
327   ,p_object_version_number           out nocopy number
328   ,p_effective_start_date            out nocopy date
329   ,p_effective_end_date              out nocopy date
330   ,p_assignment_sequence             out nocopy number
331   ,p_return_status                   out nocopy varchar2
332   ) is
333   --
334   -- Variables for API Boolean parameters
335   l_validate                      boolean;
336   --
337   -- Variables for IN/OUT parameters
338   l_cagr_grade_def_id             number;
339   l_people_group_id               number;
340   l_soft_coding_keyflex_id        number;
341   --
342   -- Other variables
343   l_assignment_id                number;
344   l_proc    varchar2(72) := g_package ||'create_secondary_apl_asg';
345 Begin
346   hr_utility.set_location(' Entering:' || l_proc,10);
347   --
348   -- Issue a savepoint
349   --
350   savepoint create_secondary_apl_asg_swi;
351   --
352   -- Initialise Multiple Message Detection
353   --
354   hr_multi_message.enable_message_list;
355   --
356   -- Remember IN OUT parameter IN values
357   --
358   l_cagr_grade_def_id             := p_cagr_grade_def_id;
359   l_people_group_id               := p_people_group_id;
360   l_soft_coding_keyflex_id        := p_soft_coding_keyflex_id;
361   --
362   -- Convert constant values to their corresponding boolean value
363   --
364   l_validate :=
365     hr_api.constant_to_boolean
366       (p_constant_value => p_validate);
367   --
368   -- Register Surrogate ID or user key values
369   --
370   per_asg_ins.set_base_key_value
371     (p_assignment_id => p_assignment_id
372     );
373   --
374   -- Call API
375   --
376   hr_assignment_api.create_secondary_apl_asg
377     (p_validate                     => l_validate
378     ,p_effective_date               => p_effective_date
379     ,p_person_id                    => p_person_id
380     ,p_organization_id              => p_organization_id
381     ,p_recruiter_id                 => p_recruiter_id
382     ,p_grade_id                     => p_grade_id
383     ,p_position_id                  => p_position_id
384     ,p_job_id                       => p_job_id
385     ,p_assignment_status_type_id    => p_assignment_status_type_id
386     ,p_payroll_id                   => p_payroll_id
387     ,p_location_id                  => p_location_id
388     ,p_person_referred_by_id        => p_person_referred_by_id
389     ,p_supervisor_id                => p_supervisor_id
390     ,p_special_ceiling_step_id      => p_special_ceiling_step_id
391     ,p_recruitment_activity_id      => p_recruitment_activity_id
392     ,p_source_organization_id       => p_source_organization_id
393     ,p_vacancy_id                   => p_vacancy_id
394     ,p_pay_basis_id                 => p_pay_basis_id
395     ,p_change_reason                => p_change_reason
396     ,p_comments                     => p_comments
397     ,p_date_probation_end           => p_date_probation_end
398     ,p_default_code_comb_id         => p_default_code_comb_id
399     ,p_employment_category          => p_employment_category
400     ,p_frequency                    => p_frequency
401     ,p_internal_address_line        => p_internal_address_line
402     ,p_manager_flag                 => p_manager_flag
403     ,p_normal_hours                 => p_normal_hours
404     ,p_perf_review_period           => p_perf_review_period
405     ,p_perf_review_period_frequency => p_perf_review_period_frequency
406     ,p_probation_period             => p_probation_period
407     ,p_probation_unit               => p_probation_unit
408     ,p_sal_review_period            => p_sal_review_period
409     ,p_sal_review_period_frequency  => p_sal_review_period_frequency
410     ,p_set_of_books_id              => p_set_of_books_id
411     ,p_source_type                  => p_source_type
412     ,p_time_normal_finish           => p_time_normal_finish
413     ,p_time_normal_start            => p_time_normal_start
414     ,p_bargaining_unit_code         => p_bargaining_unit_code
415     ,p_ass_attribute_category       => p_ass_attribute_category
416     ,p_ass_attribute1               => p_ass_attribute1
417     ,p_ass_attribute2               => p_ass_attribute2
418     ,p_ass_attribute3               => p_ass_attribute3
419     ,p_ass_attribute4               => p_ass_attribute4
420     ,p_ass_attribute5               => p_ass_attribute5
421     ,p_ass_attribute6               => p_ass_attribute6
422     ,p_ass_attribute7               => p_ass_attribute7
423     ,p_ass_attribute8               => p_ass_attribute8
424     ,p_ass_attribute9               => p_ass_attribute9
425     ,p_ass_attribute10              => p_ass_attribute10
426     ,p_ass_attribute11              => p_ass_attribute11
427     ,p_ass_attribute12              => p_ass_attribute12
428     ,p_ass_attribute13              => p_ass_attribute13
429     ,p_ass_attribute14              => p_ass_attribute14
430     ,p_ass_attribute15              => p_ass_attribute15
431     ,p_ass_attribute16              => p_ass_attribute16
432     ,p_ass_attribute17              => p_ass_attribute17
433     ,p_ass_attribute18              => p_ass_attribute18
434     ,p_ass_attribute19              => p_ass_attribute19
435     ,p_ass_attribute20              => p_ass_attribute20
436     ,p_ass_attribute21              => p_ass_attribute21
437     ,p_ass_attribute22              => p_ass_attribute22
438     ,p_ass_attribute23              => p_ass_attribute23
439     ,p_ass_attribute24              => p_ass_attribute24
440     ,p_ass_attribute25              => p_ass_attribute25
441     ,p_ass_attribute26              => p_ass_attribute26
442     ,p_ass_attribute27              => p_ass_attribute27
443     ,p_ass_attribute28              => p_ass_attribute28
444     ,p_ass_attribute29              => p_ass_attribute29
445     ,p_ass_attribute30              => p_ass_attribute30
446     ,p_title                        => p_title
447     ,p_concatenated_segments        => p_concatenated_segments
448     ,p_contract_id                  => p_contract_id
449     ,p_establishment_id             => p_establishment_id
450     ,p_collective_agreement_id      => p_collective_agreement_id
451     ,p_notice_period                => p_notice_period
452     ,p_notice_period_uom            => p_notice_period_uom
453     ,p_employee_category            => p_employee_category
454     ,p_work_at_home                 => p_work_at_home
455     ,p_job_post_source_name         => p_job_post_source_name
456     ,p_applicant_rank               => p_applicant_rank
457     ,p_posting_content_id           => p_posting_content_id
458     ,p_cagr_grade_def_id            => p_cagr_grade_def_id
459     ,p_cagr_concatenated_segments   => p_cagr_concatenated_segments
460     ,p_group_name                   => p_group_name
461     ,p_assignment_id                => l_assignment_id
462     ,p_people_group_id              => p_people_group_id
463     ,p_soft_coding_keyflex_id       => p_soft_coding_keyflex_id
464     ,p_comment_id                   => p_comment_id
465     ,p_object_version_number        => p_object_version_number
466     ,p_effective_start_date         => p_effective_start_date
467     ,p_effective_end_date           => p_effective_end_date
468     ,p_assignment_sequence          => p_assignment_sequence
469     );
470   --
471   -- Convert API warning boolean parameter values to specific
472   -- messages and add them to Multiple Message List
473   --
474   --
475   -- Convert API non-warning boolean parameter values
476   --
477   --
478   -- Derive the API return status value based on whether
479   -- messages of any type exist in the Multiple Message List.
480   -- Also disable Multiple Message Detection.
481   --
482   p_return_status := hr_multi_message.get_return_status_disable;
483   hr_utility.set_location(' Leaving:' || l_proc,20);
484   --
485 exception
486   when hr_multi_message.error_message_exist then
487     --
488     -- Catch the Multiple Message List exception which
489     -- indicates API processing has been aborted because
490     -- at least one message exists in the list.
491     --
492     rollback to create_secondary_apl_asg_swi;
493     --
494     -- Reset IN OUT parameters and set OUT parameters
495     --
496     p_concatenated_segments        := null;
497     p_cagr_grade_def_id            := l_cagr_grade_def_id;
498     p_cagr_concatenated_segments   := null;
499     p_group_name                   := null;
500     p_people_group_id              := l_people_group_id;
501     p_soft_coding_keyflex_id       := l_soft_coding_keyflex_id;
502     p_comment_id                   := null;
503     p_object_version_number        := null;
504     p_effective_start_date         := null;
505     p_effective_end_date           := null;
506     p_assignment_sequence          := null;
507     p_return_status := hr_multi_message.get_return_status_disable;
508     hr_utility.set_location(' Leaving:' || l_proc, 30);
509   when others then
510     --
511     -- When Multiple Message Detection is enabled catch
512     -- any Application specific or other unexpected
513     -- exceptions.  Adding appropriate details to the
514     -- Multiple Message List.  Otherwise re-raise the
515     -- error.
516     --
517     rollback to create_secondary_apl_asg_swi;
518     if hr_multi_message.unexpected_error_add(l_proc) then
519        hr_utility.set_location(' Leaving:' || l_proc,40);
520        raise;
521     end if;
522     --
523     -- Reset IN OUT and set OUT parameters
524     --
525     p_concatenated_segments        := null;
526     p_cagr_grade_def_id            := l_cagr_grade_def_id;
527     p_cagr_concatenated_segments   := null;
528     p_group_name                   := null;
529     p_people_group_id              := l_people_group_id;
530     p_soft_coding_keyflex_id       := l_soft_coding_keyflex_id;
531     p_comment_id                   := null;
532     p_object_version_number        := null;
533     p_effective_start_date         := null;
534     p_effective_end_date           := null;
535     p_assignment_sequence          := null;
536     p_return_status := hr_multi_message.get_return_status_disable;
537     hr_utility.set_location(' Leaving:' || l_proc,50);
538 end create_secondary_apl_asg;
539 -- ----------------------------------------------------------------------------
540 -- |----------------------------< accept_apl_asg >----------------------------|
541 -- ----------------------------------------------------------------------------
542 PROCEDURE accept_apl_asg
543   (p_validate                     in     number    default hr_api.g_false_num
544   ,p_effective_date               in     date
545   ,p_datetrack_update_mode        in     varchar2
546   ,p_assignment_id                in     number
547   ,p_object_version_number        in out nocopy number
548   ,p_assignment_status_type_id    in     number    default hr_api.g_number
549   ,p_change_reason                in     varchar2  default hr_api.g_varchar2
550   ,p_effective_start_date            out nocopy date
551   ,p_effective_end_date              out nocopy date
552   ,p_return_status                   out nocopy varchar2
553   ) is
554   --
555   -- Variables for API Boolean parameters
556   l_validate                      boolean;
557   --
558   -- Variables for IN/OUT parameters
559   l_object_version_number         number;
560   --
561   -- Other variables
562   l_proc    varchar2(72) := g_package ||'accept_apl_asg';
563 Begin
564   hr_utility.set_location(' Entering:' || l_proc,10);
565   --
566   -- Issue a savepoint
567   --
568   savepoint accept_apl_asg_swi;
569   --
570   -- Initialise Multiple Message Detection
571   --
572   hr_multi_message.enable_message_list;
573   --
574   -- Remember IN OUT parameter IN values
575   --
576   l_object_version_number         := p_object_version_number;
577   --
578   -- Convert constant values to their corresponding boolean value
579   --
580   l_validate :=
581     hr_api.constant_to_boolean
582       (p_constant_value => p_validate);
583   --
584   -- Register Surrogate ID or user key values
585   --
586   --
587   -- Call API
588   --
589   hr_assignment_api.accept_apl_asg
590     (p_validate                     => l_validate
591     ,p_effective_date               => p_effective_date
592     ,p_datetrack_update_mode        => p_datetrack_update_mode
593     ,p_assignment_id                => p_assignment_id
594     ,p_object_version_number        => p_object_version_number
595     ,p_assignment_status_type_id    => p_assignment_status_type_id
596     ,p_change_reason                => p_change_reason
597     ,p_effective_start_date         => p_effective_start_date
598     ,p_effective_end_date           => p_effective_end_date
599     );
600   --
601   -- Convert API warning boolean parameter values to specific
602   -- messages and add them to Multiple Message List
603   --
604   --
605   -- Convert API non-warning boolean parameter values
606   --
607   --
608   -- Derive the API return status value based on whether
609   -- messages of any type exist in the Multiple Message List.
610   -- Also disable Multiple Message Detection.
611   --
612   p_return_status := hr_multi_message.get_return_status_disable;
613   hr_utility.set_location(' Leaving:' || l_proc,20);
614   --
615 exception
616   when hr_multi_message.error_message_exist then
617     --
618     -- Catch the Multiple Message List exception which
619     -- indicates API processing has been aborted because
620     -- at least one message exists in the list.
621     --
622     rollback to accept_apl_asg_swi;
623     --
624     -- Reset IN OUT parameters and set OUT parameters
625     --
626     p_object_version_number        := l_object_version_number;
627     p_effective_start_date         := null;
628     p_effective_end_date           := null;
629     p_return_status := hr_multi_message.get_return_status_disable;
630     hr_utility.set_location(' Leaving:' || l_proc, 30);
631   when others then
632     --
633     -- When Multiple Message Detection is enabled catch
634     -- any Application specific or other unexpected
635     -- exceptions.  Adding appropriate details to the
636     -- Multiple Message List.  Otherwise re-raise the
637     -- error.
638     --
639     rollback to accept_apl_asg_swi;
640     if hr_multi_message.unexpected_error_add(l_proc) then
641        hr_utility.set_location(' Leaving:' || l_proc,40);
642        raise;
643     end if;
644     --
645     -- Reset IN OUT and set OUT parameters
646     --
647     p_object_version_number        := l_object_version_number;
648     p_effective_start_date         := null;
649     p_effective_end_date           := null;
650     p_return_status := hr_multi_message.get_return_status_disable;
651     hr_utility.set_location(' Leaving:' || l_proc,50);
652 end accept_apl_asg;
653 -- ----------------------------------------------------------------------------
654 -- |---------------------------< activate_apl_asg >---------------------------|
655 -- ----------------------------------------------------------------------------
656 PROCEDURE activate_apl_asg
657   (p_validate                     in     number    default hr_api.g_false_num
658   ,p_effective_date               in     date
659   ,p_datetrack_update_mode        in     varchar2
660   ,p_assignment_id                in     number
661   ,p_object_version_number        in out nocopy number
662   ,p_assignment_status_type_id    in     number    default hr_api.g_number
663   ,p_change_reason                in     varchar2  default hr_api.g_varchar2
664   ,p_effective_start_date            out nocopy date
665   ,p_effective_end_date              out nocopy date
666   ,p_return_status                   out nocopy varchar2
667   ) is
668   --
669   -- Variables for API Boolean parameters
670   l_validate                      boolean;
671   --
672   -- Variables for IN/OUT parameters
673   l_object_version_number         number;
674   --
675   -- Other variables
676   l_proc    varchar2(72) := g_package ||'activate_apl_asg';
677 Begin
678   hr_utility.set_location(' Entering:' || l_proc,10);
679   --
680   -- Issue a savepoint
681   --
682   savepoint activate_apl_asg_swi;
683   --
684   -- Initialise Multiple Message Detection
685   --
686   hr_multi_message.enable_message_list;
687   --
688   -- Remember IN OUT parameter IN values
689   --
690   l_object_version_number         := p_object_version_number;
691   --
692   -- Convert constant values to their corresponding boolean value
693   --
694   l_validate :=
695     hr_api.constant_to_boolean
696       (p_constant_value => p_validate);
697   --
698   -- Register Surrogate ID or user key values
699   --
700   --
701   -- Call API
702   --
703   hr_assignment_api.activate_apl_asg
704     (p_validate                     => l_validate
705     ,p_effective_date               => p_effective_date
706     ,p_datetrack_update_mode        => p_datetrack_update_mode
707     ,p_assignment_id                => p_assignment_id
708     ,p_object_version_number        => p_object_version_number
709     ,p_assignment_status_type_id    => p_assignment_status_type_id
710     ,p_change_reason                => p_change_reason
711     ,p_effective_start_date         => p_effective_start_date
712     ,p_effective_end_date           => p_effective_end_date
713     );
714   --
715   -- Convert API warning boolean parameter values to specific
716   -- messages and add them to Multiple Message List
717   --
718   --
719   -- Convert API non-warning boolean parameter values
720   --
721   --
722   -- Derive the API return status value based on whether
723   -- messages of any type exist in the Multiple Message List.
724   -- Also disable Multiple Message Detection.
725   --
726   p_return_status := hr_multi_message.get_return_status_disable;
727   hr_utility.set_location(' Leaving:' || l_proc,20);
728   --
729 exception
730   when hr_multi_message.error_message_exist then
731     --
732     -- Catch the Multiple Message List exception which
733     -- indicates API processing has been aborted because
734     -- at least one message exists in the list.
735     --
736     rollback to activate_apl_asg_swi;
737     --
738     -- Reset IN OUT parameters and set OUT parameters
739     --
740     p_object_version_number        := l_object_version_number;
741     p_effective_start_date         := null;
742     p_effective_end_date           := null;
743     p_return_status := hr_multi_message.get_return_status_disable;
744     hr_utility.set_location(' Leaving:' || l_proc, 30);
745   when others then
746     --
747     -- When Multiple Message Detection is enabled catch
748     -- any Application specific or other unexpected
749     -- exceptions.  Adding appropriate details to the
750     -- Multiple Message List.  Otherwise re-raise the
751     -- error.
752     --
753     rollback to activate_apl_asg_swi;
754     if hr_multi_message.unexpected_error_add(l_proc) then
755        hr_utility.set_location(' Leaving:' || l_proc,40);
756        raise;
757     end if;
758     --
759     -- Reset IN OUT and set OUT parameters
760     --
761     p_object_version_number        := l_object_version_number;
762     p_effective_start_date         := null;
763     p_effective_end_date           := null;
764     p_return_status := hr_multi_message.get_return_status_disable;
765     hr_utility.set_location(' Leaving:' || l_proc,50);
766 end activate_apl_asg;
767 -- ----------------------------------------------------------------------------
768 -- |-----------------------------< offer_apl_asg >----------------------------|
769 -- ----------------------------------------------------------------------------
770 PROCEDURE offer_apl_asg
771   (p_validate                     in     number    default hr_api.g_false_num
772   ,p_effective_date               in     date
773   ,p_datetrack_update_mode        in     varchar2
774   ,p_assignment_id                in     number
775   ,p_object_version_number        in out nocopy number
776   ,p_assignment_status_type_id    in     number    default hr_api.g_number
777   ,p_change_reason                in     varchar2  default hr_api.g_varchar2
778   ,p_effective_start_date            out nocopy date
779   ,p_effective_end_date              out nocopy date
780   ,p_return_status                   out nocopy varchar2
781   ) is
782   --
783   -- Variables for API Boolean parameters
784   l_validate                      boolean;
785   --
786   -- Variables for IN/OUT parameters
787   l_object_version_number         number;
788   --
789   -- Other variables
790   l_proc    varchar2(72) := g_package ||'offer_apl_asg';
791 Begin
792   hr_utility.set_location(' Entering:' || l_proc,10);
793   --
794   -- Issue a savepoint
795   --
796   savepoint offer_apl_asg_swi;
797   --
798   -- Initialise Multiple Message Detection
799   --
800   hr_multi_message.enable_message_list;
801   --
802   -- Remember IN OUT parameter IN values
803   --
804   l_object_version_number         := p_object_version_number;
805   --
806   -- Convert constant values to their corresponding boolean value
807   --
808   l_validate :=
809     hr_api.constant_to_boolean
810       (p_constant_value => p_validate);
811   --
812   -- Register Surrogate ID or user key values
813   --
814   --
815   -- Call API
816   --
817   hr_assignment_api.offer_apl_asg
818     (p_validate                     => l_validate
819     ,p_effective_date               => p_effective_date
820     ,p_datetrack_update_mode        => p_datetrack_update_mode
821     ,p_assignment_id                => p_assignment_id
822     ,p_object_version_number        => p_object_version_number
823     ,p_assignment_status_type_id    => p_assignment_status_type_id
824     ,p_change_reason                => p_change_reason
825     ,p_effective_start_date         => p_effective_start_date
826     ,p_effective_end_date           => p_effective_end_date
827     );
828   --
829   -- Convert API warning boolean parameter values to specific
830   -- messages and add them to Multiple Message List
831   --
832   --
833   -- Convert API non-warning boolean parameter values
834   --
835   --
836   -- Derive the API return status value based on whether
837   -- messages of any type exist in the Multiple Message List.
838   -- Also disable Multiple Message Detection.
839   --
840   p_return_status := hr_multi_message.get_return_status_disable;
841   hr_utility.set_location(' Leaving:' || l_proc,20);
842   --
843 exception
844   when hr_multi_message.error_message_exist then
845     --
846     -- Catch the Multiple Message List exception which
847     -- indicates API processing has been aborted because
848     -- at least one message exists in the list.
849     --
850     rollback to offer_apl_asg_swi;
851     --
852     -- Reset IN OUT parameters and set OUT parameters
853     --
854     p_object_version_number        := l_object_version_number;
855     p_effective_start_date         := null;
856     p_effective_end_date           := null;
857     p_return_status := hr_multi_message.get_return_status_disable;
858     hr_utility.set_location(' Leaving:' || l_proc, 30);
859   when others then
860     --
861     -- When Multiple Message Detection is enabled catch
862     -- any Application specific or other unexpected
863     -- exceptions.  Adding appropriate details to the
864     -- Multiple Message List.  Otherwise re-raise the
865     -- error.
866     --
867     rollback to offer_apl_asg_swi;
868     if hr_multi_message.unexpected_error_add(l_proc) then
869        hr_utility.set_location(' Leaving:' || l_proc,40);
870        raise;
871     end if;
872     --
873     -- Reset IN OUT and set OUT parameters
874     --
875     p_object_version_number        := l_object_version_number;
876     p_effective_start_date         := null;
877     p_effective_end_date           := null;
878     p_return_status := hr_multi_message.get_return_status_disable;
879     hr_utility.set_location(' Leaving:' || l_proc,50);
880 end offer_apl_asg;
881 -- ----------------------------------------------------------------------------
882  -- |---------------------------< terminate_apl_asg >--------------------------|
883 -- ----------------------------------------------------------------------------
884 PROCEDURE terminate_apl_asg
885   (p_validate                     in     number    default hr_api.g_false_num
886   ,p_effective_date               in     date
887   ,p_assignment_id                in     number
888   ,p_object_version_number        in out nocopy number
889   ,p_effective_start_date            out nocopy date
890   ,p_effective_end_date              out nocopy date
891   ,p_return_status                   out nocopy varchar2
892   ) is
893   --
894   -- Variables for API Boolean parameters
895   l_validate                      boolean;
896   --
897   -- Variables for IN/OUT parameters
898   l_object_version_number         number;
899   --
900   -- Other variables
901   l_proc    varchar2(72) := g_package ||'terminate_apl_asg';
902 Begin
903   hr_utility.set_location(' Entering:' || l_proc,10);
904   --
905   -- Issue a savepoint
906   --
907   savepoint terminate_apl_asg_swi;
908   --
909   -- Initialise Multiple Message Detection
910   --
911   hr_multi_message.enable_message_list;
912   --
913   -- Remember IN OUT parameter IN values
914   --
915   l_object_version_number         := p_object_version_number;
916   --
917   -- Convert constant values to their corresponding boolean value
918   --
919   l_validate :=
920     hr_api.constant_to_boolean
921       (p_constant_value => p_validate);
922   --
923   -- Register Surrogate ID or user key values
924   --
925   --
926   -- Call API
927   --
928   hr_assignment_api.terminate_apl_asg
929     (p_validate                     => l_validate
930     ,p_effective_date               => p_effective_date
931     ,p_assignment_id                => p_assignment_id
932     ,p_object_version_number        => p_object_version_number
933     ,p_effective_start_date         => p_effective_start_date
934     ,p_effective_end_date           => p_effective_end_date
935     );
936   --
937   -- Convert API warning boolean parameter values to specific
938   -- messages and add them to Multiple Message List
939   --
940   --
941   -- Convert API non-warning boolean parameter values
942   --
943   --
944   -- Derive the API return status value based on whether
945   -- messages of any type exist in the Multiple Message List.
946   -- Also disable Multiple Message Detection.
947   --
948   p_return_status := hr_multi_message.get_return_status_disable;
949   hr_utility.set_location(' Leaving:' || l_proc,20);
950   --
951 exception
952   when hr_multi_message.error_message_exist then
953     --
954     -- Catch the Multiple Message List exception which
955     -- indicates API processing has been aborted because
956     -- at least one message exists in the list.
957     --
958     rollback to terminate_apl_asg_swi;
959     --
960     -- Reset IN OUT parameters and set OUT parameters
961     --
962     p_object_version_number        := l_object_version_number;
963     p_effective_start_date         := null;
964     p_effective_end_date           := null;
965     p_return_status := hr_multi_message.get_return_status_disable;
966     hr_utility.set_location(' Leaving:' || l_proc, 30);
967   when others then
968     --
969     -- When Multiple Message Detection is enabled catch
970     -- any Application specific or other unexpected
971     -- exceptions.  Adding appropriate details to the
972     -- Multiple Message List.  Otherwise re-raise the
973     -- error.
974     --
975     rollback to terminate_apl_asg_swi;
976     if hr_multi_message.unexpected_error_add(l_proc) then
977        hr_utility.set_location(' Leaving:' || l_proc,40);
978        raise;
979     end if;
980     --
981     -- Reset IN OUT and set OUT parameters
982     --
983     p_object_version_number        := l_object_version_number;
984     p_effective_start_date         := null;
985     p_effective_end_date           := null;
986     p_return_status := hr_multi_message.get_return_status_disable;
987     hr_utility.set_location(' Leaving:' || l_proc,50);
988 end terminate_apl_asg;
989 -- ----------------------------------------------------------------------------
990 -- |----------------------------< update_apl_asg >----------------------------|
991 -- ----------------------------------------------------------------------------
992 PROCEDURE update_apl_asg
993   (p_validate                     in     number    default hr_api.g_false_num
994   ,p_effective_date               in     date
995   ,p_datetrack_update_mode        in     varchar2
996   ,p_assignment_id                in     number
997   ,p_object_version_number        in out nocopy number
998   ,p_recruiter_id                 in     number    default hr_api.g_number
999   ,p_grade_id                     in     number    default hr_api.g_number
1000   ,p_position_id                  in     number    default hr_api.g_number
1001   ,p_job_id                       in     number    default hr_api.g_number
1002   ,p_payroll_id                   in     number    default hr_api.g_number
1003   ,p_location_id                  in     number    default hr_api.g_number
1004   ,p_person_referred_by_id        in     number    default hr_api.g_number
1005   ,p_supervisor_id                in     number    default hr_api.g_number
1006   ,p_special_ceiling_step_id      in     number    default hr_api.g_number
1007   ,p_recruitment_activity_id      in     number    default hr_api.g_number
1008   ,p_source_organization_id       in     number    default hr_api.g_number
1009   ,p_organization_id              in     number    default hr_api.g_number
1010   ,p_vacancy_id                   in     number    default hr_api.g_number
1011   ,p_pay_basis_id                 in     number    default hr_api.g_number
1012   ,p_application_id               in     number    default hr_api.g_number
1013   ,p_change_reason                in     varchar2  default hr_api.g_varchar2
1014   ,p_assignment_status_type_id    in     number    default hr_api.g_number
1015   ,p_comments                     in     varchar2  default hr_api.g_varchar2
1016   ,p_date_probation_end           in     date      default hr_api.g_date
1017   ,p_default_code_comb_id         in     number    default hr_api.g_number
1018   ,p_employment_category          in     varchar2  default hr_api.g_varchar2
1019   ,p_frequency                    in     varchar2  default hr_api.g_varchar2
1020   ,p_internal_address_line        in     varchar2  default hr_api.g_varchar2
1021   ,p_manager_flag                 in     varchar2  default hr_api.g_varchar2
1022   ,p_normal_hours                 in     number    default hr_api.g_number
1023   ,p_perf_review_period           in     number    default hr_api.g_number
1024   ,p_perf_review_period_frequency in     varchar2  default hr_api.g_varchar2
1025   ,p_probation_period             in     number    default hr_api.g_number
1026   ,p_probation_unit               in     varchar2  default hr_api.g_varchar2
1027   ,p_sal_review_period            in     number    default hr_api.g_number
1028   ,p_sal_review_period_frequency  in     varchar2  default hr_api.g_varchar2
1029   ,p_set_of_books_id              in     number    default hr_api.g_number
1030   ,p_source_type                  in     varchar2  default hr_api.g_varchar2
1031   ,p_time_normal_finish           in     varchar2  default hr_api.g_varchar2
1032   ,p_time_normal_start            in     varchar2  default hr_api.g_varchar2
1033   ,p_bargaining_unit_code         in     varchar2  default hr_api.g_varchar2
1034   ,p_ass_attribute_category       in     varchar2  default hr_api.g_varchar2
1035   ,p_ass_attribute1               in     varchar2  default hr_api.g_varchar2
1036   ,p_ass_attribute2               in     varchar2  default hr_api.g_varchar2
1037   ,p_ass_attribute3               in     varchar2  default hr_api.g_varchar2
1038   ,p_ass_attribute4               in     varchar2  default hr_api.g_varchar2
1039   ,p_ass_attribute5               in     varchar2  default hr_api.g_varchar2
1040   ,p_ass_attribute6               in     varchar2  default hr_api.g_varchar2
1041   ,p_ass_attribute7               in     varchar2  default hr_api.g_varchar2
1042   ,p_ass_attribute8               in     varchar2  default hr_api.g_varchar2
1043   ,p_ass_attribute9               in     varchar2  default hr_api.g_varchar2
1044   ,p_ass_attribute10              in     varchar2  default hr_api.g_varchar2
1045   ,p_ass_attribute11              in     varchar2  default hr_api.g_varchar2
1046   ,p_ass_attribute12              in     varchar2  default hr_api.g_varchar2
1047   ,p_ass_attribute13              in     varchar2  default hr_api.g_varchar2
1048   ,p_ass_attribute14              in     varchar2  default hr_api.g_varchar2
1049   ,p_ass_attribute15              in     varchar2  default hr_api.g_varchar2
1050   ,p_ass_attribute16              in     varchar2  default hr_api.g_varchar2
1051   ,p_ass_attribute17              in     varchar2  default hr_api.g_varchar2
1052   ,p_ass_attribute18              in     varchar2  default hr_api.g_varchar2
1053   ,p_ass_attribute19              in     varchar2  default hr_api.g_varchar2
1054   ,p_ass_attribute20              in     varchar2  default hr_api.g_varchar2
1055   ,p_ass_attribute21              in     varchar2  default hr_api.g_varchar2
1056   ,p_ass_attribute22              in     varchar2  default hr_api.g_varchar2
1057   ,p_ass_attribute23              in     varchar2  default hr_api.g_varchar2
1058   ,p_ass_attribute24              in     varchar2  default hr_api.g_varchar2
1059   ,p_ass_attribute25              in     varchar2  default hr_api.g_varchar2
1060   ,p_ass_attribute26              in     varchar2  default hr_api.g_varchar2
1061   ,p_ass_attribute27              in     varchar2  default hr_api.g_varchar2
1062   ,p_ass_attribute28              in     varchar2  default hr_api.g_varchar2
1063   ,p_ass_attribute29              in     varchar2  default hr_api.g_varchar2
1064   ,p_ass_attribute30              in     varchar2  default hr_api.g_varchar2
1065   ,p_title                        in     varchar2  default hr_api.g_varchar2
1066   ,p_concatenated_segments           out nocopy varchar2
1067   ,p_contract_id                  in     number    default hr_api.g_number
1068   ,p_establishment_id             in     number    default hr_api.g_number
1069   ,p_collective_agreement_id      in     number    default hr_api.g_number
1070   ,p_notice_period                in     number    default hr_api.g_number
1071   ,p_notice_period_uom            in     varchar2  default hr_api.g_varchar2
1072   ,p_employee_category            in     varchar2  default hr_api.g_varchar2
1073   ,p_work_at_home                 in     varchar2  default hr_api.g_varchar2
1074   ,p_job_post_source_name         in     varchar2  default hr_api.g_varchar2
1075   ,p_posting_content_id           in     number    default hr_api.g_number
1076   ,p_applicant_rank               in     number    default hr_api.g_number
1077   ,p_cagr_grade_def_id            in out nocopy number
1078   ,p_cagr_concatenated_segments      out nocopy varchar2
1079   ,p_group_name                      out nocopy varchar2
1080   ,p_comment_id                      out nocopy number
1081   ,p_people_group_id              in out nocopy number
1082   ,p_soft_coding_keyflex_id       in out nocopy number
1083   ,p_effective_start_date            out nocopy date
1084   ,p_effective_end_date              out nocopy date
1085   ,p_return_status                   out nocopy varchar2
1086   ) is
1087   --
1088   -- Variables for API Boolean parameters
1089   l_validate                      boolean;
1090   --
1091   -- Added for turn off key flex field validation
1092   l_add_struct hr_kflex_utility.l_ignore_kfcode_varray :=
1093                            hr_kflex_utility.l_ignore_kfcode_varray();
1094   --
1095   -- Variables for IN/OUT parameters
1096   l_object_version_number         number;
1097   l_cagr_grade_def_id             number;
1098   l_people_group_id               number;
1099   l_soft_coding_keyflex_id        number;
1100   l_datetrack_update_mode varchar2(30) := p_datetrack_update_mode;
1101   --
1102   -- Other variables
1103   l_effective_date             date;
1104   l_proc    varchar2(72) := g_package ||'update_apl_asg';
1105 Begin
1106   hr_utility.set_location(' Entering:' || l_proc,10);
1107   --
1108   -- Initialise local variable
1109   --
1110   l_effective_date := trunc(p_effective_date);
1111   --
1112   -- Issue a savepoint
1113   --
1114   savepoint update_apl_asg_swi;
1115   --
1116   -- Initialise Multiple Message Detection
1117   --
1118   hr_multi_message.enable_message_list;
1119   --
1120   -- Remember IN OUT parameter IN values
1121   --
1122   l_object_version_number         := p_object_version_number;
1123   l_cagr_grade_def_id             := p_cagr_grade_def_id;
1124   l_people_group_id               := p_people_group_id;
1125   l_soft_coding_keyflex_id        := p_soft_coding_keyflex_id;
1126   --
1127   -- Convert constant values to their corresponding boolean value
1128   --
1129   l_validate :=
1130     hr_api.constant_to_boolean
1131       (p_constant_value => p_validate);
1132   --
1133   -- Added for turn off key flex field validation
1134   l_add_struct.extend(1);
1135   l_add_struct(l_add_struct.count) := 'GRP';
1136   --
1137   hr_kflex_utility.create_ignore_kf_validation(p_rec => l_add_struct);
1138   --
1139   -- Register Surrogate ID or user key values
1140   --
1141   --
1142   -- Call API
1143   --
1144   IF NOT hr_assignment_swi.chg_in_sys_status_to_term_apl
1145            ( p_effective_date              => l_effective_date
1146            , p_datetrack_update_mode       => l_datetrack_update_mode
1147            , p_assignment_status_type_id   => p_assignment_status_type_id
1148            , p_assignment_id               => p_assignment_id
1149            , p_change_reason               => p_change_reason
1150            , p_object_version_number       => p_object_version_number
1151            , p_effective_start_date        => p_effective_start_date
1152            , p_effective_end_date          => p_effective_end_date
1153            ) THEN
1154               hr_assignment_api.update_apl_asg
1155                 (p_validate                     => l_validate
1156                 ,p_effective_date               => p_effective_date
1157                 ,p_datetrack_update_mode        => l_datetrack_update_mode
1158                 ,p_assignment_id                => p_assignment_id
1159                 ,p_object_version_number        => p_object_version_number
1160                 ,p_recruiter_id                 => p_recruiter_id
1161                 ,p_grade_id                     => p_grade_id
1162                 ,p_position_id                  => p_position_id
1163                 ,p_job_id                       => p_job_id
1164                 ,p_payroll_id                   => p_payroll_id
1165                 ,p_location_id                  => p_location_id
1166                 ,p_person_referred_by_id        => p_person_referred_by_id
1167                 ,p_supervisor_id                => p_supervisor_id
1168                 ,p_special_ceiling_step_id      => p_special_ceiling_step_id
1169                 ,p_recruitment_activity_id      => p_recruitment_activity_id
1170                 ,p_source_organization_id       => p_source_organization_id
1171                 ,p_organization_id              => p_organization_id
1172                 ,p_vacancy_id                   => p_vacancy_id
1173                 ,p_pay_basis_id                 => p_pay_basis_id
1174                 ,p_application_id               => p_application_id
1175                 ,p_change_reason                => p_change_reason
1176                 ,p_assignment_status_type_id    => p_assignment_status_type_id
1177                 ,p_comments                     => p_comments
1178                 ,p_date_probation_end           => p_date_probation_end
1179                 ,p_default_code_comb_id         => p_default_code_comb_id
1180                 ,p_employment_category          => p_employment_category
1181                 ,p_frequency                    => p_frequency
1182                 ,p_internal_address_line        => p_internal_address_line
1183                 ,p_manager_flag                 => p_manager_flag
1184                 ,p_normal_hours                 => p_normal_hours
1185                 ,p_perf_review_period           => p_perf_review_period
1186                 ,p_perf_review_period_frequency => p_perf_review_period_frequency
1187                 ,p_probation_period             => p_probation_period
1188                 ,p_probation_unit               => p_probation_unit
1189                 ,p_sal_review_period            => p_sal_review_period
1190                 ,p_sal_review_period_frequency  => p_sal_review_period_frequency
1191                 ,p_set_of_books_id              => p_set_of_books_id
1192                 ,p_source_type                  => p_source_type
1193                 ,p_time_normal_finish           => p_time_normal_finish
1194                 ,p_time_normal_start            => p_time_normal_start
1195                 ,p_bargaining_unit_code         => p_bargaining_unit_code
1196                 ,p_ass_attribute_category       => p_ass_attribute_category
1197                 ,p_ass_attribute1               => p_ass_attribute1
1198                 ,p_ass_attribute2               => p_ass_attribute2
1199                 ,p_ass_attribute3               => p_ass_attribute3
1200                 ,p_ass_attribute4               => p_ass_attribute4
1201                 ,p_ass_attribute5               => p_ass_attribute5
1202                 ,p_ass_attribute6               => p_ass_attribute6
1203                 ,p_ass_attribute7               => p_ass_attribute7
1204                 ,p_ass_attribute8               => p_ass_attribute8
1205                 ,p_ass_attribute9               => p_ass_attribute9
1206                 ,p_ass_attribute10              => p_ass_attribute10
1207                 ,p_ass_attribute11              => p_ass_attribute11
1208                 ,p_ass_attribute12              => p_ass_attribute12
1209                 ,p_ass_attribute13              => p_ass_attribute13
1210                 ,p_ass_attribute14              => p_ass_attribute14
1211                 ,p_ass_attribute15              => p_ass_attribute15
1212                 ,p_ass_attribute16              => p_ass_attribute16
1213                 ,p_ass_attribute17              => p_ass_attribute17
1214                 ,p_ass_attribute18              => p_ass_attribute18
1215                 ,p_ass_attribute19              => p_ass_attribute19
1216                 ,p_ass_attribute20              => p_ass_attribute20
1217                 ,p_ass_attribute21              => p_ass_attribute21
1218                 ,p_ass_attribute22              => p_ass_attribute22
1219                 ,p_ass_attribute23              => p_ass_attribute23
1220                 ,p_ass_attribute24              => p_ass_attribute24
1221                 ,p_ass_attribute25              => p_ass_attribute25
1222                 ,p_ass_attribute26              => p_ass_attribute26
1223                 ,p_ass_attribute27              => p_ass_attribute27
1224                 ,p_ass_attribute28              => p_ass_attribute28
1225                 ,p_ass_attribute29              => p_ass_attribute29
1226                 ,p_ass_attribute30              => p_ass_attribute30
1227                 ,p_title                        => p_title
1228                 ,p_concatenated_segments        => p_concatenated_segments
1229                 ,p_contract_id                  => p_contract_id
1230                 ,p_establishment_id             => p_establishment_id
1231                 ,p_collective_agreement_id      => p_collective_agreement_id
1232                 ,p_notice_period                => p_notice_period
1233                 ,p_notice_period_uom            => p_notice_period_uom
1234                 ,p_employee_category            => p_employee_category
1235                 ,p_work_at_home                 => p_work_at_home
1236                 ,p_job_post_source_name         => p_job_post_source_name
1237                 ,p_posting_content_id           => p_posting_content_id
1238                 ,p_applicant_rank               => p_applicant_rank
1239                 ,p_cagr_grade_def_id            => p_cagr_grade_def_id
1240                 ,p_cagr_concatenated_segments   => p_cagr_concatenated_segments
1241                 ,p_group_name                   => p_group_name
1242                 ,p_comment_id                   => p_comment_id
1243                 ,p_people_group_id              => p_people_group_id
1244                 ,p_soft_coding_keyflex_id       => p_soft_coding_keyflex_id
1245                 ,p_effective_start_date         => p_effective_start_date
1246                 ,p_effective_end_date           => p_effective_end_date
1247                 );
1248   END IF;
1249   --
1250   -- Convert API warning boolean parameter values to specific
1251   -- messages and add them to Multiple Message List
1252   --
1253   --
1254   -- Convert API non-warning boolean parameter values
1255   --
1256   --
1257   -- Derive the API return status value based on whether
1258   -- messages of any type exist in the Multiple Message List.
1259   -- Also disable Multiple Message Detection.
1260   --
1261   p_return_status := hr_multi_message.get_return_status_disable;
1262   hr_utility.set_location(' Leaving:' || l_proc,20);
1263   --
1264 exception
1265   when hr_multi_message.error_message_exist then
1266     --
1267     -- Catch the Multiple Message List exception which
1268     -- indicates API processing has been aborted because
1269     -- at least one message exists in the list.
1270     --
1271     rollback to update_apl_asg_swi;
1272     --
1273     -- Reset IN OUT parameters and set OUT parameters
1274     --
1275     p_object_version_number        := l_object_version_number;
1276     p_concatenated_segments        := null;
1277     p_cagr_grade_def_id            := l_cagr_grade_def_id;
1278     p_cagr_concatenated_segments   := null;
1279     p_group_name                   := null;
1280     p_comment_id                   := null;
1281     p_people_group_id              := l_people_group_id;
1282     p_soft_coding_keyflex_id       := l_soft_coding_keyflex_id;
1283     p_effective_start_date         := null;
1284     p_effective_end_date           := null;
1285     p_return_status := hr_multi_message.get_return_status_disable;
1286     hr_utility.set_location(' Leaving:' || l_proc, 30);
1287   when others then
1288     --
1289     -- When Multiple Message Detection is enabled catch
1290     -- any Application specific or other unexpected
1291     -- exceptions.  Adding appropriate details to the
1292     -- Multiple Message List.  Otherwise re-raise the
1293     -- error.
1294     --
1295     rollback to update_apl_asg_swi;
1296     if hr_multi_message.unexpected_error_add(l_proc) then
1297        hr_utility.set_location(' Leaving:' || l_proc,40);
1298        raise;
1299     end if;
1300     --
1301     -- Reset IN OUT and set OUT parameters
1302     --
1303     p_object_version_number        := l_object_version_number;
1304     p_concatenated_segments        := null;
1305     p_cagr_grade_def_id            := l_cagr_grade_def_id;
1306     p_cagr_concatenated_segments   := null;
1307     p_group_name                   := null;
1308     p_comment_id                   := null;
1309     p_people_group_id              := l_people_group_id;
1310     p_soft_coding_keyflex_id       := l_soft_coding_keyflex_id;
1311     p_effective_start_date         := null;
1312     p_effective_end_date           := null;
1313     p_return_status := hr_multi_message.get_return_status_disable;
1314     hr_utility.set_location(' Leaving:' || l_proc,50);
1315 end update_apl_asg;
1316 --
1317 -- ----------------------------------------------------------------------------
1318 -- |----------------------------< update_emp_asg >----------------------------|
1319 -- ----------------------------------------------------------------------------
1320 PROCEDURE update_emp_asg
1321   (p_validate                     in     number    default hr_api.g_false_num
1322   ,p_effective_date               in     date
1323   ,p_datetrack_update_mode        in     varchar2
1324   ,p_assignment_id                in     number
1325   ,p_object_version_number        in out nocopy number
1326   ,p_supervisor_id                in     number    default hr_api.g_number
1327   ,p_assignment_number            in     varchar2  default hr_api.g_varchar2
1328   ,p_change_reason                in     varchar2  default hr_api.g_varchar2
1329   ,p_assignment_status_type_id    in     number    default hr_api.g_number
1330   ,p_comments                     in     varchar2  default hr_api.g_varchar2
1331   ,p_date_probation_end           in     date      default hr_api.g_date
1332   ,p_default_code_comb_id         in     number    default hr_api.g_number
1333   ,p_frequency                    in     varchar2  default hr_api.g_varchar2
1334   ,p_internal_address_line        in     varchar2  default hr_api.g_varchar2
1335   ,p_manager_flag                 in     varchar2  default hr_api.g_varchar2
1336   ,p_normal_hours                 in     number    default hr_api.g_number
1337   ,p_perf_review_period           in     number    default hr_api.g_number
1338   ,p_perf_review_period_frequency in     varchar2  default hr_api.g_varchar2
1339   ,p_probation_period             in     number    default hr_api.g_number
1340   ,p_probation_unit               in     varchar2  default hr_api.g_varchar2
1341   ,p_sal_review_period            in     number    default hr_api.g_number
1342   ,p_sal_review_period_frequency  in     varchar2  default hr_api.g_varchar2
1343   ,p_set_of_books_id              in     number    default hr_api.g_number
1344   ,p_source_type                  in     varchar2  default hr_api.g_varchar2
1345   ,p_time_normal_finish           in     varchar2  default hr_api.g_varchar2
1346   ,p_time_normal_start            in     varchar2  default hr_api.g_varchar2
1347   ,p_bargaining_unit_code         in     varchar2  default hr_api.g_varchar2
1348   ,p_labour_union_member_flag     in     varchar2  default hr_api.g_varchar2
1349   ,p_hourly_salaried_code         in     varchar2  default hr_api.g_varchar2
1350   ,p_ass_attribute_category       in     varchar2  default hr_api.g_varchar2
1351   ,p_ass_attribute1               in     varchar2  default hr_api.g_varchar2
1352   ,p_ass_attribute2               in     varchar2  default hr_api.g_varchar2
1353   ,p_ass_attribute3               in     varchar2  default hr_api.g_varchar2
1354   ,p_ass_attribute4               in     varchar2  default hr_api.g_varchar2
1355   ,p_ass_attribute5               in     varchar2  default hr_api.g_varchar2
1356   ,p_ass_attribute6               in     varchar2  default hr_api.g_varchar2
1357   ,p_ass_attribute7               in     varchar2  default hr_api.g_varchar2
1358   ,p_ass_attribute8               in     varchar2  default hr_api.g_varchar2
1359   ,p_ass_attribute9               in     varchar2  default hr_api.g_varchar2
1360   ,p_ass_attribute10              in     varchar2  default hr_api.g_varchar2
1361   ,p_ass_attribute11              in     varchar2  default hr_api.g_varchar2
1362   ,p_ass_attribute12              in     varchar2  default hr_api.g_varchar2
1363   ,p_ass_attribute13              in     varchar2  default hr_api.g_varchar2
1364   ,p_ass_attribute14              in     varchar2  default hr_api.g_varchar2
1365   ,p_ass_attribute15              in     varchar2  default hr_api.g_varchar2
1366   ,p_ass_attribute16              in     varchar2  default hr_api.g_varchar2
1367   ,p_ass_attribute17              in     varchar2  default hr_api.g_varchar2
1368   ,p_ass_attribute18              in     varchar2  default hr_api.g_varchar2
1369   ,p_ass_attribute19              in     varchar2  default hr_api.g_varchar2
1370   ,p_ass_attribute20              in     varchar2  default hr_api.g_varchar2
1371   ,p_ass_attribute21              in     varchar2  default hr_api.g_varchar2
1372   ,p_ass_attribute22              in     varchar2  default hr_api.g_varchar2
1373   ,p_ass_attribute23              in     varchar2  default hr_api.g_varchar2
1374   ,p_ass_attribute24              in     varchar2  default hr_api.g_varchar2
1375   ,p_ass_attribute25              in     varchar2  default hr_api.g_varchar2
1376   ,p_ass_attribute26              in     varchar2  default hr_api.g_varchar2
1377   ,p_ass_attribute27              in     varchar2  default hr_api.g_varchar2
1378   ,p_ass_attribute28              in     varchar2  default hr_api.g_varchar2
1379   ,p_ass_attribute29              in     varchar2  default hr_api.g_varchar2
1380   ,p_ass_attribute30              in     varchar2  default hr_api.g_varchar2
1381   ,p_title                        in     varchar2  default hr_api.g_varchar2
1382   ,p_segment1                     in     varchar2  default hr_api.g_varchar2
1383   ,p_segment2                     in     varchar2  default hr_api.g_varchar2
1384   ,p_segment3                     in     varchar2  default hr_api.g_varchar2
1385   ,p_segment4                     in     varchar2  default hr_api.g_varchar2
1386   ,p_segment5                     in     varchar2  default hr_api.g_varchar2
1387   ,p_segment6                     in     varchar2  default hr_api.g_varchar2
1388   ,p_segment7                     in     varchar2  default hr_api.g_varchar2
1389   ,p_segment8                     in     varchar2  default hr_api.g_varchar2
1390   ,p_segment9                     in     varchar2  default hr_api.g_varchar2
1391   ,p_segment10                    in     varchar2  default hr_api.g_varchar2
1392   ,p_segment11                    in     varchar2  default hr_api.g_varchar2
1393   ,p_segment12                    in     varchar2  default hr_api.g_varchar2
1394   ,p_segment13                    in     varchar2  default hr_api.g_varchar2
1395   ,p_segment14                    in     varchar2  default hr_api.g_varchar2
1396   ,p_segment15                    in     varchar2  default hr_api.g_varchar2
1397   ,p_segment16                    in     varchar2  default hr_api.g_varchar2
1398   ,p_segment17                    in     varchar2  default hr_api.g_varchar2
1399   ,p_segment18                    in     varchar2  default hr_api.g_varchar2
1400   ,p_segment19                    in     varchar2  default hr_api.g_varchar2
1401   ,p_segment20                    in     varchar2  default hr_api.g_varchar2
1402   ,p_segment21                    in     varchar2  default hr_api.g_varchar2
1403   ,p_segment22                    in     varchar2  default hr_api.g_varchar2
1404   ,p_segment23                    in     varchar2  default hr_api.g_varchar2
1405   ,p_segment24                    in     varchar2  default hr_api.g_varchar2
1406   ,p_segment25                    in     varchar2  default hr_api.g_varchar2
1407   ,p_segment26                    in     varchar2  default hr_api.g_varchar2
1408   ,p_segment27                    in     varchar2  default hr_api.g_varchar2
1409   ,p_segment28                    in     varchar2  default hr_api.g_varchar2
1410   ,p_segment29                    in     varchar2  default hr_api.g_varchar2
1411   ,p_segment30                    in     varchar2  default hr_api.g_varchar2
1412   ,p_concat_segments              in     varchar2  default hr_api.g_varchar2
1413   ,p_contract_id                  in     number    default hr_api.g_number
1414   ,p_establishment_id             in     number    default hr_api.g_number
1415   ,p_collective_agreement_id      in     number    default hr_api.g_number
1416   ,p_cagr_id_flex_num             in     number    default hr_api.g_number
1417   ,p_cag_segment1                 in     varchar2  default hr_api.g_varchar2
1418   ,p_cag_segment2                 in     varchar2  default hr_api.g_varchar2
1419   ,p_cag_segment3                 in     varchar2  default hr_api.g_varchar2
1420   ,p_cag_segment4                 in     varchar2  default hr_api.g_varchar2
1421   ,p_cag_segment5                 in     varchar2  default hr_api.g_varchar2
1422   ,p_cag_segment6                 in     varchar2  default hr_api.g_varchar2
1423   ,p_cag_segment7                 in     varchar2  default hr_api.g_varchar2
1424   ,p_cag_segment8                 in     varchar2  default hr_api.g_varchar2
1425   ,p_cag_segment9                 in     varchar2  default hr_api.g_varchar2
1426   ,p_cag_segment10                in     varchar2  default hr_api.g_varchar2
1427   ,p_cag_segment11                in     varchar2  default hr_api.g_varchar2
1428   ,p_cag_segment12                in     varchar2  default hr_api.g_varchar2
1429   ,p_cag_segment13                in     varchar2  default hr_api.g_varchar2
1430   ,p_cag_segment14                in     varchar2  default hr_api.g_varchar2
1431   ,p_cag_segment15                in     varchar2  default hr_api.g_varchar2
1432   ,p_cag_segment16                in     varchar2  default hr_api.g_varchar2
1433   ,p_cag_segment17                in     varchar2  default hr_api.g_varchar2
1434   ,p_cag_segment18                in     varchar2  default hr_api.g_varchar2
1435   ,p_cag_segment19                in     varchar2  default hr_api.g_varchar2
1436   ,p_cag_segment20                in     varchar2  default hr_api.g_varchar2
1437   ,p_notice_period                in     number    default hr_api.g_number
1438   ,p_notice_period_uom            in     varchar2  default hr_api.g_varchar2
1439   ,p_employee_category            in     varchar2  default hr_api.g_varchar2
1440   ,p_work_at_home                 in     varchar2  default hr_api.g_varchar2
1441   ,p_job_post_source_name         in     varchar2  default hr_api.g_varchar2
1442   ,p_cagr_grade_def_id               out nocopy number
1443   ,p_cagr_concatenated_segments      out nocopy varchar2
1444   ,p_concatenated_segments           out nocopy varchar2
1445   ,p_soft_coding_keyflex_id          out nocopy number
1446   ,p_comment_id                      out nocopy number
1447   ,p_effective_start_date            out nocopy date
1448   ,p_effective_end_date              out nocopy date
1449   ,p_return_status                   out nocopy varchar2
1450   ) is
1451   --
1452   -- Variables for API Boolean parameters
1453   l_validate                      boolean;
1454   l_no_managers_warning           boolean;
1455   l_other_manager_warning         boolean;
1456   l_hourly_salaried_warning       boolean;
1457   --
1458   -- Variables for IN/OUT parameters
1459   l_object_version_number         number;
1460   --
1461   -- Other variables
1462   l_proc    varchar2(72) := g_package ||'update_emp_asg';
1463 Begin
1464   hr_utility.set_location(' Entering:' || l_proc,10);
1465   --
1466   -- Issue a savepoint
1467   --
1468   savepoint update_emp_asg_swi;
1469   --
1470   -- Initialise Multiple Message Detection
1471   --
1472   hr_multi_message.enable_message_list;
1473   --
1474   -- Remember IN OUT parameter IN values
1475   --
1476   l_object_version_number         := p_object_version_number;
1477   --
1478   -- Convert constant values to their corresponding boolean value
1479   --
1480   l_validate :=
1481     hr_api.constant_to_boolean
1482       (p_constant_value => p_validate);
1483   --
1484   -- Register Surrogate ID or user key values
1485   --
1486   --
1487   -- Call API
1488   --
1489   hr_assignment_api.update_emp_asg
1490     (p_validate                     => l_validate
1491     ,p_effective_date               => p_effective_date
1492     ,p_datetrack_update_mode        => p_datetrack_update_mode
1493     ,p_assignment_id                => p_assignment_id
1494     ,p_object_version_number        => p_object_version_number
1495     ,p_supervisor_id                => p_supervisor_id
1496     ,p_assignment_number            => p_assignment_number
1497     ,p_change_reason                => p_change_reason
1498     ,p_assignment_status_type_id    => p_assignment_status_type_id
1499     ,p_comments                     => p_comments
1500     ,p_date_probation_end           => p_date_probation_end
1501     ,p_default_code_comb_id         => p_default_code_comb_id
1502     ,p_frequency                    => p_frequency
1503     ,p_internal_address_line        => p_internal_address_line
1504     ,p_manager_flag                 => p_manager_flag
1505     ,p_normal_hours                 => p_normal_hours
1506     ,p_perf_review_period           => p_perf_review_period
1507     ,p_perf_review_period_frequency => p_perf_review_period_frequency
1508     ,p_probation_period             => p_probation_period
1509     ,p_probation_unit               => p_probation_unit
1510     ,p_sal_review_period            => p_sal_review_period
1511     ,p_sal_review_period_frequency  => p_sal_review_period_frequency
1512     ,p_set_of_books_id              => p_set_of_books_id
1513     ,p_source_type                  => p_source_type
1514     ,p_time_normal_finish           => p_time_normal_finish
1515     ,p_time_normal_start            => p_time_normal_start
1516     ,p_bargaining_unit_code         => p_bargaining_unit_code
1517     ,p_labour_union_member_flag     => p_labour_union_member_flag
1518     ,p_hourly_salaried_code         => p_hourly_salaried_code
1519     ,p_ass_attribute_category       => p_ass_attribute_category
1520     ,p_ass_attribute1               => p_ass_attribute1
1521     ,p_ass_attribute2               => p_ass_attribute2
1522     ,p_ass_attribute3               => p_ass_attribute3
1523     ,p_ass_attribute4               => p_ass_attribute4
1524     ,p_ass_attribute5               => p_ass_attribute5
1525     ,p_ass_attribute6               => p_ass_attribute6
1526     ,p_ass_attribute7               => p_ass_attribute7
1527     ,p_ass_attribute8               => p_ass_attribute8
1528     ,p_ass_attribute9               => p_ass_attribute9
1529     ,p_ass_attribute10              => p_ass_attribute10
1530     ,p_ass_attribute11              => p_ass_attribute11
1531     ,p_ass_attribute12              => p_ass_attribute12
1532     ,p_ass_attribute13              => p_ass_attribute13
1533     ,p_ass_attribute14              => p_ass_attribute14
1534     ,p_ass_attribute15              => p_ass_attribute15
1535     ,p_ass_attribute16              => p_ass_attribute16
1536     ,p_ass_attribute17              => p_ass_attribute17
1537     ,p_ass_attribute18              => p_ass_attribute18
1538     ,p_ass_attribute19              => p_ass_attribute19
1539     ,p_ass_attribute20              => p_ass_attribute20
1540     ,p_ass_attribute21              => p_ass_attribute21
1541     ,p_ass_attribute22              => p_ass_attribute22
1542     ,p_ass_attribute23              => p_ass_attribute23
1543     ,p_ass_attribute24              => p_ass_attribute24
1544     ,p_ass_attribute25              => p_ass_attribute25
1545     ,p_ass_attribute26              => p_ass_attribute26
1546     ,p_ass_attribute27              => p_ass_attribute27
1547     ,p_ass_attribute28              => p_ass_attribute28
1548     ,p_ass_attribute29              => p_ass_attribute29
1549     ,p_ass_attribute30              => p_ass_attribute30
1550     ,p_title                        => p_title
1551     ,p_segment1                     => p_segment1
1552     ,p_segment2                     => p_segment2
1553     ,p_segment3                     => p_segment3
1554     ,p_segment4                     => p_segment4
1555     ,p_segment5                     => p_segment5
1556     ,p_segment6                     => p_segment6
1557     ,p_segment7                     => p_segment7
1558     ,p_segment8                     => p_segment8
1559     ,p_segment9                     => p_segment9
1560     ,p_segment10                    => p_segment10
1561     ,p_segment11                    => p_segment11
1562     ,p_segment12                    => p_segment12
1563     ,p_segment13                    => p_segment13
1564     ,p_segment14                    => p_segment14
1565     ,p_segment15                    => p_segment15
1566     ,p_segment16                    => p_segment16
1567     ,p_segment17                    => p_segment17
1568     ,p_segment18                    => p_segment18
1569     ,p_segment19                    => p_segment19
1570     ,p_segment20                    => p_segment20
1571     ,p_segment21                    => p_segment21
1572     ,p_segment22                    => p_segment22
1573     ,p_segment23                    => p_segment23
1574     ,p_segment24                    => p_segment24
1575     ,p_segment25                    => p_segment25
1576     ,p_segment26                    => p_segment26
1577     ,p_segment27                    => p_segment27
1578     ,p_segment28                    => p_segment28
1579     ,p_segment29                    => p_segment29
1580     ,p_segment30                    => p_segment30
1581     ,p_concat_segments              => p_concat_segments
1582     ,p_contract_id                  => p_contract_id
1583     ,p_establishment_id             => p_establishment_id
1584     ,p_collective_agreement_id      => p_collective_agreement_id
1585     ,p_cagr_id_flex_num             => p_cagr_id_flex_num
1586     ,p_cag_segment1                 => p_cag_segment1
1587     ,p_cag_segment2                 => p_cag_segment2
1588     ,p_cag_segment3                 => p_cag_segment3
1589     ,p_cag_segment4                 => p_cag_segment4
1590     ,p_cag_segment5                 => p_cag_segment5
1591     ,p_cag_segment6                 => p_cag_segment6
1592     ,p_cag_segment7                 => p_cag_segment7
1593     ,p_cag_segment8                 => p_cag_segment8
1594     ,p_cag_segment9                 => p_cag_segment9
1595     ,p_cag_segment10                => p_cag_segment10
1596     ,p_cag_segment11                => p_cag_segment11
1597     ,p_cag_segment12                => p_cag_segment12
1598     ,p_cag_segment13                => p_cag_segment13
1599     ,p_cag_segment14                => p_cag_segment14
1600     ,p_cag_segment15                => p_cag_segment15
1601     ,p_cag_segment16                => p_cag_segment16
1602     ,p_cag_segment17                => p_cag_segment17
1603     ,p_cag_segment18                => p_cag_segment18
1604     ,p_cag_segment19                => p_cag_segment19
1605     ,p_cag_segment20                => p_cag_segment20
1606     ,p_notice_period                => p_notice_period
1607     ,p_notice_period_uom            => p_notice_period_uom
1608     ,p_employee_category            => p_employee_category
1609     ,p_work_at_home                 => p_work_at_home
1610     ,p_job_post_source_name         => p_job_post_source_name
1611     ,p_cagr_grade_def_id            => p_cagr_grade_def_id
1612     ,p_cagr_concatenated_segments   => p_cagr_concatenated_segments
1613     ,p_concatenated_segments        => p_concatenated_segments
1614     ,p_soft_coding_keyflex_id       => p_soft_coding_keyflex_id
1615     ,p_comment_id                   => p_comment_id
1616     ,p_effective_start_date         => p_effective_start_date
1617     ,p_effective_end_date           => p_effective_end_date
1618     ,p_no_managers_warning          => l_no_managers_warning
1619     ,p_other_manager_warning        => l_other_manager_warning
1620     ,p_hourly_salaried_warning      => l_hourly_salaried_warning
1621     );
1622   --
1623   -- Convert API warning boolean parameter values to specific
1624   -- messages and add them to Multiple Message List
1625   --
1626   if l_no_managers_warning then
1627      fnd_message.set_name('PER', 'HR_289214_NO_MANAGERS');
1628       hr_multi_message.add
1629         (p_message_type => hr_multi_message.g_warning_msg
1630         );
1631   end if;
1632   if l_other_manager_warning then
1633      fnd_message.set_name('PER', 'HR_289215_DUPLICATE_MANAGERS');
1634       hr_multi_message.add
1635         (p_message_type => hr_multi_message.g_warning_msg
1636         );
1637   end if;
1638   if l_hourly_salaried_warning then
1639      fnd_message.set_name('PER', 'HR_289648_CWK_HR_CODE_NOT_NULL');
1640       hr_multi_message.add
1641         (p_message_type => hr_multi_message.g_warning_msg
1642         );
1643   end if;  --
1644   -- Convert API non-warning boolean parameter values
1645   --
1646   --
1647   -- Derive the API return status value based on whether
1648   -- messages of any type exist in the Multiple Message List.
1649   -- Also disable Multiple Message Detection.
1650   --
1651   p_return_status := hr_multi_message.get_return_status_disable;
1652   hr_utility.set_location(' Leaving:' || l_proc,20);
1653   --
1654 exception
1655   when hr_multi_message.error_message_exist then
1656     --
1657     -- Catch the Multiple Message List exception which
1658     -- indicates API processing has been aborted because
1659     -- at least one message exists in the list.
1660     --
1661     rollback to update_emp_asg_swi;
1662     --
1663     -- Reset IN OUT parameters and set OUT parameters
1664     --
1665     p_object_version_number        := l_object_version_number;
1666     p_cagr_grade_def_id            := null;
1667     p_cagr_concatenated_segments   := null;
1668     p_concatenated_segments        := null;
1669     p_soft_coding_keyflex_id       := null;
1670     p_comment_id                   := null;
1671     p_effective_start_date         := null;
1672     p_effective_end_date           := null;
1673     p_return_status := hr_multi_message.get_return_status_disable;
1674     hr_utility.set_location(' Leaving:' || l_proc, 30);
1675   when others then
1676     --
1677     -- When Multiple Message Detection is enabled catch
1678     -- any Application specific or other unexpected
1679     -- exceptions.  Adding appropriate details to the
1680     -- Multiple Message List.  Otherwise re-raise the
1681     -- error.
1682     --
1683     rollback to update_emp_asg_swi;
1684     if hr_multi_message.unexpected_error_add(l_proc) then
1685        hr_utility.set_location(' Leaving:' || l_proc,40);
1686        raise;
1687     end if;
1688     --
1689     -- Reset IN OUT and set OUT parameters
1690     --
1691     p_object_version_number        := l_object_version_number;
1692     p_cagr_grade_def_id            := null;
1693     p_cagr_concatenated_segments   := null;
1694     p_concatenated_segments        := null;
1695     p_soft_coding_keyflex_id       := null;
1696     p_comment_id                   := null;
1697     p_effective_start_date         := null;
1698     p_effective_end_date           := null;
1699     p_return_status := hr_multi_message.get_return_status_disable;
1700     hr_utility.set_location(' Leaving:' || l_proc,50);
1701 end update_emp_asg;
1702 --
1703 --
1704 --
1705 -- ----------------------------------------------------------------------------
1706 -- |------------------------< update_emp_asg_criteria >-----------------------|
1707 -- ----------------------------------------------------------------------------
1708 PROCEDURE update_emp_asg_criteria
1709   (p_validate                     in     number    default hr_api.g_false_num
1710   ,p_effective_date               in     date
1711   ,p_datetrack_update_mode        in     varchar2
1712   ,p_assignment_id                in     number
1713   ,p_object_version_number        in out nocopy number
1714   ,p_grade_id                     in     number    default hr_api.g_number
1715   ,p_position_id                  in     number    default hr_api.g_number
1716   ,p_job_id                       in     number    default hr_api.g_number
1717   ,p_payroll_id                   in     number    default hr_api.g_number
1718   ,p_location_id                  in     number    default hr_api.g_number
1719   ,p_special_ceiling_step_id      in out nocopy number
1720   ,p_organization_id              in     number    default hr_api.g_number
1721   ,p_pay_basis_id                 in     number    default hr_api.g_number
1722   ,p_segment1                     in     varchar2  default hr_api.g_varchar2
1723   ,p_segment2                     in     varchar2  default hr_api.g_varchar2
1724   ,p_segment3                     in     varchar2  default hr_api.g_varchar2
1725   ,p_segment4                     in     varchar2  default hr_api.g_varchar2
1726   ,p_segment5                     in     varchar2  default hr_api.g_varchar2
1727   ,p_segment6                     in     varchar2  default hr_api.g_varchar2
1728   ,p_segment7                     in     varchar2  default hr_api.g_varchar2
1729   ,p_segment8                     in     varchar2  default hr_api.g_varchar2
1730   ,p_segment9                     in     varchar2  default hr_api.g_varchar2
1731   ,p_segment10                    in     varchar2  default hr_api.g_varchar2
1732   ,p_segment11                    in     varchar2  default hr_api.g_varchar2
1733   ,p_segment12                    in     varchar2  default hr_api.g_varchar2
1734   ,p_segment13                    in     varchar2  default hr_api.g_varchar2
1735   ,p_segment14                    in     varchar2  default hr_api.g_varchar2
1736   ,p_segment15                    in     varchar2  default hr_api.g_varchar2
1737   ,p_segment16                    in     varchar2  default hr_api.g_varchar2
1738   ,p_segment17                    in     varchar2  default hr_api.g_varchar2
1739   ,p_segment18                    in     varchar2  default hr_api.g_varchar2
1740   ,p_segment19                    in     varchar2  default hr_api.g_varchar2
1741   ,p_segment20                    in     varchar2  default hr_api.g_varchar2
1742   ,p_segment21                    in     varchar2  default hr_api.g_varchar2
1743   ,p_segment22                    in     varchar2  default hr_api.g_varchar2
1744   ,p_segment23                    in     varchar2  default hr_api.g_varchar2
1745   ,p_segment24                    in     varchar2  default hr_api.g_varchar2
1746   ,p_segment25                    in     varchar2  default hr_api.g_varchar2
1747   ,p_segment26                    in     varchar2  default hr_api.g_varchar2
1748   ,p_segment27                    in     varchar2  default hr_api.g_varchar2
1749   ,p_segment28                    in     varchar2  default hr_api.g_varchar2
1750   ,p_segment29                    in     varchar2  default hr_api.g_varchar2
1751   ,p_segment30                    in     varchar2  default hr_api.g_varchar2
1752   ,p_concat_segments              in     varchar2  default hr_api.g_varchar2
1753   ,p_group_name                      out nocopy varchar2
1754   ,p_employment_category          in     varchar2  default hr_api.g_varchar2
1755   ,p_effective_start_date            out nocopy date
1756   ,p_effective_end_date              out nocopy date
1757   ,p_people_group_id                 out nocopy number
1758   ,p_entries_changed_warning         out nocopy varchar2
1759   ,p_return_status                   out nocopy varchar2
1760   ) is
1761   --
1762   -- Variables for API Boolean parameters
1763   l_validate                      boolean;
1764   l_org_now_no_manager_warning    boolean;
1765   l_other_manager_warning         boolean;
1766   l_spp_delete_warning            boolean;
1767   l_tax_district_changed_warning  boolean;
1768   --
1769   -- Variables for IN/OUT parameters
1770   l_object_version_number         number;
1771   l_special_ceiling_step_id       number;
1772   --
1773   -- Other variables
1774   l_proc    varchar2(72) := g_package ||'update_emp_asg_criteria';
1775 Begin
1776   hr_utility.set_location(' Entering:' || l_proc,10);
1777   --
1778   -- Issue a savepoint
1779   --
1780   savepoint update_emp_asg_criteria_swi;
1781   --
1782   -- Initialise Multiple Message Detection
1783   --
1784   hr_multi_message.enable_message_list;
1785   --
1786   -- Remember IN OUT parameter IN values
1787   --
1788   l_object_version_number         := p_object_version_number;
1789   l_special_ceiling_step_id       := p_special_ceiling_step_id;
1790   --
1791   -- Convert constant values to their corresponding boolean value
1792   --
1793   l_validate :=
1794     hr_api.constant_to_boolean
1795       (p_constant_value => p_validate);
1796   --
1797   -- Register Surrogate ID or user key values
1798   --
1799   --
1800   -- Call API
1801   --
1802   hr_assignment_api.update_emp_asg_criteria
1803     (p_validate                     => l_validate
1804     ,p_effective_date               => p_effective_date
1805     ,p_datetrack_update_mode        => p_datetrack_update_mode
1806     ,p_assignment_id                => p_assignment_id
1807     ,p_object_version_number        => p_object_version_number
1808     ,p_grade_id                     => p_grade_id
1809     ,p_position_id                  => p_position_id
1810     ,p_job_id                       => p_job_id
1811     ,p_payroll_id                   => p_payroll_id
1812     ,p_location_id                  => p_location_id
1813     ,p_special_ceiling_step_id      => p_special_ceiling_step_id
1814     ,p_organization_id              => p_organization_id
1815     ,p_pay_basis_id                 => p_pay_basis_id
1816     ,p_segment1                     => p_segment1
1817     ,p_segment2                     => p_segment2
1818     ,p_segment3                     => p_segment3
1819     ,p_segment4                     => p_segment4
1820     ,p_segment5                     => p_segment5
1821     ,p_segment6                     => p_segment6
1822     ,p_segment7                     => p_segment7
1823     ,p_segment8                     => p_segment8
1824     ,p_segment9                     => p_segment9
1825     ,p_segment10                    => p_segment10
1826     ,p_segment11                    => p_segment11
1827     ,p_segment12                    => p_segment12
1828     ,p_segment13                    => p_segment13
1829     ,p_segment14                    => p_segment14
1830     ,p_segment15                    => p_segment15
1831     ,p_segment16                    => p_segment16
1832     ,p_segment17                    => p_segment17
1833     ,p_segment18                    => p_segment18
1834     ,p_segment19                    => p_segment19
1835     ,p_segment20                    => p_segment20
1836     ,p_segment21                    => p_segment21
1837     ,p_segment22                    => p_segment22
1838     ,p_segment23                    => p_segment23
1839     ,p_segment24                    => p_segment24
1840     ,p_segment25                    => p_segment25
1841     ,p_segment26                    => p_segment26
1842     ,p_segment27                    => p_segment27
1843     ,p_segment28                    => p_segment28
1844     ,p_segment29                    => p_segment29
1845     ,p_segment30                    => p_segment30
1846     ,p_concat_segments              => p_concat_segments
1847     ,p_group_name                   => p_group_name
1848     ,p_employment_category          => p_employment_category
1849     ,p_effective_start_date         => p_effective_start_date
1850     ,p_effective_end_date           => p_effective_end_date
1851     ,p_people_group_id              => p_people_group_id
1852     ,p_org_now_no_manager_warning   => l_org_now_no_manager_warning
1853     ,p_other_manager_warning        => l_other_manager_warning
1854     ,p_spp_delete_warning           => l_spp_delete_warning
1855     ,p_entries_changed_warning      => p_entries_changed_warning
1856     ,p_tax_district_changed_warning => l_tax_district_changed_warning
1857     );
1858   --
1859   -- Convert API warning boolean parameter values to specific
1860   -- messages and add them to Multiple Message List
1861   --
1862   if l_org_now_no_manager_warning then
1863      fnd_message.set_name('PER', 'HR_7429_ASG_INV_MANAGER_FLAG');
1864       hr_multi_message.add
1865         (p_message_type => hr_multi_message.g_warning_msg
1866         );
1867   end if;
1868   if l_other_manager_warning then
1869      fnd_message.set_name('PER', 'HR_289215_DUPLICATE_MANAGERS');
1870       hr_multi_message.add
1871         (p_message_type => hr_multi_message.g_warning_msg
1872         );
1873   end if;
1874   if l_spp_delete_warning then
1875      fnd_message.set_name('PER', 'HR_289826_SPP_DELETE_WARN_API');
1876       hr_multi_message.add
1877         (p_message_type => hr_multi_message.g_warning_msg
1878         );
1879   end if;
1880   if l_tax_district_changed_warning then
1881      fnd_message.set_name('PER', 'EDIT_HERE: MESSAGE_NAME ');
1882       hr_multi_message.add
1883         (p_message_type => hr_multi_message.g_warning_msg
1884         );
1885   end if;  --
1886   -- Convert API non-warning boolean parameter values
1887   --
1888   --
1889   -- Derive the API return status value based on whether
1890   -- messages of any type exist in the Multiple Message List.
1891   -- Also disable Multiple Message Detection.
1892   --
1893   p_return_status := hr_multi_message.get_return_status_disable;
1894   hr_utility.set_location(' Leaving:' || l_proc,20);
1895   --
1896 exception
1897   when hr_multi_message.error_message_exist then
1898     --
1899     -- Catch the Multiple Message List exception which
1900     -- indicates API processing has been aborted because
1901     -- at least one message exists in the list.
1902     --
1903     rollback to update_emp_asg_criteria_swi;
1904     --
1905     -- Reset IN OUT parameters and set OUT parameters
1906     --
1907     p_object_version_number        := l_object_version_number;
1908     p_special_ceiling_step_id      := l_special_ceiling_step_id;
1909     p_group_name                   := null;
1910     p_effective_start_date         := null;
1911     p_effective_end_date           := null;
1912     p_people_group_id              := null;
1913     p_return_status := hr_multi_message.get_return_status_disable;
1914     hr_utility.set_location(' Leaving:' || l_proc, 30);
1915   when others then
1916     --
1917     -- When Multiple Message Detection is enabled catch
1918     -- any Application specific or other unexpected
1919     -- exceptions.  Adding appropriate details to the
1920     -- Multiple Message List.  Otherwise re-raise the
1921     -- error.
1922     --
1923     rollback to update_emp_asg_criteria_swi;
1924     if hr_multi_message.unexpected_error_add(l_proc) then
1925        hr_utility.set_location(' Leaving:' || l_proc,40);
1926        raise;
1927     end if;
1928     --
1929     -- Reset IN OUT and set OUT parameters
1930     --
1931     p_object_version_number        := l_object_version_number;
1932     p_special_ceiling_step_id      := l_special_ceiling_step_id;
1933     p_group_name                   := null;
1934     p_effective_start_date         := null;
1935     p_effective_end_date           := null;
1936     p_people_group_id              := null;
1937     p_return_status := hr_multi_message.get_return_status_disable;
1938     hr_utility.set_location(' Leaving:' || l_proc,50);
1939 end update_emp_asg_criteria;
1940 
1941 end hr_assignment_swi;