DBA Data[Home] [Help]

PACKAGE BODY: APPS.HR_PROCESS_CONTACT_SS

Source


1 PACKAGE BODY HR_PROCESS_CONTACT_SS AS
2 /* $Header: hrconwrs.pkb 120.5.12000000.4 2007/05/17 09:08:25 rachakra ship $*/
3  --
4  -- Package scope global variables.
5  --
6  g_package                   varchar2(30)   := 'HR_PROCESS_CONTACT_SS';
7  g_data_error                exception;
8  g_no_changes                exception;
9  -- g_date_format  constant     varchar2(10):='RRRR/MM/DD';
10 
11  l_message_number            VARCHAR2(10);
12  --
13  -- Global cursor
14  --
15   CURSOR gc_get_cur_contact_data
16          (p_contact_relationship_id      in number
17          ,p_eff_date                     in date default trunc(sysdate)
18           )
19   IS
20      SELECT
21      contact_relationship_id,
22      contact_type,
23      comments,
24      primary_contact_flag,
25      third_party_pay_flag,
26      bondholder_flag,
27      date_start,
28      start_life_reason_id,
29      date_end,
30      end_life_reason_id,
31      rltd_per_rsds_w_dsgntr_flag,
32      personal_flag,
33      sequence_number,
34      dependent_flag,
35      beneficiary_flag,
36      cont_attribute_category,
37      cont_attribute1,
38      cont_attribute2,
39      cont_attribute3,
40      cont_attribute4,
41      cont_attribute5,
42      cont_attribute6,
43      cont_attribute7,
44      cont_attribute8,
45      cont_attribute9,
46      cont_attribute10,
47      cont_attribute11,
48      cont_attribute12,
49      cont_attribute13,
50      cont_attribute14,
51      cont_attribute15,
52      cont_attribute16,
53      cont_attribute17,
54      cont_attribute18,
55      cont_attribute19,
56      cont_attribute20,
57      CONT_INFORMATION_CATEGORY,
58      CONT_INFORMATION1  ,
59      CONT_INFORMATION2  ,
60      CONT_INFORMATION3  ,
61      CONT_INFORMATION4  ,
62      CONT_INFORMATION5  ,
63      CONT_INFORMATION6  ,
64      CONT_INFORMATION7  ,
65      CONT_INFORMATION8  ,
66      CONT_INFORMATION9  ,
67      CONT_INFORMATION10 ,
68      CONT_INFORMATION11 ,
69      CONT_INFORMATION12 ,
70      CONT_INFORMATION13 ,
71      CONT_INFORMATION14 ,
72      CONT_INFORMATION15 ,
73      CONT_INFORMATION16 ,
74      CONT_INFORMATION17 ,
75      CONT_INFORMATION18 ,
76      CONT_INFORMATION19 ,
77      CONT_INFORMATION20 ,
78      pcr.object_version_number
79   FROM
80      per_contact_relationships pcr
81      ,per_all_people_f pap
82      ,hr_comments        hc
83   WHERE  pcr.contact_relationship_id = p_contact_relationship_id
84     AND  pcr.contact_person_id = pap.person_id
85     AND  p_eff_date BETWEEN pap.effective_start_date and pap.effective_end_date
86     AND  hc.comment_id (+) = pap.comment_id;
87 
88 -- ---------------------------------------------------------------------------
89 -- ---------------------- < p_del_cont_primary_addr> -------------------------
90 -- ---------------------------------------------------------------------------
91 -- Purpose: This procedure will delete the address if the shared residence flag
92 --          is checked and primary address already exists.
93 -- ---------------------------------------------------------------------------
94 --
95 PROCEDURE p_del_cont_primary_addr
96    (p_contact_relationship_id          in  number
97    )
98 is
99   --
100   CURSOR c_cont_primary_addr
101   IS
102      SELECT addr.address_id
103      FROM per_contact_relationships pcr
104          ,per_addresses addr
105      WHERE  pcr.contact_relationship_id = p_contact_relationship_id
106        and  pcr.contact_person_id = addr.person_id
107        and  trunc(sysdate) between addr.date_from
108                                and nvl(addr.date_to, trunc(sysdate))
109        and  addr.primary_flag  = 'Y'
110        --
111        -- Bug 2652114 : Do not delete the address if contact is already a employee
112        -- otherwise his payroll will get affected.
113        --
114        and not exists
115              (select null
116               from per_all_assignments_f asg
117               where trunc(sysdate) between asg.effective_start_date
118                                        and asg.effective_end_date
119                 and asg.person_id = addr.person_id
120                 and asg.primary_flag = 'Y'
121                 and asg.assignment_type = 'E'
122              );
123 
124   --
125   l_cont_primary_addr c_cont_primary_addr%rowtype;
126   l_proc varchar2(72) :=  g_package ||  'p_del_cont_primary_addr';
127 
128   --
129 begin
130   --
131   hr_utility.set_Location('Entering'||l_proc,5);
132   OPEN c_cont_primary_addr;
133   FETCH c_cont_primary_addr into l_cont_primary_addr;
134   --
135   IF c_cont_primary_addr%FOUND
136   THEN
137     --
138     -- Delete the contacts primary address.
139     -- As there is no API to do the delete we have to physically call the
140     -- the delete statement.
141     --
142       hr_utility.set_Location('IF c_cont_primary_addr FOUND:'||l_proc,10);
143     delete from per_addresses
144       where address_id = l_cont_primary_addr.address_id;
145     --
146   END IF;
147   --
148   CLOSE c_cont_primary_addr;
149   --
150   hr_utility.set_Location('Exiting :'||l_proc,15);
151 end p_del_cont_primary_addr;
152 /* 999 Delete before arcsin
153 -- ----------------------------------------------------------------------------
154 -- |------------------------------< get_varchar2_value >------------------------|
155 -- ----------------------------------------------------------------------------
156 function get_varchar2_value
157   (p_transaction_step_id       in      number
158   ,p_name                      in      varchar2
159   ) return varchar2 is
160 
161   -- --------------------------------------------------------------------------
162   -- declare local variables
163   -- --------------------------------------------------------------------------
164   l_proc   varchar2(72)  := g_package||'get_varchar2_value';
165   l_insert boolean := false;
166   l_name           hr_api_transaction_values.name%type;
167   l_varchar2_value  varchar2(1000);
168   --
169   cursor csr_hatv is
170     select hatv.varchar2_value
171     from   hr_api_transaction_values hatv
172     where  hatv.transaction_step_id = p_transaction_step_id
173     and    hatv.name                = l_name;
174   --
175 begin
176 
177   hr_utility.set_location('Entering:'|| l_proc, 5);
178   -- upper the parameter name
179   l_name := upper(p_name);
180   -- select the transaction value details
181   open csr_hatv;
182   fetch csr_hatv
183   into l_varchar2_value;
184 
185   if csr_hatv%notfound then
186     -- parameter does not exist
187     close csr_hatv;
188     hr_utility.raise_error;
189   end if;
190   close csr_hatv;
191   --
192   return l_varchar2_value;
193   hr_utility.set_location(' Leaving:'||l_proc, 10);
194 end get_varchar2_value;
195 */
196 --
197 -- ----------------------------------------------------------------------------
198 -- |------------------------------< get_number_value >------------------------|
199 -- ----------------------------------------------------------------------------
200 function get_number_value
201   (p_transaction_step_id       in      number
202   ,p_name                      in      varchar2
203   ) return number is
204 
205   -- --------------------------------------------------------------------------
206   -- declare local variables
207   -- --------------------------------------------------------------------------
208   l_proc   varchar2(72)  := g_package||'get_number_value';
209   l_insert boolean := false;
210   l_name           hr_api_transaction_values.name%type;
211   l_number_value  number;
212   --
213   cursor csr_hatv is
214     select hatv.number_value
215     from   hr_api_transaction_values hatv
216     where  hatv.transaction_step_id = p_transaction_step_id
217     and    hatv.name                = l_name;
218   --
219 begin
220 
221   hr_utility.set_location('Entering:'|| l_proc, 5);
222   -- upper the parameter name
223   l_name := upper(p_name);
224   -- select the transaction value details
225   open csr_hatv;
226   fetch csr_hatv
227   into l_number_value;
228 
229   if csr_hatv%notfound then
230     -- parameter does not exist
231   hr_utility.set_location('If Parameter does not exist'|| l_proc, 10);
232     close csr_hatv;
233     hr_utility.raise_error;
234   end if;
235   close csr_hatv;
236   --
237   hr_utility.set_location(' Leaving:'||l_proc, 15);
238   return l_number_value;
239 
240 end get_number_value;
241 --
242 -- ---------------------------------------------------------------------------
243 -- ---------------------- < get_contact_relationship_tt> -------------------------
244 -- ---------------------------------------------------------------------------
245 -- Purpose: This procedure will get which regions are changed in earlier save
246 --          in the current transaction.  This is invoked when a user click BACK
247 --          button to go back from the Review page to Update page to correct
248 --          typos or make further changes.  Hence, we need to use the item_type
249 --          item_key passed in to retrieve the transaction record.
250 --          This is also used when the user first time navigates to review page.
251 --          Based on the output of this procedure Review page layout is built.
252 --          Ex : If contacts and phone changed then both are shown, if Only
253 --          phone changed then shows phone data.
254 -- ---------------------------------------------------------------------------
255 --
256 PROCEDURE get_contact_regions_status_tt
257    (p_item_type                       in  varchar2
258    ,p_item_key                        in  varchar2
259    ,p_activity_id                     in  varchar2
260    ,p_trans_rec_count                 out nocopy number
261    ,p_contact_changed                 out nocopy varchar2
262    ,p_phone_changed                   out nocopy varchar2
263    ,p_address_changed                 out nocopy varchar2
264    ,p_second_address_changed          out nocopy varchar2
265    ,p_parent_id                       out nocopy varchar2
266    ,p_contact_person_id               out nocopy varchar2
267    ,p_contact_relationship_id         out nocopy varchar2
268    ,p_contact_operation               out nocopy varchar2
269    ,p_shared_Residence_Flag           out nocopy varchar2
270    ,p_save_mode                       out nocopy varchar2
271    ,p_address_id                      out nocopy varchar2
272    ,p_contact_step_id                 out nocopy varchar2
273    ,p_phone_step_id                   out nocopy varchar2
274    ,p_address_step_id                 out nocopy varchar2
275    ,p_second_address_step_id          out nocopy varchar2
276    ,p_first_name                      out nocopy varchar2
277    ,p_last_name                       out nocopy varchar2
278    ,p_contact_set                     in  varchar2
279    )
280 is
281   --
282   l_trans_step_id                    number default null;
283   l_trans_rec_count                  integer default 0;
284   l_trans_step_ids       hr_util_web.g_varchar2_tab_type;
285   l_trans_obj_vers_nums  hr_util_web.g_varchar2_tab_type;
286   l_trans_step_rows                  NUMBER  ;
287   ln_index                           number  default 0;
288   l_id                               number;
289   l_contact_step_id                  varchar2(100) := null;
290   l_phone_step_id                    varchar2(100) := null;
291   l_address_step_id                  varchar2(100) := null;
292   l_second_address_step_id           varchar2(100) := null;
293   l_addr_person_id                   varchar2(100) := null;
294   -- 2447751 change starts
295   l_first_name     PER_ALL_PEOPLE_F.FIRST_NAME%TYPE := null;
296   l_last_name      PER_ALL_PEOPLE_F.LAST_NAME%TYPE := null;
297   -- 2447751 change ends
298   l_prmry_flag                       varchar2(100) := null;
299   -- StartRegistration
300   l_contact_set                      varchar2(5) := null;
301   l_contact_operation                varchar2(100) := null;
302   l_shared_Residence_Flag            varchar2(100) := null;
303   l_local_shared_Residence_Flag      varchar2(100) := null;
304   l_save_mode                        varchar2(100) := null;
305   l_contact_person_id                varchar2(100) := null;
306   l_proc   varchar2(72)  := g_package||'get_contact_regions_status_tt';
307 
308   --
309   CURSOR c_get_names
310   IS
311      SELECT last_name, first_name
312      from per_all_people_f
313      WHERE  person_id = p_contact_person_id
314        AND  trunc(sysdate) BETWEEN effective_start_date and effective_end_date;
315 
316   --
317 begin
318   --
319   hr_utility.set_location('Entering:'||l_proc, 5);
320   p_contact_changed   := 'N';
321   p_phone_changed     := 'N';
322   p_address_changed   := 'N';
323 --shdas
324   p_second_address_changed   := 'N';
325 --shdas
326   p_parent_id         := null;
327   p_contact_person_id := null;
328   p_contact_relationship_id  := null;
329   p_address_id        := null;
330   --
331   -- For a given item key, there could be multiple transaction steps saved.
332   -- Get whether transaction data is written for contacts, phone, address.
333   --
334   hr_transaction_api.get_transaction_step_info
335              (p_item_type              => p_item_type
336              ,p_item_key               => p_item_key
337              ,p_activity_id            => p_activity_id
338              ,p_transaction_step_id    => l_trans_step_ids
339              ,p_object_version_number  => l_trans_obj_vers_nums
340              ,p_rows                   => l_trans_step_rows);
341 
342   --
343   -- ---------------------------------------------------------------------
344   -- NOTE:We need to adjust the index which referrences l_trans_step_ids
345   --    by 1 because that table was created with the index starts at 0
346   --    in hr_transaction_api.get_transaction_step_info.
347   -- ---------------------------------------------------------------------
348   --
349   ln_index := 0;
350   --
351   hr_utility.set_location('Entering For Loop:'||l_proc, 10);
352   FOR j in 1..l_trans_step_rows
353   LOOP
354     -- StartRegistration
355     -- Get the contact set from java and compare with the contact set id
356     -- in each step.
357     -- if the step doesnot match, ignore the step and go to next step.
358     --
359     begin
360       l_contact_set := hr_transaction_api.get_varchar2_value
361         (p_transaction_step_id => l_trans_step_ids(ln_index)
362         ,p_name                => 'P_CONTACT_SET');
363     exception
364      when others then
365       --
366       hr_utility.set_location('Exception:'||l_proc,555);
367       l_contact_set := 1;
368       --
369     end;
370     --
371     if l_contact_set is null then
372        --
373         l_contact_set := 1;
374        --
375     end if;
376 
377    -- Save for later changes
378    begin
379       if l_contact_operation is null then
380         l_contact_operation := hr_transaction_api.get_varchar2_value
381          (p_transaction_step_id => l_trans_step_ids(ln_index)
382         ,p_name                => 'P_CONTACT_OPERATION');
383       end if;
384    /* fix sansingh , at this juncture check if
385       l_contact_operation from earlier check is null, the same information is stored
386        as P_PER_OR_CONTACT by PHONE NUMBER  region
387        so obtain l_contact_operation from here
388          */
389       if l_contact_operation is null then
390         l_contact_operation := hr_transaction_api.get_varchar2_value
391          (p_transaction_step_id => l_trans_step_ids(ln_index)
392         ,p_name                => 'P_PER_OR_CONTACT');
393       end if;
394       /*
395         fix sansingh if l_contact_operation is still null ,it means that only address region was get updated
396          where the same values is saved as  P_CONTACT_OR_PERSON ,
397          so obtain l_contact_operation from here
398       */
399       if l_contact_operation is null then
400          l_contact_operation := hr_transaction_api.get_varchar2_value
401          (p_transaction_step_id => l_trans_step_ids(ln_index)
402         ,p_name                => 'P_CONTACT_OR_PERSON');
403       end if;
404    exception
405      when others then
406       --
407       hr_utility.set_location('Exception:'||l_proc,560);
408       l_contact_operation := null ;
409       --
410     end;
411     --
412    -- Get the Save Mode
413    begin
414      --
415        if l_save_mode is null then
416        --
417        l_save_mode :=  hr_transaction_api.get_varchar2_value
418           (p_transaction_step_id => l_trans_step_ids(ln_index)
419           ,p_name                => 'P_SAVE_MODE');
420        --
421        end if;
422      --
423     exception
424      when others then
425       --
426       hr_utility.set_location('Exception:'||l_proc,565);
427       l_save_mode := null ;
428       --
429     end;
430     --
431     if l_contact_set is null then
432        --
433        l_contact_set := 1;
434        --
435     end if;
436     --
437     if  l_contact_set = p_contact_set then
438       --
439    -- Get Shared Residence Flag
440    begin
441      --
442        --
443        l_shared_Residence_Flag := hr_transaction_api.get_varchar2_value
444           (p_transaction_step_id => l_trans_step_ids(ln_index)
445           ,p_name                => 'P_RLTD_PER_RSDS_W_DSGNTR_FLAG');
446        --
447        if l_shared_Residence_Flag is null then
448           l_shared_Residence_Flag := l_local_shared_Residence_Flag ;
449        else
450           l_local_shared_Residence_Flag := l_shared_Residence_Flag;
451        end if;
452        --
453     exception
454      when others then
455       --
456       hr_utility.set_location('Exception:'||l_proc,570);
457       l_shared_Residence_Flag := l_local_shared_Residence_Flag ;
458       --
459    end;
460 
461       -- Now check the transaction data for each region.
462       -- If transaction data exists that means the region
463       -- was modified.
464 
465       --
466       -- Check Contact.
467       --
468       if (p_contact_changed = 'N') then
469         --
470         begin
471          --l_id := hr_transaction_api.get_number_value
472          l_id := get_number_value
473                      (p_transaction_step_id => l_trans_step_ids(ln_index)
474                      ,p_name                => 'P_CONTACT_PERSON_ID');
475 
476          p_contact_changed := 'Y';
477          p_contact_person_id := to_char(l_id);
478          l_contact_step_id   :=  l_trans_step_ids(ln_index);
479          --
480          l_id := get_number_value
481                      (p_transaction_step_id => l_trans_step_ids(ln_index)
482                      ,p_name                => 'P_CONTACT_RELATIONSHIP_ID');
483 
484          p_contact_relationship_id := to_char(l_id);
485          --
486          l_first_name        := hr_transaction_api.get_varchar2_value
487                                 (p_transaction_step_id => l_trans_step_ids(ln_index)
488                                 ,p_name                =>upper( 'p_first_name'));
489          --
490          l_last_name         := hr_transaction_api.get_varchar2_value
491                                 (p_transaction_step_id => l_trans_step_ids(ln_index)
492                                 ,p_name                =>upper( 'p_last_name'));
493          --
494         exception
495           when others then
496              null;
497         end;
498       end if;
499       --
500       -- Check phone
501       --
502       if (p_phone_changed = 'N') then
503         --
504         begin
505          -- l_id := hr_transaction_api.get_number_value
506          l_id := get_number_value
507                      (p_transaction_step_id => l_trans_step_ids(ln_index)
508                      ,p_name                => 'P_PHONE_ID');
509          --
510          p_phone_changed   := 'Y';
511 
512          l_phone_step_id   :=  l_trans_step_ids(ln_index);
513 
514          l_id := hr_transaction_api.get_number_value
515                      (p_transaction_step_id => l_trans_step_ids(ln_index)
516                      ,p_name                => 'P_PERSON_ID');
517          --
518          p_parent_id := to_char(l_id);
519          l_contact_person_id := p_parent_id;
520          if (p_contact_relationship_id is null) then
521            l_id := get_number_value
522                      (p_transaction_step_id => l_trans_step_ids(ln_index)
523                      ,p_name                => 'P_CONTACT_RELATIONSHIP_ID');
524 
525              p_contact_relationship_id := to_char(l_id);
526          end if;
527          --
528         exception
529           when others then
530              null;
531         end;
532       end if;
533 
534       --
535       -- Check Address.
536       --
537       if (p_address_changed = 'N') then
538         --
539         begin
540          l_id := get_number_value
541                      (p_transaction_step_id => l_trans_step_ids(ln_index)
542                      ,p_name                => 'P_ADDRESS_ID');
543          l_prmry_flag         := hr_transaction_api.get_varchar2_value
544                                 (p_transaction_step_id => l_trans_step_ids(ln_index)
545                                 ,p_name                => 'P_PRIMARY_FLAG');
546 
547          if (l_prmry_flag = 'Y') then
548             p_address_changed := 'Y';
549 
550             p_address_id      := to_char(l_id);
551             l_address_step_id   :=  l_trans_step_ids(ln_index);
552 
553             l_addr_person_id := hr_transaction_api.get_number_value
554                              (p_transaction_step_id => l_trans_step_ids(ln_index)
555                              ,p_name                => 'P_PERSON_ID');
556             l_contact_person_id := l_addr_person_id;
557          end if;
558          if (p_contact_relationship_id is null) then
559            l_id := get_number_value
560                      (p_transaction_step_id => l_trans_step_ids(ln_index)
561                      ,p_name                => 'P_CONTACT_RELATIONSHIP_ID');
562              p_contact_relationship_id := to_char(l_id);
563          end if;
564         exception
565           when others then
566              null;
567         end;
568         --
569       end if;
570       --
571       if (p_second_address_changed = 'N') then
572         --
573         begin
574          l_id := get_number_value
575                      (p_transaction_step_id => l_trans_step_ids(ln_index)
576                      ,p_name                => 'P_ADDRESS_ID');
577 
578          l_prmry_flag         := hr_transaction_api.get_varchar2_value
579                                 (p_transaction_step_id => l_trans_step_ids(ln_index)
580                                 ,p_name                => 'P_PRIMARY_FLAG');
581 
582          if (l_prmry_flag = 'N') then
583             p_second_address_changed := 'Y';
584             p_address_id      := to_char(l_id);
585 
586             l_second_address_step_id   :=  l_trans_step_ids(ln_index);
587 
588             l_addr_person_id := hr_transaction_api.get_number_value
589                              (p_transaction_step_id => l_trans_step_ids(ln_index)
590                              ,p_name                => 'P_PERSON_ID');
591             l_contact_person_id := l_addr_person_id;
592          end if;
593          if (p_contact_relationship_id is null) then
594            l_id := get_number_value
595                      (p_transaction_step_id => l_trans_step_ids(ln_index)
596                      ,p_name                => 'P_CONTACT_RELATIONSHIP_ID');
597 
598              p_contact_relationship_id := to_char(l_id);
599          end if;
600         exception
601           when others then
602              null;
603         end;
604         --
605       end if;
606 
607     end if; -- end check for current contact set
608     --
609     ln_index := ln_index + 1;
610     l_trans_rec_count  := l_trans_rec_count  + 1;
611     p_second_address_step_id  := l_second_address_step_id;
612     p_address_step_id  := l_address_step_id;
613     p_contact_step_id  := l_contact_step_id;
614     p_phone_step_id    := l_phone_step_id;
615     p_contact_person_id := nvl(nvl(p_contact_person_id, l_addr_person_id), p_parent_id);
616     --
617     if (p_contact_person_id > 0) and (p_contact_changed = 'N') then
618          --
619          -- It could be possible that only address or phone data was
620          -- updated, so we need to pass back the first name, last name to display as
621          -- context.
622          --
623          open  c_get_names;
624          fetch c_get_names into l_last_name, l_first_name;
625          close c_get_names;
626          --
627     end if;
628     --
629   END LOOP;
630 
631   --
632   p_last_name         := l_last_name;
633   p_first_name        := l_first_name;
634   p_contact_operation := l_contact_operation ;
635   p_save_mode         := l_save_mode;
636   p_shared_residence_flag := l_shared_residence_flag;
637   p_trans_rec_count := l_trans_rec_count;
638 
639   hr_utility.set_location('Exiting For Loop:'||l_proc, 20);
640   /* fix sansingh
641    before leaving check if p_contact_person_id is populated or not
642    if only phone or address region is updated , p_contact_person_id
643    would not be populated , it would be actually stored as p_person_id in that case for the transaction step
644    so populating p_contact_person_id with the same
645   */
646   if (p_contact_person_id is null) then
647     p_contact_person_id := l_contact_person_id;
648   end if;
649 
650   hr_utility.set_location('Exiting:'||l_proc, 25);
651   --
652 EXCEPTION
653    WHEN OTHERS THEN
654       fnd_message.set_name('PER', SQLERRM ||' '||to_char(SQLCODE));
655       hr_utility.set_location('Exception OTHERS:'||l_proc,555);
656       hr_utility.raise_error;
657   --
658 
659 end get_contact_regions_status_tt;
660 
661 --
662 -- ---------------------------------------------------------------------------
663 -- ---------------------- < get_contact_relationship_tt> -------------------------
664 -- ---------------------------------------------------------------------------
665 -- Purpose: This procedure will get transaction data which are saved earlier
666 --          in the current transaction.  This is invoked when a user click BACK
667 --          button to go back from the Review page to Update page to correct
668 --          typos or make further changes.  Hence, we need to use the item_type
669 --          item_key passed in to retrieve the transaction record.
670 --          This is an overloaded version.
671 -- ---------------------------------------------------------------------------
672 --
673 PROCEDURE get_contact_relationship_tt
674    (p_item_type                       in  varchar2
675    ,p_item_key                        in  varchar2
676    ,p_activity_id                     in  number
677    -- 9999 What is this parameter.
678    ,p_trans_rec_count                 out nocopy number
679    ,p_effective_date                  out nocopy date
680    -- 9999 What is this parameter.
681    ,p_attribute_update_mode           out nocopy varchar2
682    ,P_CONTACT_RELATIONSHIP_ID         out nocopy NUMBER
683    ,P_CONTACT_TYPE                    out nocopy VARCHAR2
684    ,P_COMMENTS                        out nocopy VARCHAR2
685    ,P_PRIMARY_CONTACT_FLAG            out nocopy VARCHAR2
686    ,P_THIRD_PARTY_PAY_FLAG            out nocopy VARCHAR2
687    ,p_bondholder_flag                 out nocopy varchar2
688    ,p_date_start                      out nocopy date
689    ,p_start_life_reason_id            out nocopy number
690    ,p_date_end                        out nocopy date
691    ,p_end_life_reason_id              out nocopy number
692    ,p_rltd_per_rsds_w_dsgntr_flag      out nocopy varchar2
693    ,p_personal_flag                    out nocopy varchar2
694    ,p_sequence_number                  out nocopy number
695    ,p_dependent_flag                   out nocopy varchar2
696    ,p_beneficiary_flag                 out nocopy varchar2
697    ,p_cont_attribute_category          out nocopy varchar2
698    ,p_cont_attribute1                  out nocopy varchar2
699    ,p_cont_attribute2                  out nocopy varchar2
700    ,p_cont_attribute3                  out nocopy varchar2
701    ,p_cont_attribute4                  out nocopy varchar2
702    ,p_cont_attribute5                  out nocopy varchar2
703    ,p_cont_attribute6                  out nocopy varchar2
704    ,p_cont_attribute7                  out nocopy varchar2
705    ,p_cont_attribute8                  out nocopy varchar2
706    ,p_cont_attribute9                  out nocopy varchar2
707    ,p_cont_attribute10                  out nocopy varchar2
708    ,p_cont_attribute11                  out nocopy varchar2
709    ,p_cont_attribute12                  out nocopy varchar2
710    ,p_cont_attribute13                  out nocopy varchar2
711    ,p_cont_attribute14                  out nocopy varchar2
712    ,p_cont_attribute15                  out nocopy varchar2
713    ,p_cont_attribute16                  out nocopy varchar2
714    ,p_cont_attribute17                  out nocopy varchar2
715    ,p_cont_attribute18                  out nocopy varchar2
716    ,p_cont_attribute19                  out nocopy varchar2
717    ,p_cont_attribute20                  out nocopy varchar2
718    ,P_CONT_INFORMATION_CATEGORY         out nocopy varchar2
719    ,P_CONT_INFORMATION1                 out nocopy varchar2
720    ,P_CONT_INFORMATION2                 out nocopy varchar2
721    ,P_CONT_INFORMATION3                 out nocopy varchar2
722    ,P_CONT_INFORMATION4                 out nocopy varchar2
723    ,P_CONT_INFORMATION5                 out nocopy varchar2
724    ,P_CONT_INFORMATION6                 out nocopy varchar2
725    ,P_CONT_INFORMATION7                 out nocopy varchar2
726    ,P_CONT_INFORMATION8                 out nocopy varchar2
727    ,P_CONT_INFORMATION9                 out nocopy varchar2
728    ,P_CONT_INFORMATION10                out nocopy varchar2
729    ,P_CONT_INFORMATION11                out nocopy varchar2
730    ,P_CONT_INFORMATION12                out nocopy varchar2
731    ,P_CONT_INFORMATION13                out nocopy varchar2
732    ,P_CONT_INFORMATION14                out nocopy varchar2
733    ,P_CONT_INFORMATION15                out nocopy varchar2
734    ,P_CONT_INFORMATION16                out nocopy varchar2
735    ,P_CONT_INFORMATION17                out nocopy varchar2
736    ,P_CONT_INFORMATION18                out nocopy varchar2
737    ,P_CONT_INFORMATION19                out nocopy varchar2
738    ,P_CONT_INFORMATION20                out nocopy varchar2
739    ,p_object_version_number             out nocopy number
740    -- 9999 What is this parameter.
741    ,p_review_proc_call                    out nocopy varchar2
742 )is
743 
744   l_transaction_step_id        number default null;
745   l_trans_obj_vers_num         number default null;
746   l_transaction_rec_count      integer default 0;
747   l_proc   varchar2(72)  := g_package||'get_contact_relationship_tt';
748 
749 begin
750     hr_utility.set_location('Entering:'||l_proc, 5);
751   -- ------------------------------------------------------------------
752   -- Check if there are any transaction rec already saved for the current
753   -- transaction. This is used for re-display the Update page when a user
754   -- clicks the Back button on the Review page to go back to the Update page
755   -- to make further changes or to correct errors.
756   -----------------------------------------------------------------------------
757   hr_transaction_api.get_transaction_step_info
758      (p_item_type              => p_item_type
759      ,p_item_key               => p_item_key
760      ,p_activity_id            => p_activity_id
761      ,p_transaction_step_id    => l_transaction_step_id
762      ,p_object_version_number  => l_trans_obj_vers_num);
763 
764 
765   IF l_transaction_step_id > 0
766   THEN
767      hr_utility.set_location('l_transaction_step_id > 0:'||l_proc, 10);
768      l_transaction_rec_count := 1;
769   ELSE
770      hr_utility.set_location('l_transaction_step_id < 0:'||l_proc, 10);
771      l_transaction_rec_count := 0;
772      return;
773   END IF;
774   --
775   -- -------------------------------------------------------------------
776   -- There are some changes made earlier in the transaction.
777   -- Retrieve the data and return to caller.
778   -- -------------------------------------------------------------------
779   --
780   -- Now get the transaction data for the given step
781   get_contact_relationship_tt(
782     p_transaction_step_id          => l_transaction_step_id
783    ,p_effective_date               => p_effective_date
784    -- 9999 What is this parameter
785    ,p_attribute_update_mode        => p_attribute_update_mode
786    ,P_CONTACT_RELATIONSHIP_ID      =>  P_CONTACT_RELATIONSHIP_ID
787    ,P_CONTACT_TYPE                 =>  P_CONTACT_TYPE
788    ,P_COMMENTS                     =>  P_COMMENTS
789    ,P_PRIMARY_CONTACT_FLAG         =>  P_PRIMARY_CONTACT_FLAG
790    ,P_THIRD_PARTY_PAY_FLAG         =>  P_THIRD_PARTY_PAY_FLAG
791    ,p_bondholder_flag              =>  p_bondholder_flag
792    ,p_date_start                   =>  p_date_start
793    ,p_start_life_reason_id         =>  p_start_life_reason_id
794    ,p_date_end                     =>  p_date_end
795    ,p_end_life_reason_id           =>  p_end_life_reason_id
796    ,p_rltd_per_rsds_w_dsgntr_flag  =>  p_rltd_per_rsds_w_dsgntr_flag
797    ,p_personal_flag                =>  p_personal_flag
798    ,p_sequence_number              =>  p_sequence_number
799    ,p_dependent_flag               =>  p_dependent_flag
800    ,p_beneficiary_flag             =>  p_beneficiary_flag
801    ,p_cont_attribute_category      =>  p_cont_attribute_category
802    ,p_cont_attribute1              =>  p_cont_attribute1
803    ,p_cont_attribute2              =>  p_cont_attribute2
804    ,p_cont_attribute3              =>  p_cont_attribute3
805    ,p_cont_attribute4              =>  p_cont_attribute4
806    ,p_cont_attribute5              =>  p_cont_attribute5
807    ,p_cont_attribute6              =>  p_cont_attribute6
808    ,p_cont_attribute7              =>  p_cont_attribute7
809    ,p_cont_attribute8              =>  p_cont_attribute8
810    ,p_cont_attribute9              =>  p_cont_attribute9
811    ,p_cont_attribute10             =>  p_cont_attribute10
812    ,p_cont_attribute11             =>  p_cont_attribute11
813    ,p_cont_attribute12             =>  p_cont_attribute12
814    ,p_cont_attribute13             =>  p_cont_attribute13
815    ,p_cont_attribute14             =>  p_cont_attribute14
816    ,p_cont_attribute15             =>  p_cont_attribute15
817    ,p_cont_attribute16             =>  p_cont_attribute16
818    ,p_cont_attribute17             =>  p_cont_attribute17
819    ,p_cont_attribute18             =>  p_cont_attribute18
820    ,p_cont_attribute19             =>  p_cont_attribute19
821    ,p_cont_attribute20             =>  p_cont_attribute20
822    ,p_object_version_number        =>  p_object_version_number
823    ,P_CONT_INFORMATION_CATEGORY    => P_CONT_INFORMATION_CATEGORY
824    ,P_CONT_INFORMATION1            => P_CONT_INFORMATION1
825    ,P_CONT_INFORMATION2            => P_CONT_INFORMATION2
826    ,P_CONT_INFORMATION3            => P_CONT_INFORMATION3
827    ,P_CONT_INFORMATION4            => P_CONT_INFORMATION4
828    ,P_CONT_INFORMATION5            => P_CONT_INFORMATION5
829    ,P_CONT_INFORMATION6            => P_CONT_INFORMATION6
830    ,P_CONT_INFORMATION7            => P_CONT_INFORMATION7
831    ,P_CONT_INFORMATION8            => P_CONT_INFORMATION8
832    ,P_CONT_INFORMATION9            => P_CONT_INFORMATION9
833    ,P_CONT_INFORMATION10           => P_CONT_INFORMATION10
834    ,P_CONT_INFORMATION11           => P_CONT_INFORMATION11
835    ,P_CONT_INFORMATION12           => P_CONT_INFORMATION12
836    ,P_CONT_INFORMATION13           => P_CONT_INFORMATION13
837    ,P_CONT_INFORMATION14           => P_CONT_INFORMATION14
838    ,P_CONT_INFORMATION15           => P_CONT_INFORMATION15
839    ,P_CONT_INFORMATION16           => P_CONT_INFORMATION16
840    ,P_CONT_INFORMATION17           => P_CONT_INFORMATION17
841    ,P_CONT_INFORMATION18           => P_CONT_INFORMATION18
842    ,P_CONT_INFORMATION19           => P_CONT_INFORMATION19
843    ,P_CONT_INFORMATION20           => P_CONT_INFORMATION20
844    ,p_review_proc_call             => p_review_proc_call
845    );
846  --
847  p_trans_rec_count := l_transaction_rec_count;
848  hr_utility.set_location('Exiting:'||l_proc, 15);
849  --
850 EXCEPTION
851    WHEN g_data_error THEN
852       hr_utility.set_location('Exception:g_data_error'||l_proc,555);
853       RAISE;
854 
855 
856 END get_contact_relationship_tt;
857 --
858 -- ---------------------------------------------------------------------------
859 -- ---------------------- < get_contact_relationship_tt> -------------------------
860 -- ---------------------------------------------------------------------------
861 -- Purpose: This procedure will get transaction data which are pending for
862 --          approval in workflow for a transaction step id.
863 --          This is the procedure which does the actual work.
864 -- ---------------------------------------------------------------------------
865 procedure get_contact_relationship_tt
866    (p_transaction_step_id             in  number
867    ,p_effective_date                  out nocopy date
868    -- 9999 What is this paramter.
869    ,p_attribute_update_mode           out nocopy varchar2
870    ,P_CONTACT_RELATIONSHIP_ID         out nocopy NUMBER
871    ,P_CONTACT_TYPE                    out nocopy VARCHAR2
872    ,P_COMMENTS                        out nocopy VARCHAR2
873    ,P_PRIMARY_CONTACT_FLAG            out nocopy VARCHAR2
874    ,P_THIRD_PARTY_PAY_FLAG            out nocopy VARCHAR2
875    ,p_bondholder_flag                 out nocopy varchar2
876    ,p_date_start                      out nocopy date
877    ,p_start_life_reason_id            out nocopy number
878    ,p_date_end                        out nocopy date
879    ,p_end_life_reason_id              out nocopy number
880    ,p_rltd_per_rsds_w_dsgntr_flag      out nocopy varchar2
881    ,p_personal_flag                    out nocopy varchar2
882    ,p_sequence_number                  out nocopy number
883    ,p_dependent_flag                   out nocopy varchar2
884    ,p_beneficiary_flag                 out nocopy varchar2
885    ,p_cont_attribute_category          out nocopy varchar2
886    ,p_cont_attribute1                  out nocopy varchar2
887    ,p_cont_attribute2                  out nocopy varchar2
888    ,p_cont_attribute3                  out nocopy varchar2
889    ,p_cont_attribute4                  out nocopy varchar2
890    ,p_cont_attribute5                  out nocopy varchar2
891    ,p_cont_attribute6                  out nocopy varchar2
892    ,p_cont_attribute7                  out nocopy varchar2
893    ,p_cont_attribute8                  out nocopy varchar2
894    ,p_cont_attribute9                  out nocopy varchar2
895    ,p_cont_attribute10                  out nocopy varchar2
896    ,p_cont_attribute11                  out nocopy varchar2
897    ,p_cont_attribute12                  out nocopy varchar2
898    ,p_cont_attribute13                  out nocopy varchar2
899    ,p_cont_attribute14                  out nocopy varchar2
900    ,p_cont_attribute15                  out nocopy varchar2
901    ,p_cont_attribute16                  out nocopy varchar2
902    ,p_cont_attribute17                  out nocopy varchar2
903    ,p_cont_attribute18                  out nocopy varchar2
904    ,p_cont_attribute19                  out nocopy varchar2
905    ,p_cont_attribute20                  out nocopy varchar2
906    ,P_CONT_INFORMATION_CATEGORY         out nocopy varchar2
907    ,P_CONT_INFORMATION1                 out nocopy varchar2
908    ,P_CONT_INFORMATION2                 out nocopy varchar2
909    ,P_CONT_INFORMATION3                 out nocopy varchar2
910    ,P_CONT_INFORMATION4                 out nocopy varchar2
911    ,P_CONT_INFORMATION5                 out nocopy varchar2
912    ,P_CONT_INFORMATION6                 out nocopy varchar2
913    ,P_CONT_INFORMATION7                 out nocopy varchar2
914    ,P_CONT_INFORMATION8                 out nocopy varchar2
915    ,P_CONT_INFORMATION9                 out nocopy varchar2
916    ,P_CONT_INFORMATION10                out nocopy varchar2
917    ,P_CONT_INFORMATION11                out nocopy varchar2
918    ,P_CONT_INFORMATION12                out nocopy varchar2
919    ,P_CONT_INFORMATION13                out nocopy varchar2
920    ,P_CONT_INFORMATION14                out nocopy varchar2
921    ,P_CONT_INFORMATION15                out nocopy varchar2
922    ,P_CONT_INFORMATION16                out nocopy varchar2
923    ,P_CONT_INFORMATION17                out nocopy varchar2
924    ,P_CONT_INFORMATION18                out nocopy varchar2
925    ,P_CONT_INFORMATION19                out nocopy varchar2
926    ,P_CONT_INFORMATION20                out nocopy varchar2
927    ,p_object_version_number             out nocopy number
928    -- 9999 What is this parameter.
929    ,p_review_proc_call                out nocopy varchar2
930 )is
931  --
932  --
933    l_proc   varchar2(72)  := g_package||'get_contact_relationship_tt';
934 
935 BEGIN
936   --
937   p_effective_date:=
938     hr_transaction_api.get_date_value
939     (p_transaction_step_id => p_transaction_step_id
940     ,p_name                => 'P_EFFECTIVE_DATE');
941   --
942   hr_utility.set_location('P_EFFECTIVE_DATE', 2222);
943   P_ATTRIBUTE_UPDATE_MODE := 'update';
944   /*
945   -- 9999 delete it later if not required.
946   p_attribute_update_mode :=
947     hr_transaction_api.get_varchar2_value
948     (p_transaction_step_id => p_transaction_step_id
949     ,p_name                => 'P_ATTRIBUTE_UPDATE_MODE');
950   hr_utility.set_location('P_ATTRIBUTE_UPDATE_MODE', 2222);
951   */
952   --
953   P_CONTACT_RELATIONSHIP_ID  :=
954       hr_transaction_api.get_NUMBER_value
955         (p_transaction_step_id => p_transaction_step_id
956         ,p_name                => 'P_CONTACT_RELATIONSHIP_ID');
957   hr_utility.set_location('P_CONTACT_RELATIONSHIP_ID', 2222);
958   --
959   P_CONTACT_TYPE  :=
960       hr_transaction_api.get_VARCHAR2_value
961         (p_transaction_step_id => p_transaction_step_id
962         ,p_name                => 'P_CONTACT_TYPE');
963   hr_utility.set_location('P_CONTACT_TYPE', 2222);
964   --
965   P_COMMENTS  :=
966       hr_transaction_api.get_VARCHAR2_value
967         (p_transaction_step_id => p_transaction_step_id
968         ,p_name                => 'P_COMMENTS');
969   hr_utility.set_location('P_COMMENTS', 2222);
970   --
971   P_PRIMARY_CONTACT_FLAG  :=
972       hr_transaction_api.get_VARCHAR2_value
973         (p_transaction_step_id => p_transaction_step_id
974         ,p_name                => 'P_PRIMARY_CONTACT_FLAG');
975   hr_utility.set_location('P_PRIMARY_CONTACT_FLAG', 2222);
976   --
977   P_THIRD_PARTY_PAY_FLAG  :=
978       hr_transaction_api.get_VARCHAR2_value
979         (p_transaction_step_id => p_transaction_step_id
980         ,p_name                => 'P_THIRD_PARTY_PAY_FLAG');
981   hr_utility.set_location('P_THIRD_PARTY_PAY_FLAG', 2222);
982   --
983   p_bondholder_flag  :=
984       hr_transaction_api.get_varchar2_value
985         (p_transaction_step_id => p_transaction_step_id
986         ,p_name                => 'P_BONDHOLDER_FLAG');
987   hr_utility.set_location('P_BONDHOLDER_FLAG', 2222);
988   --
989   p_date_start  :=
990       hr_transaction_api.get_date_value
991         (p_transaction_step_id => p_transaction_step_id
992         ,p_name                => 'P_DATE_START');
993   hr_utility.set_location('P_DATE_START', 2222);
994   --
995   p_start_life_reason_id  :=
996       hr_transaction_api.get_number_value
997         (p_transaction_step_id => p_transaction_step_id
998         ,p_name                => 'P_START_LIFE_REASON_ID');
999   hr_utility.set_location('P_START_LIFE_REASON_ID', 2222);
1000   --
1001   p_date_end  :=
1002       hr_transaction_api.get_date_value
1003         (p_transaction_step_id => p_transaction_step_id
1004         ,p_name                => 'P_DATE_END');
1005   hr_utility.set_location('P_DATE_END', 2222);
1006   --
1007   p_end_life_reason_id  :=
1008       hr_transaction_api.get_number_value
1009         (p_transaction_step_id => p_transaction_step_id
1010         ,p_name                => 'P_END_LIFE_REASON_ID');
1011   hr_utility.set_location('P_END_LIFE_REASON_ID', 2222);
1012   --
1013   p_rltd_per_rsds_w_dsgntr_flag  :=
1014       hr_transaction_api.get_varchar2_value
1015         (p_transaction_step_id => p_transaction_step_id
1016         ,p_name                => 'P_RLTD_PER_RSDS_W_DSGNTR_FLAG');
1017   hr_utility.set_location('P_RLTD_PER_RSDS_W_DSGNTR_FLAG', 2222);
1018   --
1019   p_personal_flag  :=
1020       hr_transaction_api.get_varchar2_value
1021         (p_transaction_step_id => p_transaction_step_id
1022         ,p_name                => 'P_PERSONAL_FLAG');
1023   hr_utility.set_location('P_PERSONAL_FLAG', 2222);
1024   --
1025   p_sequence_number  :=
1026       hr_transaction_api.get_number_value
1027         (p_transaction_step_id => p_transaction_step_id
1028         ,p_name                => 'P_SEQUENCE_NUMBER');
1029   hr_utility.set_location('P_SEQUENCE_NUMBER', 2222);
1030   --
1031   p_dependent_flag  :=
1032       hr_transaction_api.get_varchar2_value
1033         (p_transaction_step_id => p_transaction_step_id
1034         ,p_name                => 'P_DEPENDENT_FLAG');
1035   hr_utility.set_location('P_DEPENDENT_FLAG', 2222);
1036   --
1037   p_beneficiary_flag  :=
1038       hr_transaction_api.get_varchar2_value
1039         (p_transaction_step_id => p_transaction_step_id
1040         ,p_name                => 'P_BENEFICIARY_FLAG');
1041   hr_utility.set_location('P_BENEFICIARY_FLAG', 2222);
1042   --
1043   p_cont_attribute_category  :=
1044       hr_transaction_api.get_varchar2_value
1045         (p_transaction_step_id => p_transaction_step_id
1046         ,p_name                => 'P_CONT_ATTRIBUTE_CATEGORY');
1047   hr_utility.set_location('P_CONT_ATTRIBUTE_CATEGORY', 2222);
1048   --
1049   p_cont_attribute1  :=
1050       hr_transaction_api.get_varchar2_value
1051         (p_transaction_step_id => p_transaction_step_id
1052         ,p_name                => 'P_CONT_ATTRIBUTE1');
1053   hr_utility.set_location('P_CONT_ATTRIBUTE1', 2222);
1054   --
1055   p_cont_attribute2  :=
1056       hr_transaction_api.get_varchar2_value
1057         (p_transaction_step_id => p_transaction_step_id
1058         ,p_name                => 'P_CONT_ATTRIBUTE2');
1059   hr_utility.set_location('P_CONT_ATTRIBUTE2', 2222);
1060   --
1061   p_cont_attribute3  :=
1062       hr_transaction_api.get_varchar2_value
1063         (p_transaction_step_id => p_transaction_step_id
1064         ,p_name                => 'P_CONT_ATTRIBUTE3');
1065   hr_utility.set_location('P_CONT_ATTRIBUTE3', 2222);
1066   --
1067   p_cont_attribute4  :=
1068       hr_transaction_api.get_varchar2_value
1069         (p_transaction_step_id => p_transaction_step_id
1070         ,p_name                => 'P_CONT_ATTRIBUTE4');
1071   hr_utility.set_location('P_CONT_ATTRIBUTE4', 2222);
1072   --
1073   p_cont_attribute5  :=
1074       hr_transaction_api.get_varchar2_value
1075         (p_transaction_step_id => p_transaction_step_id
1076         ,p_name                => 'P_CONT_ATTRIBUTE5');
1077   hr_utility.set_location('P_CONT_ATTRIBUTE5', 2222);
1078   --
1079   p_cont_attribute6  :=
1080       hr_transaction_api.get_varchar2_value
1081         (p_transaction_step_id => p_transaction_step_id
1082         ,p_name                => 'P_CONT_ATTRIBUTE6');
1083   hr_utility.set_location('P_CONT_ATTRIBUTE6', 2222);
1084   --
1085   p_cont_attribute7  :=
1086       hr_transaction_api.get_varchar2_value
1087         (p_transaction_step_id => p_transaction_step_id
1088         ,p_name                => 'P_CONT_ATTRIBUTE7');
1089   hr_utility.set_location('P_CONT_ATTRIBUTE7', 2222);
1090   --
1091   p_cont_attribute8  :=
1092       hr_transaction_api.get_varchar2_value
1093         (p_transaction_step_id => p_transaction_step_id
1094         ,p_name                => 'P_CONT_ATTRIBUTE8');
1095   hr_utility.set_location('P_CONT_ATTRIBUTE8', 2222);
1096   --
1097   p_cont_attribute9  :=
1098       hr_transaction_api.get_varchar2_value
1099         (p_transaction_step_id => p_transaction_step_id
1100         ,p_name                => 'P_CONT_ATTRIBUTE9');
1101   hr_utility.set_location('P_CONT_ATTRIBUTE9', 2222);
1102   --
1103   p_cont_attribute10  :=
1104       hr_transaction_api.get_varchar2_value
1105         (p_transaction_step_id => p_transaction_step_id
1106         ,p_name                => 'P_CONT_ATTRIBUTE10');
1107   hr_utility.set_location('P_CONT_ATTRIBUTE10', 2222);
1108   --
1109   p_cont_attribute11  :=
1110       hr_transaction_api.get_varchar2_value
1111         (p_transaction_step_id => p_transaction_step_id
1112         ,p_name                => 'P_CONT_ATTRIBUTE11');
1113   hr_utility.set_location('P_CONT_ATTRIBUTE11', 2222);
1114   --
1115   p_cont_attribute12  :=
1116       hr_transaction_api.get_varchar2_value
1117         (p_transaction_step_id => p_transaction_step_id
1118         ,p_name                => 'P_CONT_ATTRIBUTE12');
1119   hr_utility.set_location('P_CONT_ATTRIBUTE12', 2222);
1120   --
1121   p_cont_attribute13  :=
1122       hr_transaction_api.get_varchar2_value
1123         (p_transaction_step_id => p_transaction_step_id
1124         ,p_name                => 'P_CONT_ATTRIBUTE13');
1125   hr_utility.set_location('P_CONT_ATTRIBUTE13', 2222);
1126   --
1127   p_cont_attribute14  :=
1128       hr_transaction_api.get_varchar2_value
1129         (p_transaction_step_id => p_transaction_step_id
1130         ,p_name                => 'P_CONT_ATTRIBUTE14');
1131   hr_utility.set_location('P_CONT_ATTRIBUTE14', 2222);
1132   --
1133   p_cont_attribute15  :=
1134       hr_transaction_api.get_varchar2_value
1135         (p_transaction_step_id => p_transaction_step_id
1136         ,p_name                => 'P_CONT_ATTRIBUTE15');
1137   hr_utility.set_location('P_CONT_ATTRIBUTE15', 2222);
1138   --
1139   p_cont_attribute16  :=
1140       hr_transaction_api.get_varchar2_value
1141         (p_transaction_step_id => p_transaction_step_id
1142         ,p_name                => 'P_CONT_ATTRIBUTE16');
1143   hr_utility.set_location('P_CONT_ATTRIBUTE16', 2222);
1144   --
1145   p_cont_attribute17  :=
1146       hr_transaction_api.get_varchar2_value
1147         (p_transaction_step_id => p_transaction_step_id
1148         ,p_name                => 'P_CONT_ATTRIBUTE17');
1149   hr_utility.set_location('P_CONT_ATTRIBUTE17', 2222);
1150   --
1151   p_cont_attribute18  :=
1152       hr_transaction_api.get_varchar2_value
1153         (p_transaction_step_id => p_transaction_step_id
1154         ,p_name                => 'P_CONT_ATTRIBUTE18');
1155   hr_utility.set_location('P_CONT_ATTRIBUTE18', 2222);
1156   --
1157   p_cont_attribute19  :=
1158       hr_transaction_api.get_varchar2_value
1159         (p_transaction_step_id => p_transaction_step_id
1160         ,p_name                => 'P_CONT_ATTRIBUTE19');
1161   hr_utility.set_location('P_CONT_ATTRIBUTE19', 2222);
1162   --
1163   p_cont_attribute20  :=
1164       hr_transaction_api.get_varchar2_value
1165         (p_transaction_step_id => p_transaction_step_id
1166         ,p_name                => 'P_CONT_ATTRIBUTE20');
1167   hr_utility.set_location('p_cont_attribute20', 2222);
1168   --
1169   p_object_version_number  :=
1170       hr_transaction_api.get_number_value
1171         (p_transaction_step_id => p_transaction_step_id
1172         ,p_name                => 'P_OBJECT_VERSION_NUMBER');
1173   hr_utility.set_location('p_object_version_number', 2222);
1174   --
1175   p_review_proc_call :=
1176     hr_transaction_api.get_varchar2_value
1177     (p_transaction_step_id => p_transaction_step_id
1178     ,p_name                => 'P_REVIEW_PROC_CALL');
1179   hr_utility.set_location('P_REVIEW_PROC_CALL', 2222);
1180   --
1181   --
1182   P_CONT_INFORMATION_CATEGORY  :=
1183       hr_transaction_api.get_VARCHAR2_value
1184             (p_transaction_step_id => p_transaction_step_id
1185             ,p_name                => 'P_CONT_INFORMATION_CATEGORY');
1186   --
1187   P_CONT_INFORMATION1  :=
1188       hr_transaction_api.get_VARCHAR2_value
1189             (p_transaction_step_id => p_transaction_step_id
1190             ,p_name                => 'P_CONT_INFORMATION1');
1191   --
1192   P_CONT_INFORMATION2  :=
1193       hr_transaction_api.get_VARCHAR2_value
1194             (p_transaction_step_id => p_transaction_step_id
1195             ,p_name                => 'P_CONT_INFORMATION2');
1196   --
1197   P_CONT_INFORMATION3  :=
1198       hr_transaction_api.get_VARCHAR2_value
1199             (p_transaction_step_id => p_transaction_step_id
1200             ,p_name                => 'P_CONT_INFORMATION3');
1201   --
1202   P_CONT_INFORMATION4  :=
1203       hr_transaction_api.get_VARCHAR2_value
1204             (p_transaction_step_id => p_transaction_step_id
1205             ,p_name                => 'P_CONT_INFORMATION4');
1206   --
1207   P_CONT_INFORMATION5  :=
1208       hr_transaction_api.get_VARCHAR2_value
1209             (p_transaction_step_id => p_transaction_step_id
1210             ,p_name                => 'P_CONT_INFORMATION5');
1211   --
1212   P_CONT_INFORMATION6  :=
1213        hr_transaction_api.get_VARCHAR2_value
1214             (p_transaction_step_id => p_transaction_step_id
1215             ,p_name                => 'P_CONT_INFORMATION6');
1216   --
1217   P_CONT_INFORMATION7  :=
1218        hr_transaction_api.get_VARCHAR2_value
1219             (p_transaction_step_id => p_transaction_step_id
1220             ,p_name                => 'P_CONT_INFORMATION7');
1221   --
1222   P_CONT_INFORMATION8  :=
1223        hr_transaction_api.get_VARCHAR2_value
1224             (p_transaction_step_id => p_transaction_step_id
1225             ,p_name                => 'P_CONT_INFORMATION8');
1226   --
1227   P_CONT_INFORMATION9  :=
1228        hr_transaction_api.get_VARCHAR2_value
1229             (p_transaction_step_id => p_transaction_step_id
1230             ,p_name                => 'P_CONT_INFORMATION9');
1231   --
1232   P_CONT_INFORMATION10  :=
1233        hr_transaction_api.get_VARCHAR2_value
1234             (p_transaction_step_id => p_transaction_step_id
1235             ,p_name                => 'P_CONT_INFORMATION10');
1236    --
1237    P_CONT_INFORMATION11  :=
1238        hr_transaction_api.get_VARCHAR2_value
1239             (p_transaction_step_id => p_transaction_step_id
1240             ,p_name                => 'P_CONT_INFORMATION11');
1241    --
1242    P_CONT_INFORMATION12  :=
1243         hr_transaction_api.get_VARCHAR2_value
1244             (p_transaction_step_id => p_transaction_step_id
1245             ,p_name                => 'P_CONT_INFORMATION12');
1246    --
1247    P_CONT_INFORMATION13  :=
1248         hr_transaction_api.get_VARCHAR2_value
1249             (p_transaction_step_id => p_transaction_step_id
1250             ,p_name                => 'P_CONT_INFORMATION13');
1251    --
1252    P_CONT_INFORMATION14  :=
1253         hr_transaction_api.get_VARCHAR2_value
1254             (p_transaction_step_id => p_transaction_step_id
1255             ,p_name                => 'P_CONT_INFORMATION14');
1256    --
1257    P_CONT_INFORMATION15  :=
1258         hr_transaction_api.get_VARCHAR2_value
1259             (p_transaction_step_id => p_transaction_step_id
1260             ,p_name                => 'P_CONT_INFORMATION15');
1261    --
1262    P_CONT_INFORMATION16  :=
1263         hr_transaction_api.get_VARCHAR2_value
1264             (p_transaction_step_id => p_transaction_step_id
1265             ,p_name                => 'P_CONT_INFORMATION16');
1266    --
1267    P_CONT_INFORMATION17  :=
1268         hr_transaction_api.get_VARCHAR2_value
1269             (p_transaction_step_id => p_transaction_step_id
1270             ,p_name                => 'P_CONT_INFORMATION17');
1271    --
1272    P_CONT_INFORMATION18  :=
1273         hr_transaction_api.get_VARCHAR2_value
1274             (p_transaction_step_id => p_transaction_step_id
1275             ,p_name                => 'P_CONT_INFORMATION18');
1276    --
1277    P_CONT_INFORMATION19  :=
1278         hr_transaction_api.get_VARCHAR2_value
1279             (p_transaction_step_id => p_transaction_step_id
1280             ,p_name                => 'P_CONT_INFORMATION19');
1281    --
1282    P_CONT_INFORMATION20  :=
1283         hr_transaction_api.get_VARCHAR2_value
1284             (p_transaction_step_id => p_transaction_step_id
1285             ,p_name                => 'P_CONT_INFORMATION20');
1286    --
1287 hr_utility.set_location('Exiting:'||l_proc, 15);
1288 EXCEPTION
1289    WHEN OTHERS THEN
1290       hr_utility.set_location('Exception:'||l_proc,555);
1291       fnd_message.set_name('PER', SQLERRM ||' '||to_char(SQLCODE));
1292       hr_utility.raise_error;
1293       --RAISE;
1294 
1295 END get_contact_relationship_tt;
1296 
1297 -- ----------------------------------------------------------------------------
1298  -- |-------------------------< check_ni_unique>------------------------|
1299  -- ----------------------------------------------------------------------------
1300  -- this procedure checks if the SSN entered is duplicate or not.If value of profile
1301  -- HR: NI Unique Error or Warning is 'Warning' then warning is raised for duplicate
1302  -- SSN entered else if value is 'Error' or null then error is raised.
1303 
1304 procedure check_ni_unique(
1305 p_national_identifier          in        varchar2    default null
1306 ,p_business_group_id           in        number
1307 ,p_person_id                   in        number
1308 ,p_ni_duplicate_warn_or_err    out nocopy       varchar2) is
1309 
1310  l_warning                           boolean default false;
1311  l_warning_or_error                  varchar2(20);
1312  l_proc   varchar2(72)  := g_package||'check_ni_unique';
1313 
1314 begin
1315   hr_utility.set_location('Entering:'||l_proc, 5);
1316   hr_utility.clear_message();
1317   hr_utility.clear_warning();
1318 
1319 
1320   l_warning_or_error := fnd_profile.value('PER_NI_UNIQUE_ERROR_WARNING');
1321   if l_warning_or_error is null then
1322     l_warning_or_error:= 'ERROR';
1323     hr_utility.set_location('l_warning_or_error:'||l_proc,10 );
1324   end if;
1325 
1326   if p_national_identifier is not null then
1327 
1328       hr_utility.set_location('p_national_identifier is not null:'||l_proc,15 );
1329       hr_ni_chk_pkg.check_ni_unique(p_national_identifier => p_national_identifier
1330                                    ,p_person_id => p_person_id
1331                                    ,p_business_group_id => p_business_group_id
1332                                    ,p_raise_error_or_warning => l_warning_or_error);
1333 
1334 
1335   l_warning := hr_utility.check_warning();
1336    if l_warning then
1337     hr_utility.set_location('if l_warning:'||l_proc,20);
1338     p_ni_duplicate_warn_or_err := 'WARNING';
1339    else
1340     hr_utility.set_location('else part of if l_warning:'||l_proc,25);
1341     p_ni_duplicate_warn_or_err := 'NONE';
1342    end if;
1343   end if;
1344 
1345   hr_utility.set_location('Exiting:'||l_proc, 30);
1346    exception
1347    when others then
1348    hr_utility.set_location('Exception:'||l_proc,555);
1349   if not l_warning then
1350     p_ni_duplicate_warn_or_err := 'ERROR';
1351     raise;
1352   end if;
1353 
1354   end check_ni_unique;
1355 --
1356 --
1357 --
1358 
1359 --
1360 -- 99999
1361 -- In update_person of hrperwrs.pkb p_login_person_id,
1362 -- p_process_section_name, p_action_type, p_review_page_region_code
1363 -- are there what is the significance of it.
1364 --
1365 -- 99999
1366 -- Write something similar to hr_process_person_ss.is_rec_changed
1367 -- validate_basic_details,
1368 -- 99999
1369 -- Include the following code in update_contact_relationship
1370 -- --
1371 --  l_count := l_count + 1;
1372 --  l_transaction_table(l_count).param_name := 'P_PROCESS_SECTION_NAME';
1373 --  l_transaction_table(l_count).param_value := p_process_section_name;
1374  -- l_transaction_table(l_count).param_data_type := 'VARCHAR2';
1375 --  l_count := l_count + 1;
1376 --  l_transaction_table(l_count).param_name := 'P_ACTION_TYPE';
1377 --  l_transaction_table(l_count).param_value := p_action_type;
1378 --  l_transaction_table(l_count).param_data_type := 'VARCHAR2';
1379 --
1380 --9999
1381 -- Put the errors like :
1382 --   WHEN g_data_error THEN
1383 --    hr_utility.raise_error;
1384 --
1385 --  WHEN g_no_changes THEN
1386 --    hr_utility.set_message(800, 'HR_PERINFO_NO_CHANGES');
1387 --    hr_utility.raise_error;
1388 --
1389 --  WHEN others THEN
1390 --    hr_utility.raise_error;
1391 -- 9999
1392 --
1393   /*
1394   ||===========================================================================
1395   || PROCEDURE: update_contact_relationship
1396   ||---------------------------------------------------------------------------
1397   ||
1398   || Description:
1399   || Description:
1400   ||     This procedure will call the actual API -
1401   ||                hr_contact_rel_api.update_contact_relationship()
1402   ||
1403   || Pre Conditions:
1404   ||
1405   || In Arguments:
1406   ||     Contains entire list of parameters that are defined in the actual
1407   ||     API. For details see peaddapi.pkb file.
1408   ||
1409   || out nocopy Arguments:
1410   ||
1411   || In out nocopy Arguments:
1412   ||
1413   || Post Success:
1414   ||     Executes the API call.
1415   ||
1416   || Post Failure:
1417   ||     Raises an exception
1418   ||
1419   || Access Status:
1420   ||     Public.
1421   ||
1422   ||===========================================================================
1423   */
1424 
1425 PROCEDURE update_contact_relationship
1426   (p_validate                      in        varchar2  default 'Y'
1427   ,p_cont_effective_date           in        date
1428   ,p_contact_relationship_id       in        number
1429   ,p_contact_type                  in        varchar2  default hr_api.g_varchar2
1430   ,p_ctr_comments                  in        long      default hr_api.g_varchar2
1431   ,p_primary_contact_flag          in        varchar2  default hr_api.g_varchar2
1432   ,p_third_party_pay_flag          in        varchar2  default hr_api.g_varchar2
1433   ,p_bondholder_flag               in        varchar2  default hr_api.g_varchar2
1434   ,p_date_start                    in        date      default hr_api.g_date
1435   ,p_start_life_reason_id          in        number    default hr_api.g_number
1436   ,p_date_end                      in        date      default hr_api.g_date
1437   ,p_end_life_reason_id            in        number    default hr_api.g_number
1438   ,p_rltd_per_rsds_w_dsgntr_flag   in        varchar2  default hr_api.g_varchar2
1439   ,p_personal_flag                 in        varchar2  default hr_api.g_varchar2
1440   ,p_sequence_number               in        number    default hr_api.g_number
1441   ,p_dependent_flag                in        varchar2  default hr_api.g_varchar2
1442   ,p_beneficiary_flag              in        varchar2  default hr_api.g_varchar2
1443   ,p_cont_attribute_category       in        varchar2  default hr_api.g_varchar2
1444   ,p_cont_attribute1               in        varchar2  default hr_api.g_varchar2
1445   ,p_cont_attribute2               in        varchar2  default hr_api.g_varchar2
1446   ,p_cont_attribute3               in        varchar2  default hr_api.g_varchar2
1447   ,p_cont_attribute4               in        varchar2  default hr_api.g_varchar2
1448   ,p_cont_attribute5               in        varchar2  default hr_api.g_varchar2
1449   ,p_cont_attribute6               in        varchar2  default hr_api.g_varchar2
1450   ,p_cont_attribute7               in        varchar2  default hr_api.g_varchar2
1451   ,p_cont_attribute8               in        varchar2  default hr_api.g_varchar2
1452   ,p_cont_attribute9               in        varchar2  default hr_api.g_varchar2
1453   ,p_cont_attribute10              in        varchar2  default hr_api.g_varchar2
1454   ,p_cont_attribute11              in        varchar2  default hr_api.g_varchar2
1455   ,p_cont_attribute12              in        varchar2  default hr_api.g_varchar2
1456   ,p_cont_attribute13              in        varchar2  default hr_api.g_varchar2
1457   ,p_cont_attribute14              in        varchar2  default hr_api.g_varchar2
1458   ,p_cont_attribute15              in        varchar2  default hr_api.g_varchar2
1459   ,p_cont_attribute16              in        varchar2  default hr_api.g_varchar2
1460   ,p_cont_attribute17              in        varchar2  default hr_api.g_varchar2
1461   ,p_cont_attribute18              in        varchar2  default hr_api.g_varchar2
1462   ,p_cont_attribute19              in        varchar2  default hr_api.g_varchar2
1463   ,p_cont_attribute20              in        varchar2  default hr_api.g_varchar2
1464   ,p_person_id                     in        number
1465   ,p_login_person_id               in        number    default hr_api.g_number
1466   ,p_cont_object_version_number    in out nocopy    number
1467   ,p_item_type                     in        varchar2
1468   ,p_item_key                      in        varchar2
1469   ,p_activity_id                   in        number
1470   ,p_action                        in        varchar2 -- this is p_action_type
1471   ,p_process_section_name          in        varchar2
1472   ,p_review_page_region_code       in        varchar2 default hr_api.g_varchar2
1473 
1474   -- Update_person parameters
1475 
1476   ,p_per_effective_date           in      date
1477   ,p_datetrack_update_mode        in      varchar2
1478   ,p_cont_person_id               in      number
1479   ,p_per_object_version_number    in out nocopy  number
1480   ,p_person_type_id               in      number   default hr_api.g_number
1481   ,p_last_name                    in      varchar2 default hr_api.g_varchar2
1482   ,p_applicant_number             in      varchar2 default hr_api.g_varchar2
1483   ,p_per_comments                 in      varchar2 default hr_api.g_varchar2
1484   ,p_date_employee_data_verified  in      date     default hr_api.g_date
1485   ,p_date_of_birth                in      date     default hr_api.g_date
1486   ,p_email_address                in      varchar2 default hr_api.g_varchar2
1487   ,p_employee_number              in out nocopy  varchar2
1488   ,p_expense_check_send_to_addres in      varchar2 default hr_api.g_varchar2
1489   ,p_first_name                   in      varchar2 default hr_api.g_varchar2
1490   ,p_known_as                     in      varchar2 default hr_api.g_varchar2
1491   ,p_marital_status               in      varchar2 default hr_api.g_varchar2
1492   ,p_middle_names                 in      varchar2 default hr_api.g_varchar2
1493   ,p_nationality                  in      varchar2 default hr_api.g_varchar2
1494   ,p_national_identifier          in      varchar2 default hr_api.g_varchar2
1495   ,p_previous_last_name           in      varchar2 default hr_api.g_varchar2
1496   ,p_registered_disabled_flag     in      varchar2 default hr_api.g_varchar2
1497   ,p_sex                          in      varchar2 default hr_api.g_varchar2
1498   ,p_title                        in      varchar2 default hr_api.g_varchar2
1499   ,p_vendor_id                    in      number   default hr_api.g_number
1500   ,p_work_telephone               in      varchar2 default hr_api.g_varchar2
1501   ,p_attribute_category           in      varchar2 default hr_api.g_varchar2
1502   ,p_attribute1                   in      varchar2 default hr_api.g_varchar2
1503   ,p_attribute2                   in      varchar2 default hr_api.g_varchar2
1504   ,p_attribute3                   in      varchar2 default hr_api.g_varchar2
1505   ,p_attribute4                   in      varchar2 default hr_api.g_varchar2
1506   ,p_attribute5                   in      varchar2 default hr_api.g_varchar2
1507   ,p_attribute6                   in      varchar2 default hr_api.g_varchar2
1508   ,p_attribute7                   in      varchar2 default hr_api.g_varchar2
1509   ,p_attribute8                   in      varchar2 default hr_api.g_varchar2
1510   ,p_attribute9                   in      varchar2 default hr_api.g_varchar2
1511   ,p_attribute10                  in      varchar2 default hr_api.g_varchar2
1512   ,p_attribute11                  in      varchar2 default hr_api.g_varchar2
1513   ,p_attribute12                  in      varchar2 default hr_api.g_varchar2
1514   ,p_attribute13                  in      varchar2 default hr_api.g_varchar2
1515   ,p_attribute14                  in      varchar2 default hr_api.g_varchar2
1516   ,p_attribute15                  in      varchar2 default hr_api.g_varchar2
1517   ,p_attribute16                  in      varchar2 default hr_api.g_varchar2
1518   ,p_attribute17                  in      varchar2 default hr_api.g_varchar2
1519   ,p_attribute18                  in      varchar2 default hr_api.g_varchar2
1520   ,p_attribute19                  in      varchar2 default hr_api.g_varchar2
1521   ,p_attribute20                  in      varchar2 default hr_api.g_varchar2
1522   ,p_attribute21                  in      varchar2 default hr_api.g_varchar2
1523   ,p_attribute22                  in      varchar2 default hr_api.g_varchar2
1524   ,p_attribute23                  in      varchar2 default hr_api.g_varchar2
1525   ,p_attribute24                  in      varchar2 default hr_api.g_varchar2
1526   ,p_attribute25                  in      varchar2 default hr_api.g_varchar2
1527   ,p_attribute26                  in      varchar2 default hr_api.g_varchar2
1528   ,p_attribute27                  in      varchar2 default hr_api.g_varchar2
1529   ,p_attribute28                  in      varchar2 default hr_api.g_varchar2
1530   ,p_attribute29                  in      varchar2 default hr_api.g_varchar2
1531   ,p_attribute30                  in      varchar2 default hr_api.g_varchar2
1532   ,p_per_information_category     in      varchar2 default hr_api.g_varchar2
1533   ,p_per_information1             in      varchar2 default hr_api.g_varchar2
1534   ,p_per_information2             in      varchar2 default hr_api.g_varchar2
1535   ,p_per_information3             in      varchar2 default hr_api.g_varchar2
1536   ,p_per_information4             in      varchar2 default hr_api.g_varchar2
1537   ,p_per_information5             in      varchar2 default hr_api.g_varchar2
1538   ,p_per_information6             in      varchar2 default hr_api.g_varchar2
1539   ,p_per_information7             in      varchar2 default hr_api.g_varchar2
1540   ,p_per_information8             in      varchar2 default hr_api.g_varchar2
1541   ,p_per_information9             in      varchar2 default hr_api.g_varchar2
1542   ,p_per_information10            in      varchar2 default hr_api.g_varchar2
1543   ,p_per_information11            in      varchar2 default hr_api.g_varchar2
1544   ,p_per_information12            in      varchar2 default hr_api.g_varchar2
1545   ,p_per_information13            in      varchar2 default hr_api.g_varchar2
1546   ,p_per_information14            in      varchar2 default hr_api.g_varchar2
1547   ,p_per_information15            in      varchar2 default hr_api.g_varchar2
1548   ,p_per_information16            in      varchar2 default hr_api.g_varchar2
1549   ,p_per_information17            in      varchar2 default hr_api.g_varchar2
1550   ,p_per_information18            in      varchar2 default hr_api.g_varchar2
1551   ,p_per_information19            in      varchar2 default hr_api.g_varchar2
1552   ,p_per_information20            in      varchar2 default hr_api.g_varchar2
1553   ,p_per_information21            in      varchar2 default hr_api.g_varchar2
1554   ,p_per_information22            in      varchar2 default hr_api.g_varchar2
1555   ,p_per_information23            in      varchar2 default hr_api.g_varchar2
1556   ,p_per_information24            in      varchar2 default hr_api.g_varchar2
1557   ,p_per_information25            in      varchar2 default hr_api.g_varchar2
1558   ,p_per_information26            in      varchar2 default hr_api.g_varchar2
1559   ,p_per_information27            in      varchar2 default hr_api.g_varchar2
1560   ,p_per_information28            in      varchar2 default hr_api.g_varchar2
1561   ,p_per_information29            in      varchar2 default hr_api.g_varchar2
1562   ,p_per_information30            in      varchar2 default hr_api.g_varchar2
1563   ,p_date_of_death                in      date     default hr_api.g_date
1564   ,p_background_check_status      in      varchar2 default hr_api.g_varchar2
1565   ,p_background_date_check        in      date     default hr_api.g_date
1566   ,p_blood_type                   in      varchar2 default hr_api.g_varchar2
1567   ,p_correspondence_language      in      varchar2 default hr_api.g_varchar2
1568   ,p_fast_path_employee           in      varchar2 default hr_api.g_varchar2
1569   ,p_fte_capacity                 in      number   default hr_api.g_number
1570   ,p_hold_applicant_date_until    in      date     default hr_api.g_date
1571   ,p_honors                       in      varchar2 default hr_api.g_varchar2
1572   ,p_internal_location            in      varchar2 default hr_api.g_varchar2
1573   ,p_last_medical_test_by         in      varchar2 default hr_api.g_varchar2
1574   ,p_last_medical_test_date       in      date     default hr_api.g_date
1575   ,p_mailstop                     in      varchar2 default hr_api.g_varchar2
1576   ,p_office_number                in      varchar2 default hr_api.g_varchar2
1577   ,p_on_military_service          in      varchar2 default hr_api.g_varchar2
1578   ,p_pre_name_adjunct             in      varchar2 default hr_api.g_varchar2
1579   ,p_projected_start_date         in      date     default hr_api.g_date
1580   ,p_rehire_authorizor            in      varchar2 default hr_api.g_varchar2
1581   ,p_rehire_recommendation        in      varchar2 default hr_api.g_varchar2
1582   ,p_resume_exists                in      varchar2 default hr_api.g_varchar2
1583   ,p_resume_last_updated          in      date     default hr_api.g_date
1584   ,p_second_passport_exists       in      varchar2 default hr_api.g_varchar2
1585   ,p_student_status               in      varchar2 default hr_api.g_varchar2
1586   ,p_work_schedule                in      varchar2 default hr_api.g_varchar2
1587   ,p_rehire_reason                in      varchar2 default hr_api.g_varchar2
1588   ,p_suffix                       in      varchar2 default hr_api.g_varchar2
1589   ,p_benefit_group_id             in      number   default hr_api.g_number
1590   ,p_receipt_of_death_cert_date   in      date     default hr_api.g_date
1591   ,p_coord_ben_med_pln_no         in      varchar2 default hr_api.g_varchar2
1592   ,p_coord_ben_no_cvg_flag        in      varchar2 default hr_api.g_varchar2
1593   ,p_uses_tobacco_flag            in      varchar2 default hr_api.g_varchar2
1594   ,p_dpdnt_adoption_date          in      date     default hr_api.g_date
1595   ,p_dpdnt_vlntry_svce_flag       in      varchar2 default hr_api.g_varchar2
1596   ,p_original_date_of_hire        in      date     default hr_api.g_date
1597   ,p_adjusted_svc_date            in      date     default hr_api.g_date
1598   ,p_town_of_birth                in      varchar2 default hr_api.g_varchar2
1599   ,p_region_of_birth              in      varchar2 default hr_api.g_varchar2
1600   ,p_country_of_birth             in      varchar2 default hr_api.g_varchar2
1601   ,p_global_person_id             in      varchar2 default hr_api.g_varchar2
1602   ,p_business_group_id            in      number   default hr_api.g_number
1603   ,p_contact_operation            in      varchar2 default hr_api.g_varchar2
1604   ,p_emrg_cont_flag               in      varchar2 default hr_api.g_varchar2
1605   ,p_dpdnt_bnf_flag               in      varchar2 default hr_api.g_varchar2
1606   ,p_save_mode                    in      varchar2 default null
1607   ,P_CONT_INFORMATION_CATEGORY    in        varchar2    default hr_api.g_varchar2
1608   ,P_CONT_INFORMATION1            in        varchar2    default hr_api.g_varchar2
1609   ,P_CONT_INFORMATION2            in        varchar2    default hr_api.g_varchar2
1610   ,P_CONT_INFORMATION3            in        varchar2    default hr_api.g_varchar2
1611   ,P_CONT_INFORMATION4            in        varchar2    default hr_api.g_varchar2
1612   ,P_CONT_INFORMATION5            in        varchar2    default hr_api.g_varchar2
1613   ,P_CONT_INFORMATION6            in        varchar2    default hr_api.g_varchar2
1614   ,P_CONT_INFORMATION7            in        varchar2    default hr_api.g_varchar2
1615   ,P_CONT_INFORMATION8            in        varchar2    default hr_api.g_varchar2
1616   ,P_CONT_INFORMATION9            in        varchar2    default hr_api.g_varchar2
1617   ,P_CONT_INFORMATION10           in        varchar2    default hr_api.g_varchar2
1618   ,P_CONT_INFORMATION11           in        varchar2    default hr_api.g_varchar2
1619   ,P_CONT_INFORMATION12           in        varchar2    default hr_api.g_varchar2
1620   ,P_CONT_INFORMATION13           in        varchar2    default hr_api.g_varchar2
1621   ,P_CONT_INFORMATION14           in        varchar2    default hr_api.g_varchar2
1622   ,P_CONT_INFORMATION15           in        varchar2    default hr_api.g_varchar2
1623   ,P_CONT_INFORMATION16           in        varchar2    default hr_api.g_varchar2
1624   ,P_CONT_INFORMATION17           in        varchar2    default hr_api.g_varchar2
1625   ,P_CONT_INFORMATION18           in        varchar2    default hr_api.g_varchar2
1626   ,P_CONT_INFORMATION19           in        varchar2    default hr_api.g_varchar2
1627   ,P_CONT_INFORMATION20           in        varchar2    default hr_api.g_varchar2
1628   ,p_effective_start_date         out nocopy     date
1629   ,p_effective_end_date           out nocopy     date
1630   ,p_full_name                    out nocopy     varchar2
1631   ,p_comment_id                   out nocopy     number
1632   ,p_name_combination_warning     out nocopy     varchar2
1633   ,p_assign_payroll_warning       out nocopy     varchar2
1634   ,p_orig_hire_warning            out nocopy     varchar2
1635   ,p_ni_duplicate_warn_or_err   out nocopy     varchar2
1636   ,p_orig_rel_type                in varchar2      default null
1637 
1638  ) IS
1639 
1640    cursor get_emrg_primary_cont_flag(p_contact_relationship_id     number
1641                             ,p_contact_person_id           number
1642                             ,p_person_id number)
1643    is
1644    select primary_contact_flag --'N'
1645    from PER_CONTACT_RELATIONSHIPS
1646    where person_id = p_person_id
1647    and contact_person_id = p_contact_person_id
1648    and contact_type = 'EMRG'
1649    and trunc(sysdate) >= decode(date_start,null,trunc(sysdate),trunc(date_start))
1650    and trunc(sysdate) <  decode(date_end,null,trunc(sysdate)+1,trunc(date_end)) ;
1651 --   and primary_contact_flag = 'Y';
1652       --
1653       l_transaction_table            hr_transaction_ss.transaction_table;
1654       l_transaction_step_id          hr_api_transaction_steps.transaction_step_id%type;
1655       l_trs_object_version_number    hr_api_transaction_steps.object_version_number%type;
1656       l_cont_old_ovn                 number ;
1657       l_per_old_ovn                  number;
1658       l_old_contact_relationship_id  number;
1659       l_employee_number              per_all_people_f.employee_number%type ;
1660       l_count                        INTEGER := 0;
1661       l_attribute_update_mode        varchar2(100) default  null;
1662       l_validate                     boolean  default false;
1663       l_basic_details_changed        boolean default null;
1664       l_per_name_combination_warning VARCHAR2(100) default null;
1665       l_per_assign_payroll_warning   VARCHAR2(100) default null;
1666       l_per_orig_hire_warning        VARCHAR2(100) default null;
1667       l_per_details_changed          boolean default null;
1668       l_vendor_id                     number default null;
1669       l_sequence_number               number default null;
1670       l_benefit_group_id              number default null;
1671       l_fte_capacity                  number default null;
1672       l_result                     varchar2(100) default null;
1673       l_transaction_id             number default null;
1674       --
1675       l_effective_start_date             date default null;
1676       l_effective_end_date               date default null;
1677       l_per_ovn                          number default null;
1678       l_full_name                        per_all_people_f.full_name%type default null;
1679       l_comment_id                       number default null;
1680       l_name_combination_warning         boolean default null ;
1681       l_assign_payroll_warning           boolean default null ;
1682       l_orig_hire_warning                boolean default null ;
1683       -- StartRegistration
1684       l_contact_set                       number;
1685       -- EndRegistration
1686       l_start_life_reason_id              number := null;
1687       l_end_life_reason_id                number := null;
1688       l_contact_relationship_id           number := null;
1689       l_person_type_id                    number := null;
1690       -- Bug 2315163
1691       l_is_emergency_contact              varchar2(50) default null ;
1692       l_is_dpdnt_bnf                      varchar2(50) default null;
1693       l_emrg_primary_cont_flag            varchar2(30) default 'N';
1694 
1695       l_date_start                        date := p_date_start;
1696       l_proc   varchar2(72)  := g_package||'update_contact_relationship';
1697 
1698   --
1699  BEGIN
1700   --
1701   hr_utility.set_location('Entering hr_contact_rel_api.update_contact_relationship', 5);
1702   --
1703   IF upper(p_action) = g_change
1704   THEN
1705      l_attribute_update_mode := g_attribute_update;
1706   ELSE
1707      IF upper(p_action) = g_correct
1708      THEN
1709         l_attribute_update_mode := g_attribute_correct;
1710      END IF;
1711   END IF;
1712 
1713   hr_utility.set_location('l_attribute_update_mode=' ||
1714                           l_attribute_update_mode, 10);
1715 
1716  -- Bug no:2263008 fix begins
1717 
1718    check_ni_unique(
1719      p_national_identifier => p_national_identifier
1720      ,p_business_group_id => p_business_group_id
1721      ,p_person_id => p_cont_person_id
1722      ,p_ni_duplicate_warn_or_err => p_ni_duplicate_warn_or_err);
1723 
1724    --Bug no:2263008 fix ends.
1725 
1726   l_cont_old_ovn := p_cont_object_version_number;
1727   l_old_contact_relationship_id := p_contact_relationship_id;
1728   l_per_old_ovn  := p_per_object_version_number;
1729   l_employee_number := p_employee_number ;
1730   --
1731   -- We will always save to transaction table regardless of whether the update is
1732   -- for approval or not.  Therefore, the validate_mode for calling the person
1733   -- api should always be set to true.
1734   --
1735   l_start_life_reason_id  := p_start_life_reason_id;
1736   if  p_start_life_reason_id <=0 then
1737       l_start_life_reason_id  := null;
1738   end if;
1739 
1740   l_end_life_reason_id      := p_end_life_reason_id;
1741   if p_end_life_reason_id   <= 0 then
1742      l_end_life_reason_id      := null;
1743   end if;
1744 
1745   l_contact_relationship_id := p_contact_relationship_id;
1746   if p_contact_relationship_id  <= 0 then
1747      l_contact_relationship_id   := null;
1748   end if;
1749 /*
1750   l_sequence_number  := p_sequence_number;
1751   if p_sequence_number  <= 0 then
1752      l_sequence_number  := null;
1753   end if;
1754 */
1755 
1756   l_person_type_id :=  p_person_type_id ;
1757   if p_person_type_id <= 0 then
1758      l_person_type_id  := null;
1759   end if;
1760 
1761    IF p_validate = 'N' OR p_validate IS NULL
1762    THEN
1763       l_validate := false;
1764    ELSE
1765       l_validate := true;
1766    END IF;
1767 
1768   SAVEPOINT  before_entering_into_update ;
1769 
1770   hr_utility.set_location('Before calling is_rec_changed', 15);
1771   --
1772   l_sequence_number  := p_sequence_number;
1773   --
1774   IF p_sequence_number <= 0
1775   THEN
1776      l_sequence_number := null;
1777   ELSE
1778      l_sequence_number := p_vendor_id;
1779   END IF;
1780   --
1781   if p_contact_operation not in ( 'EMER_CR_NEW_REL', 'DPDNT_CR_NEW_REL') Then
1782     --
1783     -- Check if the record has changed
1784     --
1785 -- Bug 3469145 : Not passing p_primary_contact_flag value as it contains data respective to
1786 -- the Emergency relationship and here all the data belong to the other relationship.
1787 
1788    l_basic_details_changed := hr_process_contact_ss.is_rec_changed(
1789     p_effective_date            =>  p_cont_effective_date
1790    ,p_contact_relationship_id   =>  l_contact_relationship_id
1791    ,p_contact_type      	=>  p_contact_type
1792    ,p_comments      		=>  p_ctr_comments
1793 --   ,p_primary_contact_flag      =>  p_primary_contact_flag
1794    ,p_third_party_pay_flag      =>  p_third_party_pay_flag
1795    ,p_bondholder_flag      	=>  p_bondholder_flag
1796    ,p_date_start      		=>  p_date_start
1797    ,p_start_life_reason_id      =>  l_start_life_reason_id
1798    ,p_date_end      		=>  p_date_end
1799    ,p_end_life_reason_id      	=>  l_end_life_reason_id
1800    ,p_rltd_per_rsds_w_dsgntr_flag      =>  p_rltd_per_rsds_w_dsgntr_flag
1801    ,p_personal_flag         =>  p_personal_flag
1802 --   ,p_sequence_number       =>  l_sequence_number
1803    ,p_dependent_flag        =>  p_dependent_flag
1804    ,p_beneficiary_flag      =>  p_beneficiary_flag
1805    ,p_cont_attribute_category      =>  p_cont_attribute_category
1806    ,p_cont_attribute1       =>  p_cont_attribute1
1807    ,p_cont_attribute2       =>  p_cont_attribute2
1808    ,p_cont_attribute3       =>  p_cont_attribute3
1809    ,p_cont_attribute4       =>  p_cont_attribute4
1810    ,p_cont_attribute5       =>  p_cont_attribute5
1811    ,p_cont_attribute6       =>  p_cont_attribute6
1812    ,p_cont_attribute7       =>  p_cont_attribute7
1813    ,p_cont_attribute8       =>  p_cont_attribute8
1814    ,p_cont_attribute9       =>  p_cont_attribute9
1815    ,p_cont_attribute10      =>  p_cont_attribute10
1816    ,p_cont_attribute11      =>  p_cont_attribute11
1817    ,p_cont_attribute12      =>  p_cont_attribute12
1818    ,p_cont_attribute13      =>  p_cont_attribute13
1819    ,p_cont_attribute14      =>  p_cont_attribute14
1820    ,p_cont_attribute15      =>  p_cont_attribute15
1821    ,p_cont_attribute16      =>  p_cont_attribute16
1822    ,p_cont_attribute17      =>  p_cont_attribute17
1823    ,p_cont_attribute18      =>  p_cont_attribute18
1824    ,p_cont_attribute19      =>  p_cont_attribute19
1825    ,p_cont_attribute20      =>  p_cont_attribute20
1826    ,P_CONT_INFORMATION_CATEGORY => P_CONT_INFORMATION_CATEGORY
1827    ,P_CONT_INFORMATION1     => P_CONT_INFORMATION1
1828    ,P_CONT_INFORMATION2     => P_CONT_INFORMATION2
1829    ,P_CONT_INFORMATION3     => P_CONT_INFORMATION3
1830    ,P_CONT_INFORMATION4     => P_CONT_INFORMATION4
1831    ,P_CONT_INFORMATION5     => P_CONT_INFORMATION5
1832    ,P_CONT_INFORMATION6     => P_CONT_INFORMATION6
1833    ,P_CONT_INFORMATION7     => P_CONT_INFORMATION7
1834    ,P_CONT_INFORMATION8     => P_CONT_INFORMATION8
1835    ,P_CONT_INFORMATION9     => P_CONT_INFORMATION9
1836    ,P_CONT_INFORMATION10    => P_CONT_INFORMATION10
1837    ,P_CONT_INFORMATION11    => P_CONT_INFORMATION11
1838    ,P_CONT_INFORMATION12    => P_CONT_INFORMATION12
1839    ,P_CONT_INFORMATION13    => P_CONT_INFORMATION13
1840    ,P_CONT_INFORMATION14    => P_CONT_INFORMATION14
1841    ,P_CONT_INFORMATION15    => P_CONT_INFORMATION15
1842    ,P_CONT_INFORMATION16    => P_CONT_INFORMATION16
1843    ,P_CONT_INFORMATION17    => P_CONT_INFORMATION17
1844    ,P_CONT_INFORMATION18    => P_CONT_INFORMATION18
1845    ,P_CONT_INFORMATION19    => P_CONT_INFORMATION19
1846    ,P_CONT_INFORMATION20    => P_CONT_INFORMATION20
1847    ,p_object_version_number =>  p_cont_object_version_number
1848    );
1849    --
1850   else
1851    --
1852    l_basic_details_changed := true;
1853    --
1854   end if;
1855 
1856 -- Bug 3504216  : Checking if primary cont flag has changed or not.
1857 -- If primary contact flag has changed then setting l_basic_details_changed as true.
1858 -- Primary flag checkbox is availaible only in Emergency Contact.So checking for
1859 -- change in primary contact only when in Emerg Update.
1860 
1861 if p_contact_operation in ('EMRG_OVRW_UPD') then
1862     hr_utility.set_location('if p_contact_operation in EMRG_OVRW_UPD:'||l_proc,20);
1863     open get_emrg_primary_cont_flag(l_contact_relationship_id,
1864                                     p_cont_person_id,
1865                                     p_person_id);
1866     fetch get_emrg_primary_cont_flag into l_emrg_primary_cont_flag;
1867     if nvl(l_emrg_primary_cont_flag,'N') <> nvl(p_primary_contact_flag,'N') then
1868        l_basic_details_changed := true;
1869        validate_primary_cont_flag(
1870          p_contact_relationship_id => l_contact_relationship_id
1871         ,p_primary_contact_flag    => p_primary_contact_flag
1872         ,p_date_start              => sysdate
1873         ,p_contact_person_id       => p_cont_person_id
1874         ,p_object_version_number   => p_cont_object_version_number);
1875     end if;
1876     close get_emrg_primary_cont_flag;
1877 end if;
1878 
1879   IF l_basic_details_changed and
1880      p_contact_operation not in ( 'EMER_CR_NEW_REL', 'DPDNT_CR_NEW_REL') and
1881      nvl(p_save_mode, 'NVL') <> 'SAVE_FOR_LATER'
1882   THEN
1883 
1884     -- Call the actual API.
1885     --
1886     hr_utility.set_location('Calling hr_contact_rel_api.update_contact_relationship', 25);
1887     --
1888     if (nvl(p_rltd_per_rsds_w_dsgntr_flag , 'N') = 'Y') then
1889        --
1890        p_del_cont_primary_addr
1891        (p_contact_relationship_id          => p_contact_relationship_id);
1892        --
1893     end if;
1894 
1895     l_emrg_primary_cont_flag := p_primary_contact_flag;
1896 
1897     -- if primary contact flag already exists for the emergeny relationship
1898     -- then do not update again
1899 
1900  /*   open get_emrg_primary_cont_flag(l_contact_relationship_id,
1901                                     p_cont_person_id,
1902                                     p_person_id);
1903     fetch get_emrg_primary_cont_flag into l_emrg_primary_cont_flag;
1904     if get_emrg_primary_cont_flag%notfound then
1905        l_emrg_primary_cont_flag := p_primary_contact_flag;
1906     end if;
1907     close get_emrg_primary_cont_flag; */
1908 -- Bug 3306000 :
1909 
1910 validate_rel_start_date (
1911    p_person_id         => p_person_id
1912   ,p_item_key          => p_item_key
1913   ,p_save_mode         => p_save_mode
1914   ,p_date_start        => l_date_start
1915   ,p_date_of_birth     => p_date_of_birth );
1916 
1917     --
1918     hr_contact_rel_api.update_contact_relationship(
1919         p_validate                          => l_validate
1920        ,p_effective_date                    => p_cont_effective_date
1921        ,p_contact_relationship_id           => l_contact_relationship_id
1922        ,p_contact_type                      => p_contact_type
1923        ,p_comments                          => p_ctr_comments
1924 --       ,p_primary_contact_flag              => l_emrg_primary_cont_flag
1925        ,p_third_party_pay_flag              => p_third_party_pay_flag
1926        ,p_bondholder_flag                   => p_bondholder_flag
1927        ,p_date_start                        => p_date_start
1928        ,p_start_life_reason_id              => l_start_life_reason_id
1929        ,p_date_end                          => p_date_end
1930        ,p_end_life_reason_id                => l_end_life_reason_id
1931        ,p_rltd_per_rsds_w_dsgntr_flag       => p_rltd_per_rsds_w_dsgntr_flag
1932        ,p_personal_flag                     => p_personal_flag
1933  --      ,p_sequence_number                   => l_sequence_number
1934        ,p_dependent_flag                    => p_dependent_flag
1935        ,p_beneficiary_flag                  => p_beneficiary_flag
1936        ,p_cont_attribute_category           => p_cont_attribute_category
1937        ,p_cont_attribute1                   => p_cont_attribute1
1938        ,p_cont_attribute2                   => p_cont_attribute2
1939        ,p_cont_attribute3                   => p_cont_attribute3
1940        ,p_cont_attribute4                   => p_cont_attribute4
1941        ,p_cont_attribute5                   => p_cont_attribute5
1942        ,p_cont_attribute6                   => p_cont_attribute6
1943        ,p_cont_attribute7                   => p_cont_attribute7
1944        ,p_cont_attribute8                   => p_cont_attribute8
1945        ,p_cont_attribute9                   => p_cont_attribute9
1946        ,p_cont_attribute10                  => p_cont_attribute10
1947        ,p_cont_attribute11                  => p_cont_attribute11
1948        ,p_cont_attribute12                  => p_cont_attribute12
1949        ,p_cont_attribute13                  => p_cont_attribute13
1950        ,p_cont_attribute14                  => p_cont_attribute14
1951        ,p_cont_attribute15                  => p_cont_attribute15
1952        ,p_cont_attribute16                  => p_cont_attribute16
1953        ,p_cont_attribute17                  => p_cont_attribute17
1954        ,p_cont_attribute18                  => p_cont_attribute18
1955        ,p_cont_attribute19                  => p_cont_attribute19
1956        ,p_cont_attribute20                  => p_cont_attribute20
1957        ,P_CONT_INFORMATION_CATEGORY         => P_CONT_INFORMATION_CATEGORY
1958        ,P_CONT_INFORMATION1                 => P_CONT_INFORMATION1
1959        ,P_CONT_INFORMATION2                 => P_CONT_INFORMATION2
1960        ,P_CONT_INFORMATION3                 => P_CONT_INFORMATION3
1961        ,P_CONT_INFORMATION4                 => P_CONT_INFORMATION4
1962        ,P_CONT_INFORMATION5                 => P_CONT_INFORMATION5
1963        ,P_CONT_INFORMATION6                 => P_CONT_INFORMATION6
1964        ,P_CONT_INFORMATION7                 => P_CONT_INFORMATION7
1965        ,P_CONT_INFORMATION8                 => P_CONT_INFORMATION8
1966        ,P_CONT_INFORMATION9                 => P_CONT_INFORMATION9
1967        ,P_CONT_INFORMATION10                => P_CONT_INFORMATION10
1968        ,P_CONT_INFORMATION11                => P_CONT_INFORMATION11
1969        ,P_CONT_INFORMATION12                => P_CONT_INFORMATION12
1970        ,P_CONT_INFORMATION13                => P_CONT_INFORMATION13
1971        ,P_CONT_INFORMATION14                => P_CONT_INFORMATION14
1972        ,P_CONT_INFORMATION15                => P_CONT_INFORMATION15
1973        ,P_CONT_INFORMATION16                => P_CONT_INFORMATION16
1974        ,P_CONT_INFORMATION17                => P_CONT_INFORMATION17
1975        ,P_CONT_INFORMATION18                => P_CONT_INFORMATION18
1976        ,P_CONT_INFORMATION19                => P_CONT_INFORMATION19
1977        ,P_CONT_INFORMATION20                => P_CONT_INFORMATION20
1978        ,p_object_version_number             => p_cont_object_version_number
1979     );
1980     --
1981     --
1982     --
1983     IF hr_errors_api.errorExists
1984     THEN
1985        hr_utility.set_location('api error exists hr_contact_rel_api.update_contact_relationship', 30);
1986        ROLLBACK  to before_entering_into_update ;
1987        raise g_data_error;
1988     END IF;
1989   --
1990   --
1991   ELSE
1992     --
1993     hr_utility.set_location('No changes found  hr_contact_rel_api.update_contact_relationship', 35);
1994     --
1995   END IF;
1996 
1997   IF p_vendor_id = 0
1998   THEN
1999      l_vendor_id := null;
2000   ELSE
2001      l_vendor_id := p_vendor_id;
2002   END IF;
2003   --
2004   IF p_benefit_group_id = 0
2005   THEN
2006      l_benefit_group_id := null;
2007   ELSE
2008      l_benefit_group_id := p_benefit_group_id;
2009   END IF;
2010   --
2011   IF p_fte_capacity = 0
2012   THEN
2013      l_fte_capacity := null;
2014   ELSE
2015      l_fte_capacity := p_fte_capacity;
2016   END IF;
2017   --
2018   l_per_details_changed := hr_process_person_ss.is_rec_changed
2019     (p_effective_date              => p_per_effective_date
2020     ,p_person_id                   => p_cont_person_id
2021     ,p_object_version_number       => p_per_object_version_number
2022     ,p_person_type_id              => l_person_type_id
2023     ,p_last_name                   => p_last_name
2024     ,p_applicant_number            => p_applicant_number
2025     ,p_comments                    => p_per_comments
2026     ,p_date_employee_data_verified => p_date_employee_data_verified
2027     ,p_original_date_of_hire       => p_original_date_of_hire
2028     ,p_date_of_birth               => p_date_of_birth
2029     ,p_town_of_birth               => p_town_of_birth
2030     ,p_region_of_birth             => p_region_of_birth
2031     ,p_country_of_birth            => p_country_of_birth
2032     ,p_global_person_id            => p_global_person_id
2033     ,p_email_address               => p_email_address
2034     ,p_employee_number             => p_employee_number
2035     ,p_expense_check_send_to_addres => p_expense_check_send_to_addres
2036     ,p_first_name                  => p_first_name
2037     ,p_known_as                    => p_known_as
2038     ,p_marital_status              => p_marital_status
2039     ,p_middle_names                => p_middle_names
2040     ,p_nationality                 => p_nationality
2041     ,p_national_identifier         => p_national_identifier
2042     ,p_previous_last_name          => p_previous_last_name
2043     ,p_registered_disabled_flag    => p_registered_disabled_flag
2044     ,p_sex                         => p_sex
2045     ,p_title                       => p_title
2046     ,p_vendor_id                   => l_vendor_id
2047     ,p_work_telephone              => p_work_telephone
2048     ,p_suffix                      => p_suffix
2049     ,p_date_of_death               => p_date_of_death
2050     ,p_background_check_status     => p_background_check_status
2051     ,p_background_date_check       => p_background_date_check
2052     ,p_blood_type                  => p_blood_type
2053     ,p_correspondence_language     => p_correspondence_language
2054     ,p_fast_path_employee          => p_fast_path_employee
2055     ,p_fte_capacity                => l_fte_capacity
2056     ,p_hold_applicant_date_until   => p_hold_applicant_date_until
2057     ,p_honors                      => p_honors
2058     ,p_internal_location           => p_internal_location
2059     ,p_last_medical_test_by        => p_last_medical_test_by
2060     ,p_last_medical_test_date      => p_last_medical_test_date
2061     ,p_mailstop                    => p_mailstop
2062     ,p_office_number               => p_office_number
2063     ,p_on_military_service         => p_on_military_service
2064     ,p_pre_name_adjunct            => p_pre_name_adjunct
2065     ,p_projected_start_date        => p_projected_start_date
2066     ,p_rehire_authorizor           => p_rehire_authorizor
2067     ,p_rehire_recommendation       => p_rehire_recommendation
2068     ,p_resume_exists               => p_resume_exists
2069     ,p_resume_last_updated         => p_resume_last_updated
2070     ,p_second_passport_exists      => p_second_passport_exists
2071     ,p_student_status              => p_student_status
2072     ,p_work_schedule               => p_work_schedule
2073     ,p_rehire_reason               => p_rehire_reason
2074     ,p_benefit_group_id            => l_benefit_group_id
2075     ,p_receipt_of_death_cert_date  => p_receipt_of_death_cert_date
2076     ,p_coord_ben_med_pln_no        => p_coord_ben_med_pln_no
2077     ,p_coord_ben_no_cvg_flag       => p_coord_ben_no_cvg_flag
2078     ,p_uses_tobacco_flag           => p_uses_tobacco_flag
2079     ,p_dpdnt_adoption_date         => p_dpdnt_adoption_date
2080     ,p_dpdnt_vlntry_svce_flag      => p_dpdnt_vlntry_svce_flag
2081 --  ,p_adjusted_svc_date           => p_adjusted_svc_date
2082     ,p_attribute_category          => p_attribute_category
2083     ,p_attribute1                  => p_attribute1
2084     ,p_attribute2                  => p_attribute2
2085     ,p_attribute3                  => p_attribute3
2086     ,p_attribute4                  => p_attribute4
2087     ,p_attribute5                  => p_attribute5
2088     ,p_attribute6                  => p_attribute6
2089     ,p_attribute7                  => p_attribute7
2090     ,p_attribute8                  => p_attribute8
2091     ,p_attribute9                  => p_attribute9
2092     ,p_attribute10                 => p_attribute10
2093     ,p_attribute11                 => p_attribute11
2094     ,p_attribute12                 => p_attribute12
2095     ,p_attribute13                 => p_attribute13
2096     ,p_attribute14                 => p_attribute14
2097     ,p_attribute15                 => p_attribute15
2098     ,p_attribute16                 => p_attribute16
2099     ,p_attribute17                 => p_attribute17
2100     ,p_attribute18                 => p_attribute18
2101     ,p_attribute19                 => p_attribute19
2102     ,p_attribute20                 => p_attribute20
2103     ,p_attribute21                 => p_attribute21
2104     ,p_attribute22                 => p_attribute22
2105     ,p_attribute23                 => p_attribute23
2106     ,p_attribute24                 => p_attribute24
2107     ,p_attribute25                 => p_attribute25
2108     ,p_attribute26                 => p_attribute26
2109     ,p_attribute27                 => p_attribute27
2110     ,p_attribute28                 => p_attribute28
2111     ,p_attribute29                 => p_attribute29
2112     ,p_attribute30                 => p_attribute30
2113     ,p_per_information_category    => p_per_information_category
2114     ,p_per_information1            => p_per_information1
2115     ,p_per_information2            => p_per_information2
2116     ,p_per_information3            => p_per_information3
2117     ,p_per_information4            => p_per_information4
2118     ,p_per_information5            => p_per_information5
2119     ,p_per_information6            => p_per_information6
2120     ,p_per_information7            => p_per_information7
2121     ,p_per_information8            => p_per_information8
2122     ,p_per_information9            => p_per_information9
2123     ,p_per_information10           => p_per_information10
2124     ,p_per_information11           => p_per_information11
2125     ,p_per_information12           => p_per_information12
2126     ,p_per_information13           => p_per_information13
2127     ,p_per_information14           => p_per_information14
2128     ,p_per_information15           => p_per_information15
2129     ,p_per_information16           => p_per_information16
2130     ,p_per_information17           => p_per_information17
2131     ,p_per_information18           => p_per_information18
2132     ,p_per_information19           => p_per_information19
2133     ,p_per_information20           => p_per_information20
2134     ,p_per_information21           => p_per_information21
2135     ,p_per_information22           => p_per_information22
2136     ,p_per_information23           => p_per_information23
2137     ,p_per_information24           => p_per_information24
2138     ,p_per_information25           => p_per_information25
2139     ,p_per_information26           => p_per_information26
2140     ,p_per_information27           => p_per_information27
2141     ,p_per_information28           => p_per_information28
2142     ,p_per_information29           => p_per_information29
2143     ,p_per_information30           => p_per_information30
2144     );
2145   --
2146   --
2147   IF  l_per_details_changed  and
2148       nvl(p_save_mode, 'NVL') <> 'SAVE_FOR_LATER'
2149   THEN
2150      --
2151      -- Call actual api itself.
2152      --
2153      l_per_ovn := p_per_object_version_number;
2154      l_employee_number := p_employee_number;
2155     --
2156     hr_person_api.update_person(
2157          p_validate                          => l_validate
2158          ,p_effective_date                   => p_per_effective_date
2159          ,p_datetrack_update_mode            => 'CORRECTION'
2160          ,p_person_id                        => p_cont_person_id
2161          ,p_object_version_number            => l_per_ovn -- p_per_object_version_number
2162          --,p_person_type_id                   => l_person_type_id
2163          ,p_last_name                        => p_last_name
2164          ,p_applicant_number                  => p_applicant_number
2165          ,p_comments                         => p_per_comments
2166          ,p_date_employee_data_verified      => p_date_employee_data_verified
2167          ,p_date_of_birth                    => p_date_of_birth
2168          ,p_email_address                    => p_email_address
2169          ,p_employee_number                  => l_employee_number
2170          ,p_expense_check_send_to_addres     => p_expense_check_send_to_addres
2171          ,p_first_name                       => p_first_name
2172          ,p_known_as                         => p_known_as
2173          ,p_marital_status                   => p_marital_status
2174          ,p_middle_names                     => p_middle_names
2175          ,p_nationality                      => p_nationality
2176          ,p_national_identifier              => p_national_identifier
2177          ,p_previous_last_name               => p_previous_last_name
2178          ,p_registered_disabled_flag         => p_registered_disabled_flag
2179          ,p_sex                              => p_sex
2180          ,p_title                            => p_title
2181          ,p_vendor_id                        => p_vendor_id
2182          ,p_work_telephone                   => p_work_telephone
2183          ,p_attribute_category               =>  p_attribute_category
2184          ,p_attribute1                       =>  p_attribute1
2185          ,p_attribute2                       =>  p_attribute2
2186          ,p_attribute3                       =>  p_attribute3
2187          ,p_attribute4                       =>  p_attribute4
2188          ,p_attribute5                       =>  p_attribute5
2189          ,p_attribute6                       =>  p_attribute6
2190          ,p_attribute7                       =>  p_attribute7
2191          ,p_attribute8                       =>  p_attribute8
2192          ,p_attribute9                       =>  p_attribute9
2193          ,p_attribute10                       =>  p_attribute10
2194          ,p_attribute11                       =>  p_attribute11
2195          ,p_attribute12                       =>  p_attribute12
2196          ,p_attribute13                       =>  p_attribute13
2197          ,p_attribute14                       =>  p_attribute14
2198          ,p_attribute15                       =>  p_attribute15
2199          ,p_attribute16                       =>  p_attribute16
2200          ,p_attribute17                       =>  p_attribute17
2201          ,p_attribute18                       =>  p_attribute18
2202          ,p_attribute19                       =>  p_attribute19
2203          ,p_attribute20                       =>  p_attribute20
2204          ,p_attribute21                       =>  p_attribute21
2205          ,p_attribute22                       =>  p_attribute22
2206          ,p_attribute23                       =>  p_attribute23
2207          ,p_attribute24                       =>  p_attribute24
2208          ,p_attribute25                       =>  p_attribute25
2209          ,p_attribute26                       =>  p_attribute26
2210          ,p_attribute27                       =>  p_attribute27
2211          ,p_attribute28                       =>  p_attribute28
2212          ,p_attribute29                       =>  p_attribute29
2213          ,p_attribute30                       =>  p_attribute30
2214          ,p_per_information_category          =>  p_per_information_category
2215          ,p_per_information1                  =>  p_per_information1
2216          ,p_per_information2                  =>  p_per_information2
2217          ,p_per_information3                  =>  p_per_information3
2218          ,p_per_information4                  =>  p_per_information4
2219          ,p_per_information5                  =>  p_per_information5
2220          ,p_per_information6                  =>  p_per_information6
2221          ,p_per_information7                  =>  p_per_information7
2222          ,p_per_information8                  =>  p_per_information8
2223          ,p_per_information9                  =>  p_per_information9
2224          ,p_per_information10                  =>  p_per_information10
2225          ,p_per_information11                  =>  p_per_information11
2226          ,p_per_information12                  =>  p_per_information12
2227          ,p_per_information13                  =>  p_per_information13
2228          ,p_per_information14                  =>  p_per_information14
2229          ,p_per_information15                  =>  p_per_information15
2230          ,p_per_information16                  =>  p_per_information16
2231          ,p_per_information17                  =>  p_per_information17
2232          ,p_per_information18                  =>  p_per_information18
2233          ,p_per_information19                  =>  p_per_information19
2234          ,p_per_information20                  =>  p_per_information20
2235          ,p_per_information21                  =>  p_per_information21
2236          ,p_per_information22                  =>  p_per_information22
2237          ,p_per_information23                  =>  p_per_information23
2238          ,p_per_information24                  =>  p_per_information24
2239          ,p_per_information25                  =>  p_per_information25
2240          ,p_per_information26                  =>  p_per_information26
2241          ,p_per_information27                  =>  p_per_information27
2242          ,p_per_information28                  =>  p_per_information28
2243          ,p_per_information29                  =>  p_per_information29
2244          ,p_per_information30                  =>  p_per_information30
2245          ,p_date_of_death                    => p_date_of_death
2246          ,p_background_check_status          => p_background_check_status
2247          ,p_background_date_check            => p_background_date_check
2248          ,p_blood_type                       => p_blood_type
2249          ,p_correspondence_language          => p_correspondence_language
2250          ,p_fast_path_employee               => p_fast_path_employee
2251          ,p_fte_capacity                     => p_fte_capacity
2252          ,p_hold_applicant_date_until        => p_hold_applicant_date_until
2253          ,p_honors                           => p_honors
2254          ,p_internal_location                => p_internal_location
2255          ,p_last_medical_test_by             => p_last_medical_test_by
2256          ,p_last_medical_test_date           => p_last_medical_test_date
2257          ,p_mailstop                         => p_mailstop
2258          ,p_office_number                    => p_office_number
2259          ,p_on_military_service              => p_on_military_service
2260          ,p_pre_name_adjunct                 => p_pre_name_adjunct
2261          ,p_projected_start_date             => p_projected_start_date
2262          ,p_rehire_authorizor                => p_rehire_authorizor
2263          ,p_rehire_recommendation            => p_rehire_recommendation
2264          ,p_resume_exists                    => p_resume_exists
2265          ,p_resume_last_updated              => p_resume_last_updated
2266          ,p_second_passport_exists           => p_second_passport_exists
2267          ,p_student_status                   => p_student_status
2268          ,p_work_schedule                    => p_work_schedule
2269          ,p_rehire_reason                    => p_rehire_reason
2270          ,p_suffix                           => p_suffix
2271          ,p_benefit_group_id                 => p_benefit_group_id
2272          ,p_receipt_of_death_cert_date       => p_receipt_of_death_cert_date
2273          ,p_coord_ben_med_pln_no             => p_coord_ben_med_pln_no
2274          ,p_coord_ben_no_cvg_flag            => p_coord_ben_no_cvg_flag
2275          ,p_uses_tobacco_flag                => p_uses_tobacco_flag
2276          ,p_dpdnt_adoption_date              => p_dpdnt_adoption_date
2277          ,p_dpdnt_vlntry_svce_flag           => p_dpdnt_vlntry_svce_flag
2278          ,p_original_date_of_hire            => p_original_date_of_hire
2279         --  ,p_adjusted_svc_date                => bb
2280          ,p_town_of_birth                    => p_town_of_birth
2281          ,p_region_of_birth                  => p_region_of_birth
2282          ,p_country_of_birth                 => p_country_of_birth
2283          ,p_global_person_id                 => p_global_person_id
2284          ,p_effective_start_date             =>  l_effective_start_date
2285          ,p_effective_end_date               =>  l_effective_end_date
2286          ,p_full_name                        =>  l_full_name
2287          ,p_comment_id                       =>  l_comment_id
2288          ,p_name_combination_warning         =>  l_name_combination_warning
2289          ,p_assign_payroll_warning           =>  l_assign_payroll_warning
2290          ,p_orig_hire_warning                =>  l_orig_hire_warning
2291   );
2292     --
2293     --
2294     IF hr_errors_api.errorExists
2295       THEN
2296          hr_utility.set_location('api error exists hr_process_person_ss.update_person', 40);
2297          ROLLBACK to  before_entering_into_update ;
2298          raise g_data_error;
2299     END IF;
2300   ELSE
2301     --
2302     hr_utility.set_location('No changes found in  hr_process_person_ss.update_person', 45);
2303     --
2304   END IF;
2305 
2306   ROLLBACK  to  before_entering_into_update ;
2307   --
2308   -- --------------------------------------------------------------------------
2309   -- We will write the data to transaction tables.
2310   -- Determine if a transaction step exists for this activity
2311   -- if a transaction step does exist then the transaction_step_id and
2312   -- object_version_number are set (i.e. not null).
2313   -- --------------------------------------------------------------------------
2314   --
2315   IF l_per_details_changed OR l_basic_details_changed
2316   THEN
2317     hr_utility.set_location('l_per_details_changed OR l_basic_details_changed', 50);
2318      -- First, check if transaction id exists or not
2319 
2320      l_transaction_id := hr_transaction_ss.get_transaction_id
2321                      (p_item_type   => p_item_type
2322                      ,p_item_key    => p_item_key);
2323      --
2324      --
2325      IF l_transaction_id is null THEN
2326     hr_utility.set_location('IF l_transaction_id is null THEN', 55);
2327         -- Start a Transaction
2328         hr_transaction_ss.start_transaction
2329            (itemtype   => p_item_type
2330            ,itemkey    => p_item_key
2331            ,actid      => p_activity_id
2332            ,funmode    => 'RUN'
2333            ,p_api_addtnl_info => p_contact_operation    --TEST
2334            ,p_login_person_id => nvl(p_login_person_id, p_person_id)
2335            ,result     => l_result);
2336 
2337         l_transaction_id := hr_transaction_ss.get_transaction_id
2338                         (p_item_type   => p_item_type
2339                         ,p_item_key    => p_item_key);
2340      END IF;
2341      --
2342      -- Create a transaction step
2343      --
2344      hr_transaction_api.create_transaction_step
2345         (p_validate              => false
2346         ,p_creator_person_id     => nvl(p_login_person_id, p_person_id)
2347         ,p_transaction_id        => l_transaction_id
2348         ,p_api_name              => g_package || '.PROCESS_API'
2349         ,p_item_type             => p_item_type
2350         ,p_item_key              => p_item_key
2351         ,p_activity_id           => p_activity_id
2352         ,p_transaction_step_id   => l_transaction_step_id
2353         ,p_object_version_number => l_trs_object_version_number);
2354 
2355      --
2356      hr_utility.set_location('l_transaction_step_id = '
2357                            || to_char(l_transaction_step_id), 30);
2358 
2359 
2360      l_count := l_count + 1;
2361      l_transaction_table(l_count).param_name :=upper('p_validate');
2362      l_transaction_table(l_count).param_value := p_validate;
2363      l_transaction_table(l_count).param_data_type := upper('varchar2');
2364      --
2365      l_count:=l_count+1;
2366      l_transaction_table(l_count).param_name      := 'P_SAVE_MODE';
2367      l_transaction_table(l_count).param_value     :=  p_save_mode;
2368      l_transaction_table(l_count).param_data_type := 'VARCHAR2';
2369      --
2370      l_count := l_count + 1;
2371      l_transaction_table(l_count).param_name :=upper('p_item_type');
2372      l_transaction_table(l_count).param_value := p_item_type;
2373      l_transaction_table(l_count).param_data_type := upper('varchar2');
2374      --
2375      --
2376      l_count := l_count + 1;
2377      l_transaction_table(l_count).param_name :=upper('p_item_key');
2378      l_transaction_table(l_count).param_value := p_item_key;
2379      l_transaction_table(l_count).param_data_type := upper('varchar2');
2380      --
2381      --
2382      l_count := l_count + 1;
2383      l_transaction_table(l_count).param_name :=upper('p_activity_id');
2384      l_transaction_table(l_count).param_value := p_activity_id;
2385      l_transaction_table(l_count).param_data_type := upper('number');
2386      --
2387      --
2388      l_count := l_count + 1;
2389      l_transaction_table(l_count).param_name :=upper('p_action');
2390      l_transaction_table(l_count).param_value := p_action;
2391      l_transaction_table(l_count).param_data_type := upper('varchar2');
2392      --
2393      --
2394      l_count := l_count + 1;
2395      l_transaction_table(l_count).param_name :=upper('p_process_section_name');
2396      l_transaction_table(l_count).param_value := p_process_section_name;
2397      l_transaction_table(l_count).param_data_type := upper('varchar2');
2398      --
2399      --
2400      l_count := l_count + 1;
2401      l_transaction_table(l_count).param_name :=upper('p_review_page_region_code');
2402      l_transaction_table(l_count).param_value := p_review_page_region_code;
2403      l_transaction_table(l_count).param_data_type := upper('varchar2');
2404      --
2405      --
2406      l_count := l_count + 1;
2407      l_transaction_table(l_count).param_name :=upper('p_business_group_id');
2408      l_transaction_table(l_count).param_value := p_business_group_id;
2409      l_transaction_table(l_count).param_data_type := upper('number');
2410      --
2411      l_count := l_count + 1;
2412      l_transaction_table(l_count).param_name :=upper('p_person_id');
2413      l_transaction_table(l_count).param_value := p_person_id;
2414      l_transaction_table(l_count).param_data_type := upper('number');
2415      --
2416      l_count := l_count + 1;
2417      l_transaction_table(l_count).param_name :=upper('p_login_person_id');
2418      l_transaction_table(l_count).param_value := p_login_person_id;
2419      l_transaction_table(l_count).param_data_type := upper('number');
2420      --
2421      --
2422      l_count := l_count + 1;
2423      l_transaction_table(l_count).param_name :=upper('P_REVIEW_PROC_CALL');
2424      l_transaction_table(l_count).param_value := p_review_page_region_code;
2425      l_transaction_table(l_count).param_data_type := upper('varchar2');
2426      --
2427      --
2428      l_count := l_count + 1;
2429      l_transaction_table(l_count).param_name := 'P_REVIEW_ACTID';
2430      l_transaction_table(l_count).param_value := P_ACTIVITY_ID;
2431      l_transaction_table(l_count).param_data_type := 'VARCHAR2';
2432      --
2433   --END IF;
2434   --
2435   --
2436     IF  l_basic_details_changed  THEN
2437      --
2438     hr_utility.set_location('IF  l_basic_details_changed  THEN', 60);
2439      l_count := l_count + 1;
2440      l_transaction_table(l_count).param_name :=upper('p_cont_rec_changed');
2441      l_transaction_table(l_count).param_value := 'CHANGED';
2442      l_transaction_table(l_count).param_data_type := upper('varchar2');
2443      --
2444     END IF ;
2445      --
2446      l_count := l_count + 1;
2447      l_transaction_table(l_count).param_name :=upper('p_cont_effective_date');
2448      l_transaction_table(l_count).param_value :=to_char( p_cont_effective_date,
2449    						hr_transaction_ss.g_date_format);
2450      l_transaction_table(l_count).param_data_type := upper('date');
2451      --
2452      --
2453      l_count := l_count + 1;
2454      l_transaction_table(l_count).param_name :=upper('p_contact_relationship_id');
2455      l_transaction_table(l_count).param_value := l_contact_relationship_id;
2456      l_transaction_table(l_count).param_data_type := upper('number');
2457      --
2458      --
2459      l_count := l_count + 1;
2460      l_transaction_table(l_count).param_name :=upper('p_contact_type');
2461      l_transaction_table(l_count).param_value := p_contact_type;
2462      l_transaction_table(l_count).param_data_type := upper('varchar2');
2463      --
2464      --
2465      l_count := l_count + 1;
2466      l_transaction_table(l_count).param_name :=upper('p_ctr_comments');
2467      l_transaction_table(l_count).param_value := p_ctr_comments;
2468      l_transaction_table(l_count).param_data_type := upper('varchar2');
2469      --
2470      --
2471      l_count := l_count + 1;
2472      l_transaction_table(l_count).param_name :=upper('p_primary_contact_flag');
2473      l_transaction_table(l_count).param_value := p_primary_contact_flag;
2474      l_transaction_table(l_count).param_data_type := upper('varchar2');
2475      --
2476      --
2477      l_count := l_count + 1;
2478      l_transaction_table(l_count).param_name :=upper('p_third_party_pay_flag');
2479      l_transaction_table(l_count).param_value := p_third_party_pay_flag;
2480      l_transaction_table(l_count).param_data_type := upper('varchar2');
2481      --
2482      --
2483      l_count := l_count + 1;
2484      l_transaction_table(l_count).param_name :=upper('p_bondholder_flag');
2485      l_transaction_table(l_count).param_value := p_bondholder_flag;
2486      l_transaction_table(l_count).param_data_type := upper('varchar2');
2487      --
2488      --
2489      l_count := l_count + 1;
2490      l_transaction_table(l_count).param_name :=upper('p_date_start');
2491      l_transaction_table(l_count).param_value := to_char(p_date_start,
2492                                                  hr_transaction_ss.g_date_format);
2493      l_transaction_table(l_count).param_data_type := upper('date');
2494      --
2495      --
2496      l_count := l_count + 1;
2497      l_transaction_table(l_count).param_name :=upper('p_start_life_reason_id');
2498      l_transaction_table(l_count).param_value := l_start_life_reason_id;
2499      l_transaction_table(l_count).param_data_type := upper('number');
2500      --
2501      --
2502      l_count := l_count + 1;
2503      l_transaction_table(l_count).param_name :=upper('p_date_end');
2504      l_transaction_table(l_count).param_value :=to_char( p_date_end,
2505                                                  hr_transaction_ss.g_date_format);
2506      l_transaction_table(l_count).param_data_type := upper('date');
2507      --
2508      --
2509      l_count := l_count + 1;
2510      l_transaction_table(l_count).param_name :=upper('p_end_life_reason_id');
2511      l_transaction_table(l_count).param_value := l_end_life_reason_id;
2512      l_transaction_table(l_count).param_data_type := upper('number');
2513      --
2514      --
2515      l_count := l_count + 1;
2516      l_transaction_table(l_count).param_name :=upper('p_rltd_per_rsds_w_dsgntr_flag');
2517      l_transaction_table(l_count).param_value := p_rltd_per_rsds_w_dsgntr_flag;
2518      l_transaction_table(l_count).param_data_type := upper('varchar2');
2519      --
2520      --
2521      l_count := l_count + 1;
2522      l_transaction_table(l_count).param_name :=upper('p_personal_flag');
2523      l_transaction_table(l_count).param_value := p_personal_flag;
2524      l_transaction_table(l_count).param_data_type := upper('varchar2');
2525      --
2526      --
2527      l_count := l_count + 1;
2528      l_transaction_table(l_count).param_name :=upper('p_sequence_number');
2529      l_transaction_table(l_count).param_value := l_sequence_number;
2530      l_transaction_table(l_count).param_data_type := upper('number');
2531      --
2532      --
2533      l_count := l_count + 1;
2534      l_transaction_table(l_count).param_name :=upper('p_dependent_flag');
2535      l_transaction_table(l_count).param_value := p_dependent_flag;
2536      l_transaction_table(l_count).param_data_type := upper('varchar2');
2537      --
2538      --
2539      l_count := l_count + 1;
2540      l_transaction_table(l_count).param_name :=upper('p_beneficiary_flag');
2541      l_transaction_table(l_count).param_value := p_beneficiary_flag;
2542      l_transaction_table(l_count).param_data_type := upper('varchar2');
2543      --
2544      --
2545      l_count := l_count + 1;
2546      l_transaction_table(l_count).param_name :=upper('p_cont_attribute_category');
2547      l_transaction_table(l_count).param_value := p_cont_attribute_category;
2548      l_transaction_table(l_count).param_data_type := upper('varchar2');
2549      --
2550      --
2551      l_count := l_count + 1;
2552      l_transaction_table(l_count).param_name :=upper('p_cont_attribute1');
2553      l_transaction_table(l_count).param_value := p_cont_attribute1;
2554      l_transaction_table(l_count).param_data_type := upper('varchar2');
2555      --
2556      --
2557      l_count := l_count + 1;
2558      l_transaction_table(l_count).param_name :=upper('p_cont_attribute2');
2559      l_transaction_table(l_count).param_value := p_cont_attribute2;
2560      l_transaction_table(l_count).param_data_type := upper('varchar2');
2561      --
2562      --
2563      l_count := l_count + 1;
2564      l_transaction_table(l_count).param_name :=upper('p_cont_attribute3');
2565      l_transaction_table(l_count).param_value := p_cont_attribute3;
2566      l_transaction_table(l_count).param_data_type := upper('varchar2');
2567      --
2568      --
2569      l_count := l_count + 1;
2570      l_transaction_table(l_count).param_name :=upper('p_cont_attribute4');
2571      l_transaction_table(l_count).param_value := p_cont_attribute4;
2572      l_transaction_table(l_count).param_data_type := upper('varchar2');
2573      --
2574      --
2575      l_count := l_count + 1;
2576      l_transaction_table(l_count).param_name :=upper('p_cont_attribute5');
2577      l_transaction_table(l_count).param_value := p_cont_attribute5;
2578      l_transaction_table(l_count).param_data_type := upper('varchar2');
2579      --
2580      --
2581      l_count := l_count + 1;
2582      l_transaction_table(l_count).param_name :=upper('p_cont_attribute6');
2583      l_transaction_table(l_count).param_value := p_cont_attribute6;
2584      l_transaction_table(l_count).param_data_type := upper('varchar2');
2585      --
2586      --
2587      l_count := l_count + 1;
2588      l_transaction_table(l_count).param_name :=upper('p_cont_attribute7');
2589      l_transaction_table(l_count).param_value := p_cont_attribute7;
2590      l_transaction_table(l_count).param_data_type := upper('varchar2');
2591      --
2592      --
2593      l_count := l_count + 1;
2594      l_transaction_table(l_count).param_name :=upper('p_cont_attribute8');
2595      l_transaction_table(l_count).param_value := p_cont_attribute8;
2596      l_transaction_table(l_count).param_data_type := upper('varchar2');
2597      --
2598      --
2599      l_count := l_count + 1;
2600      l_transaction_table(l_count).param_name :=upper('p_cont_attribute9');
2601      l_transaction_table(l_count).param_value := p_cont_attribute9;
2602      l_transaction_table(l_count).param_data_type := upper('varchar2');
2603      --
2604      --
2605      l_count := l_count + 1;
2606      l_transaction_table(l_count).param_name :=upper('p_cont_attribute10');
2607      l_transaction_table(l_count).param_value := p_cont_attribute10;
2608      l_transaction_table(l_count).param_data_type := upper('varchar2');
2609      --
2610      --
2611      l_count := l_count + 1;
2612      l_transaction_table(l_count).param_name :=upper('p_cont_attribute11');
2613      l_transaction_table(l_count).param_value := p_cont_attribute11;
2614      l_transaction_table(l_count).param_data_type := upper('varchar2');
2615      --
2616      --
2617      l_count := l_count + 1;
2618      l_transaction_table(l_count).param_name :=upper('p_cont_attribute12');
2619      l_transaction_table(l_count).param_value := p_cont_attribute12;
2620      l_transaction_table(l_count).param_data_type := upper('varchar2');
2621      --
2622      --
2623      l_count := l_count + 1;
2624      l_transaction_table(l_count).param_name :=upper('p_cont_attribute13');
2625      l_transaction_table(l_count).param_value := p_cont_attribute13;
2626      l_transaction_table(l_count).param_data_type := upper('varchar2');
2627      --
2628      --
2629      l_count := l_count + 1;
2630      l_transaction_table(l_count).param_name :=upper('p_cont_attribute14');
2631      l_transaction_table(l_count).param_value := p_cont_attribute14;
2632      l_transaction_table(l_count).param_data_type := upper('varchar2');
2633      --
2634      --
2635      l_count := l_count + 1;
2636      l_transaction_table(l_count).param_name :=upper('p_cont_attribute15');
2637      l_transaction_table(l_count).param_value := p_cont_attribute15;
2638      l_transaction_table(l_count).param_data_type := upper('varchar2');
2639      --
2640      --
2641      l_count := l_count + 1;
2642      l_transaction_table(l_count).param_name :=upper('p_cont_attribute16');
2643      l_transaction_table(l_count).param_value := p_cont_attribute16;
2644      l_transaction_table(l_count).param_data_type := upper('varchar2');
2645      --
2646      --
2647      l_count := l_count + 1;
2648      l_transaction_table(l_count).param_name :=upper('p_cont_attribute17');
2649      l_transaction_table(l_count).param_value := p_cont_attribute17;
2650      l_transaction_table(l_count).param_data_type := upper('varchar2');
2651      --
2652      --
2653      l_count := l_count + 1;
2654      l_transaction_table(l_count).param_name :=upper('p_cont_attribute18');
2655      l_transaction_table(l_count).param_value := p_cont_attribute18;
2656      l_transaction_table(l_count).param_data_type := upper('varchar2');
2657      --
2658      --
2659      l_count := l_count + 1;
2660      l_transaction_table(l_count).param_name :=upper('p_cont_attribute19');
2661      l_transaction_table(l_count).param_value := p_cont_attribute19;
2662      l_transaction_table(l_count).param_data_type := upper('varchar2');
2663      --
2664      --
2665      l_count := l_count + 1;
2666      l_transaction_table(l_count).param_name :=upper('p_cont_attribute20');
2667      l_transaction_table(l_count).param_value := p_cont_attribute20;
2668      l_transaction_table(l_count).param_data_type := upper('varchar2');
2669      --
2670      --
2671      l_count := l_count + 1;
2672      l_transaction_table(l_count).param_name :=upper('p_cont_object_version_number');
2673      l_transaction_table(l_count).param_value := l_cont_old_ovn;
2674      l_transaction_table(l_count).param_data_type := upper('number');
2675      --
2676      if not l_per_details_changed then
2677         --
2678         hr_utility.set_location('if not l_per_details_changed then', 65);
2679         l_count := l_count + 1;
2680         l_transaction_table(l_count).param_name :=upper('p_per_rec_changed');
2681         l_transaction_table(l_count).param_value := null;
2682         l_transaction_table(l_count).param_data_type := upper('varchar2');
2683         --
2684      end if;
2685      --
2686   --END IF ; -- End of parameters for update_contact_relationship
2687   --
2688   --
2689     IF  l_per_details_changed  THEN
2690       --
2691       l_count := l_count + 1;
2692       hr_utility.set_location('if l_per_details_changed  THEN', 70);
2693       l_transaction_table(l_count).param_name :=upper('p_per_rec_changed');
2694       l_transaction_table(l_count).param_value := 'CHANGED';
2695       l_transaction_table(l_count).param_data_type := upper('varchar2');
2696       --
2697     END IF ;
2698       --
2699       l_count := l_count + 1;
2700       l_transaction_table(l_count).param_name :=upper('p_per_effective_date');
2701       l_transaction_table(l_count).param_value := to_char(p_per_effective_date,
2702                                                   hr_transaction_ss.g_date_format);
2703       l_transaction_table(l_count).param_data_type := upper('date');
2704       --
2705       --
2706       l_count := l_count + 1;
2707       l_transaction_table(l_count).param_name :=upper('p_datetrack_update_mode');
2708       l_transaction_table(l_count).param_value := p_datetrack_update_mode;
2709       l_transaction_table(l_count).param_data_type := upper('varchar2');
2710       --
2711       --
2712       l_count := l_count + 1;
2713       l_transaction_table(l_count).param_name :=upper('p_cont_person_id');
2714       l_transaction_table(l_count).param_value := p_cont_person_id;
2715       l_transaction_table(l_count).param_data_type := upper('number');
2716       --
2717       --
2718       l_count := l_count + 1;
2719       l_transaction_table(l_count).param_name :=upper('p_per_object_version_number');
2720       l_transaction_table(l_count).param_value := l_per_old_ovn;
2721       l_transaction_table(l_count).param_data_type := upper('number');
2722       --
2723       --
2724       l_count := l_count + 1;
2725       l_transaction_table(l_count).param_name :=upper('p_person_type_id');
2726       l_transaction_table(l_count).param_value := l_person_type_id;
2727       l_transaction_table(l_count).param_data_type := upper('number');
2728       --
2729       --
2730       l_count := l_count + 1;
2731       l_transaction_table(l_count).param_name :=upper('p_last_name');
2732       l_transaction_table(l_count).param_value := p_last_name;
2733       l_transaction_table(l_count).param_data_type := upper('varchar2');
2734       --
2735       --
2736       l_count := l_count + 1;
2737       l_transaction_table(l_count).param_name :=upper('p_applicant_number');
2738       l_transaction_table(l_count).param_value := p_applicant_number;
2739       l_transaction_table(l_count).param_data_type := upper('varchar2');
2740       --
2741       --
2742       l_count := l_count + 1;
2743       l_transaction_table(l_count).param_name :=upper('p_per_comments');
2744       l_transaction_table(l_count).param_value := p_per_comments;
2745       l_transaction_table(l_count).param_data_type := upper('varchar2');
2746       --
2747       --
2748       l_count := l_count + 1;
2749       l_transaction_table(l_count).param_name :=upper('p_date_employee_data_verified');
2750       l_transaction_table(l_count).param_value := to_char(p_date_employee_data_verified,
2751                                                   hr_transaction_ss.g_date_format);
2752       l_transaction_table(l_count).param_data_type := upper('date');
2753       --
2754       --
2755       l_count := l_count + 1;
2756       l_transaction_table(l_count).param_name :=upper('p_date_of_birth');
2757       l_transaction_table(l_count).param_value :=to_char( p_date_of_birth,
2758                                                   hr_transaction_ss.g_date_format);
2759       l_transaction_table(l_count).param_data_type := upper('date');
2760       --
2761       --
2762       l_count := l_count + 1;
2763       l_transaction_table(l_count).param_name :=upper('p_email_address');
2764       l_transaction_table(l_count).param_value := p_email_address;
2765       l_transaction_table(l_count).param_data_type := upper('varchar2');
2766       --
2767       --
2768       l_count := l_count + 1;
2769       l_transaction_table(l_count).param_name :=upper('p_employee_number');
2770       l_transaction_table(l_count).param_value := l_employee_number;
2771       l_transaction_table(l_count).param_data_type := upper('varchar2');
2772       --
2773       --
2774       l_count := l_count + 1;
2775       l_transaction_table(l_count).param_name :=upper('p_expense_check_send_to_addres');
2776       l_transaction_table(l_count).param_value := p_expense_check_send_to_addres;
2777       l_transaction_table(l_count).param_data_type := upper('varchar2');
2778       --
2779       --
2780       l_count := l_count + 1;
2781       l_transaction_table(l_count).param_name :=upper('p_first_name');
2782       l_transaction_table(l_count).param_value := p_first_name;
2783       l_transaction_table(l_count).param_data_type := upper('varchar2');
2784       --
2785       --
2786       l_count := l_count + 1;
2787       l_transaction_table(l_count).param_name :=upper('p_known_as');
2788       l_transaction_table(l_count).param_value := p_known_as;
2789       l_transaction_table(l_count).param_data_type := upper('varchar2');
2790       --
2791       --
2792       l_count := l_count + 1;
2793       l_transaction_table(l_count).param_name :=upper('p_marital_status');
2794       l_transaction_table(l_count).param_value := p_marital_status;
2795       l_transaction_table(l_count).param_data_type := upper('varchar2');
2796       --
2797       --
2798       l_count := l_count + 1;
2799       l_transaction_table(l_count).param_name :=upper('p_middle_names');
2800       l_transaction_table(l_count).param_value := p_middle_names;
2801       l_transaction_table(l_count).param_data_type := upper('varchar2');
2802       --
2803       --
2804       l_count := l_count + 1;
2805       l_transaction_table(l_count).param_name :=upper('p_nationality');
2806       l_transaction_table(l_count).param_value := p_nationality;
2807       l_transaction_table(l_count).param_data_type := upper('varchar2');
2808       --
2809       --
2810       l_count := l_count + 1;
2811       l_transaction_table(l_count).param_name :=upper('p_national_identifier');
2812       l_transaction_table(l_count).param_value := p_national_identifier;
2813       l_transaction_table(l_count).param_data_type := upper('varchar2');
2814       --
2815       --
2816       l_count := l_count + 1;
2817       l_transaction_table(l_count).param_name :=upper('p_previous_last_name');
2818       l_transaction_table(l_count).param_value := p_previous_last_name;
2819       l_transaction_table(l_count).param_data_type := upper('varchar2');
2820       --
2821       --
2822       l_count := l_count + 1;
2823       l_transaction_table(l_count).param_name :=upper('p_registered_disabled_flag');
2824       l_transaction_table(l_count).param_value := p_registered_disabled_flag;
2825       l_transaction_table(l_count).param_data_type := upper('varchar2');
2826       --
2827       --
2828       l_count := l_count + 1;
2829       l_transaction_table(l_count).param_name :=upper('p_sex');
2830       l_transaction_table(l_count).param_value := p_sex;
2831       l_transaction_table(l_count).param_data_type := upper('varchar2');
2832       --
2833       --
2834       l_count := l_count + 1;
2835       l_transaction_table(l_count).param_name :=upper('p_title');
2836       l_transaction_table(l_count).param_value := p_title;
2837       l_transaction_table(l_count).param_data_type := upper('varchar2');
2838       --
2839       --
2840       l_count := l_count + 1;
2841       l_transaction_table(l_count).param_name :=upper('p_vendor_id');
2842       l_transaction_table(l_count).param_value := p_vendor_id;
2843       l_transaction_table(l_count).param_data_type := upper('number');
2844       --
2845       --
2846       l_count := l_count + 1;
2847       l_transaction_table(l_count).param_name :=upper('p_work_telephone');
2848       l_transaction_table(l_count).param_value := p_work_telephone;
2849       l_transaction_table(l_count).param_data_type := upper('varchar2');
2850       --
2851       --
2852       l_count := l_count + 1;
2853       l_transaction_table(l_count).param_name :=upper('p_attribute_category');
2854       l_transaction_table(l_count).param_value := p_attribute_category;
2855       l_transaction_table(l_count).param_data_type := upper('varchar2');
2856       --
2857       --
2858       l_count := l_count + 1;
2859       l_transaction_table(l_count).param_name :=upper('p_attribute1');
2860       l_transaction_table(l_count).param_value := p_attribute1;
2861       l_transaction_table(l_count).param_data_type := upper('varchar2');
2862       --
2863       --
2864       l_count := l_count + 1;
2865       l_transaction_table(l_count).param_name :=upper('p_attribute2');
2866       l_transaction_table(l_count).param_value := p_attribute2;
2867       l_transaction_table(l_count).param_data_type := upper('varchar2');
2868       --
2869       --
2870       l_count := l_count + 1;
2871       l_transaction_table(l_count).param_name :=upper('p_attribute3');
2872       l_transaction_table(l_count).param_value := p_attribute3;
2873       l_transaction_table(l_count).param_data_type := upper('varchar2');
2874       --
2875       --
2876       l_count := l_count + 1;
2877       l_transaction_table(l_count).param_name :=upper('p_attribute4');
2878       l_transaction_table(l_count).param_value := p_attribute4;
2879       l_transaction_table(l_count).param_data_type := upper('varchar2');
2880       --
2881       --
2882       l_count := l_count + 1;
2883       l_transaction_table(l_count).param_name :=upper('p_attribute5');
2884       l_transaction_table(l_count).param_value := p_attribute5;
2885       l_transaction_table(l_count).param_data_type := upper('varchar2');
2886       --
2887       --
2888       l_count := l_count + 1;
2889       l_transaction_table(l_count).param_name :=upper('p_attribute6');
2890       l_transaction_table(l_count).param_value := p_attribute6;
2891       l_transaction_table(l_count).param_data_type := upper('varchar2');
2892       --
2893       --
2894       l_count := l_count + 1;
2895       l_transaction_table(l_count).param_name :=upper('p_attribute7');
2896       l_transaction_table(l_count).param_value := p_attribute7;
2897       l_transaction_table(l_count).param_data_type := upper('varchar2');
2898       --
2899       --
2900       l_count := l_count + 1;
2901       l_transaction_table(l_count).param_name :=upper('p_attribute8');
2902       l_transaction_table(l_count).param_value := p_attribute8;
2903       l_transaction_table(l_count).param_data_type := upper('varchar2');
2904       --
2905       --
2906       l_count := l_count + 1;
2907       l_transaction_table(l_count).param_name :=upper('p_attribute9');
2908       l_transaction_table(l_count).param_value := p_attribute9;
2909       l_transaction_table(l_count).param_data_type := upper('varchar2');
2910       --
2911       --
2912       l_count := l_count + 1;
2913       l_transaction_table(l_count).param_name :=upper('p_attribute10');
2914       l_transaction_table(l_count).param_value := p_attribute10;
2915       l_transaction_table(l_count).param_data_type := upper('varchar2');
2916       --
2917       --
2918       l_count := l_count + 1;
2919       l_transaction_table(l_count).param_name :=upper('p_attribute11');
2920       l_transaction_table(l_count).param_value := p_attribute11;
2921       l_transaction_table(l_count).param_data_type := upper('varchar2');
2922       --
2923       --
2924       l_count := l_count + 1;
2925       l_transaction_table(l_count).param_name :=upper('p_attribute12');
2926       l_transaction_table(l_count).param_value := p_attribute12;
2927       l_transaction_table(l_count).param_data_type := upper('varchar2');
2928       --
2929       --
2930       l_count := l_count + 1;
2931       l_transaction_table(l_count).param_name :=upper('p_attribute13');
2932       l_transaction_table(l_count).param_value := p_attribute13;
2933       l_transaction_table(l_count).param_data_type := upper('varchar2');
2934       --
2935       --
2936       l_count := l_count + 1;
2937       l_transaction_table(l_count).param_name :=upper('p_attribute14');
2938       l_transaction_table(l_count).param_value := p_attribute14;
2939       l_transaction_table(l_count).param_data_type := upper('varchar2');
2940       --
2941       --
2942       l_count := l_count + 1;
2943       l_transaction_table(l_count).param_name :=upper('p_attribute15');
2944       l_transaction_table(l_count).param_value := p_attribute15;
2945       l_transaction_table(l_count).param_data_type := upper('varchar2');
2946       --
2947       --
2948       l_count := l_count + 1;
2949       l_transaction_table(l_count).param_name :=upper('p_attribute16');
2950       l_transaction_table(l_count).param_value := p_attribute16;
2951       l_transaction_table(l_count).param_data_type := upper('varchar2');
2952       --
2953       --
2954       l_count := l_count + 1;
2955       l_transaction_table(l_count).param_name :=upper('p_attribute17');
2956       l_transaction_table(l_count).param_value := p_attribute17;
2957       l_transaction_table(l_count).param_data_type := upper('varchar2');
2958       --
2959       --
2960       l_count := l_count + 1;
2961       l_transaction_table(l_count).param_name :=upper('p_attribute18');
2962       l_transaction_table(l_count).param_value := p_attribute18;
2963       l_transaction_table(l_count).param_data_type := upper('varchar2');
2964       --
2965       --
2966       l_count := l_count + 1;
2967       l_transaction_table(l_count).param_name :=upper('p_attribute19');
2968       l_transaction_table(l_count).param_value := p_attribute19;
2969       l_transaction_table(l_count).param_data_type := upper('varchar2');
2970       --
2971       --
2972       l_count := l_count + 1;
2973       l_transaction_table(l_count).param_name :=upper('p_attribute20');
2974       l_transaction_table(l_count).param_value := p_attribute20;
2975       l_transaction_table(l_count).param_data_type := upper('varchar2');
2976       --
2977       --
2978       l_count := l_count + 1;
2979       l_transaction_table(l_count).param_name :=upper('p_attribute21');
2980       l_transaction_table(l_count).param_value := p_attribute21;
2981       l_transaction_table(l_count).param_data_type := upper('varchar2');
2982       --
2983       --
2984       l_count := l_count + 1;
2985       l_transaction_table(l_count).param_name :=upper('p_attribute22');
2986       l_transaction_table(l_count).param_value := p_attribute22;
2987       l_transaction_table(l_count).param_data_type := upper('varchar2');
2988       --
2989       --
2990       l_count := l_count + 1;
2991       l_transaction_table(l_count).param_name :=upper('p_attribute23');
2992       l_transaction_table(l_count).param_value := p_attribute23;
2993       l_transaction_table(l_count).param_data_type := upper('varchar2');
2994       --
2995       --
2996       l_count := l_count + 1;
2997       l_transaction_table(l_count).param_name :=upper('p_attribute24');
2998       l_transaction_table(l_count).param_value := p_attribute24;
2999       l_transaction_table(l_count).param_data_type := upper('varchar2');
3000       --
3001       --
3002       l_count := l_count + 1;
3003       l_transaction_table(l_count).param_name :=upper('p_attribute25');
3004       l_transaction_table(l_count).param_value := p_attribute25;
3005       l_transaction_table(l_count).param_data_type := upper('varchar2');
3006       --
3007       --
3008       l_count := l_count + 1;
3009       l_transaction_table(l_count).param_name :=upper('p_attribute26');
3010       l_transaction_table(l_count).param_value := p_attribute26;
3011       l_transaction_table(l_count).param_data_type := upper('varchar2');
3012       --
3013       --
3014       l_count := l_count + 1;
3015       l_transaction_table(l_count).param_name :=upper('p_attribute27');
3016       l_transaction_table(l_count).param_value := p_attribute27;
3017       l_transaction_table(l_count).param_data_type := upper('varchar2');
3018       --
3019       --
3020       l_count := l_count + 1;
3021       l_transaction_table(l_count).param_name :=upper('p_attribute28');
3022       l_transaction_table(l_count).param_value := p_attribute28;
3023       l_transaction_table(l_count).param_data_type := upper('varchar2');
3024       --
3025       --
3026       l_count := l_count + 1;
3027       l_transaction_table(l_count).param_name :=upper('p_attribute29');
3028       l_transaction_table(l_count).param_value := p_attribute29;
3029       l_transaction_table(l_count).param_data_type := upper('varchar2');
3030       --
3031       --
3032       l_count := l_count + 1;
3033       l_transaction_table(l_count).param_name :=upper('p_attribute30');
3034       l_transaction_table(l_count).param_value := p_attribute30;
3035       l_transaction_table(l_count).param_data_type := upper('varchar2');
3036       --
3037       --
3038       l_count := l_count + 1;
3039       l_transaction_table(l_count).param_name :=upper('p_per_information_category');
3040       l_transaction_table(l_count).param_value := p_per_information_category;
3041       l_transaction_table(l_count).param_data_type := upper('varchar2');
3042       --
3043       --
3044       l_count := l_count + 1;
3045       l_transaction_table(l_count).param_name :=upper('p_per_information1');
3046       l_transaction_table(l_count).param_value := p_per_information1;
3047       l_transaction_table(l_count).param_data_type := upper('varchar2');
3048       --
3049       --
3050       l_count := l_count + 1;
3051       l_transaction_table(l_count).param_name :=upper('p_per_information2');
3052       l_transaction_table(l_count).param_value := p_per_information2;
3053       l_transaction_table(l_count).param_data_type := upper('varchar2');
3054       --
3055       --
3056       l_count := l_count + 1;
3057       l_transaction_table(l_count).param_name :=upper('p_per_information3');
3058       l_transaction_table(l_count).param_value := p_per_information3;
3059       l_transaction_table(l_count).param_data_type := upper('varchar2');
3060       --
3061       --
3062       l_count := l_count + 1;
3063       l_transaction_table(l_count).param_name :=upper('p_per_information4');
3064       l_transaction_table(l_count).param_value := p_per_information4;
3065       l_transaction_table(l_count).param_data_type := upper('varchar2');
3066       --
3067       --
3068       l_count := l_count + 1;
3069       l_transaction_table(l_count).param_name :=upper('p_per_information5');
3070       l_transaction_table(l_count).param_value := p_per_information5;
3071       l_transaction_table(l_count).param_data_type := upper('varchar2');
3072       --
3073       --
3074       l_count := l_count + 1;
3075       l_transaction_table(l_count).param_name :=upper('p_per_information6');
3076       l_transaction_table(l_count).param_value := p_per_information6;
3077       l_transaction_table(l_count).param_data_type := upper('varchar2');
3078       --
3079       --
3080       l_count := l_count + 1;
3081       l_transaction_table(l_count).param_name :=upper('p_per_information7');
3082       l_transaction_table(l_count).param_value := p_per_information7;
3083       l_transaction_table(l_count).param_data_type := upper('varchar2');
3084       --
3085       --
3086       l_count := l_count + 1;
3087       l_transaction_table(l_count).param_name :=upper('p_per_information8');
3088       l_transaction_table(l_count).param_value := p_per_information8;
3089       l_transaction_table(l_count).param_data_type := upper('varchar2');
3090       --
3091       --
3092       l_count := l_count + 1;
3093       l_transaction_table(l_count).param_name :=upper('p_per_information9');
3094       l_transaction_table(l_count).param_value := p_per_information9;
3095       l_transaction_table(l_count).param_data_type := upper('varchar2');
3096       --
3097       --
3098       l_count := l_count + 1;
3099       l_transaction_table(l_count).param_name :=upper('p_per_information10');
3100       l_transaction_table(l_count).param_value := p_per_information10;
3101       l_transaction_table(l_count).param_data_type := upper('varchar2');
3102       --
3103       --
3104       l_count := l_count + 1;
3105       l_transaction_table(l_count).param_name :=upper('p_per_information11');
3106       l_transaction_table(l_count).param_value := p_per_information11;
3107       l_transaction_table(l_count).param_data_type := upper('varchar2');
3108       --
3109       --
3110       l_count := l_count + 1;
3111       l_transaction_table(l_count).param_name :=upper('p_per_information12');
3112       l_transaction_table(l_count).param_value := p_per_information12;
3113       l_transaction_table(l_count).param_data_type := upper('varchar2');
3114       --
3115       --
3116       l_count := l_count + 1;
3117       l_transaction_table(l_count).param_name :=upper('p_per_information13');
3118       l_transaction_table(l_count).param_value := p_per_information13;
3119       l_transaction_table(l_count).param_data_type := upper('varchar2');
3120       --
3121       --
3122       l_count := l_count + 1;
3123       l_transaction_table(l_count).param_name :=upper('p_per_information14');
3124       l_transaction_table(l_count).param_value := p_per_information14;
3125       l_transaction_table(l_count).param_data_type := upper('varchar2');
3126       --
3127       --
3128       l_count := l_count + 1;
3129       l_transaction_table(l_count).param_name :=upper('p_per_information15');
3130       l_transaction_table(l_count).param_value := p_per_information15;
3131       l_transaction_table(l_count).param_data_type := upper('varchar2');
3132       --
3133       --
3134       l_count := l_count + 1;
3135       l_transaction_table(l_count).param_name :=upper('p_per_information16');
3136       l_transaction_table(l_count).param_value := p_per_information16;
3137       l_transaction_table(l_count).param_data_type := upper('varchar2');
3138       --
3139       --
3140       l_count := l_count + 1;
3141       l_transaction_table(l_count).param_name :=upper('p_per_information17');
3142       l_transaction_table(l_count).param_value := p_per_information17;
3143       l_transaction_table(l_count).param_data_type := upper('varchar2');
3144       --
3145       --
3146       l_count := l_count + 1;
3147       l_transaction_table(l_count).param_name :=upper('p_per_information18');
3148       l_transaction_table(l_count).param_value := p_per_information18;
3149       l_transaction_table(l_count).param_data_type := upper('varchar2');
3150       --
3151       --
3152       l_count := l_count + 1;
3153       l_transaction_table(l_count).param_name :=upper('p_per_information19');
3154       l_transaction_table(l_count).param_value := p_per_information19;
3155       l_transaction_table(l_count).param_data_type := upper('varchar2');
3156       --
3157       --
3158       l_count := l_count + 1;
3159       l_transaction_table(l_count).param_name :=upper('p_per_information20');
3160       l_transaction_table(l_count).param_value := p_per_information20;
3161       l_transaction_table(l_count).param_data_type := upper('varchar2');
3162       --
3163       --
3164       l_count := l_count + 1;
3165       l_transaction_table(l_count).param_name :=upper('p_per_information21');
3166       l_transaction_table(l_count).param_value := p_per_information21;
3167       l_transaction_table(l_count).param_data_type := upper('varchar2');
3168       --
3169       --
3170       l_count := l_count + 1;
3171       l_transaction_table(l_count).param_name :=upper('p_per_information22');
3172       l_transaction_table(l_count).param_value := p_per_information22;
3173       l_transaction_table(l_count).param_data_type := upper('varchar2');
3174       --
3175       --
3176       l_count := l_count + 1;
3177       l_transaction_table(l_count).param_name :=upper('p_per_information23');
3178       l_transaction_table(l_count).param_value := p_per_information23;
3179       l_transaction_table(l_count).param_data_type := upper('varchar2');
3180       --
3181       --
3182       l_count := l_count + 1;
3183       l_transaction_table(l_count).param_name :=upper('p_per_information24');
3184       l_transaction_table(l_count).param_value := p_per_information24;
3185       l_transaction_table(l_count).param_data_type := upper('varchar2');
3186       --
3187       --
3188       l_count := l_count + 1;
3189       l_transaction_table(l_count).param_name :=upper('p_per_information25');
3190       l_transaction_table(l_count).param_value := p_per_information25;
3191       l_transaction_table(l_count).param_data_type := upper('varchar2');
3192       --
3193       --
3194       l_count := l_count + 1;
3195       l_transaction_table(l_count).param_name :=upper('p_per_information26');
3196       l_transaction_table(l_count).param_value := p_per_information26;
3197       l_transaction_table(l_count).param_data_type := upper('varchar2');
3198       --
3199       --
3200       l_count := l_count + 1;
3201       l_transaction_table(l_count).param_name :=upper('p_per_information27');
3202       l_transaction_table(l_count).param_value := p_per_information27;
3203       l_transaction_table(l_count).param_data_type := upper('varchar2');
3204       --
3205       --
3206       l_count := l_count + 1;
3207       l_transaction_table(l_count).param_name :=upper('p_per_information28');
3208       l_transaction_table(l_count).param_value := p_per_information28;
3209       l_transaction_table(l_count).param_data_type := upper('varchar2');
3210       --
3211       --
3212       l_count := l_count + 1;
3213       l_transaction_table(l_count).param_name :=upper('p_per_information29');
3214       l_transaction_table(l_count).param_value := p_per_information29;
3215       l_transaction_table(l_count).param_data_type := upper('varchar2');
3216       --
3217       --
3218       l_count := l_count + 1;
3219       l_transaction_table(l_count).param_name :=upper('p_per_information30');
3220       l_transaction_table(l_count).param_value := p_per_information30;
3221       l_transaction_table(l_count).param_data_type := upper('varchar2');
3222       --
3223       --
3224       l_count := l_count + 1;
3225       l_transaction_table(l_count).param_name :=upper('p_date_of_death');
3226       l_transaction_table(l_count).param_value := to_char(p_date_of_death,
3227                                                   hr_transaction_ss.g_date_format);
3228       l_transaction_table(l_count).param_data_type := upper('date');
3229       --
3230       --
3231       l_count := l_count + 1;
3232       l_transaction_table(l_count).param_name :=upper('p_dpdnt_adoption_date');
3233       l_transaction_table(l_count).param_value :=to_char(p_dpdnt_adoption_date,
3234                                                        hr_transaction_ss.g_date_format);
3235       l_transaction_table(l_count).param_data_type := upper('date');
3236       --
3237       l_count := l_count + 1;
3238       l_transaction_table(l_count).param_name :=upper('p_background_check_status');
3239       l_transaction_table(l_count).param_value := p_background_check_status;
3240       l_transaction_table(l_count).param_data_type := upper('varchar2');
3241       --
3242       --
3243       l_count := l_count + 1;
3244       l_transaction_table(l_count).param_name :=upper('p_background_date_check');
3245       l_transaction_table(l_count).param_value := to_char(p_background_date_check,
3246                                                   hr_transaction_ss.g_date_format);
3247       l_transaction_table(l_count).param_data_type := upper('date');
3248       --
3249       --
3250       l_count := l_count + 1;
3251       l_transaction_table(l_count).param_name :=upper('p_blood_type');
3252       l_transaction_table(l_count).param_value := p_blood_type;
3253       l_transaction_table(l_count).param_data_type := upper('varchar2');
3254       --
3255       --
3256       l_count := l_count + 1;
3257       l_transaction_table(l_count).param_name :=upper('p_correspondence_language');
3258       l_transaction_table(l_count).param_value := p_correspondence_language;
3259       l_transaction_table(l_count).param_data_type := upper('varchar2');
3260       --
3261       --
3262       l_count := l_count + 1;
3263       l_transaction_table(l_count).param_name :=upper('p_fast_path_employee');
3264       l_transaction_table(l_count).param_value := p_fast_path_employee;
3265       l_transaction_table(l_count).param_data_type := upper('varchar2');
3266       --
3267       --
3268       l_count := l_count + 1;
3269       l_transaction_table(l_count).param_name :=upper('p_fte_capacity');
3270       l_transaction_table(l_count).param_value := p_fte_capacity;
3271       l_transaction_table(l_count).param_data_type := upper('number');
3272       --
3273       --
3274       l_count := l_count + 1;
3275       l_transaction_table(l_count).param_name :=upper('p_hold_applicant_date_until');
3276       l_transaction_table(l_count).param_value := to_char(p_hold_applicant_date_until,
3277                                                        hr_transaction_ss.g_date_format);
3278       l_transaction_table(l_count).param_data_type := upper('date');
3279       --
3280       --
3281       l_count := l_count + 1;
3282       l_transaction_table(l_count).param_name :=upper('p_honors');
3283       l_transaction_table(l_count).param_value := p_honors;
3284       l_transaction_table(l_count).param_data_type := upper('varchar2');
3285       --
3286       --
3287       l_count := l_count + 1;
3288       l_transaction_table(l_count).param_name :=upper('p_internal_location');
3289       l_transaction_table(l_count).param_value := p_internal_location;
3290       l_transaction_table(l_count).param_data_type := upper('varchar2');
3291       --
3292       --
3293       l_count := l_count + 1;
3294       l_transaction_table(l_count).param_name :=upper('p_last_medical_test_by');
3295       l_transaction_table(l_count).param_value := p_last_medical_test_by;
3296       l_transaction_table(l_count).param_data_type := upper('varchar2');
3297       --
3298       --
3299       l_count := l_count + 1;
3300       l_transaction_table(l_count).param_name :=upper('p_last_medical_test_date');
3301       l_transaction_table(l_count).param_value := to_char(p_last_medical_test_date,
3302                                                        hr_transaction_ss.g_date_format);
3303       l_transaction_table(l_count).param_data_type := upper('date');
3304       --
3305       --
3306       l_count := l_count + 1;
3307       l_transaction_table(l_count).param_name :=upper('p_mailstop');
3308       l_transaction_table(l_count).param_value := p_mailstop;
3309       l_transaction_table(l_count).param_data_type := upper('varchar2');
3310       --
3311       --
3312       l_count := l_count + 1;
3313       l_transaction_table(l_count).param_name :=upper('p_office_number');
3314       l_transaction_table(l_count).param_value := p_office_number;
3315       l_transaction_table(l_count).param_data_type := upper('varchar2');
3316       --
3317       --
3318       l_count := l_count + 1;
3319       l_transaction_table(l_count).param_name :=upper('p_on_military_service');
3320       l_transaction_table(l_count).param_value := p_on_military_service;
3321       l_transaction_table(l_count).param_data_type := upper('varchar2');
3322       --
3323       --
3324       l_count := l_count + 1;
3325       l_transaction_table(l_count).param_name :=upper('p_pre_name_adjunct');
3326       l_transaction_table(l_count).param_value := p_pre_name_adjunct;
3327       l_transaction_table(l_count).param_data_type := upper('varchar2');
3328       --
3329       --
3330       l_count := l_count + 1;
3331       l_transaction_table(l_count).param_name :=upper('p_projected_start_date');
3332       l_transaction_table(l_count).param_value := to_char(p_projected_start_date,
3333                                                        hr_transaction_ss.g_date_format);
3334       l_transaction_table(l_count).param_data_type := upper('date');
3335       --
3336       --
3337       l_count := l_count + 1;
3338       l_transaction_table(l_count).param_name :=upper('p_rehire_authorizor');
3339       l_transaction_table(l_count).param_value := p_rehire_authorizor;
3340       l_transaction_table(l_count).param_data_type := upper('varchar2');
3341       --
3342       --
3343       l_count := l_count + 1;
3344       l_transaction_table(l_count).param_name :=upper('p_rehire_recommendation');
3345       l_transaction_table(l_count).param_value := p_rehire_recommendation;
3346       l_transaction_table(l_count).param_data_type := upper('varchar2');
3347       --
3348       --
3349       l_count := l_count + 1;
3350       l_transaction_table(l_count).param_name :=upper('p_resume_exists');
3351       l_transaction_table(l_count).param_value := p_resume_exists;
3352       l_transaction_table(l_count).param_data_type := upper('varchar2');
3353       --
3354       --
3355       l_count := l_count + 1;
3356       l_transaction_table(l_count).param_name :=upper('p_resume_last_updated');
3357       l_transaction_table(l_count).param_value := to_char(p_resume_last_updated,
3358                                                        hr_transaction_ss.g_date_format);
3359       l_transaction_table(l_count).param_data_type := upper('date');
3360       --
3361       --
3362       l_count := l_count + 1;
3363       l_transaction_table(l_count).param_name :=upper('p_second_passport_exists');
3364       l_transaction_table(l_count).param_value := p_second_passport_exists;
3365       l_transaction_table(l_count).param_data_type := upper('varchar2');
3366       --
3367       --
3368       l_count := l_count + 1;
3369       l_transaction_table(l_count).param_name :=upper('p_student_status');
3370       l_transaction_table(l_count).param_value := p_student_status;
3371       l_transaction_table(l_count).param_data_type := upper('varchar2');
3372       --
3373       --
3374       l_count := l_count + 1;
3375       l_transaction_table(l_count).param_name :=upper('p_work_schedule');
3376       l_transaction_table(l_count).param_value := p_work_schedule;
3377       l_transaction_table(l_count).param_data_type := upper('varchar2');
3378       --
3379       --
3380       l_count := l_count + 1;
3381       l_transaction_table(l_count).param_name :=upper('p_rehire_reason');
3382       l_transaction_table(l_count).param_value := p_rehire_reason;
3383       l_transaction_table(l_count).param_data_type := upper('varchar2');
3384       --
3385       --
3386       l_count := l_count + 1;
3387       l_transaction_table(l_count).param_name :=upper('p_suffix');
3388       l_transaction_table(l_count).param_value := p_suffix;
3389       l_transaction_table(l_count).param_data_type := upper('varchar2');
3390       --
3391       --
3392       l_count := l_count + 1;
3393       l_transaction_table(l_count).param_name :=upper('p_benefit_group_id');
3394       l_transaction_table(l_count).param_value := p_benefit_group_id;
3395       l_transaction_table(l_count).param_data_type := upper('number');
3396       --
3397       --
3398       l_count := l_count + 1;
3399       l_transaction_table(l_count).param_name :=upper('p_receipt_of_death_cert_date');
3400       l_transaction_table(l_count).param_value := to_char(p_receipt_of_death_cert_date,
3401                                                        hr_transaction_ss.g_date_format);
3402       l_transaction_table(l_count).param_data_type := upper('date');
3403       --
3404       --
3405       l_count := l_count + 1;
3406       l_transaction_table(l_count).param_name :=upper('p_coord_ben_med_pln_no');
3407       l_transaction_table(l_count).param_value := p_coord_ben_med_pln_no;
3408       l_transaction_table(l_count).param_data_type := upper('varchar2');
3409       --
3410       --
3411       l_count := l_count + 1;
3412       l_transaction_table(l_count).param_name :=upper('p_coord_ben_no_cvg_flag');
3413       l_transaction_table(l_count).param_value := p_coord_ben_no_cvg_flag;
3414       l_transaction_table(l_count).param_data_type := upper('varchar2');
3415       --
3416       --
3417       l_count := l_count + 1;
3418       l_transaction_table(l_count).param_name :=upper('p_uses_tobacco_flag');
3419       l_transaction_table(l_count).param_value := p_uses_tobacco_flag;
3420       l_transaction_table(l_count).param_data_type := upper('varchar2');
3421       --
3422       --
3423       l_count := l_count + 1;
3424       l_transaction_table(l_count).param_name :=upper('p_dpdnt_vlntry_svce_flag');
3425       l_transaction_table(l_count).param_value := p_dpdnt_vlntry_svce_flag;
3426       l_transaction_table(l_count).param_data_type := upper('varchar2');
3427       --
3428       --
3429       l_count := l_count + 1;
3430       l_transaction_table(l_count).param_name :=upper('p_original_date_of_hire');
3431       l_transaction_table(l_count).param_value := to_char(p_original_date_of_hire,
3432                                                        hr_transaction_ss.g_date_format);
3433       l_transaction_table(l_count).param_data_type := upper('date');
3434       --
3435       --
3436       l_count := l_count + 1;
3437       l_transaction_table(l_count).param_name :=upper('p_adjusted_svc_date');
3438       l_transaction_table(l_count).param_value := to_char(p_adjusted_svc_date,
3439                                                        hr_transaction_ss.g_date_format);
3440       l_transaction_table(l_count).param_data_type := upper('date');
3441       --
3442       --
3443       l_count := l_count + 1;
3444       l_transaction_table(l_count).param_name :=upper('p_town_of_birth');
3445       l_transaction_table(l_count).param_value := p_town_of_birth;
3446       l_transaction_table(l_count).param_data_type := upper('varchar2');
3447       --
3448       --
3449       l_count := l_count + 1;
3450       l_transaction_table(l_count).param_name :=upper('p_region_of_birth');
3451       l_transaction_table(l_count).param_value := p_region_of_birth;
3452       l_transaction_table(l_count).param_data_type := upper('varchar2');
3453       --
3454       --
3455       l_count := l_count + 1;
3456       l_transaction_table(l_count).param_name :=upper('p_country_of_birth');
3457       l_transaction_table(l_count).param_value := p_country_of_birth;
3458       l_transaction_table(l_count).param_data_type := upper('varchar2');
3459       --
3460       --
3461       l_count := l_count + 1;
3462       l_transaction_table(l_count).param_name :=upper('p_global_person_id');
3463       l_transaction_table(l_count).param_value := p_global_person_id;
3464       l_transaction_table(l_count).param_data_type := upper('varchar2');
3465       --
3466       -- These are the parameters which are there in the create_contact.
3467       -- We need to populate null values so that we can have generic get
3468       -- ffunction which works for create_contact and update_contact.
3469       --
3470       l_count := l_count + 1;
3471       l_transaction_table(l_count).param_name :=upper('p_start_date');
3472       l_transaction_table(l_count).param_value := to_char(p_date_start, hr_transaction_ss.g_date_format);
3473       l_transaction_table(l_count).param_data_type := upper('date');
3474       --
3475       --
3476       l_count := l_count + 1;
3477       l_transaction_table(l_count).param_name :=upper('p_contact_person_id');
3478       l_transaction_table(l_count).param_value := p_cont_person_id;
3479       l_transaction_table(l_count).param_data_type := upper('number');
3480       --
3481       --
3482       l_count := l_count + 1;
3483       l_transaction_table(l_count).param_name :=upper('p_create_mirror_flag');
3484       l_transaction_table(l_count).param_value := null;
3485       l_transaction_table(l_count).param_data_type := upper('varchar2');
3486       --
3487       --
3488       l_count := l_count + 1;
3489       l_transaction_table(l_count).param_name :=upper('p_mirror_type');
3490       l_transaction_table(l_count).param_value := null;
3491       l_transaction_table(l_count).param_data_type := upper('varchar2');
3492       --
3493       --
3494       l_count := l_count + 1;
3495       l_transaction_table(l_count).param_name :=upper('p_mirror_cont_attribute_cat');
3496       l_transaction_table(l_count).param_value := null;
3497       l_transaction_table(l_count).param_data_type := upper('varchar2');
3498       --
3499       --
3500       l_count := l_count + 1;
3501       l_transaction_table(l_count).param_name :=upper('p_mirror_cont_attribute1');
3502       l_transaction_table(l_count).param_value := null;
3503       l_transaction_table(l_count).param_data_type := upper('varchar2');
3504       --
3505       --
3506       l_count := l_count + 1;
3507       l_transaction_table(l_count).param_name :=upper('p_mirror_cont_attribute2');
3508       l_transaction_table(l_count).param_value := null;
3509       l_transaction_table(l_count).param_data_type := upper('varchar2');
3510       --
3511       --
3512       l_count := l_count + 1;
3513       l_transaction_table(l_count).param_name :=upper('p_mirror_cont_attribute3');
3514       l_transaction_table(l_count).param_value := null;
3515       l_transaction_table(l_count).param_data_type := upper('varchar2');
3516       --
3517       --
3518       l_count := l_count + 1;
3519       l_transaction_table(l_count).param_name :=upper('p_mirror_cont_attribute4');
3520       l_transaction_table(l_count).param_value := null;
3521       l_transaction_table(l_count).param_data_type := upper('varchar2');
3522       --
3523       --
3524       l_count := l_count + 1;
3525       l_transaction_table(l_count).param_name :=upper('p_mirror_cont_attribute5');
3526       l_transaction_table(l_count).param_value := null;
3527       l_transaction_table(l_count).param_data_type := upper('varchar2');
3528       --
3529       --
3530       l_count := l_count + 1;
3531       l_transaction_table(l_count).param_name :=upper('p_mirror_cont_attribute6');
3532       l_transaction_table(l_count).param_value := null;
3533       l_transaction_table(l_count).param_data_type := upper('varchar2');
3534       --
3535       --
3536       l_count := l_count + 1;
3537       l_transaction_table(l_count).param_name :=upper('p_mirror_cont_attribute7');
3538       l_transaction_table(l_count).param_value := null;
3539       l_transaction_table(l_count).param_data_type := upper('varchar2');
3540       --
3541       --
3542       l_count := l_count + 1;
3543       l_transaction_table(l_count).param_name :=upper('p_mirror_cont_attribute8');
3544       l_transaction_table(l_count).param_value := null;
3545       l_transaction_table(l_count).param_data_type := upper('varchar2');
3546       --
3547       --
3548       l_count := l_count + 1;
3549       l_transaction_table(l_count).param_name :=upper('p_mirror_cont_attribute9');
3550       l_transaction_table(l_count).param_value := null;
3551       l_transaction_table(l_count).param_data_type := upper('varchar2');
3552       --
3553       --
3554       l_count := l_count + 1;
3555       l_transaction_table(l_count).param_name :=upper('p_mirror_cont_attribute10');
3556       l_transaction_table(l_count).param_value := null;
3557       l_transaction_table(l_count).param_data_type := upper('varchar2');
3558       --
3559       --
3560       l_count := l_count + 1;
3561       l_transaction_table(l_count).param_name :=upper('p_mirror_cont_attribute11');
3562       l_transaction_table(l_count).param_value := null;
3563       l_transaction_table(l_count).param_data_type := upper('varchar2');
3564       --
3565       --
3566       l_count := l_count + 1;
3567       l_transaction_table(l_count).param_name :=upper('p_mirror_cont_attribute12');
3568       l_transaction_table(l_count).param_value := null;
3569       l_transaction_table(l_count).param_data_type := upper('varchar2');
3570       --
3571       --
3572       l_count := l_count + 1;
3573       l_transaction_table(l_count).param_name :=upper('p_mirror_cont_attribute13');
3574       l_transaction_table(l_count).param_value := null;
3575       l_transaction_table(l_count).param_data_type := upper('varchar2');
3576       --
3577       --
3578       l_count := l_count + 1;
3579       l_transaction_table(l_count).param_name :=upper('p_mirror_cont_attribute14');
3580       l_transaction_table(l_count).param_value := null;
3581       l_transaction_table(l_count).param_data_type := upper('varchar2');
3582       --
3583       --
3584       l_count := l_count + 1;
3585       l_transaction_table(l_count).param_name :=upper('p_mirror_cont_attribute15');
3586       l_transaction_table(l_count).param_value := null;
3587       l_transaction_table(l_count).param_data_type := upper('varchar2');
3588       --
3589       --
3590       l_count := l_count + 1;
3591       l_transaction_table(l_count).param_name :=upper('p_mirror_cont_attribute16');
3592       l_transaction_table(l_count).param_value := null;
3593       l_transaction_table(l_count).param_data_type := upper('varchar2');
3594       --
3595       --
3596       l_count := l_count + 1;
3597       l_transaction_table(l_count).param_name :=upper('p_mirror_cont_attribute17');
3598       l_transaction_table(l_count).param_value := null;
3599       l_transaction_table(l_count).param_data_type := upper('varchar2');
3600       --
3601       --
3602       l_count := l_count + 1;
3603       l_transaction_table(l_count).param_name :=upper('p_mirror_cont_attribute18');
3604       l_transaction_table(l_count).param_value := null;
3605       l_transaction_table(l_count).param_data_type := upper('varchar2');
3606       --
3607       --
3608       l_count := l_count + 1;
3609       l_transaction_table(l_count).param_name :=upper('p_mirror_cont_attribute19');
3610       l_transaction_table(l_count).param_value := null;
3611       l_transaction_table(l_count).param_data_type := upper('varchar2');
3612       --
3613       --
3614       l_count := l_count + 1;
3615       l_transaction_table(l_count).param_name :=upper('p_mirror_cont_attribute20');
3616       l_transaction_table(l_count).param_value := null;
3617       l_transaction_table(l_count).param_data_type := upper('varchar2');
3618       --
3619       --StartRegistration
3620       --  This is a marker for the contact person to be used to identify the Address
3621       --  to be retrieved for the contact person in context in review page.
3622       --  The HR_LAST_CONTACT_SET is in from the work flow attribute
3623       begin
3624             l_contact_set := wf_engine.GetItemAttrNumber(itemtype => p_item_type,
3625                                                 itemkey  => p_item_key,
3626                                                 aname    => 'HR_CONTACT_SET');
3627 
3628             exception when others then
3629                 hr_utility.set_location('Exception:'||l_proc,555);
3630                 l_contact_set := 0;
3631 
3632       end;
3633 
3634       l_count := l_count + 1;
3635       l_transaction_table(l_count).param_name := 'P_CONTACT_SET';
3636       l_transaction_table(l_count).param_value := l_contact_set;
3637       l_transaction_table(l_count).param_data_type := 'VARCHAR2';
3638       --
3639       -- EndRegistration
3640       --
3641       l_count := l_count + 1;
3642       l_transaction_table(l_count).param_name :=upper('p_contact_operation');
3643       l_transaction_table(l_count).param_value := p_contact_operation;
3644       l_transaction_table(l_count).param_data_type := upper('varchar2');
3645       --
3646       l_count := l_count + 1;
3647       l_transaction_table(l_count).param_name :=upper('p_emrg_cont_flag');
3648       l_transaction_table(l_count).param_value := p_emrg_cont_flag;
3649       l_transaction_table(l_count).param_data_type := upper('varchar2');
3650       --
3651       l_count := l_count + 1;
3652       l_transaction_table(l_count).param_name :=upper('p_dpdnt_bnf_flag');
3653       l_transaction_table(l_count).param_value := p_dpdnt_bnf_flag;
3654       l_transaction_table(l_count).param_data_type := upper('varchar2');
3655 
3656      --2315163fix
3657      --
3658       if p_contact_operation  in ( 'EMER_CR_NEW_CONT', 'EMER_CR_NEW_REL', 'EMRG_OVRW_UPD')
3659          or p_emrg_cont_flag ='Y' then
3660         l_is_emergency_contact := 'Yes';
3661       else
3662         l_is_emergency_contact := 'No';
3663       end if;
3664 
3665       l_count := l_count + 1;
3666       l_transaction_table(l_count).param_name :=upper('p_is_emergency_contact');
3667       l_transaction_table(l_count).param_value := l_is_emergency_contact;
3668       l_transaction_table(l_count).param_data_type := upper('varchar2');
3669 
3670       if p_contact_operation  in ( 'DPDNT_CR_NEW_CONT', 'DPDNT_CR_NEW_REL',  'DPDNT_OVRW_UPD')
3671          or p_dpdnt_bnf_flag ='Y' then
3672         l_is_dpdnt_bnf := 'Yes';
3673       else
3674         l_is_dpdnt_bnf := 'No';
3675       end if;
3676 
3677       l_count := l_count + 1;
3678       l_transaction_table(l_count).param_name :=upper('p_is_dpdnt_bnf');
3679       l_transaction_table(l_count).param_value := l_is_dpdnt_bnf;
3680       l_transaction_table(l_count).param_data_type := upper('varchar2');
3681       --
3682   l_count := l_count + 1;
3683   l_transaction_table(l_count).param_name :=upper('P_CONT_INFORMATION_CATEGORY');
3684   l_transaction_table(l_count).param_value := P_CONT_INFORMATION_CATEGORY;
3685   l_transaction_table(l_count).param_data_type := upper('varchar2');
3686 
3687   --
3688   --
3689 
3690   l_count := l_count + 1;
3691   l_transaction_table(l_count).param_name :=upper('P_CONT_INFORMATION1');
3692   l_transaction_table(l_count).param_value := P_CONT_INFORMATION1;
3693   l_transaction_table(l_count).param_data_type := upper('varchar2');
3694 
3695   --
3696   --
3697 
3698   l_count := l_count + 1;
3699   l_transaction_table(l_count).param_name :=upper('P_CONT_INFORMATION2');
3700   l_transaction_table(l_count).param_value := P_CONT_INFORMATION2;
3701   l_transaction_table(l_count).param_data_type := upper('varchar2');
3702 
3703   --
3704   --
3705 
3706   l_count := l_count + 1;
3707   l_transaction_table(l_count).param_name :=upper('P_CONT_INFORMATION3');
3708   l_transaction_table(l_count).param_value := P_CONT_INFORMATION3;
3709   l_transaction_table(l_count).param_data_type := upper('varchar2');
3710 
3711   --
3712   --
3713 
3714   l_count := l_count + 1;
3715   l_transaction_table(l_count).param_name :=upper('P_CONT_INFORMATION4');
3716   l_transaction_table(l_count).param_value := P_CONT_INFORMATION4;
3717   l_transaction_table(l_count).param_data_type := upper('varchar2');
3718 
3719   --
3720   --
3721 
3722   l_count := l_count + 1;
3723   l_transaction_table(l_count).param_name :=upper('P_CONT_INFORMATION5');
3724   l_transaction_table(l_count).param_value := P_CONT_INFORMATION5;
3725   l_transaction_table(l_count).param_data_type := upper('varchar2');
3726 
3727   --
3728   --
3729 
3730   l_count := l_count + 1;
3731   l_transaction_table(l_count).param_name :=upper('P_CONT_INFORMATION6');
3732   l_transaction_table(l_count).param_value := P_CONT_INFORMATION6;
3733   l_transaction_table(l_count).param_data_type := upper('varchar2');
3734 
3735   --
3736   --
3737 
3738   l_count := l_count + 1;
3739   l_transaction_table(l_count).param_name :=upper('P_CONT_INFORMATION7');
3740   l_transaction_table(l_count).param_value := P_CONT_INFORMATION7;
3741   l_transaction_table(l_count).param_data_type := upper('varchar2');
3742 
3743   --
3744   --
3745 
3746   l_count := l_count + 1;
3747   l_transaction_table(l_count).param_name :=upper('P_CONT_INFORMATION8');
3748   l_transaction_table(l_count).param_value := P_CONT_INFORMATION8;
3749   l_transaction_table(l_count).param_data_type := upper('varchar2');
3750 
3751   --
3752   --
3753 
3754   l_count := l_count + 1;
3755   l_transaction_table(l_count).param_name :=upper('P_CONT_INFORMATION9');
3756   l_transaction_table(l_count).param_value := P_CONT_INFORMATION9;
3757   l_transaction_table(l_count).param_data_type := upper('varchar2');
3758 
3759   --
3760   --
3761 
3762   l_count := l_count + 1;
3763   l_transaction_table(l_count).param_name :=upper('P_CONT_INFORMATION10');
3764   l_transaction_table(l_count).param_value := P_CONT_INFORMATION10;
3765   l_transaction_table(l_count).param_data_type := upper('varchar2');
3766 
3767   --
3768   --
3769 
3770   l_count := l_count + 1;
3771   l_transaction_table(l_count).param_name :=upper('P_CONT_INFORMATION11');
3772   l_transaction_table(l_count).param_value := P_CONT_INFORMATION11;
3773   l_transaction_table(l_count).param_data_type := upper('varchar2');
3774 
3775   --
3776   --
3777 
3778   l_count := l_count + 1;
3779   l_transaction_table(l_count).param_name :=upper('P_CONT_INFORMATION12');
3780   l_transaction_table(l_count).param_value := P_CONT_INFORMATION12;
3781   l_transaction_table(l_count).param_data_type := upper('varchar2');
3782 
3783   --
3784   --
3785 
3786   l_count := l_count + 1;
3787   l_transaction_table(l_count).param_name :=upper('P_CONT_INFORMATION13');
3788   l_transaction_table(l_count).param_value := P_CONT_INFORMATION13;
3789   l_transaction_table(l_count).param_data_type := upper('varchar2');
3790 
3791   --
3792   --
3793 
3794   l_count := l_count + 1;
3795   l_transaction_table(l_count).param_name :=upper('P_CONT_INFORMATION14');
3796   l_transaction_table(l_count).param_value := P_CONT_INFORMATION14;
3797   l_transaction_table(l_count).param_data_type := upper('varchar2');
3798 
3799   --
3800   --
3801 
3802   l_count := l_count + 1;
3803   l_transaction_table(l_count).param_name :=upper('P_CONT_INFORMATION15');
3804   l_transaction_table(l_count).param_value := P_CONT_INFORMATION15;
3805   l_transaction_table(l_count).param_data_type := upper('varchar2');
3806 
3807   --
3808   --
3809 
3810   l_count := l_count + 1;
3811   l_transaction_table(l_count).param_name :=upper('P_CONT_INFORMATION16');
3812   l_transaction_table(l_count).param_value := P_CONT_INFORMATION16;
3813   l_transaction_table(l_count).param_data_type := upper('varchar2');
3814 
3815   --
3816   --
3817 
3818   l_count := l_count + 1;
3819   l_transaction_table(l_count).param_name :=upper('P_CONT_INFORMATION17');
3820   l_transaction_table(l_count).param_value := P_CONT_INFORMATION17;
3821   l_transaction_table(l_count).param_data_type := upper('varchar2');
3822 
3823   --
3824   --
3825 
3826   l_count := l_count + 1;
3827   l_transaction_table(l_count).param_name :=upper('P_CONT_INFORMATION18');
3828   l_transaction_table(l_count).param_value := P_CONT_INFORMATION18;
3829   l_transaction_table(l_count).param_data_type := upper('varchar2');
3830 
3831   --
3832   --
3833 
3834   l_count := l_count + 1;
3835   l_transaction_table(l_count).param_name :=upper('P_CONT_INFORMATION19');
3836   l_transaction_table(l_count).param_value := P_CONT_INFORMATION19;
3837   l_transaction_table(l_count).param_data_type := upper('varchar2');
3838 
3839   --
3840   --
3841 
3842   l_count := l_count + 1;
3843   l_transaction_table(l_count).param_name :=upper('P_CONT_INFORMATION20');
3844   l_transaction_table(l_count).param_value := P_CONT_INFORMATION20;
3845   l_transaction_table(l_count).param_data_type := upper('varchar2');
3846 
3847       hr_utility.set_location('Before Calling :hr_transaction_ss.save_transaction_step', 75);
3848       hr_utility.set_location('Before Calling :hr_transaction_ss.save_transaction_step '
3849                                || to_char(l_transaction_table.count), 75);
3850       --
3851 
3852      -- Bug 3152505 : Added the new transaction var
3853      l_count := l_count + 1;
3854      l_transaction_table(l_count).param_name :=upper('p_orig_rel_type');
3855      l_transaction_table(l_count).param_value := p_orig_rel_type;
3856      l_transaction_table(l_count).param_data_type := upper('varchar2');
3857     --
3858 
3859       hr_transaction_ss.save_transaction_step
3860                 (p_item_type => p_item_type
3861                 ,p_item_key => p_item_key
3862                 ,p_login_person_id => nvl(p_login_person_id, p_person_id)
3863                 ,p_actid => p_activity_id
3864                 ,p_transaction_step_id => l_transaction_step_id
3865                 ,p_api_name => g_package || '.PROCESS_API'
3866                 ,p_transaction_data => l_transaction_table);
3867       --
3868       hr_utility.set_location('Leaving hr_process_contact_ss.update_contact_relationship', 80);
3869 
3870   END IF;
3871   --
3872   -- 9999 set out variables here. Do we need to set anyway.
3873   --
3874   p_name_combination_warning  :=  l_per_name_combination_warning;
3875   p_assign_payroll_warning    :=  l_per_assign_payroll_warning;
3876   p_orig_hire_warning         :=  l_per_orig_hire_warning;
3877   hr_utility.set_location('Exiting:'||l_proc, 85);
3878 
3879   EXCEPTION
3880     WHEN hr_utility.hr_error THEN
3881          -- -------------------------------------------
3882          -- an application error has been raised so we must
3883          -- redisplay the web form to display the error
3884          -- --------------------------------------------
3885          hr_utility.set_location('Exception:'||l_proc,560);
3886          hr_message.provide_error;
3887          l_message_number := hr_message.last_message_number;
3888          --
3889          -- 99999 What error messages I have to trap here.
3890          --
3891          IF l_message_number = 'APP-7165' OR
3892             l_message_number = 'APP-7155' THEN
3893             hr_utility.set_message(800, 'HR_UPDATE_NOT_ALLOWED');
3894             hr_utility.raise_error;
3895          ELSE
3896             hr_utility.raise_error;
3897          END IF;
3898     WHEN OTHERS THEN
3899       hr_utility.set_location('Exception:'||l_proc,565);
3900       fnd_message.set_name('PER', SQLERRM ||' '||to_char(SQLCODE));
3901       hr_utility.raise_error;
3902       --RAISE;  -- Raise error here relevant to the new tech stack.
3903   --
3904  end update_contact_relationship;
3905 --
3906 -- ---------------------------------------------------------------------------
3907 -- ---------------------------- < is_rec_changed > ---------------------------
3908 -- ---------------------------------------------------------------------------
3909 -- Purpose: This function will check field by field to determine if there
3910 --          are any changes made to the record.
3911 -- ---------------------------------------------------------------------------
3912 FUNCTION  is_rec_changed (
3913    p_effective_date                in        date
3914   ,p_contact_relationship_id       in        number
3915   ,p_contact_type                  in        varchar2  default hr_api.g_varchar2
3916   ,p_comments                      in        long      default hr_api.g_varchar2
3917   ,p_primary_contact_flag          in        varchar2  default hr_api.g_varchar2
3918   ,p_third_party_pay_flag          in        varchar2  default hr_api.g_varchar2
3919   ,p_bondholder_flag               in        varchar2  default hr_api.g_varchar2
3920   ,p_date_start                    in        date      default hr_api.g_date
3921   ,p_start_life_reason_id          in        number    default hr_api.g_number
3922   ,p_date_end                      in        date      default hr_api.g_date
3923   ,p_end_life_reason_id            in        number    default hr_api.g_number
3924   ,p_rltd_per_rsds_w_dsgntr_flag   in        varchar2  default hr_api.g_varchar2
3925   ,p_personal_flag                 in        varchar2  default hr_api.g_varchar2
3926   ,p_sequence_number               in        number    default hr_api.g_number
3927   ,p_dependent_flag                in        varchar2  default hr_api.g_varchar2
3928   ,p_beneficiary_flag              in        varchar2  default hr_api.g_varchar2
3929   ,p_cont_attribute_category       in        varchar2  default hr_api.g_varchar2
3930   ,p_cont_attribute1               in        varchar2  default hr_api.g_varchar2
3931   ,p_cont_attribute2               in        varchar2  default hr_api.g_varchar2
3932   ,p_cont_attribute3               in        varchar2  default hr_api.g_varchar2
3933   ,p_cont_attribute4               in        varchar2  default hr_api.g_varchar2
3934   ,p_cont_attribute5               in        varchar2  default hr_api.g_varchar2
3935   ,p_cont_attribute6               in        varchar2  default hr_api.g_varchar2
3936   ,p_cont_attribute7               in        varchar2  default hr_api.g_varchar2
3937   ,p_cont_attribute8               in        varchar2  default hr_api.g_varchar2
3938   ,p_cont_attribute9               in        varchar2  default hr_api.g_varchar2
3939   ,p_cont_attribute10              in        varchar2  default hr_api.g_varchar2
3940   ,p_cont_attribute11              in        varchar2  default hr_api.g_varchar2
3941   ,p_cont_attribute12              in        varchar2  default hr_api.g_varchar2
3942   ,p_cont_attribute13              in        varchar2  default hr_api.g_varchar2
3943   ,p_cont_attribute14              in        varchar2  default hr_api.g_varchar2
3944   ,p_cont_attribute15              in        varchar2  default hr_api.g_varchar2
3945   ,p_cont_attribute16              in        varchar2  default hr_api.g_varchar2
3946   ,p_cont_attribute17              in        varchar2  default hr_api.g_varchar2
3947   ,p_cont_attribute18              in        varchar2  default hr_api.g_varchar2
3948   ,p_cont_attribute19              in        varchar2  default hr_api.g_varchar2
3949   ,p_cont_attribute20              in        varchar2  default hr_api.g_varchar2
3950 -- Added new params
3951   ,P_CONT_INFORMATION_CATEGORY 	  in        varchar2    default hr_api.g_varchar2
3952   ,P_CONT_INFORMATION1            in        varchar2    default hr_api.g_varchar2
3953   ,P_CONT_INFORMATION2            in        varchar2    default hr_api.g_varchar2
3954   ,P_CONT_INFORMATION3            in        varchar2    default hr_api.g_varchar2
3955   ,P_CONT_INFORMATION4            in        varchar2    default hr_api.g_varchar2
3956   ,P_CONT_INFORMATION5            in        varchar2    default hr_api.g_varchar2
3957   ,P_CONT_INFORMATION6            in        varchar2    default hr_api.g_varchar2
3958   ,P_CONT_INFORMATION7            in        varchar2    default hr_api.g_varchar2
3959   ,P_CONT_INFORMATION8            in        varchar2    default hr_api.g_varchar2
3960   ,P_CONT_INFORMATION9            in        varchar2    default hr_api.g_varchar2
3961   ,P_CONT_INFORMATION10           in        varchar2    default hr_api.g_varchar2
3962   ,P_CONT_INFORMATION11           in        varchar2    default hr_api.g_varchar2
3963   ,P_CONT_INFORMATION12           in        varchar2    default hr_api.g_varchar2
3964   ,P_CONT_INFORMATION13           in        varchar2    default hr_api.g_varchar2
3965   ,P_CONT_INFORMATION14           in        varchar2    default hr_api.g_varchar2
3966   ,P_CONT_INFORMATION15           in        varchar2    default hr_api.g_varchar2
3967   ,P_CONT_INFORMATION16           in        varchar2    default hr_api.g_varchar2
3968   ,P_CONT_INFORMATION17           in        varchar2    default hr_api.g_varchar2
3969   ,P_CONT_INFORMATION18           in        varchar2    default hr_api.g_varchar2
3970   ,P_CONT_INFORMATION19           in        varchar2    default hr_api.g_varchar2
3971   ,P_CONT_INFORMATION20           in        varchar2    default hr_api.g_varchar2
3972   ,p_object_version_number         in        number )
3973 return boolean  is
3974 --
3975   l_rec_changed                    boolean default null;
3976   l_cur_contact_data               gc_get_cur_contact_data%rowtype;
3977   l_proc   varchar2(72)  := g_package||'is_rec_changed';
3978 --
3979 BEGIN
3980   --
3981 --2480916 fix starts
3982 --decommenting the fetch of cursor data as we are checking this cursor value with the current value.
3983 --
3984   hr_utility.set_location('Entering:'||l_proc, 5);
3985   OPEN gc_get_cur_contact_data(p_contact_relationship_id => p_contact_relationship_id);
3986   FETCH gc_get_cur_contact_data into l_cur_contact_data;
3987   IF gc_get_cur_contact_data%NOTFOUND
3988   THEN
3989      hr_utility.set_location('IF gc_get_cur_contact_data NOTFOUND:'||l_proc,10 );
3990      CLOSE gc_get_cur_contact_data;
3991      raise g_data_error;
3992   ELSE
3993      hr_utility.set_location('IF gc_get_cur_contact_data FOUND:'||l_proc,15 );
3994      CLOSE gc_get_cur_contact_data;
3995   END IF;
3996 --2480916 fix ends
3997 --
3998 ------------------------------------------------------------------------------
3999 -- NOTE: We need to use nvl(xxx attribute name, hr_api.g_xxxx) because the
4000 --       parameter coming in can be null.  If we do not use nvl, then it will
4001 --       never be equal to the database null value if the parameter value is
4002 --       also null.
4003 ------------------------------------------------------------------------------
4004 
4005    --
4006    IF p_contact_type <> hr_api.g_varchar2
4007    THEN
4008        --
4009        IF nvl(p_contact_type, hr_api.g_varchar2) <>
4010              nvl(l_cur_contact_data.contact_type, hr_api.g_varchar2)
4011        THEN
4012             l_rec_changed := TRUE;
4013             goto finish;
4014        END IF;
4015        --
4016    END IF;
4017    --
4018    --
4019    IF p_comments <> hr_api.g_varchar2
4020    THEN
4021        --
4022        IF nvl(p_comments, hr_api.g_varchar2) <>
4023              nvl(l_cur_contact_data.comments, hr_api.g_varchar2)
4024        THEN
4025             l_rec_changed := TRUE;
4026             goto finish;
4027        END IF;
4028        --
4029    END IF;
4030    --
4031    --
4032    IF p_primary_contact_flag <> hr_api.g_varchar2
4033    THEN
4034        --
4035        IF nvl(p_primary_contact_flag, hr_api.g_varchar2) <>
4036              nvl(l_cur_contact_data.primary_contact_flag, hr_api.g_varchar2)
4037        THEN
4038             l_rec_changed := TRUE;
4039             goto finish;
4040        END IF;
4041        --
4042    END IF;
4043    --
4044    --
4045    IF p_third_party_pay_flag <> hr_api.g_varchar2
4046    THEN
4047        --
4048        IF nvl(p_third_party_pay_flag, hr_api.g_varchar2) <>
4049              nvl(l_cur_contact_data.third_party_pay_flag, hr_api.g_varchar2)
4050        THEN
4051             l_rec_changed := TRUE;
4052             goto finish;
4053        END IF;
4054        --
4055    END IF;
4056    --
4057    --
4058    IF p_bondholder_flag <> hr_api.g_varchar2
4059    THEN
4060        --
4061        IF nvl(p_bondholder_flag, hr_api.g_varchar2) <>
4062              nvl(l_cur_contact_data.bondholder_flag, hr_api.g_varchar2)
4063        THEN
4064             l_rec_changed := TRUE;
4065             goto finish;
4066        END IF;
4067        --
4068    END IF;
4069    --
4070    --
4071    IF p_date_start <> hr_api.g_date
4072    THEN
4073        --
4074        IF nvl(p_date_start, hr_api.g_date) <>
4075              nvl(l_cur_contact_data.date_start, hr_api.g_date)
4076        THEN
4077             l_rec_changed := TRUE;
4078             goto finish;
4079        END IF;
4080        --
4081    END IF;
4082    --
4083    --
4084    IF p_start_life_reason_id <> hr_api.g_number
4085    THEN
4086        --
4087        IF nvl(p_start_life_reason_id, hr_api.g_number) <>
4088              nvl(l_cur_contact_data.start_life_reason_id, hr_api.g_number)
4089        THEN
4090             l_rec_changed := TRUE;
4091             goto finish;
4092        END IF;
4093        --
4094    END IF;
4095    --
4096    --
4097    IF p_date_end <> hr_api.g_date
4098    THEN
4099        --
4100        IF nvl(p_date_end, hr_api.g_date) <>
4101              nvl(l_cur_contact_data.date_end, hr_api.g_date)
4102        THEN
4103             l_rec_changed := TRUE;
4104             goto finish;
4105        END IF;
4106        --
4107    END IF;
4108    --
4109    --
4110    IF p_end_life_reason_id <> hr_api.g_number
4111    THEN
4112        --
4113        IF nvl(p_end_life_reason_id, hr_api.g_number) <>
4114              nvl(l_cur_contact_data.end_life_reason_id, hr_api.g_number)
4115        THEN
4116             l_rec_changed := TRUE;
4117             goto finish;
4118        END IF;
4119        --
4120    END IF;
4121    --
4122    --
4123    IF p_rltd_per_rsds_w_dsgntr_flag <> hr_api.g_varchar2
4124    THEN
4125        --
4126        IF nvl(p_rltd_per_rsds_w_dsgntr_flag, hr_api.g_varchar2) <>
4127              nvl(l_cur_contact_data.rltd_per_rsds_w_dsgntr_flag, hr_api.g_varchar2)
4128        THEN
4129             l_rec_changed := TRUE;
4130             goto finish;
4131        END IF;
4132        --
4133    END IF;
4134    --
4135    --
4136    IF p_personal_flag <> hr_api.g_varchar2
4137    THEN
4138        --
4139        IF nvl(p_personal_flag, hr_api.g_varchar2) <>
4140              nvl(l_cur_contact_data.personal_flag, hr_api.g_varchar2)
4141        THEN
4142             l_rec_changed := TRUE;
4143             goto finish;
4144        END IF;
4145        --
4146    END IF;
4147    --
4148    --
4149    IF p_sequence_number <> hr_api.g_number
4150    THEN
4151        --
4152        IF nvl(p_sequence_number, hr_api.g_number) <>
4153              nvl(l_cur_contact_data.sequence_number, hr_api.g_number)
4154        THEN
4155             l_rec_changed := TRUE;
4156             goto finish;
4157        END IF;
4158        --
4159    END IF;
4160    --
4161    --
4162    IF p_dependent_flag <> hr_api.g_varchar2
4163    THEN
4164        --
4165        IF nvl(p_dependent_flag, hr_api.g_varchar2) <>
4166              nvl(l_cur_contact_data.dependent_flag, hr_api.g_varchar2)
4167        THEN
4168             l_rec_changed := TRUE;
4169             goto finish;
4170        END IF;
4171        --
4172    END IF;
4173    --
4174    --
4175    IF p_beneficiary_flag <> hr_api.g_varchar2
4176    THEN
4177        --
4178        IF nvl(p_beneficiary_flag, hr_api.g_varchar2) <>
4179              nvl(l_cur_contact_data.beneficiary_flag, hr_api.g_varchar2)
4180        THEN
4181             l_rec_changed := TRUE;
4182             goto finish;
4183        END IF;
4184        --
4185    END IF;
4186    --
4187    --
4188    IF p_cont_attribute_category <> hr_api.g_varchar2
4189    THEN
4190        --
4191        IF nvl(p_cont_attribute_category, hr_api.g_varchar2) <>
4192              nvl(l_cur_contact_data.cont_attribute_category, hr_api.g_varchar2)
4193        THEN
4194             l_rec_changed := TRUE;
4195             goto finish;
4196        END IF;
4197        --
4198    END IF;
4199    --
4200    --
4201    IF p_cont_attribute1 <> hr_api.g_varchar2
4202    THEN
4203        --
4204        IF nvl(p_cont_attribute1, hr_api.g_varchar2) <>
4205              nvl(l_cur_contact_data.cont_attribute1, hr_api.g_varchar2)
4206        THEN
4207             l_rec_changed := TRUE;
4208             goto finish;
4209        END IF;
4210        --
4211    END IF;
4212    --
4213    --
4214    IF p_cont_attribute2 <> hr_api.g_varchar2
4215    THEN
4216        --
4217        IF nvl(p_cont_attribute2, hr_api.g_varchar2) <>
4218              nvl(l_cur_contact_data.cont_attribute2, hr_api.g_varchar2)
4219        THEN
4220             l_rec_changed := TRUE;
4221             goto finish;
4222        END IF;
4223        --
4224    END IF;
4225    --
4226    --
4227    IF p_cont_attribute3 <> hr_api.g_varchar2
4228    THEN
4229        --
4230        IF nvl(p_cont_attribute3, hr_api.g_varchar2) <>
4231              nvl(l_cur_contact_data.cont_attribute3, hr_api.g_varchar2)
4232        THEN
4233             l_rec_changed := TRUE;
4234             goto finish;
4235        END IF;
4236        --
4237    END IF;
4238    --
4239    --
4240    IF p_cont_attribute4 <> hr_api.g_varchar2
4241    THEN
4242        --
4243        IF nvl(p_cont_attribute4, hr_api.g_varchar2) <>
4244              nvl(l_cur_contact_data.cont_attribute4, hr_api.g_varchar2)
4245        THEN
4246             l_rec_changed := TRUE;
4247             goto finish;
4248        END IF;
4249        --
4250    END IF;
4251    --
4252    --
4253    IF p_cont_attribute5 <> hr_api.g_varchar2
4254    THEN
4255        --
4256        IF nvl(p_cont_attribute5, hr_api.g_varchar2) <>
4257              nvl(l_cur_contact_data.cont_attribute5, hr_api.g_varchar2)
4258        THEN
4259             l_rec_changed := TRUE;
4260             goto finish;
4261        END IF;
4262        --
4263    END IF;
4264    --
4265    --
4266    IF p_cont_attribute6 <> hr_api.g_varchar2
4267    THEN
4268        --
4269        IF nvl(p_cont_attribute6, hr_api.g_varchar2) <>
4270              nvl(l_cur_contact_data.cont_attribute6, hr_api.g_varchar2)
4271        THEN
4272             l_rec_changed := TRUE;
4273             goto finish;
4274        END IF;
4275        --
4276    END IF;
4277    --
4278    --
4279    IF p_cont_attribute7 <> hr_api.g_varchar2
4280    THEN
4281        --
4282        IF nvl(p_cont_attribute7, hr_api.g_varchar2) <>
4283              nvl(l_cur_contact_data.cont_attribute7, hr_api.g_varchar2)
4284        THEN
4285             l_rec_changed := TRUE;
4286             goto finish;
4287        END IF;
4288        --
4289    END IF;
4290    --
4291    --
4292    IF p_cont_attribute8 <> hr_api.g_varchar2
4293    THEN
4294        --
4295        IF nvl(p_cont_attribute8, hr_api.g_varchar2) <>
4296              nvl(l_cur_contact_data.cont_attribute8, hr_api.g_varchar2)
4297        THEN
4298             l_rec_changed := TRUE;
4299             goto finish;
4300        END IF;
4301        --
4302    END IF;
4303    --
4304    --
4305    IF p_cont_attribute9 <> hr_api.g_varchar2
4306    THEN
4307        --
4308        IF nvl(p_cont_attribute9, hr_api.g_varchar2) <>
4309              nvl(l_cur_contact_data.cont_attribute9, hr_api.g_varchar2)
4310        THEN
4311             l_rec_changed := TRUE;
4312             goto finish;
4313        END IF;
4314        --
4315    END IF;
4316    --
4317    --
4318    IF p_cont_attribute10 <> hr_api.g_varchar2
4319    THEN
4320        --
4321        IF nvl(p_cont_attribute10, hr_api.g_varchar2) <>
4322              nvl(l_cur_contact_data.cont_attribute10, hr_api.g_varchar2)
4323        THEN
4324             l_rec_changed := TRUE;
4325             goto finish;
4326        END IF;
4327        --
4328    END IF;
4329    --
4330    --
4331    IF p_cont_attribute11 <> hr_api.g_varchar2
4332    THEN
4333        --
4334        IF nvl(p_cont_attribute11, hr_api.g_varchar2) <>
4335              nvl(l_cur_contact_data.cont_attribute11, hr_api.g_varchar2)
4336        THEN
4337             l_rec_changed := TRUE;
4338             goto finish;
4339        END IF;
4340        --
4341    END IF;
4342    --
4343    --
4344    IF p_cont_attribute12 <> hr_api.g_varchar2
4345    THEN
4346        --
4347        IF nvl(p_cont_attribute12, hr_api.g_varchar2) <>
4348              nvl(l_cur_contact_data.cont_attribute12, hr_api.g_varchar2)
4349        THEN
4350             l_rec_changed := TRUE;
4351             goto finish;
4352        END IF;
4353        --
4354    END IF;
4355    --
4356    --
4357    IF p_cont_attribute13 <> hr_api.g_varchar2
4358    THEN
4359        --
4360        IF nvl(p_cont_attribute13, hr_api.g_varchar2) <>
4361              nvl(l_cur_contact_data.cont_attribute13, hr_api.g_varchar2)
4362        THEN
4363             l_rec_changed := TRUE;
4364             goto finish;
4365        END IF;
4366        --
4367    END IF;
4368    --
4369    --
4370    IF p_cont_attribute14 <> hr_api.g_varchar2
4371    THEN
4372        --
4373        IF nvl(p_cont_attribute14, hr_api.g_varchar2) <>
4374              nvl(l_cur_contact_data.cont_attribute14, hr_api.g_varchar2)
4375        THEN
4376             l_rec_changed := TRUE;
4377             goto finish;
4378        END IF;
4379        --
4380    END IF;
4381    --
4382    --
4383    IF p_cont_attribute15 <> hr_api.g_varchar2
4384    THEN
4385        --
4386        IF nvl(p_cont_attribute15, hr_api.g_varchar2) <>
4387              nvl(l_cur_contact_data.cont_attribute15, hr_api.g_varchar2)
4388        THEN
4389             l_rec_changed := TRUE;
4390             goto finish;
4391        END IF;
4392        --
4393    END IF;
4394    --
4395    --
4396    IF p_cont_attribute16 <> hr_api.g_varchar2
4397    THEN
4398        --
4399        IF nvl(p_cont_attribute16, hr_api.g_varchar2) <>
4400              nvl(l_cur_contact_data.cont_attribute16, hr_api.g_varchar2)
4401        THEN
4402             l_rec_changed := TRUE;
4403             goto finish;
4404        END IF;
4405        --
4406    END IF;
4407    --
4408    --
4409    IF p_cont_attribute17 <> hr_api.g_varchar2
4410    THEN
4411        --
4412        IF nvl(p_cont_attribute17, hr_api.g_varchar2) <>
4413              nvl(l_cur_contact_data.cont_attribute17, hr_api.g_varchar2)
4414        THEN
4415             l_rec_changed := TRUE;
4416             goto finish;
4417        END IF;
4418        --
4419    END IF;
4420    --
4421    --
4422    IF p_cont_attribute18 <> hr_api.g_varchar2
4423    THEN
4424        --
4425        IF nvl(p_cont_attribute18, hr_api.g_varchar2) <>
4426              nvl(l_cur_contact_data.cont_attribute18, hr_api.g_varchar2)
4427        THEN
4428             l_rec_changed := TRUE;
4429             goto finish;
4430        END IF;
4431        --
4432    END IF;
4433    --
4434    --
4435    IF p_cont_attribute19 <> hr_api.g_varchar2
4436    THEN
4437        --
4438        IF nvl(p_cont_attribute19, hr_api.g_varchar2) <>
4439              nvl(l_cur_contact_data.cont_attribute19, hr_api.g_varchar2)
4440        THEN
4441             l_rec_changed := TRUE;
4442             goto finish;
4443        END IF;
4444        --
4445    END IF;
4446    --
4447    --
4448    IF p_cont_attribute20 <> hr_api.g_varchar2
4449    THEN
4450        --
4451        IF nvl(p_cont_attribute20, hr_api.g_varchar2) <>
4452              nvl(l_cur_contact_data.cont_attribute20, hr_api.g_varchar2)
4453        THEN
4454             l_rec_changed := TRUE;
4455             goto finish;
4456        END IF;
4457        --
4458    END IF;
4459    --
4460  IF P_CONT_INFORMATION1 <> hr_api.g_varchar2
4461    THEN
4462        --
4463        IF nvl(P_CONT_INFORMATION1, hr_api.g_varchar2) <>
4464              nvl(l_cur_contact_data.CONT_INFORMATION1, hr_api.g_varchar2)
4465        THEN
4466             l_rec_changed := TRUE;
4467             goto finish;
4468        END IF;
4469        --
4470    END IF;
4471 
4472    IF P_CONT_INFORMATION2 <> hr_api.g_varchar2
4473    THEN
4474        --
4475        IF nvl(P_CONT_INFORMATION2, hr_api.g_varchar2) <>
4476              nvl(l_cur_contact_data.CONT_INFORMATION2, hr_api.g_varchar2)
4477        THEN
4478             l_rec_changed := TRUE;
4479             goto finish;
4480        END IF;
4481        --
4482    END IF;
4483 
4484    IF P_CONT_INFORMATION3 <> hr_api.g_varchar2
4485    THEN
4486        --
4487        IF nvl(P_CONT_INFORMATION3, hr_api.g_varchar2) <>
4488              nvl(l_cur_contact_data.CONT_INFORMATION3, hr_api.g_varchar2)
4489        THEN
4490             l_rec_changed := TRUE;
4491             goto finish;
4492        END IF;
4493        --
4494    END IF;
4495 
4496    IF P_CONT_INFORMATION4 <> hr_api.g_varchar2
4497    THEN
4498        --
4499        IF nvl(P_CONT_INFORMATION4, hr_api.g_varchar2) <>
4500              nvl(l_cur_contact_data.CONT_INFORMATION4, hr_api.g_varchar2)
4501        THEN
4502             l_rec_changed := TRUE;
4503             goto finish;
4504        END IF;
4505        --
4506    END IF;
4507 
4508    IF P_CONT_INFORMATION5 <> hr_api.g_varchar2
4509    THEN
4510        --
4511        IF nvl(P_CONT_INFORMATION5, hr_api.g_varchar2) <>
4512              nvl(l_cur_contact_data.CONT_INFORMATION5, hr_api.g_varchar2)
4513        THEN
4514             l_rec_changed := TRUE;
4515             goto finish;
4516        END IF;
4517        --
4518    END IF;
4519 
4520    IF P_CONT_INFORMATION6 <> hr_api.g_varchar2
4521    THEN
4522        --
4523        IF nvl(P_CONT_INFORMATION6, hr_api.g_varchar2) <>
4524              nvl(l_cur_contact_data.CONT_INFORMATION6, hr_api.g_varchar2)
4525        THEN
4526             l_rec_changed := TRUE;
4527             goto finish;
4528        END IF;
4529        --
4530    END IF;
4531 
4532    IF P_CONT_INFORMATION7 <> hr_api.g_varchar2
4533    THEN
4534        --
4535        IF nvl(P_CONT_INFORMATION7, hr_api.g_varchar2) <>
4536              nvl(l_cur_contact_data.CONT_INFORMATION7, hr_api.g_varchar2)
4537        THEN
4538             l_rec_changed := TRUE;
4539             goto finish;
4540        END IF;
4541        --
4542    END IF;
4543 
4544    IF P_CONT_INFORMATION8 <> hr_api.g_varchar2
4545    THEN
4546        --
4547        IF nvl(P_CONT_INFORMATION8, hr_api.g_varchar2) <>
4548              nvl(l_cur_contact_data.CONT_INFORMATION8, hr_api.g_varchar2)
4549        THEN
4550             l_rec_changed := TRUE;
4551             goto finish;
4552        END IF;
4553        --
4554    END IF;
4555 
4556    IF P_CONT_INFORMATION9 <> hr_api.g_varchar2
4557    THEN
4558        --
4559        IF nvl(P_CONT_INFORMATION9, hr_api.g_varchar2) <>
4560              nvl(l_cur_contact_data.CONT_INFORMATION9, hr_api.g_varchar2)
4561        THEN
4562             l_rec_changed := TRUE;
4563             goto finish;
4564        END IF;
4565        --
4566    END IF;
4567 
4568    IF P_CONT_INFORMATION10 <> hr_api.g_varchar2
4569    THEN
4570        --
4571        IF nvl(P_CONT_INFORMATION10, hr_api.g_varchar2) <>
4572              nvl(l_cur_contact_data.CONT_INFORMATION10, hr_api.g_varchar2)
4573        THEN
4574             l_rec_changed := TRUE;
4575             goto finish;
4576        END IF;
4577        --
4578    END IF;
4579 
4580    IF P_CONT_INFORMATION11 <> hr_api.g_varchar2
4581    THEN
4582        --
4583        IF nvl(P_CONT_INFORMATION11, hr_api.g_varchar2) <>
4584              nvl(l_cur_contact_data.CONT_INFORMATION11, hr_api.g_varchar2)
4585        THEN
4586             l_rec_changed := TRUE;
4587             goto finish;
4588        END IF;
4589        --
4590    END IF;
4591 
4592    IF P_CONT_INFORMATION12 <> hr_api.g_varchar2
4593    THEN
4594        --
4595        IF nvl(P_CONT_INFORMATION12, hr_api.g_varchar2) <>
4596              nvl(l_cur_contact_data.CONT_INFORMATION12, hr_api.g_varchar2)
4597        THEN
4598             l_rec_changed := TRUE;
4599             goto finish;
4600        END IF;
4601        --
4602    END IF;
4603 
4604    IF P_CONT_INFORMATION13 <> hr_api.g_varchar2
4605    THEN
4606        --
4607        IF nvl(P_CONT_INFORMATION13, hr_api.g_varchar2) <>
4608              nvl(l_cur_contact_data.CONT_INFORMATION13, hr_api.g_varchar2)
4609        THEN
4610             l_rec_changed := TRUE;
4611             goto finish;
4612        END IF;
4613        --
4614    END IF;
4615 
4616    IF P_CONT_INFORMATION14 <> hr_api.g_varchar2
4617    THEN
4618        --
4619        IF nvl(P_CONT_INFORMATION14, hr_api.g_varchar2) <>
4620              nvl(l_cur_contact_data.CONT_INFORMATION14, hr_api.g_varchar2)
4621        THEN
4622             l_rec_changed := TRUE;
4623             goto finish;
4624        END IF;
4625        --
4626    END IF;
4627 
4628    IF P_CONT_INFORMATION15 <> hr_api.g_varchar2
4629    THEN
4630        --
4631        IF nvl(P_CONT_INFORMATION15, hr_api.g_varchar2) <>
4632              nvl(l_cur_contact_data.CONT_INFORMATION15, hr_api.g_varchar2)
4633        THEN
4634             l_rec_changed := TRUE;
4635             goto finish;
4636        END IF;
4637        --
4638    END IF;
4639 
4640    IF P_CONT_INFORMATION16 <> hr_api.g_varchar2
4641    THEN
4642        --
4643        IF nvl(P_CONT_INFORMATION16, hr_api.g_varchar2) <>
4644              nvl(l_cur_contact_data.CONT_INFORMATION16, hr_api.g_varchar2)
4645        THEN
4646             l_rec_changed := TRUE;
4647             goto finish;
4648        END IF;
4649        --
4650    END IF;
4651 
4652    IF P_CONT_INFORMATION17 <> hr_api.g_varchar2
4653    THEN
4654        --
4655        IF nvl(P_CONT_INFORMATION17, hr_api.g_varchar2) <>
4656              nvl(l_cur_contact_data.CONT_INFORMATION17, hr_api.g_varchar2)
4657        THEN
4658             l_rec_changed := TRUE;
4659             goto finish;
4660        END IF;
4661        --
4662    END IF;
4663 
4664    IF P_CONT_INFORMATION18 <> hr_api.g_varchar2
4665    THEN
4666        --
4667        IF nvl(P_CONT_INFORMATION18, hr_api.g_varchar2) <>
4668              nvl(l_cur_contact_data.CONT_INFORMATION18, hr_api.g_varchar2)
4669        THEN
4670             l_rec_changed := TRUE;
4671             goto finish;
4672        END IF;
4673        --
4674    END IF;
4675 
4676    IF P_CONT_INFORMATION19 <> hr_api.g_varchar2
4677    THEN
4678        --
4679        IF nvl(P_CONT_INFORMATION19, hr_api.g_varchar2) <>
4680              nvl(l_cur_contact_data.CONT_INFORMATION19, hr_api.g_varchar2)
4681        THEN
4682             l_rec_changed := TRUE;
4683             goto finish;
4684        END IF;
4685        --
4686    END IF;
4687 
4688    IF P_CONT_INFORMATION20 <> hr_api.g_varchar2
4689    THEN
4690        --
4691        IF nvl(P_CONT_INFORMATION20, hr_api.g_varchar2) <>
4692              nvl(l_cur_contact_data.CONT_INFORMATION20, hr_api.g_varchar2)
4693        THEN
4694             l_rec_changed := TRUE;
4695             goto finish;
4696        END IF;
4697        --
4698    END IF;
4699    --
4700    <<finish>>
4701    --
4702   hr_utility.set_location('Exiting:'||l_proc, 20);
4703   RETURN l_rec_changed;
4704 
4705 
4706   EXCEPTION
4707   When g_data_error THEN
4708   hr_utility.set_location('Exception:When g_data_error THEN'||l_proc,555);
4709        raise;
4710 
4711   When others THEN
4712     hr_utility.set_location('  When others THEN'||l_proc,560);
4713       fnd_message.set_name('PER', SQLERRM ||' '||to_char(SQLCODE));
4714       hr_utility.raise_error;
4715        --raise;
4716 
4717   END is_rec_changed;
4718 
4719 
4720 -- ---------------------------------------------------------------------------
4721 -- ---------------------- < get_contact_from_tt> -------------------------
4722 -- ---------------------------------------------------------------------------
4723 -- Purpose: This procedure will get transaction data which are saved earlier
4724 --          in the current transaction.  This is invoked when a user click BACK
4725 --          button to go back from the Review page to Update page to correct
4726 --          typos or make further changes.  Hence, we need to use the item_type
4727 --          item_key passed in to retrieve the transaction record.
4728 --          This is an overloaded version.
4729 -- ---------------------------------------------------------------------------
4730 
4731 procedure get_contact_from_tt
4732   (
4733    p_start_date                   out nocopy        date
4734   ,p_business_group_id            out nocopy        number
4735   ,p_person_id                    out nocopy        number
4736   ,p_contact_person_id            out nocopy        number
4737   ,p_contact_type                 out nocopy        varchar2
4738   ,p_ctr_comments                 out nocopy        varchar2
4739   ,p_primary_contact_flag         out nocopy        varchar2
4740   ,p_date_start                   out nocopy        date
4741   ,p_start_life_reason_id         out nocopy        number
4742   ,p_date_end                     out nocopy        date
4743   ,p_end_life_reason_id           out nocopy        number
4744   ,p_rltd_per_rsds_w_dsgntr_flag  out nocopy        varchar2
4745   ,p_personal_flag                out nocopy        varchar2
4746   ,p_sequence_number              out nocopy        number
4747   ,p_cont_attribute_category      out nocopy        varchar2
4748   ,p_cont_attribute1              out nocopy        varchar2
4749   ,p_cont_attribute2              out nocopy        varchar2
4750   ,p_cont_attribute3              out nocopy        varchar2
4751   ,p_cont_attribute4              out nocopy        varchar2
4752   ,p_cont_attribute5              out nocopy        varchar2
4753   ,p_cont_attribute6              out nocopy        varchar2
4754   ,p_cont_attribute7              out nocopy        varchar2
4755   ,p_cont_attribute8              out nocopy        varchar2
4756   ,p_cont_attribute9              out nocopy        varchar2
4757   ,p_cont_attribute10             out nocopy        varchar2
4758   ,p_cont_attribute11             out nocopy        varchar2
4759   ,p_cont_attribute12             out nocopy        varchar2
4760   ,p_cont_attribute13             out nocopy        varchar2
4761   ,p_cont_attribute14             out nocopy        varchar2
4762   ,p_cont_attribute15             out nocopy        varchar2
4763   ,p_cont_attribute16             out nocopy        varchar2
4764   ,p_cont_attribute17             out nocopy        varchar2
4765   ,p_cont_attribute18             out nocopy        varchar2
4766   ,p_cont_attribute19             out nocopy        varchar2
4767   ,p_cont_attribute20             out nocopy        varchar2
4768   ,p_third_party_pay_flag         out nocopy        varchar2
4769   ,p_bondholder_flag              out nocopy        varchar2
4770   ,p_dependent_flag               out nocopy        varchar2
4771   ,p_beneficiary_flag             out nocopy        varchar2
4772   ,p_last_name                    out nocopy        varchar2
4773   ,p_sex                          out nocopy        varchar2
4774   ,p_sex_meaning                  out nocopy        varchar2
4775   ,p_person_type_id               out nocopy        number
4776   ,p_per_comments                 out nocopy        varchar2
4777   ,p_date_of_birth                out nocopy        date
4778   ,p_email_address                out nocopy        varchar2
4779   ,p_first_name                   out nocopy        varchar2
4780   ,p_known_as                     out nocopy        varchar2
4781   ,p_marital_status               out nocopy        varchar2
4782   ,p_marital_status_meaning       out nocopy        varchar2
4783   ,p_student_status               out nocopy        varchar2
4784   ,p_student_status_meaning       out nocopy        varchar2
4785   ,p_middle_names                 out nocopy        varchar2
4786   ,p_nationality                  out nocopy        varchar2
4787   ,p_national_identifier          out nocopy        varchar2
4788   ,p_previous_last_name           out nocopy        varchar2
4789   ,p_registered_disabled_flag     out nocopy        varchar2
4790   ,p_registered_disabled          out nocopy        varchar2
4791   ,p_title                        out nocopy        varchar2
4792   ,p_work_telephone               out nocopy        varchar2
4793   ,p_attribute_category           out nocopy        varchar2
4794   ,p_attribute1                   out nocopy        varchar2
4795   ,p_attribute2                   out nocopy        varchar2
4796   ,p_attribute3                   out nocopy        varchar2
4797   ,p_attribute4                   out nocopy        varchar2
4798   ,p_attribute5                   out nocopy        varchar2
4799   ,p_attribute6                   out nocopy        varchar2
4800   ,p_attribute7                   out nocopy        varchar2
4801   ,p_attribute8                   out nocopy        varchar2
4802   ,p_attribute9                   out nocopy        varchar2
4803   ,p_attribute10                  out nocopy        varchar2
4804   ,p_attribute11                  out nocopy        varchar2
4805   ,p_attribute12                  out nocopy        varchar2
4806   ,p_attribute13                  out nocopy        varchar2
4807   ,p_attribute14                  out nocopy        varchar2
4808   ,p_attribute15                  out nocopy        varchar2
4809   ,p_attribute16                  out nocopy        varchar2
4810   ,p_attribute17                  out nocopy        varchar2
4811   ,p_attribute18                  out nocopy        varchar2
4812   ,p_attribute19                  out nocopy        varchar2
4813   ,p_attribute20                  out nocopy        varchar2
4814   ,p_attribute21                  out nocopy        varchar2
4815   ,p_attribute22                  out nocopy        varchar2
4816   ,p_attribute23                  out nocopy        varchar2
4817   ,p_attribute24                  out nocopy        varchar2
4818   ,p_attribute25                  out nocopy        varchar2
4819   ,p_attribute26                  out nocopy        varchar2
4820   ,p_attribute27                  out nocopy        varchar2
4821   ,p_attribute28                  out nocopy        varchar2
4822   ,p_attribute29                  out nocopy        varchar2
4823   ,p_attribute30                  out nocopy        varchar2
4824   ,p_per_information_category     out nocopy        varchar2
4825   ,p_per_information1             out nocopy        varchar2
4826   ,p_per_information2             out nocopy        varchar2
4827   ,p_per_information3             out nocopy        varchar2
4828   ,p_per_information4             out nocopy        varchar2
4829   ,p_per_information5             out nocopy        varchar2
4830   ,p_per_information6             out nocopy        varchar2
4831   ,p_per_information7             out nocopy        varchar2
4832   ,p_per_information8             out nocopy        varchar2
4833   ,p_per_information9             out nocopy        varchar2
4834   ,p_per_information10            out nocopy        varchar2
4835   ,p_per_information11            out nocopy        varchar2
4836   ,p_per_information12            out nocopy        varchar2
4837   ,p_per_information13            out nocopy        varchar2
4838   ,p_per_information14            out nocopy        varchar2
4839   ,p_per_information15            out nocopy        varchar2
4840   ,p_per_information16            out nocopy        varchar2
4841   ,p_per_information17            out nocopy        varchar2
4842   ,p_per_information18            out nocopy        varchar2
4843   ,p_per_information19            out nocopy        varchar2
4844   ,p_per_information20            out nocopy        varchar2
4845   ,p_per_information21            out nocopy        varchar2
4846   ,p_per_information22            out nocopy        varchar2
4847   ,p_per_information23            out nocopy        varchar2
4848   ,p_per_information24            out nocopy        varchar2
4849   ,p_per_information25            out nocopy        varchar2
4850   ,p_per_information26            out nocopy        varchar2
4851   ,p_per_information27            out nocopy        varchar2
4852   ,p_per_information28            out nocopy        varchar2
4853   ,p_per_information29            out nocopy        varchar2
4854   ,p_per_information30            out nocopy        varchar2
4855   ,p_uses_tobacco_flag            out nocopy        varchar2
4856   ,p_uses_tobacco_meaning         out nocopy        varchar2
4857   ,p_on_military_service          out nocopy        varchar2
4858   ,p_on_military_service_meaning  out nocopy        varchar2
4859   ,p_dpdnt_vlntry_svce_flag       out nocopy        varchar2
4860   ,p_dpdnt_vlntry_svce_meaning    out nocopy        varchar2
4861   ,p_correspondence_language      out nocopy        varchar2
4862   ,p_honors                       out nocopy        varchar2
4863   ,p_pre_name_adjunct             out nocopy        varchar2
4864   ,p_suffix                       out nocopy        varchar2
4865   ,p_create_mirror_flag           out nocopy        varchar2
4866   ,p_mirror_type                  out nocopy        varchar2
4867   ,p_mirror_cont_attribute_cat    out nocopy        varchar2
4868   ,p_mirror_cont_attribute1       out nocopy        varchar2
4869   ,p_mirror_cont_attribute2       out nocopy        varchar2
4870   ,p_mirror_cont_attribute3       out nocopy        varchar2
4871   ,p_mirror_cont_attribute4       out nocopy        varchar2
4872   ,p_mirror_cont_attribute5       out nocopy        varchar2
4873   ,p_mirror_cont_attribute6       out nocopy        varchar2
4874   ,p_mirror_cont_attribute7       out nocopy        varchar2
4875   ,p_mirror_cont_attribute8       out nocopy        varchar2
4876   ,p_mirror_cont_attribute9       out nocopy        varchar2
4877   ,p_mirror_cont_attribute10      out nocopy        varchar2
4878   ,p_mirror_cont_attribute11      out nocopy        varchar2
4879   ,p_mirror_cont_attribute12      out nocopy        varchar2
4880   ,p_mirror_cont_attribute13      out nocopy        varchar2
4881   ,p_mirror_cont_attribute14      out nocopy        varchar2
4882   ,p_mirror_cont_attribute15      out nocopy        varchar2
4883   ,p_mirror_cont_attribute16      out nocopy        varchar2
4884   ,p_mirror_cont_attribute17      out nocopy        varchar2
4885   ,p_mirror_cont_attribute18      out nocopy        varchar2
4886   ,p_mirror_cont_attribute19      out nocopy        varchar2
4887   ,p_mirror_cont_attribute20      out nocopy        varchar2
4888   ,p_item_type                    in         varchar2
4889   ,p_item_key                     in         varchar2
4890   ,p_activity_id                  in         number
4891   ,p_action                       out nocopy        varchar2
4892   ,p_login_person_id              out nocopy        number
4893   ,p_process_section_name         out nocopy        varchar2
4894   ,p_review_page_region_code      out nocopy        varchar2
4895   -- Bug 1914891
4896   ,p_date_of_death                out nocopy        date
4897   ,p_dpdnt_adoption_date          out nocopy        date
4898   ,p_title_meaning                out nocopy        varchar2
4899   ,p_contact_type_meaning         out nocopy        varchar2
4900   ,p_contact_operation            out nocopy        varchar2
4901   ,p_emrg_cont_flag               out nocopy        varchar2
4902   ,p_dpdnt_bnf_flag               out nocopy        varchar2
4903   ,p_contact_relationship_id      out nocopy        number
4904   ,p_cont_object_version_number   out nocopy        number
4905   -- bug# 2315163
4906   ,p_is_emrg_cont                 out nocopy        varchar2
4907   ,p_is_dpdnt_bnf                 out nocopy        varchar2
4908   ,P_CONT_INFORMATION_CATEGORY    out nocopy        varchar2
4909   ,P_CONT_INFORMATION1            out nocopy        varchar2
4910   ,P_CONT_INFORMATION2            out nocopy        varchar2
4911   ,P_CONT_INFORMATION3            out nocopy        varchar2
4912   ,P_CONT_INFORMATION4            out nocopy        varchar2
4913   ,P_CONT_INFORMATION5            out nocopy        varchar2
4914   ,P_CONT_INFORMATION6            out nocopy        varchar2
4915   ,P_CONT_INFORMATION7            out nocopy        varchar2
4916   ,P_CONT_INFORMATION8            out nocopy        varchar2
4917   ,P_CONT_INFORMATION9            out nocopy        varchar2
4918   ,P_CONT_INFORMATION10           out nocopy        varchar2
4919   ,P_CONT_INFORMATION11           out nocopy        varchar2
4920   ,P_CONT_INFORMATION12           out nocopy        varchar2
4921   ,P_CONT_INFORMATION13           out nocopy        varchar2
4922   ,P_CONT_INFORMATION14           out nocopy        varchar2
4923   ,P_CONT_INFORMATION15           out nocopy        varchar2
4924   ,P_CONT_INFORMATION16           out nocopy        varchar2
4925   ,P_CONT_INFORMATION17           out nocopy        varchar2
4926   ,P_CONT_INFORMATION18           out nocopy        varchar2
4927   ,P_CONT_INFORMATION19           out nocopy        varchar2
4928   ,P_CONT_INFORMATION20           out nocopy        varchar2)
4929 
4930 
4931 IS
4932   l_transaction_step_id        number default null;
4933   l_trans_obj_vers_num         number default null;
4934   l_transaction_rec_count      integer default 0;
4935   l_proc   varchar2(72)  := g_package||'get_contact_from_tt';
4936 
4937 BEGIN
4938 
4939   -- ------------------------------------------------------------------
4940   -- Check if there are any transaction rec already saved for the current
4941   -- transaction. This is used for re-display the Update page when a user
4942   -- clicks the Back button on the Review page to go back to the Update page
4943   -- to make further changes or to correct errors.
4944   -----------------------------------------------------------------------------
4945   hr_utility.set_location('Entering:'||l_proc, 5);
4946   hr_transaction_api.get_transaction_step_info
4947      (p_item_type              => p_item_type
4948      ,p_item_key               => p_item_key
4949      ,p_activity_id            => p_activity_id
4950      ,p_transaction_step_id    => l_transaction_step_id
4951      ,p_object_version_number  => l_trans_obj_vers_num);
4952 
4953   IF l_transaction_step_id > 0
4954   THEN
4955      l_transaction_rec_count := 1;
4956   ELSE
4957      l_transaction_rec_count := 0;
4958      hr_utility.set_location('Exiting thru Else part of l_transaction_step_id > 0 :'||l_proc, 10);
4959      return;
4960   END IF;
4961   --
4962   -- -------------------------------------------------------------------
4963   -- There are some changes made earlier in the transaction.
4964   -- Retrieve the data and return to caller.
4965   -- -------------------------------------------------------------------
4966   --
4967   -- Now get the transaction data for the given step
4968    get_contact_from_tt (
4969    p_transaction_step_id     	=>  l_transaction_step_id
4970    ,p_start_date     		=>  p_start_date
4971    ,p_business_group_id     	=>  p_business_group_id
4972    ,p_person_id     		=>  p_person_id
4973    ,p_contact_person_id     	=>  p_contact_person_id
4974    ,p_contact_type     		=>  p_contact_type
4975    ,p_ctr_comments     		=>  p_ctr_comments
4976    ,p_primary_contact_flag     	=>  p_primary_contact_flag
4977    ,p_date_start     		=>  p_date_start
4978    ,p_start_life_reason_id     	=>  p_start_life_reason_id
4979    ,p_date_end     		=>  p_date_end
4980    ,p_end_life_reason_id     	=>  p_end_life_reason_id
4981    ,p_rltd_per_rsds_w_dsgntr_flag     =>  p_rltd_per_rsds_w_dsgntr_flag
4982    ,p_personal_flag     	=>  p_personal_flag
4983    ,p_sequence_number     	=>  p_sequence_number
4984    ,p_cont_attribute_category   =>  p_cont_attribute_category
4985    ,p_cont_attribute1     	=>  p_cont_attribute1
4986    ,p_cont_attribute2     	=>  p_cont_attribute2
4987    ,p_cont_attribute3     	=>  p_cont_attribute3
4988    ,p_cont_attribute4     	=>  p_cont_attribute4
4989    ,p_cont_attribute5     	=>  p_cont_attribute5
4990    ,p_cont_attribute6     	=>  p_cont_attribute6
4991    ,p_cont_attribute7     	=>  p_cont_attribute7
4992    ,p_cont_attribute8     	=>  p_cont_attribute8
4993    ,p_cont_attribute9     =>  p_cont_attribute9
4994    ,p_cont_attribute10     =>  p_cont_attribute10
4995    ,p_cont_attribute11     =>  p_cont_attribute11
4996    ,p_cont_attribute12     =>  p_cont_attribute12
4997    ,p_cont_attribute13     =>  p_cont_attribute13
4998    ,p_cont_attribute14     =>  p_cont_attribute14
4999    ,p_cont_attribute15     =>  p_cont_attribute15
5000    ,p_cont_attribute16     =>  p_cont_attribute16
5001    ,p_cont_attribute17     =>  p_cont_attribute17
5002    ,p_cont_attribute18     =>  p_cont_attribute18
5003    ,p_cont_attribute19     =>  p_cont_attribute19
5004    ,p_cont_attribute20     =>  p_cont_attribute20
5005    ,p_third_party_pay_flag     =>  p_third_party_pay_flag
5006    ,p_bondholder_flag     	=>  p_bondholder_flag
5007    ,p_dependent_flag     	=>  p_dependent_flag
5008    ,p_beneficiary_flag     	=>  p_beneficiary_flag
5009    ,p_last_name     		=>  p_last_name
5010    ,p_sex     			=>  p_sex
5011    ,p_sex_meaning               =>  p_sex_meaning
5012    ,p_person_type_id     =>  p_person_type_id
5013    ,p_per_comments     =>  p_per_comments
5014    ,p_date_of_birth     =>  p_date_of_birth
5015    ,p_email_address     =>  p_email_address
5016    ,p_first_name     =>  p_first_name
5017    ,p_known_as     =>  p_known_as
5018    ,p_marital_status     =>  p_marital_status
5019    ,p_marital_status_meaning     =>  p_marital_status_meaning
5020    ,p_student_status     =>  p_student_status
5021    ,p_student_status_meaning     =>  p_student_status_meaning
5022    ,p_middle_names     =>  p_middle_names
5023    ,p_nationality     =>  p_nationality
5024    ,p_national_identifier     =>  p_national_identifier
5025    ,p_previous_last_name     =>  p_previous_last_name
5026    ,p_registered_disabled_flag     =>  p_registered_disabled_flag
5027    ,p_registered_disabled          =>  p_registered_disabled
5028    ,p_title     =>  p_title
5029    ,p_work_telephone     =>  p_work_telephone
5030    ,p_attribute_category     =>  p_attribute_category
5031    ,p_attribute1     =>  p_attribute1
5032    ,p_attribute2     =>  p_attribute2
5033    ,p_attribute3     =>  p_attribute3
5034    ,p_attribute4     =>  p_attribute4
5035    ,p_attribute5     =>  p_attribute5
5036    ,p_attribute6     =>  p_attribute6
5037    ,p_attribute7     =>  p_attribute7
5038    ,p_attribute8     =>  p_attribute8
5039    ,p_attribute9     =>  p_attribute9
5040    ,p_attribute10     =>  p_attribute10
5041    ,p_attribute11     =>  p_attribute11
5042    ,p_attribute12     =>  p_attribute12
5043    ,p_attribute13     =>  p_attribute13
5044    ,p_attribute14     =>  p_attribute14
5045    ,p_attribute15     =>  p_attribute15
5046    ,p_attribute16     =>  p_attribute16
5047    ,p_attribute17     =>  p_attribute17
5048    ,p_attribute18     =>  p_attribute18
5049    ,p_attribute19     =>  p_attribute19
5050    ,p_attribute20     =>  p_attribute20
5051    ,p_attribute21     =>  p_attribute21
5052    ,p_attribute22     =>  p_attribute22
5053    ,p_attribute23     =>  p_attribute23
5054    ,p_attribute24     =>  p_attribute24
5055    ,p_attribute25     =>  p_attribute25
5056    ,p_attribute26     =>  p_attribute26
5057    ,p_attribute27     =>  p_attribute27
5058    ,p_attribute28     =>  p_attribute28
5059    ,p_attribute29     =>  p_attribute29
5060    ,p_attribute30     =>  p_attribute30
5061    ,p_per_information_category     =>  p_per_information_category
5062    ,p_per_information1     =>  p_per_information1
5063    ,p_per_information2     =>  p_per_information2
5064    ,p_per_information3     =>  p_per_information3
5065    ,p_per_information4     =>  p_per_information4
5066    ,p_per_information5     =>  p_per_information5
5067    ,p_per_information6     =>  p_per_information6
5068    ,p_per_information7     =>  p_per_information7
5069    ,p_per_information8     =>  p_per_information8
5070    ,p_per_information9     =>  p_per_information9
5071    ,p_per_information10     =>  p_per_information10
5072    ,p_per_information11     =>  p_per_information11
5073    ,p_per_information12     =>  p_per_information12
5074    ,p_per_information13     =>  p_per_information13
5075    ,p_per_information14     =>  p_per_information14
5076    ,p_per_information15     =>  p_per_information15
5077    ,p_per_information16     =>  p_per_information16
5078    ,p_per_information17     =>  p_per_information17
5079    ,p_per_information18     =>  p_per_information18
5080    ,p_per_information19     =>  p_per_information19
5081    ,p_per_information20     =>  p_per_information20
5082    ,p_per_information21     =>  p_per_information21
5083    ,p_per_information22     =>  p_per_information22
5084    ,p_per_information23     =>  p_per_information23
5085    ,p_per_information24     =>  p_per_information24
5086    ,p_per_information25     =>  p_per_information25
5087    ,p_per_information26     =>  p_per_information26
5088    ,p_per_information27     =>  p_per_information27
5089    ,p_per_information28     =>  p_per_information28
5090    ,p_per_information29     =>  p_per_information29
5091    ,p_per_information30     =>  p_per_information30
5092    ,p_uses_tobacco_flag         =>  p_uses_tobacco_flag
5093    ,p_uses_tobacco_meaning      =>  p_uses_tobacco_meaning
5094    ,p_on_military_service       =>  p_on_military_service
5095    ,p_on_military_service_meaning => p_on_military_service_meaning
5096    ,p_dpdnt_vlntry_svce_flag      => p_dpdnt_vlntry_svce_flag
5097    ,p_dpdnt_vlntry_svce_meaning   => p_dpdnt_vlntry_svce_meaning
5098    ,p_correspondence_language     =>  p_correspondence_language
5099    ,p_honors     		=>  p_honors
5100    ,p_pre_name_adjunct     	=>  p_pre_name_adjunct
5101    ,p_suffix     		=>  p_suffix
5102    ,p_create_mirror_flag     	=>  p_create_mirror_flag
5103    ,p_mirror_type     		=>  p_mirror_type
5104    ,p_mirror_cont_attribute_cat     =>  p_mirror_cont_attribute_cat
5105    ,p_mirror_cont_attribute1     =>  p_mirror_cont_attribute1
5106    ,p_mirror_cont_attribute2     =>  p_mirror_cont_attribute2
5107    ,p_mirror_cont_attribute3     =>  p_mirror_cont_attribute3
5108    ,p_mirror_cont_attribute4     =>  p_mirror_cont_attribute4
5109    ,p_mirror_cont_attribute5     =>  p_mirror_cont_attribute5
5110    ,p_mirror_cont_attribute6     =>  p_mirror_cont_attribute6
5111    ,p_mirror_cont_attribute7     =>  p_mirror_cont_attribute7
5112    ,p_mirror_cont_attribute8     =>  p_mirror_cont_attribute8
5113    ,p_mirror_cont_attribute9     =>  p_mirror_cont_attribute9
5114    ,p_mirror_cont_attribute10     =>  p_mirror_cont_attribute10
5115    ,p_mirror_cont_attribute11     =>  p_mirror_cont_attribute11
5116    ,p_mirror_cont_attribute12     =>  p_mirror_cont_attribute12
5117    ,p_mirror_cont_attribute13     =>  p_mirror_cont_attribute13
5118    ,p_mirror_cont_attribute14     =>  p_mirror_cont_attribute14
5119    ,p_mirror_cont_attribute15     =>  p_mirror_cont_attribute15
5120    ,p_mirror_cont_attribute16     =>  p_mirror_cont_attribute16
5121    ,p_mirror_cont_attribute17     =>  p_mirror_cont_attribute17
5122    ,p_mirror_cont_attribute18     =>  p_mirror_cont_attribute18
5123    ,p_mirror_cont_attribute19     =>  p_mirror_cont_attribute19
5124    ,p_mirror_cont_attribute20     =>  p_mirror_cont_attribute20
5125    ,p_cont_information_category   =>  p_cont_information_category
5126    ,p_cont_information1           =>  p_cont_information1
5127    ,p_cont_information2           =>  p_cont_information2
5128    ,p_cont_information3           =>  p_cont_information3
5129    ,p_cont_information4           =>  p_cont_information4
5130    ,p_cont_information5           =>  p_cont_information5
5131    ,p_cont_information6           =>  p_cont_information6
5132    ,p_cont_information7           =>  p_cont_information7
5133    ,p_cont_information8           =>  p_cont_information8
5134    ,p_cont_information9           =>  p_cont_information9
5135    ,p_cont_information10          =>  p_cont_information10
5136    ,p_cont_information11          =>  p_cont_information11
5137    ,p_cont_information12          =>  p_cont_information12
5138    ,p_cont_information13          =>  p_cont_information13
5139    ,p_cont_information14          =>  p_cont_information14
5140    ,p_cont_information15          =>  p_cont_information15
5141    ,p_cont_information16          =>  p_cont_information16
5142    ,p_cont_information17          =>  p_cont_information17
5143    ,p_cont_information18          =>  p_cont_information18
5144    ,p_cont_information19          =>  p_cont_information19
5145    ,p_cont_information20          =>  p_cont_information20
5146    ,p_action     		=>  p_action
5147    ,p_login_person_id     	=>  p_login_person_id
5148    ,p_process_section_name     	=>  p_process_section_name
5149    ,p_review_page_region_code   =>  p_review_page_region_code
5150    -- Bug 1914891
5151    ,p_date_of_death             =>  p_date_of_death
5152    -- ikasire
5153    ,p_dpdnt_adoption_date       =>  p_dpdnt_adoption_date
5154    ,p_title_meaning             =>  p_title_meaning
5155    ,p_contact_type_meaning      =>  p_contact_type_meaning
5156    ,p_contact_operation         =>  p_contact_operation
5157    ,p_emrg_cont_flag            =>  p_emrg_cont_flag
5158    ,p_dpdnt_bnf_flag            =>  p_dpdnt_bnf_flag
5159    ,p_contact_relationship_id   =>  p_contact_relationship_id
5160    ,p_cont_object_version_number=>  p_cont_object_version_number
5161    --bug# 2315163
5162    ,p_is_emrg_cont              =>  p_is_emrg_cont
5163    ,p_is_dpdnt_bnf              =>  p_is_dpdnt_bnf
5164   );
5165 
5166 hr_utility.set_location('Exiting:'||l_proc, 15);
5167 
5168  EXCEPTION
5169    WHEN g_data_error THEN
5170    hr_utility.set_location('WHEN g_data_error THEN'||l_proc,555);
5171       RAISE;
5172  END get_contact_from_tt;
5173 -- ---------------------------------------------------------------------------
5174 -- ---------------------- < get_contact_from_tt> -------------------------
5175 -- ---------------------------------------------------------------------------
5176 -- Purpose: This procedure will get transaction data which are pending for 9999(?)
5177 --          approval in workflow for a transaction step id.
5178 --          This is the procedure which does the actual work.
5179 -- ---------------------------------------------------------------------------
5180 
5181 procedure get_contact_from_tt
5182   (p_transaction_step_id          in         number
5183   ,p_start_date                   out nocopy        date
5184   ,p_business_group_id            out nocopy        number
5185   ,p_person_id                    out nocopy        number
5186   ,p_contact_person_id            out nocopy        number
5187   ,p_contact_type                 out nocopy        varchar2
5188   ,p_ctr_comments                 out nocopy        varchar2
5189   ,p_primary_contact_flag         out nocopy        varchar2
5190   ,p_date_start                   out nocopy        date
5191   ,p_start_life_reason_id         out nocopy        number
5192   ,p_date_end                     out nocopy        date
5193   ,p_end_life_reason_id           out nocopy        number
5194   ,p_rltd_per_rsds_w_dsgntr_flag  out nocopy        varchar2
5195   ,p_personal_flag                out nocopy        varchar2
5196   ,p_sequence_number              out nocopy        number
5197   ,p_cont_attribute_category      out nocopy        varchar2
5198   ,p_cont_attribute1              out nocopy        varchar2
5199   ,p_cont_attribute2              out nocopy        varchar2
5200   ,p_cont_attribute3              out nocopy        varchar2
5201   ,p_cont_attribute4              out nocopy        varchar2
5202   ,p_cont_attribute5              out nocopy        varchar2
5203   ,p_cont_attribute6              out nocopy        varchar2
5204   ,p_cont_attribute7              out nocopy        varchar2
5205   ,p_cont_attribute8              out nocopy        varchar2
5206   ,p_cont_attribute9              out nocopy        varchar2
5207   ,p_cont_attribute10             out nocopy        varchar2
5208   ,p_cont_attribute11             out nocopy        varchar2
5209   ,p_cont_attribute12             out nocopy        varchar2
5210   ,p_cont_attribute13             out nocopy        varchar2
5211   ,p_cont_attribute14             out nocopy        varchar2
5212   ,p_cont_attribute15             out nocopy        varchar2
5213   ,p_cont_attribute16             out nocopy        varchar2
5214   ,p_cont_attribute17             out nocopy        varchar2
5215   ,p_cont_attribute18             out nocopy        varchar2
5216   ,p_cont_attribute19             out nocopy        varchar2
5217   ,p_cont_attribute20             out nocopy        varchar2
5218   ,p_third_party_pay_flag         out nocopy        varchar2
5219   ,p_bondholder_flag              out nocopy        varchar2
5220   ,p_dependent_flag               out nocopy        varchar2
5221   ,p_beneficiary_flag             out nocopy        varchar2
5222   ,p_last_name                    out nocopy        varchar2
5223   ,p_sex                          out nocopy        varchar2
5224   ,p_sex_meaning                  out nocopy        varchar2
5225   ,p_person_type_id               out nocopy        number
5226   ,p_per_comments                 out nocopy        varchar2
5227   ,p_date_of_birth                out nocopy        date
5228   ,p_email_address                out nocopy        varchar2
5229   ,p_first_name                   out nocopy        varchar2
5230   ,p_known_as                     out nocopy        varchar2
5231   ,p_marital_status               out nocopy        varchar2
5232   ,p_marital_status_meaning       out nocopy        varchar2
5233   ,p_student_status               out nocopy        varchar2
5234   ,p_student_status_meaning       out nocopy        varchar2
5235   ,p_middle_names                 out nocopy        varchar2
5236   ,p_nationality                  out nocopy        varchar2
5237   ,p_national_identifier          out nocopy        varchar2
5238   ,p_previous_last_name           out nocopy        varchar2
5239   ,p_registered_disabled_flag     out nocopy        varchar2
5240   ,p_registered_disabled          out nocopy        varchar2
5241   ,p_title                        out nocopy        varchar2
5242   ,p_work_telephone               out nocopy        varchar2
5243   ,p_attribute_category           out nocopy        varchar2
5244   ,p_attribute1                   out nocopy        varchar2
5245   ,p_attribute2                   out nocopy        varchar2
5246   ,p_attribute3                   out nocopy        varchar2
5247   ,p_attribute4                   out nocopy        varchar2
5248   ,p_attribute5                   out nocopy        varchar2
5249   ,p_attribute6                   out nocopy        varchar2
5250   ,p_attribute7                   out nocopy        varchar2
5251   ,p_attribute8                   out nocopy        varchar2
5252   ,p_attribute9                   out nocopy        varchar2
5253   ,p_attribute10                  out nocopy        varchar2
5254   ,p_attribute11                  out nocopy        varchar2
5255   ,p_attribute12                  out nocopy        varchar2
5256   ,p_attribute13                  out nocopy        varchar2
5257   ,p_attribute14                  out nocopy        varchar2
5258   ,p_attribute15                  out nocopy        varchar2
5259   ,p_attribute16                  out nocopy        varchar2
5260   ,p_attribute17                  out nocopy        varchar2
5261   ,p_attribute18                  out nocopy        varchar2
5262   ,p_attribute19                  out nocopy        varchar2
5263   ,p_attribute20                  out nocopy        varchar2
5264   ,p_attribute21                  out nocopy        varchar2
5265   ,p_attribute22                  out nocopy        varchar2
5266   ,p_attribute23                  out nocopy        varchar2
5267   ,p_attribute24                  out nocopy        varchar2
5268   ,p_attribute25                  out nocopy        varchar2
5269   ,p_attribute26                  out nocopy        varchar2
5270   ,p_attribute27                  out nocopy        varchar2
5271   ,p_attribute28                  out nocopy        varchar2
5272   ,p_attribute29                  out nocopy        varchar2
5273   ,p_attribute30                  out nocopy        varchar2
5274   ,p_per_information_category     out nocopy        varchar2
5275   ,p_per_information1             out nocopy        varchar2
5276   ,p_per_information2             out nocopy        varchar2
5277   ,p_per_information3             out nocopy        varchar2
5278   ,p_per_information4             out nocopy        varchar2
5279   ,p_per_information5             out nocopy        varchar2
5280   ,p_per_information6             out nocopy        varchar2
5281   ,p_per_information7             out nocopy        varchar2
5282   ,p_per_information8             out nocopy        varchar2
5283   ,p_per_information9             out nocopy        varchar2
5284   ,p_per_information10            out nocopy        varchar2
5285   ,p_per_information11            out nocopy        varchar2
5286   ,p_per_information12            out nocopy        varchar2
5287   ,p_per_information13            out nocopy        varchar2
5288   ,p_per_information14            out nocopy        varchar2
5289   ,p_per_information15            out nocopy        varchar2
5290   ,p_per_information16            out nocopy        varchar2
5291   ,p_per_information17            out nocopy        varchar2
5292   ,p_per_information18            out nocopy        varchar2
5293   ,p_per_information19            out nocopy        varchar2
5294   ,p_per_information20            out nocopy        varchar2
5295   ,p_per_information21            out nocopy        varchar2
5296   ,p_per_information22            out nocopy        varchar2
5297   ,p_per_information23            out nocopy        varchar2
5298   ,p_per_information24            out nocopy        varchar2
5299   ,p_per_information25            out nocopy        varchar2
5300   ,p_per_information26            out nocopy        varchar2
5301   ,p_per_information27            out nocopy        varchar2
5302   ,p_per_information28            out nocopy        varchar2
5303   ,p_per_information29            out nocopy        varchar2
5304   ,p_per_information30            out nocopy        varchar2
5305   ,p_uses_tobacco_flag            out nocopy        varchar2
5306   ,p_uses_tobacco_meaning         out nocopy        varchar2
5307   ,p_on_military_service          out nocopy        varchar2
5308   ,p_on_military_service_meaning  out nocopy        varchar2
5309   ,p_dpdnt_vlntry_svce_flag       out nocopy        varchar2
5310   ,p_dpdnt_vlntry_svce_meaning    out nocopy        varchar2
5311   ,p_correspondence_language      out nocopy        varchar2
5312   ,p_honors                       out nocopy        varchar2
5313   ,p_pre_name_adjunct             out nocopy        varchar2
5314   ,p_suffix                       out nocopy        varchar2
5315   ,p_create_mirror_flag           out nocopy        varchar2
5316   ,p_mirror_type                  out nocopy        varchar2
5317   ,p_mirror_cont_attribute_cat    out nocopy        varchar2
5318   ,p_mirror_cont_attribute1       out nocopy        varchar2
5319   ,p_mirror_cont_attribute2       out nocopy        varchar2
5320   ,p_mirror_cont_attribute3       out nocopy        varchar2
5321   ,p_mirror_cont_attribute4       out nocopy        varchar2
5322   ,p_mirror_cont_attribute5       out nocopy        varchar2
5323   ,p_mirror_cont_attribute6       out nocopy        varchar2
5324   ,p_mirror_cont_attribute7       out nocopy        varchar2
5325   ,p_mirror_cont_attribute8       out nocopy        varchar2
5326   ,p_mirror_cont_attribute9       out nocopy        varchar2
5327   ,p_mirror_cont_attribute10      out nocopy        varchar2
5328   ,p_mirror_cont_attribute11      out nocopy        varchar2
5329   ,p_mirror_cont_attribute12      out nocopy        varchar2
5330   ,p_mirror_cont_attribute13      out nocopy        varchar2
5331   ,p_mirror_cont_attribute14      out nocopy        varchar2
5332   ,p_mirror_cont_attribute15      out nocopy        varchar2
5333   ,p_mirror_cont_attribute16      out nocopy        varchar2
5334   ,p_mirror_cont_attribute17      out nocopy        varchar2
5335   ,p_mirror_cont_attribute18      out nocopy        varchar2
5336   ,p_mirror_cont_attribute19      out nocopy        varchar2
5337   ,p_mirror_cont_attribute20      out nocopy        varchar2
5338   ,p_action                       out nocopy        varchar2
5339   ,p_login_person_id              out nocopy        number
5340   ,p_process_section_name         out nocopy        varchar2
5341   ,p_review_page_region_code      out nocopy        varchar2
5342   -- Bug 1914891
5343   ,p_date_of_death                out nocopy        date
5344   -- ikasire
5345   ,p_dpdnt_adoption_date          out nocopy        date
5346   ,p_title_meaning                out nocopy        varchar2
5347   ,p_contact_type_meaning         out nocopy        varchar2
5348   ,p_contact_operation            out nocopy        varchar2
5349   ,p_emrg_cont_flag               out nocopy        varchar2
5350   ,p_dpdnt_bnf_flag               out nocopy        varchar2
5351   ,p_contact_relationship_id      out nocopy        number
5352   ,p_cont_object_version_number   out nocopy        number
5353 --bug# 2315163
5354   ,p_is_emrg_cont                 out nocopy        varchar2
5355   ,p_is_dpdnt_bnf                 out nocopy        varchar2
5356   ,P_CONT_INFORMATION_CATEGORY    out nocopy        varchar2
5357   ,P_CONT_INFORMATION1            out nocopy        varchar2
5358   ,P_CONT_INFORMATION2            out nocopy        varchar2
5359   ,P_CONT_INFORMATION3            out nocopy        varchar2
5360   ,P_CONT_INFORMATION4            out nocopy        varchar2
5361   ,P_CONT_INFORMATION5            out nocopy        varchar2
5362   ,P_CONT_INFORMATION6            out nocopy        varchar2
5363   ,P_CONT_INFORMATION7            out nocopy        varchar2
5364   ,P_CONT_INFORMATION8            out nocopy        varchar2
5365   ,P_CONT_INFORMATION9            out nocopy        varchar2
5366   ,P_CONT_INFORMATION10           out nocopy        varchar2
5367   ,P_CONT_INFORMATION11           out nocopy        varchar2
5368   ,P_CONT_INFORMATION12           out nocopy        varchar2
5369   ,P_CONT_INFORMATION13           out nocopy        varchar2
5370   ,P_CONT_INFORMATION14           out nocopy        varchar2
5371   ,P_CONT_INFORMATION15           out nocopy        varchar2
5372   ,P_CONT_INFORMATION16           out nocopy        varchar2
5373   ,P_CONT_INFORMATION17           out nocopy        varchar2
5374   ,P_CONT_INFORMATION18           out nocopy        varchar2
5375   ,P_CONT_INFORMATION19           out nocopy        varchar2
5376   ,P_CONT_INFORMATION20           out nocopy        varchar2
5377 ) IS
5378 
5379  l_proc   varchar2(72)  := g_package||'get_contact_from_tt';
5380 
5381  BEGIN
5382   --
5383   hr_utility.set_location('Entering:'||l_proc, 5);
5384 
5385   hr_utility.set_location('Setting the attributes:'||l_proc,10 );
5386   p_cont_object_version_number :=
5387       hr_transaction_api.get_number_value
5388         (p_transaction_step_id => p_transaction_step_id
5389         ,p_name                =>upper( 'p_cont_object_version_number'));
5390 
5391   p_contact_relationship_id :=
5392       hr_transaction_api.get_number_value
5393         (p_transaction_step_id => p_transaction_step_id
5394         ,p_name                =>upper( 'p_contact_relationship_id'));
5395 
5396   p_contact_operation  :=
5397       hr_transaction_api.get_varchar2_value
5398         (p_transaction_step_id => p_transaction_step_id
5399         ,p_name                =>upper( 'p_contact_operation'));
5400 
5401   p_emrg_cont_flag  :=
5402       hr_transaction_api.get_varchar2_value
5403         (p_transaction_step_id => p_transaction_step_id
5404         ,p_name                =>upper( 'p_emrg_cont_flag'));
5405 
5406   p_dpdnt_bnf_flag  :=
5407       hr_transaction_api.get_varchar2_value
5408         (p_transaction_step_id => p_transaction_step_id
5409         ,p_name                =>upper( 'p_dpdnt_bnf_flag'));
5410 
5411   --bug# 2315163
5412   p_is_emrg_cont    :=
5413       hr_transaction_api.get_varchar2_value
5414         (p_transaction_step_id => p_transaction_step_id
5415         ,p_name                =>upper( 'p_is_emergency_contact'));
5416 
5417   p_is_dpdnt_bnf    :=
5418       hr_transaction_api.get_varchar2_value
5419         (p_transaction_step_id => p_transaction_step_id
5420         ,p_name                =>upper( 'p_is_dpdnt_bnf'));
5421 
5422 
5423   -- Bug 1914891
5424   --
5425   p_date_of_death  :=
5426       hr_transaction_api.get_date_value
5427         (p_transaction_step_id => p_transaction_step_id
5428         ,p_name                =>upper( 'p_date_of_death'));
5429   --
5430   -- ikasire
5431   --
5432   p_dpdnt_adoption_date  :=
5433       hr_transaction_api.get_date_value
5434         (p_transaction_step_id => p_transaction_step_id
5435         ,p_name                =>upper( 'p_dpdnt_adoption_date'));
5436   --
5437   p_start_date  :=
5438       hr_transaction_api.get_date_value
5439         (p_transaction_step_id => p_transaction_step_id
5440         ,p_name                =>upper( 'p_start_date'));
5441   --
5442   p_business_group_id  :=
5443       hr_transaction_api.get_number_value
5444         (p_transaction_step_id => p_transaction_step_id
5445         ,p_name                =>upper( 'p_business_group_id'));
5446   --
5447   p_person_id  :=
5448       hr_transaction_api.get_number_value
5449         (p_transaction_step_id => p_transaction_step_id
5450         ,p_name                =>upper( 'p_person_id'));
5451   --
5452   p_contact_person_id  :=
5453       hr_transaction_api.get_number_value
5454         (p_transaction_step_id => p_transaction_step_id
5455         ,p_name                =>upper( 'p_contact_person_id'));
5456   --
5457   p_contact_type  :=
5458       hr_transaction_api.get_varchar2_value
5459         (p_transaction_step_id => p_transaction_step_id
5460         ,p_name                =>upper( 'p_contact_type'));
5461   --
5462   -- Bug 1914891
5463   --
5464   p_contact_type_meaning := HR_GENERAL.DECODE_LOOKUP('CONTACT',p_contact_type);
5465   --
5466   p_ctr_comments  :=
5467       hr_transaction_api.get_varchar2_value
5468         (p_transaction_step_id => p_transaction_step_id
5469         ,p_name                =>upper( 'p_ctr_comments'));
5470   --
5471   p_primary_contact_flag  :=
5472       hr_transaction_api.get_varchar2_value
5473         (p_transaction_step_id => p_transaction_step_id
5474         ,p_name                =>upper( 'p_primary_contact_flag'));
5475   --
5476   p_date_start  :=
5477       hr_transaction_api.get_date_value
5478         (p_transaction_step_id => p_transaction_step_id
5479         ,p_name                =>upper( 'p_date_start'));
5480   --
5481   p_start_life_reason_id  :=
5482       hr_transaction_api.get_number_value
5483         (p_transaction_step_id => p_transaction_step_id
5484         ,p_name                =>upper( 'p_start_life_reason_id'));
5485   --
5486   p_date_end  :=
5487       hr_transaction_api.get_date_value
5488         (p_transaction_step_id => p_transaction_step_id
5489         ,p_name                =>upper( 'p_date_end'));
5490   --
5491   p_end_life_reason_id  :=
5492       hr_transaction_api.get_number_value
5493         (p_transaction_step_id => p_transaction_step_id
5494         ,p_name                =>upper( 'p_end_life_reason_id'));
5495   --
5496   p_rltd_per_rsds_w_dsgntr_flag  :=
5497       hr_transaction_api.get_varchar2_value
5498         (p_transaction_step_id => p_transaction_step_id
5499         ,p_name                =>upper( 'p_rltd_per_rsds_w_dsgntr_flag'));
5500   --
5501   p_personal_flag  :=
5502       hr_transaction_api.get_varchar2_value
5503         (p_transaction_step_id => p_transaction_step_id
5504         ,p_name                =>upper( 'p_personal_flag'));
5505   --
5506   p_sequence_number  :=
5507       hr_transaction_api.get_number_value
5508         (p_transaction_step_id => p_transaction_step_id
5509         ,p_name                =>upper( 'p_sequence_number'));
5510   --
5511   p_cont_attribute_category  :=
5512       hr_transaction_api.get_varchar2_value
5513         (p_transaction_step_id => p_transaction_step_id
5514         ,p_name                =>upper( 'p_cont_attribute_category'));
5515   --
5516   p_cont_attribute1  :=
5517       hr_transaction_api.get_varchar2_value
5518         (p_transaction_step_id => p_transaction_step_id
5519         ,p_name                =>upper( 'p_cont_attribute1'));
5520   --
5521   p_cont_attribute2  :=
5522       hr_transaction_api.get_varchar2_value
5523         (p_transaction_step_id => p_transaction_step_id
5524         ,p_name                =>upper( 'p_cont_attribute2'));
5525   --
5526   p_cont_attribute3  :=
5527       hr_transaction_api.get_varchar2_value
5528         (p_transaction_step_id => p_transaction_step_id
5529         ,p_name                =>upper( 'p_cont_attribute3'));
5530   --
5531   p_cont_attribute4  :=
5532       hr_transaction_api.get_varchar2_value
5533         (p_transaction_step_id => p_transaction_step_id
5534         ,p_name                =>upper( 'p_cont_attribute4'));
5535   --
5536   p_cont_attribute5  :=
5537       hr_transaction_api.get_varchar2_value
5538         (p_transaction_step_id => p_transaction_step_id
5539         ,p_name                =>upper( 'p_cont_attribute5'));
5540   --
5541   p_cont_attribute6  :=
5542       hr_transaction_api.get_varchar2_value
5543         (p_transaction_step_id => p_transaction_step_id
5544         ,p_name                =>upper( 'p_cont_attribute6'));
5545   --
5546   p_cont_attribute7  :=
5547       hr_transaction_api.get_varchar2_value
5548         (p_transaction_step_id => p_transaction_step_id
5549         ,p_name                =>upper( 'p_cont_attribute7'));
5550   --
5551   p_cont_attribute8  :=
5552       hr_transaction_api.get_varchar2_value
5553         (p_transaction_step_id => p_transaction_step_id
5554         ,p_name                =>upper( 'p_cont_attribute8'));
5555   --
5556   p_cont_attribute9  :=
5557       hr_transaction_api.get_varchar2_value
5558         (p_transaction_step_id => p_transaction_step_id
5559         ,p_name                =>upper( 'p_cont_attribute9'));
5560   --
5561   p_cont_attribute10  :=
5562       hr_transaction_api.get_varchar2_value
5563         (p_transaction_step_id => p_transaction_step_id
5564         ,p_name                =>upper( 'p_cont_attribute10'));
5565   --
5566   p_cont_attribute11  :=
5567       hr_transaction_api.get_varchar2_value
5568         (p_transaction_step_id => p_transaction_step_id
5569         ,p_name                =>upper( 'p_cont_attribute11'));
5570   --
5571   p_cont_attribute12  :=
5572       hr_transaction_api.get_varchar2_value
5573         (p_transaction_step_id => p_transaction_step_id
5574         ,p_name                =>upper( 'p_cont_attribute12'));
5575   --
5576   p_cont_attribute13  :=
5577       hr_transaction_api.get_varchar2_value
5578         (p_transaction_step_id => p_transaction_step_id
5579         ,p_name                =>upper( 'p_cont_attribute13'));
5580   --
5581   p_cont_attribute14  :=
5582       hr_transaction_api.get_varchar2_value
5583         (p_transaction_step_id => p_transaction_step_id
5584         ,p_name                =>upper( 'p_cont_attribute14'));
5585   --
5586   p_cont_attribute15  :=
5587       hr_transaction_api.get_varchar2_value
5588         (p_transaction_step_id => p_transaction_step_id
5589         ,p_name                =>upper( 'p_cont_attribute15'));
5590   --
5591   p_cont_attribute16  :=
5592       hr_transaction_api.get_varchar2_value
5593         (p_transaction_step_id => p_transaction_step_id
5594         ,p_name                =>upper( 'p_cont_attribute16'));
5595   --
5596   p_cont_attribute17  :=
5597       hr_transaction_api.get_varchar2_value
5598         (p_transaction_step_id => p_transaction_step_id
5599         ,p_name                =>upper( 'p_cont_attribute17'));
5600   --
5601   p_cont_attribute18  :=
5602       hr_transaction_api.get_varchar2_value
5603         (p_transaction_step_id => p_transaction_step_id
5604         ,p_name                =>upper( 'p_cont_attribute18'));
5605   --
5606   p_cont_attribute19  :=
5607       hr_transaction_api.get_varchar2_value
5608         (p_transaction_step_id => p_transaction_step_id
5609         ,p_name                =>upper( 'p_cont_attribute19'));
5610   --
5611   p_cont_attribute20  :=
5612       hr_transaction_api.get_varchar2_value
5613         (p_transaction_step_id => p_transaction_step_id
5614         ,p_name                =>upper( 'p_cont_attribute20'));
5615   --
5616   p_third_party_pay_flag  :=
5617       hr_transaction_api.get_varchar2_value
5618         (p_transaction_step_id => p_transaction_step_id
5619         ,p_name                =>upper( 'p_third_party_pay_flag'));
5620   --
5621   p_bondholder_flag  :=
5622       hr_transaction_api.get_varchar2_value
5623         (p_transaction_step_id => p_transaction_step_id
5624         ,p_name                =>upper( 'p_bondholder_flag'));
5625   --
5626   p_dependent_flag  :=
5627       hr_transaction_api.get_varchar2_value
5628         (p_transaction_step_id => p_transaction_step_id
5629         ,p_name                =>upper( 'p_dependent_flag'));
5630   --
5631   p_beneficiary_flag  :=
5632       hr_transaction_api.get_varchar2_value
5633         (p_transaction_step_id => p_transaction_step_id
5634         ,p_name                =>upper( 'p_beneficiary_flag'));
5635   --
5636   p_last_name  :=
5637       hr_transaction_api.get_varchar2_value
5638         (p_transaction_step_id => p_transaction_step_id
5639         ,p_name                =>upper( 'p_last_name'));
5640   --
5641   p_sex  :=
5642       hr_transaction_api.get_varchar2_value
5643         (p_transaction_step_id => p_transaction_step_id
5644         ,p_name                =>upper( 'p_sex'));
5645   --
5646   p_sex_meaning  :=  HR_GENERAL.DECODE_LOOKUP('SEX',p_sex); -- 7777
5647   --
5648   p_uses_tobacco_flag  :=
5649       hr_transaction_api.get_varchar2_value
5650         (p_transaction_step_id => p_transaction_step_id
5651         ,p_name                =>upper( 'p_uses_tobacco_flag'));
5652   --
5653   p_uses_tobacco_meaning  :=  HR_GENERAL.DECODE_LOOKUP('TOBACCO_USER',p_uses_tobacco_flag); -- 7777
5654   --
5655   p_on_military_service  :=
5656       hr_transaction_api.get_varchar2_value
5657         (p_transaction_step_id => p_transaction_step_id
5658         ,p_name                =>upper( 'p_on_military_service'));
5659   --
5660   p_on_military_service_meaning  :=  HR_GENERAL.DECODE_LOOKUP('YES_NO',p_on_military_service); -- 7777
5661   --
5662   p_dpdnt_vlntry_svce_flag  :=
5663       hr_transaction_api.get_varchar2_value
5664         (p_transaction_step_id => p_transaction_step_id
5665         ,p_name                =>upper( 'p_dpdnt_vlntry_svce_flag'));
5666   --
5667   p_dpdnt_vlntry_svce_meaning    :=  HR_GENERAL.DECODE_LOOKUP('YES_NO',p_dpdnt_vlntry_svce_flag); -- 7777
5668   --
5669   p_person_type_id  :=
5670       hr_transaction_api.get_number_value
5671         (p_transaction_step_id => p_transaction_step_id
5672         ,p_name                =>upper( 'p_person_type_id'));
5673   --
5674   p_per_comments  :=
5675       hr_transaction_api.get_varchar2_value
5676         (p_transaction_step_id => p_transaction_step_id
5677         ,p_name                =>upper( 'p_per_comments'));
5678   --
5679   p_date_of_birth  :=
5680       hr_transaction_api.get_date_value
5681         (p_transaction_step_id => p_transaction_step_id
5682         ,p_name                =>upper( 'p_date_of_birth'));
5683   --
5684   p_email_address  :=
5685       hr_transaction_api.get_varchar2_value
5686         (p_transaction_step_id => p_transaction_step_id
5687         ,p_name                =>upper( 'p_email_address'));
5688   --
5689   p_first_name  :=
5690       hr_transaction_api.get_varchar2_value
5691         (p_transaction_step_id => p_transaction_step_id
5692         ,p_name                =>upper( 'p_first_name'));
5693   --
5694   p_known_as  :=
5695       hr_transaction_api.get_varchar2_value
5696         (p_transaction_step_id => p_transaction_step_id
5697         ,p_name                =>upper( 'p_known_as'));
5698   --
5699   p_marital_status  :=
5700       hr_transaction_api.get_varchar2_value
5701         (p_transaction_step_id => p_transaction_step_id
5702         ,p_name                =>upper( 'p_marital_status'));
5703   --
5704   p_marital_status_meaning  :=  HR_GENERAL.DECODE_LOOKUP('MAR_STATUS',p_marital_status); -- 7777
5705   --
5706   --
5707   p_student_status  :=  -- 12345
5708       hr_transaction_api.get_varchar2_value
5709         (p_transaction_step_id => p_transaction_step_id
5710         ,p_name                =>upper( 'p_student_status'));
5711   --
5712   p_student_status_meaning  :=  HR_GENERAL.DECODE_LOOKUP('STUDENT_STATUS',p_student_status); -- 7777
5713   --
5714   p_middle_names  :=
5715       hr_transaction_api.get_varchar2_value
5716         (p_transaction_step_id => p_transaction_step_id
5717         ,p_name                =>upper( 'p_middle_names'));
5718   --
5719   p_nationality  :=
5720       hr_transaction_api.get_varchar2_value
5721         (p_transaction_step_id => p_transaction_step_id
5722         ,p_name                =>upper( 'p_nationality'));
5723   --
5724   p_national_identifier  :=
5725       hr_transaction_api.get_varchar2_value
5726         (p_transaction_step_id => p_transaction_step_id
5727         ,p_name                =>upper( 'p_national_identifier'));
5728   --
5729   p_previous_last_name  :=
5730       hr_transaction_api.get_varchar2_value
5731         (p_transaction_step_id => p_transaction_step_id
5732         ,p_name                =>upper( 'p_previous_last_name'));
5733   --
5734   p_registered_disabled_flag  :=
5735       hr_transaction_api.get_varchar2_value
5736         (p_transaction_step_id => p_transaction_step_id
5737         ,p_name                =>upper( 'p_registered_disabled_flag'));
5738   --
5739   p_registered_disabled       :=  HR_GENERAL.DECODE_LOOKUP('REGISTERED_DISABLED', p_registered_disabled_flag);
5740   --
5741   p_title  :=
5742       hr_transaction_api.get_varchar2_value
5743         (p_transaction_step_id => p_transaction_step_id
5744         ,p_name                =>upper( 'p_title'));
5745   --
5746   -- Bug 1914891
5747   --
5748   p_title_meaning := HR_GENERAL.DECODE_LOOKUP('TITLE', p_title);
5749   --
5750   p_work_telephone  :=
5751       hr_transaction_api.get_varchar2_value
5752         (p_transaction_step_id => p_transaction_step_id
5753         ,p_name                =>upper( 'p_work_telephone'));
5754   --
5755   p_attribute_category  :=
5756       hr_transaction_api.get_varchar2_value
5757         (p_transaction_step_id => p_transaction_step_id
5758         ,p_name                =>upper( 'p_attribute_category'));
5759   --
5760   p_attribute1  :=
5761       hr_transaction_api.get_varchar2_value
5762         (p_transaction_step_id => p_transaction_step_id
5763         ,p_name                =>upper( 'p_attribute1'));
5764   --
5765   p_attribute2  :=
5766       hr_transaction_api.get_varchar2_value
5767         (p_transaction_step_id => p_transaction_step_id
5768         ,p_name                =>upper( 'p_attribute2'));
5769   --
5770   p_attribute3  :=
5771       hr_transaction_api.get_varchar2_value
5772         (p_transaction_step_id => p_transaction_step_id
5773         ,p_name                =>upper( 'p_attribute3'));
5774   --
5775   p_attribute4  :=
5776       hr_transaction_api.get_varchar2_value
5777         (p_transaction_step_id => p_transaction_step_id
5778         ,p_name                =>upper( 'p_attribute4'));
5779   --
5780   p_attribute5  :=
5781       hr_transaction_api.get_varchar2_value
5782         (p_transaction_step_id => p_transaction_step_id
5783         ,p_name                =>upper( 'p_attribute5'));
5784   --
5785   p_attribute6  :=
5786       hr_transaction_api.get_varchar2_value
5787         (p_transaction_step_id => p_transaction_step_id
5788         ,p_name                =>upper( 'p_attribute6'));
5789   --
5790   p_attribute7  :=
5791       hr_transaction_api.get_varchar2_value
5792         (p_transaction_step_id => p_transaction_step_id
5793         ,p_name                =>upper( 'p_attribute7'));
5794   --
5795   p_attribute8  :=
5796       hr_transaction_api.get_varchar2_value
5797         (p_transaction_step_id => p_transaction_step_id
5798         ,p_name                =>upper( 'p_attribute8'));
5799   --
5800   p_attribute9  :=
5801       hr_transaction_api.get_varchar2_value
5802         (p_transaction_step_id => p_transaction_step_id
5803         ,p_name                =>upper( 'p_attribute9'));
5804   --
5805   p_attribute10  :=
5806       hr_transaction_api.get_varchar2_value
5807         (p_transaction_step_id => p_transaction_step_id
5808         ,p_name                =>upper( 'p_attribute10'));
5809   --
5810   p_attribute11  :=
5811       hr_transaction_api.get_varchar2_value
5812         (p_transaction_step_id => p_transaction_step_id
5813         ,p_name                =>upper( 'p_attribute11'));
5814   --
5815   p_attribute12  :=
5816       hr_transaction_api.get_varchar2_value
5817         (p_transaction_step_id => p_transaction_step_id
5818         ,p_name                =>upper( 'p_attribute12'));
5819   --
5820   p_attribute13  :=
5821       hr_transaction_api.get_varchar2_value
5822         (p_transaction_step_id => p_transaction_step_id
5823         ,p_name                =>upper( 'p_attribute13'));
5824   --
5825   p_attribute14  :=
5826       hr_transaction_api.get_varchar2_value
5827         (p_transaction_step_id => p_transaction_step_id
5828         ,p_name                =>upper( 'p_attribute14'));
5829   --
5830   p_attribute15  :=
5831       hr_transaction_api.get_varchar2_value
5832         (p_transaction_step_id => p_transaction_step_id
5833         ,p_name                =>upper( 'p_attribute15'));
5834   --
5835   p_attribute16  :=
5836       hr_transaction_api.get_varchar2_value
5837         (p_transaction_step_id => p_transaction_step_id
5838         ,p_name                =>upper( 'p_attribute16'));
5839   --
5840   p_attribute17  :=
5841       hr_transaction_api.get_varchar2_value
5842         (p_transaction_step_id => p_transaction_step_id
5843         ,p_name                =>upper( 'p_attribute17'));
5844   --
5845   p_attribute18  :=
5846       hr_transaction_api.get_varchar2_value
5847         (p_transaction_step_id => p_transaction_step_id
5848         ,p_name                =>upper( 'p_attribute18'));
5849   --
5850   p_attribute19  :=
5851       hr_transaction_api.get_varchar2_value
5852         (p_transaction_step_id => p_transaction_step_id
5853         ,p_name                =>upper( 'p_attribute19'));
5854   --
5855   p_attribute20  :=
5856       hr_transaction_api.get_varchar2_value
5857         (p_transaction_step_id => p_transaction_step_id
5858         ,p_name                =>upper( 'p_attribute20'));
5859   --
5860   p_attribute21  :=
5861       hr_transaction_api.get_varchar2_value
5862         (p_transaction_step_id => p_transaction_step_id
5863         ,p_name                =>upper( 'p_attribute21'));
5864   --
5865   p_attribute22  :=
5866       hr_transaction_api.get_varchar2_value
5867         (p_transaction_step_id => p_transaction_step_id
5868         ,p_name                =>upper( 'p_attribute22'));
5869   --
5870   p_attribute23  :=
5871       hr_transaction_api.get_varchar2_value
5872         (p_transaction_step_id => p_transaction_step_id
5873         ,p_name                =>upper( 'p_attribute23'));
5874   --
5875   p_attribute24  :=
5876       hr_transaction_api.get_varchar2_value
5877         (p_transaction_step_id => p_transaction_step_id
5878         ,p_name                =>upper( 'p_attribute24'));
5879   --
5880   p_attribute25  :=
5881       hr_transaction_api.get_varchar2_value
5882         (p_transaction_step_id => p_transaction_step_id
5883         ,p_name                =>upper( 'p_attribute25'));
5884   --
5885   p_attribute26  :=
5886       hr_transaction_api.get_varchar2_value
5887         (p_transaction_step_id => p_transaction_step_id
5888         ,p_name                =>upper( 'p_attribute26'));
5889   --
5890   p_attribute27  :=
5891       hr_transaction_api.get_varchar2_value
5892         (p_transaction_step_id => p_transaction_step_id
5893         ,p_name                =>upper( 'p_attribute27'));
5894   --
5895   p_attribute28  :=
5896       hr_transaction_api.get_varchar2_value
5897         (p_transaction_step_id => p_transaction_step_id
5898         ,p_name                =>upper( 'p_attribute28'));
5899   --
5900   p_attribute29  :=
5901       hr_transaction_api.get_varchar2_value
5902         (p_transaction_step_id => p_transaction_step_id
5903         ,p_name                =>upper( 'p_attribute29'));
5904   --
5905   p_attribute30  :=
5906       hr_transaction_api.get_varchar2_value
5907         (p_transaction_step_id => p_transaction_step_id
5908         ,p_name                =>upper( 'p_attribute30'));
5909   --
5910   p_per_information_category  :=
5911       hr_transaction_api.get_varchar2_value
5912         (p_transaction_step_id => p_transaction_step_id
5913         ,p_name                =>upper( 'p_per_information_category'));
5914   --
5915   p_per_information1  :=
5916       hr_transaction_api.get_varchar2_value
5917         (p_transaction_step_id => p_transaction_step_id
5918         ,p_name                =>upper( 'p_per_information1'));
5919   --
5920   p_per_information2  :=
5921       hr_transaction_api.get_varchar2_value
5922         (p_transaction_step_id => p_transaction_step_id
5923         ,p_name                =>upper( 'p_per_information2'));
5924   --
5925   p_per_information3  :=
5926       hr_transaction_api.get_varchar2_value
5927         (p_transaction_step_id => p_transaction_step_id
5928         ,p_name                =>upper( 'p_per_information3'));
5929   --
5930   p_per_information4  :=
5931       hr_transaction_api.get_varchar2_value
5932         (p_transaction_step_id => p_transaction_step_id
5933         ,p_name                =>upper( 'p_per_information4'));
5934   --
5935   p_per_information5  :=
5936       hr_transaction_api.get_varchar2_value
5937         (p_transaction_step_id => p_transaction_step_id
5938         ,p_name                =>upper( 'p_per_information5'));
5939   --
5940   p_per_information6  :=
5941       hr_transaction_api.get_varchar2_value
5942         (p_transaction_step_id => p_transaction_step_id
5943         ,p_name                =>upper( 'p_per_information6'));
5944   --
5945   p_per_information7  :=
5946       hr_transaction_api.get_varchar2_value
5947         (p_transaction_step_id => p_transaction_step_id
5948         ,p_name                =>upper( 'p_per_information7'));
5949   --
5950   p_per_information8  :=
5951       hr_transaction_api.get_varchar2_value
5952         (p_transaction_step_id => p_transaction_step_id
5953         ,p_name                =>upper( 'p_per_information8'));
5954   --
5955   p_per_information9  :=
5956       hr_transaction_api.get_varchar2_value
5957         (p_transaction_step_id => p_transaction_step_id
5958         ,p_name                =>upper( 'p_per_information9'));
5959   --
5960   p_per_information10  :=
5961       hr_transaction_api.get_varchar2_value
5962         (p_transaction_step_id => p_transaction_step_id
5963         ,p_name                =>upper( 'p_per_information10'));
5964   --
5965   p_per_information11  :=
5966       hr_transaction_api.get_varchar2_value
5967         (p_transaction_step_id => p_transaction_step_id
5968         ,p_name                =>upper( 'p_per_information11'));
5969   --
5970   p_per_information12  :=
5971       hr_transaction_api.get_varchar2_value
5972         (p_transaction_step_id => p_transaction_step_id
5973         ,p_name                =>upper( 'p_per_information12'));
5974   --
5975   p_per_information13  :=
5976       hr_transaction_api.get_varchar2_value
5977         (p_transaction_step_id => p_transaction_step_id
5978         ,p_name                =>upper( 'p_per_information13'));
5979   --
5980   p_per_information14  :=
5981       hr_transaction_api.get_varchar2_value
5982         (p_transaction_step_id => p_transaction_step_id
5983         ,p_name                =>upper( 'p_per_information14'));
5984   --
5985   p_per_information15  :=
5986       hr_transaction_api.get_varchar2_value
5987         (p_transaction_step_id => p_transaction_step_id
5988         ,p_name                =>upper( 'p_per_information15'));
5989   --
5990   p_per_information16  :=
5991       hr_transaction_api.get_varchar2_value
5992         (p_transaction_step_id => p_transaction_step_id
5993         ,p_name                =>upper( 'p_per_information16'));
5994   --
5995   p_per_information17  :=
5996       hr_transaction_api.get_varchar2_value
5997         (p_transaction_step_id => p_transaction_step_id
5998         ,p_name                =>upper( 'p_per_information17'));
5999   --
6000   p_per_information18  :=
6001       hr_transaction_api.get_varchar2_value
6002         (p_transaction_step_id => p_transaction_step_id
6003         ,p_name                =>upper( 'p_per_information18'));
6004   --
6005   p_per_information19  :=
6006       hr_transaction_api.get_varchar2_value
6007         (p_transaction_step_id => p_transaction_step_id
6008         ,p_name                =>upper( 'p_per_information19'));
6009   --
6010   p_per_information20  :=
6011       hr_transaction_api.get_varchar2_value
6012         (p_transaction_step_id => p_transaction_step_id
6013         ,p_name                =>upper( 'p_per_information20'));
6014   --
6015   p_per_information21  :=
6016       hr_transaction_api.get_varchar2_value
6017         (p_transaction_step_id => p_transaction_step_id
6018         ,p_name                =>upper( 'p_per_information21'));
6019   --
6020   p_per_information22  :=
6021       hr_transaction_api.get_varchar2_value
6022         (p_transaction_step_id => p_transaction_step_id
6023         ,p_name                =>upper( 'p_per_information22'));
6024   --
6025   p_per_information23  :=
6026       hr_transaction_api.get_varchar2_value
6027         (p_transaction_step_id => p_transaction_step_id
6028         ,p_name                =>upper( 'p_per_information23'));
6029   --
6030   p_per_information24  :=
6031       hr_transaction_api.get_varchar2_value
6032         (p_transaction_step_id => p_transaction_step_id
6033         ,p_name                =>upper( 'p_per_information24'));
6034   --
6035   p_per_information25  :=
6036       hr_transaction_api.get_varchar2_value
6037         (p_transaction_step_id => p_transaction_step_id
6038         ,p_name                =>upper( 'p_per_information25'));
6039   --
6040   p_per_information26  :=
6041       hr_transaction_api.get_varchar2_value
6042         (p_transaction_step_id => p_transaction_step_id
6043         ,p_name                =>upper( 'p_per_information26'));
6044   --
6045   p_per_information27  :=
6046       hr_transaction_api.get_varchar2_value
6047         (p_transaction_step_id => p_transaction_step_id
6048         ,p_name                =>upper( 'p_per_information27'));
6049   --
6050   p_per_information28  :=
6051       hr_transaction_api.get_varchar2_value
6052         (p_transaction_step_id => p_transaction_step_id
6053         ,p_name                =>upper( 'p_per_information28'));
6054   --
6055   p_per_information29  :=
6056       hr_transaction_api.get_varchar2_value
6057         (p_transaction_step_id => p_transaction_step_id
6058         ,p_name                =>upper( 'p_per_information29'));
6059   --
6060   p_per_information30  :=
6061       hr_transaction_api.get_varchar2_value
6062         (p_transaction_step_id => p_transaction_step_id
6063         ,p_name                =>upper( 'p_per_information30'));
6064   --
6065   p_correspondence_language  :=
6066       hr_transaction_api.get_varchar2_value
6067         (p_transaction_step_id => p_transaction_step_id
6068         ,p_name                =>upper( 'p_correspondence_language'));
6069   --
6070   p_honors  :=
6071       hr_transaction_api.get_varchar2_value
6072         (p_transaction_step_id => p_transaction_step_id
6073         ,p_name                =>upper( 'p_honors'));
6074   --
6075   p_pre_name_adjunct  :=
6076       hr_transaction_api.get_varchar2_value
6077         (p_transaction_step_id => p_transaction_step_id
6078         ,p_name                =>upper( 'p_pre_name_adjunct'));
6079   --
6080   p_suffix  :=
6081       hr_transaction_api.get_varchar2_value
6082         (p_transaction_step_id => p_transaction_step_id
6083         ,p_name                =>upper( 'p_suffix'));
6084   --
6085   p_create_mirror_flag  :=
6086       hr_transaction_api.get_varchar2_value
6087         (p_transaction_step_id => p_transaction_step_id
6088         ,p_name                =>upper( 'p_create_mirror_flag'));
6089   --
6090   p_mirror_type  :=
6091       hr_transaction_api.get_varchar2_value
6092         (p_transaction_step_id => p_transaction_step_id
6093         ,p_name                =>upper( 'p_mirror_type'));
6094   --
6095   p_mirror_cont_attribute_cat  :=
6096       hr_transaction_api.get_varchar2_value
6097         (p_transaction_step_id => p_transaction_step_id
6098         ,p_name                =>upper( 'p_mirror_cont_attribute_cat'));
6099   --
6100   p_mirror_cont_attribute1  :=
6101       hr_transaction_api.get_varchar2_value
6102         (p_transaction_step_id => p_transaction_step_id
6103         ,p_name                =>upper( 'p_mirror_cont_attribute1'));
6104   --
6105   p_mirror_cont_attribute2  :=
6106       hr_transaction_api.get_varchar2_value
6107         (p_transaction_step_id => p_transaction_step_id
6108         ,p_name                =>upper( 'p_mirror_cont_attribute2'));
6109   --
6110   p_mirror_cont_attribute3  :=
6111       hr_transaction_api.get_varchar2_value
6112         (p_transaction_step_id => p_transaction_step_id
6113         ,p_name                =>upper( 'p_mirror_cont_attribute3'));
6114   --
6115   p_mirror_cont_attribute4  :=
6116       hr_transaction_api.get_varchar2_value
6117         (p_transaction_step_id => p_transaction_step_id
6118         ,p_name                =>upper( 'p_mirror_cont_attribute4'));
6119   --
6120   p_mirror_cont_attribute5  :=
6121       hr_transaction_api.get_varchar2_value
6122         (p_transaction_step_id => p_transaction_step_id
6123         ,p_name                =>upper( 'p_mirror_cont_attribute5'));
6124   --
6125   p_mirror_cont_attribute6  :=
6126       hr_transaction_api.get_varchar2_value
6127         (p_transaction_step_id => p_transaction_step_id
6128         ,p_name                =>upper( 'p_mirror_cont_attribute6'));
6129   --
6130   p_mirror_cont_attribute7  :=
6131       hr_transaction_api.get_varchar2_value
6132         (p_transaction_step_id => p_transaction_step_id
6133         ,p_name                =>upper( 'p_mirror_cont_attribute7'));
6134   --
6135   p_mirror_cont_attribute8  :=
6136       hr_transaction_api.get_varchar2_value
6137         (p_transaction_step_id => p_transaction_step_id
6138         ,p_name                =>upper( 'p_mirror_cont_attribute8'));
6139   --
6140   p_mirror_cont_attribute9  :=
6141       hr_transaction_api.get_varchar2_value
6142         (p_transaction_step_id => p_transaction_step_id
6143         ,p_name                =>upper( 'p_mirror_cont_attribute9'));
6144   --
6145   p_mirror_cont_attribute10  :=
6146       hr_transaction_api.get_varchar2_value
6147         (p_transaction_step_id => p_transaction_step_id
6148         ,p_name                =>upper( 'p_mirror_cont_attribute10'));
6149   --
6150   p_mirror_cont_attribute11  :=
6151       hr_transaction_api.get_varchar2_value
6152         (p_transaction_step_id => p_transaction_step_id
6153         ,p_name                =>upper( 'p_mirror_cont_attribute11'));
6154   --
6155   p_mirror_cont_attribute12  :=
6156       hr_transaction_api.get_varchar2_value
6157         (p_transaction_step_id => p_transaction_step_id
6158         ,p_name                =>upper( 'p_mirror_cont_attribute12'));
6159   --
6160   p_mirror_cont_attribute13  :=
6161       hr_transaction_api.get_varchar2_value
6162         (p_transaction_step_id => p_transaction_step_id
6163         ,p_name                =>upper( 'p_mirror_cont_attribute13'));
6164   --
6165   p_mirror_cont_attribute14  :=
6166       hr_transaction_api.get_varchar2_value
6167         (p_transaction_step_id => p_transaction_step_id
6168         ,p_name                =>upper( 'p_mirror_cont_attribute14'));
6169   --
6170   p_mirror_cont_attribute15  :=
6171       hr_transaction_api.get_varchar2_value
6172         (p_transaction_step_id => p_transaction_step_id
6173         ,p_name                =>upper( 'p_mirror_cont_attribute15'));
6174   --
6175   p_mirror_cont_attribute16  :=
6176       hr_transaction_api.get_varchar2_value
6177         (p_transaction_step_id => p_transaction_step_id
6178         ,p_name                =>upper( 'p_mirror_cont_attribute16'));
6179   --
6180   p_mirror_cont_attribute17  :=
6181       hr_transaction_api.get_varchar2_value
6182         (p_transaction_step_id => p_transaction_step_id
6183         ,p_name                =>upper( 'p_mirror_cont_attribute17'));
6184   --
6185   p_mirror_cont_attribute18  :=
6186       hr_transaction_api.get_varchar2_value
6187         (p_transaction_step_id => p_transaction_step_id
6188         ,p_name                =>upper( 'p_mirror_cont_attribute18'));
6189   --
6190   p_mirror_cont_attribute19  :=
6191       hr_transaction_api.get_varchar2_value
6192         (p_transaction_step_id => p_transaction_step_id
6193         ,p_name                =>upper( 'p_mirror_cont_attribute19'));
6194   --
6195   p_mirror_cont_attribute20  :=
6196       hr_transaction_api.get_varchar2_value
6197         (p_transaction_step_id => p_transaction_step_id
6198         ,p_name                =>upper( 'p_mirror_cont_attribute20'));
6199   --
6200 /*
6201   p_item_type  :=
6202       hr_transaction_api.get_varchar2_value
6203         (p_transaction_step_id => p_transaction_step_id
6204         ,p_name                =>upper( 'p_item_type'));
6205   --
6206   p_item_key  :=
6207       hr_transaction_api.get_varchar2_value
6208         (p_transaction_step_id => p_transaction_step_id
6209         ,p_name                =>upper( 'p_item_key'));
6210   --
6211   p_activity_id  :=
6212       hr_transaction_api.get_number_value
6213         (p_transaction_step_id => p_transaction_step_id
6214         ,p_name                =>upper( 'p_activity_id'));
6215 */
6216   --
6217   p_action  :=
6218       hr_transaction_api.get_varchar2_value
6219         (p_transaction_step_id => p_transaction_step_id
6220         ,p_name                =>upper( 'p_action'));
6221   --
6222   p_login_person_id  :=
6223       hr_transaction_api.get_number_value
6224         (p_transaction_step_id => p_transaction_step_id
6225         ,p_name                =>upper( 'p_login_person_id'));
6226   --
6227   p_process_section_name  :=
6228       hr_transaction_api.get_varchar2_value
6229         (p_transaction_step_id => p_transaction_step_id
6230         ,p_name                =>upper( 'p_process_section_name'));
6231   --
6232   p_review_page_region_code  :=
6233       hr_transaction_api.get_varchar2_value
6234         (p_transaction_step_id => p_transaction_step_id
6235         ,p_name                =>upper( 'P_REVIEW_PROC_CALL'));
6236 
6237   --
6238   P_CONT_INFORMATION_CATEGORY  :=
6239       hr_transaction_api.get_VARCHAR2_value
6240             (p_transaction_step_id => p_transaction_step_id
6241             ,p_name                => 'P_CONT_INFORMATION_CATEGORY');
6242   --
6243   P_CONT_INFORMATION1  :=
6244       hr_transaction_api.get_VARCHAR2_value
6245             (p_transaction_step_id => p_transaction_step_id
6246             ,p_name                => 'P_CONT_INFORMATION1');
6247   --
6248   P_CONT_INFORMATION2  :=
6249       hr_transaction_api.get_VARCHAR2_value
6250             (p_transaction_step_id => p_transaction_step_id
6251             ,p_name                => 'P_CONT_INFORMATION2');
6252   --
6253   P_CONT_INFORMATION3  :=
6254       hr_transaction_api.get_VARCHAR2_value
6255             (p_transaction_step_id => p_transaction_step_id
6256             ,p_name                => 'P_CONT_INFORMATION3');
6257   --
6258   P_CONT_INFORMATION4  :=
6259       hr_transaction_api.get_VARCHAR2_value
6260             (p_transaction_step_id => p_transaction_step_id
6261             ,p_name                => 'P_CONT_INFORMATION4');
6262   --
6263   P_CONT_INFORMATION5  :=
6264       hr_transaction_api.get_VARCHAR2_value
6265             (p_transaction_step_id => p_transaction_step_id
6266             ,p_name                => 'P_CONT_INFORMATION5');
6267   --
6268   P_CONT_INFORMATION6  :=
6269        hr_transaction_api.get_VARCHAR2_value
6270             (p_transaction_step_id => p_transaction_step_id
6271             ,p_name                => 'P_CONT_INFORMATION6');
6272   --
6273   P_CONT_INFORMATION7  :=
6274        hr_transaction_api.get_VARCHAR2_value
6275             (p_transaction_step_id => p_transaction_step_id
6276             ,p_name                => 'P_CONT_INFORMATION7');
6277   --
6278   P_CONT_INFORMATION8  :=
6279        hr_transaction_api.get_VARCHAR2_value
6280             (p_transaction_step_id => p_transaction_step_id
6281             ,p_name                => 'P_CONT_INFORMATION8');
6282   --
6283   P_CONT_INFORMATION9  :=
6284        hr_transaction_api.get_VARCHAR2_value
6285             (p_transaction_step_id => p_transaction_step_id
6286             ,p_name                => 'P_CONT_INFORMATION9');
6287   --
6288   P_CONT_INFORMATION10  :=
6289        hr_transaction_api.get_VARCHAR2_value
6290             (p_transaction_step_id => p_transaction_step_id
6291             ,p_name                => 'P_CONT_INFORMATION10');
6292    --
6293    P_CONT_INFORMATION11  :=
6294        hr_transaction_api.get_VARCHAR2_value
6295             (p_transaction_step_id => p_transaction_step_id
6296             ,p_name                => 'P_CONT_INFORMATION11');
6297    --
6298    P_CONT_INFORMATION12  :=
6299         hr_transaction_api.get_VARCHAR2_value
6300             (p_transaction_step_id => p_transaction_step_id
6301             ,p_name                => 'P_CONT_INFORMATION12');
6302    --
6303    P_CONT_INFORMATION13  :=
6304         hr_transaction_api.get_VARCHAR2_value
6305             (p_transaction_step_id => p_transaction_step_id
6306             ,p_name                => 'P_CONT_INFORMATION13');
6307    --
6308    P_CONT_INFORMATION14  :=
6309         hr_transaction_api.get_VARCHAR2_value
6310             (p_transaction_step_id => p_transaction_step_id
6311             ,p_name                => 'P_CONT_INFORMATION14');
6312    --
6313    P_CONT_INFORMATION15  :=
6314         hr_transaction_api.get_VARCHAR2_value
6315             (p_transaction_step_id => p_transaction_step_id
6316             ,p_name                => 'P_CONT_INFORMATION15');
6317    --
6318    P_CONT_INFORMATION16  :=
6319         hr_transaction_api.get_VARCHAR2_value
6320             (p_transaction_step_id => p_transaction_step_id
6321             ,p_name                => 'P_CONT_INFORMATION16');
6322    --
6323    P_CONT_INFORMATION17  :=
6324         hr_transaction_api.get_VARCHAR2_value
6325             (p_transaction_step_id => p_transaction_step_id
6326             ,p_name                => 'P_CONT_INFORMATION17');
6327    --
6328    P_CONT_INFORMATION18  :=
6329         hr_transaction_api.get_VARCHAR2_value
6330             (p_transaction_step_id => p_transaction_step_id
6331             ,p_name                => 'P_CONT_INFORMATION18');
6332    --
6333    P_CONT_INFORMATION19  :=
6334         hr_transaction_api.get_VARCHAR2_value
6335             (p_transaction_step_id => p_transaction_step_id
6336             ,p_name                => 'P_CONT_INFORMATION19');
6337    --
6338    P_CONT_INFORMATION20  :=
6339         hr_transaction_api.get_VARCHAR2_value
6340             (p_transaction_step_id => p_transaction_step_id
6341             ,p_name                => 'P_CONT_INFORMATION20');
6342    --
6343           hr_utility.set_location('End of setting the attributes:'||l_proc,15 );
6344           hr_utility.set_location('Exiting:'||l_proc, 20);
6345 
6346  EXCEPTION
6347    WHEN OTHERS THEN
6348       hr_utility.set_location('Exception:'||l_proc,555);
6349       fnd_message.set_name('PER', SQLERRM ||' '||to_char(SQLCODE));
6350       hr_utility.raise_error;
6351    --RAISE;
6352 
6353  END get_contact_from_tt;
6354  --
6355   /*
6356   ||===========================================================================
6357   || PROCEDURE: create_contact_tt
6358   ||---------------------------------------------------------------------------
6359   ||
6360   || Description:
6361   || Description:
6362   ||     This procedure will call the actual API -
6363   ||                hr_contact_rel_api.create_contact_tt()
6364   ||
6365   || Pre Conditions:
6366   ||
6367   || In Arguments:
6368   ||     Contains entire list of parameters that are defined in the actual
6369   ||     API. For details see pecrlapi.pkb file.
6370   ||
6371   || out nocopy Arguments:
6372   ||
6373   || In out nocopy Arguments:
6374   ||
6375   || Post Success:
6376   ||     Executes the API call.
6377   ||
6378   || Post Failure:
6379   ||     Raises an exception
6380   ||
6381   || Access Status:
6382   ||     Public.
6383   ||
6384   ||===========================================================================
6385   */
6386 
6387 procedure create_contact_tt
6388   (p_validate                     in        number     default 0
6389   ,p_start_date                   in        date
6390   ,p_business_group_id            in        number
6391   ,p_person_id                    in        number
6392   ,p_contact_person_id            in        number      default null
6393   ,p_contact_type                 in        varchar2
6394   ,p_ctr_comments                 in        varchar2    default null
6395   ,p_primary_contact_flag         in        varchar2    default 'N'
6396   ,p_date_start                   in        date        default null
6397   ,p_start_life_reason_id         in        number      default null
6398   ,p_date_end                     in        date        default null
6399   ,p_end_life_reason_id           in        number      default null
6400   ,p_rltd_per_rsds_w_dsgntr_flag  in        varchar2    default 'N'
6401   ,p_personal_flag                in        varchar2    default 'N'
6402   ,p_sequence_number              in        number      default null
6403   ,p_cont_attribute_category      in        varchar2    default null
6404   ,p_cont_attribute1              in        varchar2    default null
6405   ,p_cont_attribute2              in        varchar2    default null
6406   ,p_cont_attribute3              in        varchar2    default null
6407   ,p_cont_attribute4              in        varchar2    default null
6408   ,p_cont_attribute5              in        varchar2    default null
6409   ,p_cont_attribute6              in        varchar2    default null
6410   ,p_cont_attribute7              in        varchar2    default null
6411   ,p_cont_attribute8              in        varchar2    default null
6412   ,p_cont_attribute9              in        varchar2    default null
6413   ,p_cont_attribute10             in        varchar2    default null
6414   ,p_cont_attribute11             in        varchar2    default null
6415   ,p_cont_attribute12             in        varchar2    default null
6416   ,p_cont_attribute13             in        varchar2    default null
6417   ,p_cont_attribute14             in        varchar2    default null
6418   ,p_cont_attribute15             in        varchar2    default null
6419   ,p_cont_attribute16             in        varchar2    default null
6420   ,p_cont_attribute17             in        varchar2    default null
6421   ,p_cont_attribute18             in        varchar2    default null
6422   ,p_cont_attribute19             in        varchar2    default null
6423   ,p_cont_attribute20             in        varchar2    default null
6424   ,p_third_party_pay_flag         in        varchar2    default 'N'
6425   ,p_bondholder_flag              in        varchar2    default 'N'
6426   ,p_dependent_flag               in        varchar2    default 'N'
6427   ,p_beneficiary_flag             in        varchar2    default 'N'
6428   ,p_last_name                    in        varchar2    default null
6429   ,p_sex                          in        varchar2    default null
6430   ,p_person_type_id               in        number      default null
6431   ,p_per_comments                 in        varchar2    default null
6432   ,p_date_of_birth                in        date        default null
6433   ,p_email_address                in        varchar2    default null
6434   ,p_first_name                   in        varchar2    default null
6435   ,p_known_as                     in        varchar2    default null
6436   ,p_marital_status               in        varchar2    default null
6437   ,p_middle_names                 in        varchar2    default null
6438   ,p_nationality                  in        varchar2    default null
6439   ,p_national_identifier          in        varchar2    default null
6440   ,p_previous_last_name           in        varchar2    default null
6441   ,p_registered_disabled_flag     in        varchar2    default null
6442   ,p_title                        in        varchar2    default null
6443   ,p_work_telephone               in        varchar2    default null
6444   ,p_attribute_category           in        varchar2    default null
6445   ,p_attribute1                   in        varchar2    default null
6446   ,p_attribute2                   in        varchar2    default null
6447   ,p_attribute3                   in        varchar2    default null
6448   ,p_attribute4                   in        varchar2    default null
6449   ,p_attribute5                   in        varchar2    default null
6450   ,p_attribute6                   in        varchar2    default null
6451   ,p_attribute7                   in        varchar2    default null
6452   ,p_attribute8                   in        varchar2    default null
6453   ,p_attribute9                   in        varchar2    default null
6454   ,p_attribute10                  in        varchar2    default null
6455   ,p_attribute11                  in        varchar2    default null
6456   ,p_attribute12                  in        varchar2    default null
6457   ,p_attribute13                  in        varchar2    default null
6458   ,p_attribute14                  in        varchar2    default null
6459   ,p_attribute15                  in        varchar2    default null
6460   ,p_attribute16                  in        varchar2    default null
6461   ,p_attribute17                  in        varchar2    default null
6462   ,p_attribute18                  in        varchar2    default null
6463   ,p_attribute19                  in        varchar2    default null
6464   ,p_attribute20                  in        varchar2    default null
6465   ,p_attribute21                  in        varchar2    default null
6466   ,p_attribute22                  in        varchar2    default null
6467   ,p_attribute23                  in        varchar2    default null
6468   ,p_attribute24                  in        varchar2    default null
6469   ,p_attribute25                  in        varchar2    default null
6470   ,p_attribute26                  in        varchar2    default null
6471   ,p_attribute27                  in        varchar2    default null
6472   ,p_attribute28                  in        varchar2    default null
6473   ,p_attribute29                  in        varchar2    default null
6474   ,p_attribute30                  in        varchar2    default null
6475   ,p_per_information_category     in        varchar2    default null
6476   ,p_per_information1             in        varchar2    default null
6477   ,p_per_information2             in        varchar2    default null
6478   ,p_per_information3             in        varchar2    default null
6479   ,p_per_information4             in        varchar2    default null
6480   ,p_per_information5             in        varchar2    default null
6481   ,p_per_information6             in        varchar2    default null
6482   ,p_per_information7             in        varchar2    default null
6483   ,p_per_information8             in        varchar2    default null
6484   ,p_per_information9             in        varchar2    default null
6485   ,p_per_information10            in        varchar2    default null
6486   ,p_per_information11            in        varchar2    default null
6487   ,p_per_information12            in        varchar2    default null
6488   ,p_per_information13            in        varchar2    default null
6489   ,p_per_information14            in        varchar2    default null
6490   ,p_per_information15            in        varchar2    default null
6491   ,p_per_information16            in        varchar2    default null
6492   ,p_per_information17            in        varchar2    default null
6493   ,p_per_information18            in        varchar2    default null
6494   ,p_per_information19            in        varchar2    default null
6495   ,p_per_information20            in        varchar2    default null
6496   ,p_per_information21            in        varchar2    default null
6497   ,p_per_information22            in        varchar2    default null
6498   ,p_per_information23            in        varchar2    default null
6499   ,p_per_information24            in        varchar2    default null
6500   ,p_per_information25            in        varchar2    default null
6501   ,p_per_information26            in        varchar2    default null
6502   ,p_per_information27            in        varchar2    default null
6503   ,p_per_information28            in        varchar2    default null
6504   ,p_per_information29            in        varchar2    default null
6505   ,p_per_information30            in        varchar2    default null
6506   ,p_correspondence_language      in        varchar2    default null
6507   ,p_honors                       in        varchar2    default null
6508   ,p_pre_name_adjunct             in        varchar2    default null
6509   ,p_suffix                       in        varchar2    default null
6510   ,p_create_mirror_flag           in        varchar2    default 'N'
6511   ,p_mirror_type                  in        varchar2    default null
6512   ,p_mirror_cont_attribute_cat    in        varchar2    default null
6513   ,p_mirror_cont_attribute1       in        varchar2    default null
6514   ,p_mirror_cont_attribute2       in        varchar2    default null
6515   ,p_mirror_cont_attribute3       in        varchar2    default null
6516   ,p_mirror_cont_attribute4       in        varchar2    default null
6517   ,p_mirror_cont_attribute5       in        varchar2    default null
6518   ,p_mirror_cont_attribute6       in        varchar2    default null
6519   ,p_mirror_cont_attribute7       in        varchar2    default null
6520   ,p_mirror_cont_attribute8       in        varchar2    default null
6521   ,p_mirror_cont_attribute9       in        varchar2    default null
6522   ,p_mirror_cont_attribute10      in        varchar2    default null
6523   ,p_mirror_cont_attribute11      in        varchar2    default null
6524   ,p_mirror_cont_attribute12      in        varchar2    default null
6525   ,p_mirror_cont_attribute13      in        varchar2    default null
6526   ,p_mirror_cont_attribute14      in        varchar2    default null
6527   ,p_mirror_cont_attribute15      in        varchar2    default null
6528   ,p_mirror_cont_attribute16      in        varchar2    default null
6529   ,p_mirror_cont_attribute17      in        varchar2    default null
6530   ,p_mirror_cont_attribute18      in        varchar2    default null
6531   ,p_mirror_cont_attribute19      in        varchar2    default null
6532   ,p_mirror_cont_attribute20      in        varchar2    default null
6533   ,p_item_type                    in        varchar2
6534   ,p_item_key                     in        varchar2
6535   ,p_activity_id                  in        number
6536   ,p_action                       in        varchar2
6537   ,p_login_person_id              in        number
6538   ,p_process_section_name         in        varchar2
6539   ,p_review_page_region_code      in        varchar2 default null
6540 
6541   ,p_adjusted_svc_date            in      date     default null
6542   ,p_datetrack_update_mode        in      varchar2 default hr_api.g_correction -- 9999
6543   ,p_applicant_number             in      varchar2 default null
6544   ,p_background_check_status      in      varchar2 default null
6545   ,p_background_date_check        in      date     default null
6546   ,p_benefit_group_id             in      number   default null
6547   ,p_blood_type                   in      varchar2 default null
6548   ,p_coord_ben_med_pln_no         in      varchar2 default null
6549   ,p_coord_ben_no_cvg_flag        in      varchar2 default null
6550   ,p_country_of_birth             in      varchar2 default null
6551   ,p_date_employee_data_verified  in      date     default null
6552   ,p_date_of_death                in      date     default null
6553   ,p_dpdnt_adoption_date          in      date     default null
6554   ,p_dpdnt_vlntry_svce_flag       in      varchar2 default null
6555   ,p_employee_number              in out nocopy  varchar2
6556   ,p_expense_check_send_to_addres in      varchar2 default null
6557   ,p_fast_path_employee           in      varchar2 default null
6558   ,p_fte_capacity                 in      number   default null
6559   ,p_global_person_id             in      varchar2 default null
6560   ,p_hold_applicant_date_until    in      date     default null
6561   ,p_internal_location            in      varchar2 default null
6562   ,p_last_medical_test_by         in      varchar2 default null
6563   ,p_last_medical_test_date       in      date     default null
6564   ,p_mailstop                     in      varchar2 default null
6565   ,p_office_number                in      varchar2 default null
6566   ,p_on_military_service          in      varchar2 default null
6567   ,p_original_date_of_hire        in      date     default null
6568   ,p_projected_start_date         in      date     default null
6569   ,p_receipt_of_death_cert_date   in      date     default null
6570   ,p_region_of_birth              in      varchar2 default null
6571   ,p_rehire_authorizor            in      varchar2 default null
6572   ,p_rehire_recommendation        in      varchar2 default null
6573   ,p_rehire_reason                in      varchar2 default null
6574   ,p_resume_exists                in      varchar2 default null
6575   ,p_resume_last_updated          in      date     default null
6576   ,p_second_passport_exists       in      varchar2 default null
6577   ,p_student_status               in      varchar2 default null
6578   ,p_town_of_birth                in      varchar2 default null
6579   ,p_uses_tobacco_flag            in      varchar2 default null
6580   ,p_vendor_id                    in      number   default null
6581   ,p_work_schedule                in      varchar2 default null
6582   ,p_contact_operation            in      varchar2 default null
6583   ,p_emrg_cont_flag               in      varchar2 default 'N'
6584   ,p_dpdnt_bnf_flag               in      varchar2 default 'N'
6585   ,p_save_mode                    in      varchar2  default null
6586 -- Added new paramets
6587   ,P_CONT_INFORMATION_CATEGORY 	  in      varchar2    default null
6588   ,P_CONT_INFORMATION1            in      varchar2    default null
6589   ,P_CONT_INFORMATION2            in      varchar2    default null
6590   ,P_CONT_INFORMATION3            in      varchar2    default null
6591   ,P_CONT_INFORMATION4            in      varchar2    default null
6592   ,P_CONT_INFORMATION5            in      varchar2    default null
6593   ,P_CONT_INFORMATION6            in      varchar2    default null
6594   ,P_CONT_INFORMATION7            in      varchar2    default null
6595   ,P_CONT_INFORMATION8            in      varchar2    default null
6596   ,P_CONT_INFORMATION9            in      varchar2    default null
6597   ,P_CONT_INFORMATION10           in      varchar2    default null
6598   ,P_CONT_INFORMATION11           in      varchar2    default null
6599   ,P_CONT_INFORMATION12           in      varchar2    default null
6600   ,P_CONT_INFORMATION13           in      varchar2    default null
6601   ,P_CONT_INFORMATION14           in      varchar2    default null
6602   ,P_CONT_INFORMATION15           in      varchar2    default null
6603   ,P_CONT_INFORMATION16           in      varchar2    default null
6604   ,P_CONT_INFORMATION17           in      varchar2    default null
6605   ,P_CONT_INFORMATION18           in      varchar2    default null
6606   ,P_CONT_INFORMATION19           in      varchar2    default null
6607   ,P_CONT_INFORMATION20           in      varchar2    default null
6608 --bug 4634855
6609   ,P_MIRROR_CONT_INFORMATION_CAT  in      varchar2    default null
6610   ,P_MIRROR_CONT_INFORMATION1     in      varchar2    default null
6611   ,P_MIRROR_CONT_INFORMATION2     in      varchar2    default null
6612   ,P_MIRROR_CONT_INFORMATION3     in      varchar2    default null
6613   ,P_MIRROR_CONT_INFORMATION4     in      varchar2    default null
6614   ,P_MIRROR_CONT_INFORMATION5     in      varchar2    default null
6615   ,P_MIRROR_CONT_INFORMATION6     in      varchar2    default null
6616   ,P_MIRROR_CONT_INFORMATION7     in      varchar2    default null
6617   ,P_MIRROR_CONT_INFORMATION8     in      varchar2    default null
6618   ,P_MIRROR_CONT_INFORMATION9     in      varchar2    default null
6619   ,P_MIRROR_CONT_INFORMATION10     in      varchar2    default null
6620   ,P_MIRROR_CONT_INFORMATION11     in      varchar2    default null
6621   ,P_MIRROR_CONT_INFORMATION12     in      varchar2    default null
6622   ,P_MIRROR_CONT_INFORMATION13     in      varchar2    default null
6623   ,P_MIRROR_CONT_INFORMATION14     in      varchar2    default null
6624   ,P_MIRROR_CONT_INFORMATION15     in      varchar2    default null
6625   ,P_MIRROR_CONT_INFORMATION16     in      varchar2    default null
6626   ,P_MIRROR_CONT_INFORMATION17     in      varchar2    default null
6627   ,P_MIRROR_CONT_INFORMATION18     in      varchar2    default null
6628   ,P_MIRROR_CONT_INFORMATION19     in      varchar2    default null
6629   ,P_MIRROR_CONT_INFORMATION20     in      varchar2    default null
6630 
6631   ,p_contact_relationship_id      out nocopy number
6632   ,p_ctr_object_version_number    out nocopy number
6633   ,p_per_person_id                out nocopy number
6634   ,p_per_object_version_number    out nocopy number
6635   ,p_per_effective_start_date     out nocopy date
6636   ,p_per_effective_end_date       out nocopy date
6637   ,p_full_name                    out nocopy varchar2
6638   ,p_per_comment_id               out nocopy number
6639   ,p_con_name_combination_warning out nocopy varchar2
6640   ,p_per_name_combination_warning out nocopy varchar2
6641   ,p_con_orig_hire_warning            out nocopy varchar2
6642   ,p_per_orig_hire_warning            out nocopy varchar2
6643   ,p_per_assign_payroll_warning       out nocopy varchar2
6644   ,p_ni_duplicate_warn_or_err   out nocopy varchar2
6645 
6646  )
6647  IS
6648   l_count                        INTEGER := 0;
6649   l_transaction_table            hr_transaction_ss.transaction_table;
6650   l_transaction_step_id          hr_api_transaction_steps.transaction_step_id%type;
6651   l_object_version_number        hr_api_transaction_steps.object_version_number%type;
6652   l_attribute_update_mode        varchar2(100) default  null;
6653   l_validate_mode                boolean  default false;
6654   l_con_name_combination_warning boolean;
6655   l_per_name_combination_warning boolean;
6656   l_con_orig_hire_warning        boolean;
6657   l_per_orig_hire_warning        boolean;
6658   l_con_assign_payroll_warning   boolean;
6659   l_per_assign_payroll_warning   boolean;
6660   l_con_rec_changed              boolean default false ;
6661   --
6662   -- StartRegistration changes
6663   --
6664   l_start_life_reason_id              number := null;
6665   l_end_life_reason_id                number := null;
6666   l_contact_relationship_id           number := null;
6667   l_sequence_number                   number := null;
6668   l_person_type_id                    number := null;
6669   --
6670   l_person_id                         number := null;
6671   l_transaction_id                    number default null;
6672   l_trans_obj_vers_num                number default null;
6673   l_result                            varchar2(100) default null;
6674   l_reg_per_ovn                       number default null;
6675   l_reg_employee_number               number default null;
6676   l_reg_asg_ovn                       number default null;
6677   l_reg_full_name                     per_all_people_f.full_name%type default null;
6678   l_reg_assignment_id                 number;
6679   l_reg_per_effective_start_date      date;
6680   l_reg_per_effective_end_date        date;
6681   l_reg_per_comment_id                number;
6682   l_reg_assignment_sequence           number;
6683   l_reg_assignment_number             varchar2(50);
6684   l_reg_name_combination_warning      boolean;
6685   l_reg_assign_payroll_warning        boolean;
6686   l_reg_orig_hire_warning             boolean;
6687   --Startregistration
6688   l_contact_set                       number;
6689   l_primary_contact_added             number := 0;
6690   --
6691   -- EndRegistration
6692   -- bug# 2168275, 2123868
6693   l_validate_g_per_step_id            number;
6694   l_main_per_eff_start_date           date;
6695   l_main_per_date_of_birth            date;
6696   l_start_date                        date;
6697   -- bug# 2315163
6698   l_is_emergency_contact              varchar2(50) default null;
6699   l_is_dpdnt_bnf                      varchar2(50) default null;
6700   l_proc   varchar2(72)  := g_package||'create_contact_tt';
6701 
6702 --
6703 BEGIN
6704   --
6705 hr_utility.set_location('Entering:'||l_proc, 5);
6706 
6707 -- Bug no:2263008 fix begins
6708 
6709 check_ni_unique(
6710   p_national_identifier => p_national_identifier
6711   ,p_business_group_id => p_business_group_id
6712   ,p_person_id => p_contact_person_id
6713   ,p_ni_duplicate_warn_or_err => p_ni_duplicate_warn_or_err);
6714 
6715 --Bug no:2263008 fix ends.
6716   --
6717 -- bug#  2146328
6718   IF p_primary_contact_flag = 'Y' then
6719 
6720        -- Check if there are already any contacts as primary added.
6721        --
6722       hr_utility.set_location('IF p_primary_contact_flag =Y :'||l_proc,10 );
6723       BEGIN
6724          select count(hats.transaction_step_id)
6725          into   l_primary_contact_added
6726          from   hr_api_transaction_steps hats,
6727                 hr_api_transaction_values hatv
6728          where  hats.item_type = p_item_type
6729          and    hats.item_key  = p_item_key
6730          and    hats.api_name  = 'HR_PROCESS_CONTACT_SS.PROCESS_CREATE_CONTACT_API'
6731          and    hats.transaction_step_id = hatv.transaction_step_id
6732          and    hatv.varchar2_value = 'Y'
6733          and    hatv.name = upper('p_primary_contact_flag');
6734 
6735         hr_utility.set_location(
6736            'HR_PROCESS_CONTACT_SS.create_contact_tt : Check if primary contact already added in previous step : '||l_primary_contact_added, 2146328);
6737 
6738       EXCEPTION
6739          WHEN others THEN
6740            null;
6741 
6742       END;
6743 
6744       IF l_primary_contact_added >0 then
6745 
6746          hr_utility.set_location('l_primary_contact_added >0:'||l_proc,15 );
6747          hr_utility.set_message(800, 'PER_289574_EMP_CON_PRIMARY');
6748          hr_utility.raise_error;
6749 
6750 
6751       END IF;
6752 
6753   END IF;   --p_primary_contact_flag = 'Y'
6754 
6755 --end bug#2146328
6756 
6757   SAVEPOINT create_contact_tt_start;
6758   --
6759   IF upper(p_action) = g_change
6760   THEN
6761      l_attribute_update_mode := g_attribute_update;
6762   ELSE
6763      IF upper(p_action) = g_correct
6764      THEN
6765         l_attribute_update_mode := g_attribute_correct;
6766      END IF;
6767   END IF;
6768   hr_utility.set_location('Setting l_attribute_update_mode ', 20);
6769   --
6770   hr_utility.set_location('Calling hr_contact_rel_api.create_contact', 25);
6771   --
6772   -- Call the actual API.
6773   --
6774   -- Check if the record has changed is not necessary as it's a create.
6775   --
6776   -- The validate_mode for calling the create_contact
6777   -- api should always be set to true.
6778   --
6779   IF p_validate = 1 OR p_validate IS NULL
6780   THEN
6781       l_validate_mode := false;
6782   ELSE
6783       l_validate_mode := true;
6784   END IF;
6785   --
6786   -- StartRegistration changes
6787   --
6788   l_person_id := p_person_id;
6789 
6790  /*
6791 --  bug # 2168275
6792    requirement : If relation_ship_start_date < (DOB of Employee) or (DOB of Contact), then
6793                  raise error message PER_50386_CON_SDT_LES_EMP_BDT.
6794 
6795     1. Get emplyee record start date
6796 
6797         if employee id is available, then
6798             get  Employee_DOB from per_people_f
6799         else
6800             get Employee_DOB from transaction_step
6801 
6802     1. if l_main_per_date_of_birth is not null and l_main_per_date_of_birth > p_date_start then
6803         raise error;
6804         set errormessage .....
6805     elsif p_date_of_birth is not null and p_date_of_birth > p_date_start then
6806         raise error;
6807         set errormessage .....
6808 
6809     2. Compare the DOBs with  p_date_start
6810         If  Employee_DOB > p_date_start then
6811             raise error.
6812         Else
6813             If  p_date_of_birth > p_date_start then
6814             raise error.
6815 
6816 --  end bug # 2168275
6817 
6818 --  bug # 2123868
6819    requirement : Contact record Start Date should be last of
6820                 A.  Earliest contact Relation ship start dates
6821                 B.  Employee Person reocrd Start date
6822 
6823     1. Get emplyee record start date
6824 
6825         If employee id is available, then
6826             get employee_effective_start_date from per_people_f
6827         Else
6828             get the employee_effective_start_date from trx
6829 
6830     2. Set p_date_start to last of
6831 
6832          begin
6833          if contact_person_id not null them
6834             get l_ear_con_Rel_start_date from per_contact_relationships
6835             set l_ear_con_Rel_start_date to  l_start_date
6836          else
6837             set relation_ship_start_date to  l_start_date
6838          exception
6839          end
6840 
6841          If employee_effective_start_date > l_start_date  then
6842             set l_start_date to employee_effective_start_date
6843 
6844 --  end bug # 2123868
6845 
6846 
6847 
6848   --bug # 2168275,2123868
6849   begin
6850 
6851     if l_person_id is not null then
6852         select  min(p.date_of_birth) , min(p.effective_start_date)
6853         into    l_main_per_date_of_birth , l_main_per_eff_start_date
6854         from    per_people_f p
6855         where   p.person_id = l_person_id;
6856     else
6857         begin
6858             select nvl(max(hats1.transaction_step_id),0)
6859             into   l_validate_g_per_step_id
6860             from   hr_api_transaction_steps hats1
6861             where  hats1.item_type = 'HRSSA'
6862             and    hats1.item_key  = p_item_key
6863             and    hats1.api_name  in( 'HR_PROCESS_PERSON_SS.PROCESS_API', 'BEN_PROCESS_COBRA_PERSON_SS.PROCESS_API');
6864 
6865             l_main_per_date_of_birth := hr_transaction_api.get_date_value
6866                                 (p_transaction_step_id => l_validate_g_per_step_id
6867                                 ,p_name => 'P_DATE_OF_BIRTH') ;
6868 
6869             l_main_per_eff_start_date := hr_transaction_api.get_date_value
6870                                 (p_transaction_step_id => l_validate_g_per_step_id
6871                                 ,p_name => 'P_EFFECTIVE_DATE');
6872 
6873         exception
6874             when others then
6875             null;
6876         end;
6877 
6878     end if; --l_person_id is/not null
6879 
6880     -- raise error if relationship start date is earlier tahn date of birth
6881 -- fix for bug # 2221040
6882     if  nvl(p_save_mode, 'NVL') <> 'SAVE_FOR_LATER'
6883       then
6884        if l_main_per_date_of_birth is not null and l_main_per_date_of_birth > p_date_start then
6885           hr_utility.set_message(800, 'PER_50386_CON_SDT_LES_EMP_BDT');
6886           hr_utility.raise_error;
6887        elsif p_date_of_birth is not null and p_date_of_birth > p_date_start then
6888           hr_utility.set_message(800, 'PER_50386_CON_SDT_LES_EMP_BDT');
6889           hr_utility.raise_error;
6890        end if;
6891     end if;
6892 */
6893 begin
6894 
6895 l_main_per_eff_start_date := p_date_start;
6896 
6897 validate_rel_start_date (
6898    p_person_id     => p_person_id
6899   ,p_item_key      => p_item_key
6900   ,p_save_mode     => p_save_mode
6901   ,p_date_start    => l_main_per_eff_start_date
6902   ,p_date_of_birth => p_date_of_birth);
6903 
6904     l_start_date :=  p_start_date ;
6905 
6906     if p_contact_person_id is not null then
6907 
6908         begin
6909            hr_utility.set_location('if p_contact_person_id is not null then'||l_proc,30 );
6910             select min(date_start)
6911             into   l_start_date
6912             from   per_contact_relationships
6913             where  contact_person_id = p_contact_person_id;
6914         exception
6915             when others then
6916             null;
6917         end;
6918    /* bug #2224609
6919     else
6920         l_start_date := p_date_start;
6921    */
6922     end if;
6923 
6924     if l_main_per_eff_start_date > l_start_date  then
6925         l_start_date := l_main_per_eff_start_date;
6926     end if;
6927 
6928   end;
6929   -- end bug # 2168275,2123868
6930   --
6931   if (l_person_id is null or l_person_id = -1) and
6932      nvl(p_save_mode, 'NVL') <> 'SAVE_FOR_LATER'
6933   then
6934      hr_utility.set_location('l_person_id is null or l_person_id = -1 and not SFL'||l_proc,35 );
6935      --
6936      -- Either create a dummy person or temp solution use the p_login_person_id
6937      --
6938      -- l_person_id := p_login_person_id; This is for testing only.
6939       hr_employee_api.create_employee
6940       (p_validate                      => false  --in     boolean  default false
6941       --,p_hire_date                     => nvl(p_start_date,trunc(sysdate))
6942       ,p_hire_date                     => nvl(l_start_date,trunc(sysdate))
6943       ,p_business_group_id             => p_business_group_id
6944       ,p_last_name                     => 'XXX_MR_REGI'
6945       ,p_sex                           => 'M'
6946       ,p_employee_number               => l_reg_employee_number         --   in out varchar2
6947       ,p_person_id                     => l_person_id                   --   out number
6948       ,p_assignment_id                 => l_reg_assignment_id           --   out number
6949       ,p_per_object_version_number     => l_reg_per_ovn                 --   out number
6950       ,p_asg_object_version_number     => l_reg_asg_ovn                 --   out number
6951       ,p_per_effective_start_date      => l_reg_per_effective_start_date --   out date
6952       ,p_per_effective_end_date        => l_reg_per_effective_end_date   --   out date
6953       ,p_full_name                     => l_reg_full_name                --   out varchar2
6954       ,p_per_comment_id                => l_reg_per_comment_id           --   out number
6955       ,p_assignment_sequence           => l_reg_assignment_sequence      --   out number
6956       ,p_assignment_number             => l_reg_assignment_number        --   out varchar2
6957       ,p_name_combination_warning      => l_reg_name_combination_warning --   out boolean
6958       ,p_assign_payroll_warning        => l_reg_assign_payroll_warning   --   out boolean
6959       ,p_orig_hire_warning             => l_reg_orig_hire_warning        --  out boolean
6960       );
6961      --
6962   end if;
6963   --
6964   -- EndRegistration
6965   --
6966   l_start_life_reason_id  := p_start_life_reason_id;
6967   if  p_start_life_reason_id <=0 then
6968       l_start_life_reason_id  := null;
6969   end if;
6970 
6971   l_end_life_reason_id      := p_end_life_reason_id;
6972   if p_end_life_reason_id   <= 0 then
6973      l_end_life_reason_id      := null;
6974   end if;
6975 
6976   l_contact_relationship_id := p_contact_relationship_id;
6977   if p_contact_relationship_id  <= 0 then
6978      l_contact_relationship_id   := null;
6979   end if;
6980 
6981   l_sequence_number  := p_sequence_number;
6982   if p_sequence_number  <= 0 then
6983      l_sequence_number  := null;
6984   end if;
6985 
6986   l_person_type_id :=  p_person_type_id ;
6987   if (p_person_type_id <= 0 OR p_person_type_id is null) then
6988      l_person_type_id :=  hr_person_type_usage_info.get_default_person_type_id
6989                  (p_business_group_id,
6990               'OTHER');
6991   end if;
6992   --
6993   -- set the validation to false as the person_id is necessary for
6994   -- update_person api.
6995   --
6996   if  nvl(p_save_mode, 'NVL') <> 'SAVE_FOR_LATER'
6997   then
6998        hr_utility.set_location('p_save_mode not SFL'||l_proc,40 );
6999 
7000    --
7001  -- Bug 3152505 : calling call_contact_api
7002  --   hr_contact_rel_api.create_contact(
7003     call_contact_api(
7004     p_validate                 		=>  false -- l_validate_mode
7005    ,p_start_date               		=>  l_start_date --p_start_date
7006    ,p_business_group_id        		=>  p_business_group_id
7007    ,p_person_id                		=>  l_person_id
7008    ,p_contact_person_id        		=>  p_contact_person_id
7009    ,p_contact_type             		=>  p_contact_type
7010    ,p_ctr_comments             		=>  p_ctr_comments
7011    ,p_primary_contact_flag     		=>  p_primary_contact_flag
7012    ,p_date_start               		=>  p_date_start
7013    ,p_start_life_reason_id     		=>  l_start_life_reason_id
7014    ,p_date_end                 		=>  p_date_end
7015    ,p_end_life_reason_id       		=>  l_end_life_reason_id
7016    ,p_rltd_per_rsds_w_dsgntr_flag     	=>  p_rltd_per_rsds_w_dsgntr_flag
7017    ,p_personal_flag                   	=>  p_personal_flag
7018    ,p_sequence_number                 	=>  l_sequence_number
7019    ,p_cont_attribute_category     	=>  p_cont_attribute_category
7020    ,p_cont_attribute1                 	=>  p_cont_attribute1
7021    ,p_cont_attribute2                 	=>  p_cont_attribute2
7022    ,p_cont_attribute3                 	=>  p_cont_attribute3
7023    ,p_cont_attribute4                 	=>  p_cont_attribute4
7024    ,p_cont_attribute5     		=>  p_cont_attribute5
7025    ,p_cont_attribute6     		=>  p_cont_attribute6
7026    ,p_cont_attribute7     		=>  p_cont_attribute7
7027    ,p_cont_attribute8     		=>  p_cont_attribute8
7028    ,p_cont_attribute9     		=>  p_cont_attribute9
7029    ,p_cont_attribute10     		=>  p_cont_attribute10
7030    ,p_cont_attribute11     		=>  p_cont_attribute11
7031    ,p_cont_attribute12     		=>  p_cont_attribute12
7032    ,p_cont_attribute13     		=>  p_cont_attribute13
7033    ,p_cont_attribute14     		=>  p_cont_attribute14
7034    ,p_cont_attribute15     		=>  p_cont_attribute15
7035    ,p_cont_attribute16     		=>  p_cont_attribute16
7036    ,p_cont_attribute17     		=>  p_cont_attribute17
7037    ,p_cont_attribute18     		=>  p_cont_attribute18
7038    ,p_cont_attribute19     		=>  p_cont_attribute19
7039    ,p_cont_attribute20    		=>  p_cont_attribute20
7040    ,p_third_party_pay_flag     		=>  p_third_party_pay_flag
7041    ,p_bondholder_flag     		=>  p_bondholder_flag
7042    ,p_dependent_flag     		=>  p_dependent_flag
7043    ,p_beneficiary_flag     		=>  p_beneficiary_flag
7044    ,p_last_name     			=>  p_last_name
7045    ,p_sex     				=>  p_sex
7046    ,p_person_type_id     		=>  l_person_type_id
7047    ,p_per_comments     			=>  p_per_comments
7048    ,p_date_of_birth     		=>  p_date_of_birth
7049    ,p_email_address     		=>  p_email_address
7050    ,p_first_name     			=>  p_first_name
7051    ,p_known_as     			=>  p_known_as
7052    ,p_marital_status     		=>  p_marital_status
7053    ,p_middle_names     			=>  p_middle_names
7054    ,p_nationality     			=>  p_nationality
7055    ,p_national_identifier     		=>  p_national_identifier
7056    ,p_previous_last_name     		=>  p_previous_last_name
7057    ,p_registered_disabled_flag     	=>  p_registered_disabled_flag
7058    ,p_title     			=>  p_title
7059    ,p_work_telephone     		=>  p_work_telephone
7060    ,p_attribute_category     		=>  p_attribute_category
7061    ,p_attribute1     			=>  p_attribute1
7062    ,p_attribute2     			=>  p_attribute2
7063    ,p_attribute3     			=>  p_attribute3
7064    ,p_attribute4     			=>  p_attribute4
7065    ,p_attribute5     			=>  p_attribute5
7066    ,p_attribute6     			=>  p_attribute6
7067    ,p_attribute7     			=>  p_attribute7
7068    ,p_attribute8     			=>  p_attribute8
7069    ,p_attribute9     			=>  p_attribute9
7070    ,p_attribute10     			=>  p_attribute10
7071    ,p_attribute11     			=>  p_attribute11
7072    ,p_attribute12     			=>  p_attribute12
7073    ,p_attribute13     			=>  p_attribute13
7074    ,p_attribute14     			=>  p_attribute14
7075    ,p_attribute15     			=>  p_attribute15
7076    ,p_attribute16     			=>  p_attribute16
7077    ,p_attribute17     			=>  p_attribute17
7078    ,p_attribute18     			=>  p_attribute18
7079    ,p_attribute19     			=>  p_attribute19
7080    ,p_attribute20     			=>  p_attribute20
7081    ,p_attribute21     			=>  p_attribute21
7082    ,p_attribute22     			=>  p_attribute22
7083    ,p_attribute23     			=>  p_attribute23
7084    ,p_attribute24     			=>  p_attribute24
7085    ,p_attribute25     			=>  p_attribute25
7086    ,p_attribute26     			=>  p_attribute26
7087    ,p_attribute27     			=>  p_attribute27
7088    ,p_attribute28     			=>  p_attribute28
7089    ,p_attribute29     			=>  p_attribute29
7090    ,p_attribute30     			=>  p_attribute30
7091    ,p_per_information_category     	=>  p_per_information_category
7092    ,p_per_information1      =>  p_per_information1
7093    ,p_per_information2      =>  p_per_information2
7094    ,p_per_information3      =>  p_per_information3
7095    ,p_per_information4      =>  p_per_information4
7096    ,p_per_information5      =>  p_per_information5
7097    ,p_per_information6      =>  p_per_information6
7098    ,p_per_information7      =>  p_per_information7
7099    ,p_per_information8      =>  p_per_information8
7100    ,p_per_information9      =>  p_per_information9
7101    ,p_per_information10     =>  p_per_information10
7102    ,p_per_information11     =>  p_per_information11
7103    ,p_per_information12     =>  p_per_information12
7104    ,p_per_information13     =>  p_per_information13
7105    ,p_per_information14     =>  p_per_information14
7106    ,p_per_information15     =>  p_per_information15
7107    ,p_per_information16     =>  p_per_information16
7108    ,p_per_information17     =>  p_per_information17
7109    ,p_per_information18     =>  p_per_information18
7110    ,p_per_information19     =>  p_per_information19
7111    ,p_per_information20     =>  p_per_information20
7112    ,p_per_information21     =>  p_per_information21
7113    ,p_per_information22     =>  p_per_information22
7114    ,p_per_information23     =>  p_per_information23
7115    ,p_per_information24     =>  p_per_information24
7116    ,p_per_information25     =>  p_per_information25
7117    ,p_per_information26     =>  p_per_information26
7118    ,p_per_information27     =>  p_per_information27
7119    ,p_per_information28     =>  p_per_information28
7120    ,p_per_information29     =>  p_per_information29
7121    ,p_per_information30     =>  p_per_information30
7122    ,p_correspondence_language   =>  p_correspondence_language
7123    ,p_honors     		=>  p_honors
7124    ,p_pre_name_adjunct     	=>  p_pre_name_adjunct
7125    ,p_suffix     		=>  p_suffix
7126    ,p_create_mirror_flag     	=>  p_create_mirror_flag
7127    ,p_mirror_type     		=>  p_mirror_type
7128    ,p_mirror_cont_attribute_cat   =>  p_mirror_cont_attribute_cat
7129    ,p_mirror_cont_attribute1      =>  p_mirror_cont_attribute1
7130    ,p_mirror_cont_attribute2      =>  p_mirror_cont_attribute2
7131    ,p_mirror_cont_attribute3      =>  p_mirror_cont_attribute3
7132    ,p_mirror_cont_attribute4      =>  p_mirror_cont_attribute4
7133    ,p_mirror_cont_attribute5      =>  p_mirror_cont_attribute5
7134    ,p_mirror_cont_attribute6      =>  p_mirror_cont_attribute6
7135    ,p_mirror_cont_attribute7      =>  p_mirror_cont_attribute7
7136    ,p_mirror_cont_attribute8      =>  p_mirror_cont_attribute8
7137    ,p_mirror_cont_attribute9      =>  p_mirror_cont_attribute9
7138    ,p_mirror_cont_attribute10     =>  p_mirror_cont_attribute10
7139    ,p_mirror_cont_attribute11     =>  p_mirror_cont_attribute11
7140    ,p_mirror_cont_attribute12     =>  p_mirror_cont_attribute12
7141    ,p_mirror_cont_attribute13     =>  p_mirror_cont_attribute13
7142    ,p_mirror_cont_attribute14     =>  p_mirror_cont_attribute14
7143    ,p_mirror_cont_attribute15     =>  p_mirror_cont_attribute15
7144    ,p_mirror_cont_attribute16     =>  p_mirror_cont_attribute16
7145    ,p_mirror_cont_attribute17     =>  p_mirror_cont_attribute17
7146    ,p_mirror_cont_attribute18     =>  p_mirror_cont_attribute18
7147    ,p_mirror_cont_attribute19     =>  p_mirror_cont_attribute19
7148    ,p_mirror_cont_attribute20     =>  p_mirror_cont_attribute20
7149    ,P_CONT_INFORMATION_CATEGORY   => P_CONT_INFORMATION_CATEGORY
7150    ,P_CONT_INFORMATION1           => P_CONT_INFORMATION1
7151    ,P_CONT_INFORMATION2           => P_CONT_INFORMATION2
7152    ,P_CONT_INFORMATION3           => P_CONT_INFORMATION3
7153    ,P_CONT_INFORMATION4           => P_CONT_INFORMATION4
7154    ,P_CONT_INFORMATION5           => P_CONT_INFORMATION5
7155    ,P_CONT_INFORMATION6           => P_CONT_INFORMATION6
7156    ,P_CONT_INFORMATION7           => P_CONT_INFORMATION7
7157    ,P_CONT_INFORMATION8           => P_CONT_INFORMATION8
7158    ,P_CONT_INFORMATION9           => P_CONT_INFORMATION9
7159    ,P_CONT_INFORMATION10          => P_CONT_INFORMATION10
7160    ,P_CONT_INFORMATION11          => P_CONT_INFORMATION11
7161    ,P_CONT_INFORMATION12          => P_CONT_INFORMATION12
7162    ,P_CONT_INFORMATION13          => P_CONT_INFORMATION13
7163    ,P_CONT_INFORMATION14          => P_CONT_INFORMATION14
7164    ,P_CONT_INFORMATION15          => P_CONT_INFORMATION15
7165    ,P_CONT_INFORMATION16          => P_CONT_INFORMATION16
7166    ,P_CONT_INFORMATION17          => P_CONT_INFORMATION17
7167    ,P_CONT_INFORMATION18          => P_CONT_INFORMATION18
7168    ,P_CONT_INFORMATION19          => P_CONT_INFORMATION19
7169    ,P_CONT_INFORMATION20          => P_CONT_INFORMATION20
7170    ,P_MIRROR_CONT_INFORMATION_CAT => P_MIRROR_CONT_INFORMATION_CAT
7171    ,P_MIRROR_CONT_INFORMATION1    => P_MIRROR_CONT_INFORMATION1
7172    ,P_MIRROR_CONT_INFORMATION2    => P_MIRROR_CONT_INFORMATION2
7173    ,P_MIRROR_CONT_INFORMATION3    => P_MIRROR_CONT_INFORMATION3
7174    ,P_MIRROR_CONT_INFORMATION4    => P_MIRROR_CONT_INFORMATION4
7175    ,P_MIRROR_CONT_INFORMATION5    => P_MIRROR_CONT_INFORMATION5
7176    ,P_MIRROR_CONT_INFORMATION6    => P_MIRROR_CONT_INFORMATION6
7177    ,P_MIRROR_CONT_INFORMATION7    => P_MIRROR_CONT_INFORMATION7
7178    ,P_MIRROR_CONT_INFORMATION8    => P_MIRROR_CONT_INFORMATION8
7179    ,P_MIRROR_CONT_INFORMATION9    => P_MIRROR_CONT_INFORMATION9
7180    ,P_MIRROR_CONT_INFORMATION10    => P_MIRROR_CONT_INFORMATION10
7181    ,P_MIRROR_CONT_INFORMATION11    => P_MIRROR_CONT_INFORMATION11
7182    ,P_MIRROR_CONT_INFORMATION12    => P_MIRROR_CONT_INFORMATION12
7183    ,P_MIRROR_CONT_INFORMATION13    => P_MIRROR_CONT_INFORMATION13
7184    ,P_MIRROR_CONT_INFORMATION14    => P_MIRROR_CONT_INFORMATION14
7185    ,P_MIRROR_CONT_INFORMATION15    => P_MIRROR_CONT_INFORMATION15
7186    ,P_MIRROR_CONT_INFORMATION16    => P_MIRROR_CONT_INFORMATION16
7187    ,P_MIRROR_CONT_INFORMATION17    => P_MIRROR_CONT_INFORMATION17
7188    ,P_MIRROR_CONT_INFORMATION18    => P_MIRROR_CONT_INFORMATION18
7189    ,P_MIRROR_CONT_INFORMATION19    => P_MIRROR_CONT_INFORMATION19
7190    ,P_MIRROR_CONT_INFORMATION20    => P_MIRROR_CONT_INFORMATION20
7191    ,p_contact_relationship_id     => l_contact_relationship_id
7192    ,p_ctr_object_version_number   => p_ctr_object_version_number
7193    ,p_per_person_id               => p_per_person_id
7194    ,p_per_object_version_number   => p_per_object_version_number
7195    ,p_per_effective_start_date    => p_per_effective_start_date
7196    ,p_per_effective_end_date      => p_per_effective_end_date
7197    ,p_full_name                   => p_full_name
7198    ,p_per_comment_id              => p_per_comment_id
7199    ,p_name_combination_warning    => l_con_name_combination_warning
7200    ,p_orig_hire_warning           => l_con_orig_hire_warning
7201    ,p_contact_operation           => p_contact_operation
7202    ,p_emrg_cont_flag              => p_emrg_cont_flag
7203    );
7204    --
7205   end if;
7206   --
7207   -- Validating the update_person
7208   --
7209 
7210   hr_utility.set_location('After calling validate proceses ', 45);
7211   --
7212   IF hr_errors_api.errorExists
7213   THEN
7214      hr_utility.set_location('api error exists hr_contact_rel_api.create_contact', 50);
7215      rollback to create_contact_tt_start  ;
7216      raise g_data_error;
7217   END IF;
7218 
7219    l_con_rec_changed := is_con_rec_changed(
7220     p_adjusted_svc_date     	=>  p_adjusted_svc_date
7221    ,p_applicant_number     	=>  p_applicant_number
7222    ,p_background_check_status   =>  p_background_check_status
7223    ,p_background_date_check     =>  p_background_date_check
7224    ,p_benefit_group_id     	=>  p_benefit_group_id
7225    ,p_blood_type     		=>  p_blood_type
7226    ,p_coord_ben_med_pln_no     	=>  p_coord_ben_med_pln_no
7227    ,p_coord_ben_no_cvg_flag     =>  p_coord_ben_no_cvg_flag
7228    ,p_country_of_birth     	=>  p_country_of_birth
7229    ,p_date_employee_data_verified  =>  p_date_employee_data_verified
7230    ,p_date_of_death     	=>  p_date_of_death
7231    ,p_dpdnt_adoption_date     	=>  p_dpdnt_adoption_date
7232    ,p_dpdnt_vlntry_svce_flag    =>  p_dpdnt_vlntry_svce_flag
7233    ,p_expense_check_send_to_addres     =>  p_expense_check_send_to_addres
7234    ,p_fast_path_employee     	=>  p_fast_path_employee
7235    ,p_fte_capacity     		=>  p_fte_capacity
7236    ,p_global_person_id     	=>  p_global_person_id
7237    ,p_hold_applicant_date_until     =>  p_hold_applicant_date_until
7238    ,p_internal_location     	=>  p_internal_location
7239    ,p_last_medical_test_by      =>  p_last_medical_test_by
7240    ,p_last_medical_test_date    =>  p_last_medical_test_date
7241    ,p_mailstop     		=>  p_mailstop
7242    ,p_office_number     	=>  p_office_number
7243    ,p_on_military_service     	=>  p_on_military_service
7244    ,p_original_date_of_hire     =>  p_original_date_of_hire
7245    ,p_projected_start_date      =>  p_projected_start_date
7246    ,p_receipt_of_death_cert_date     =>  p_receipt_of_death_cert_date
7247    ,p_region_of_birth     	=>  p_region_of_birth
7248    ,p_rehire_authorizor     	=>  p_rehire_authorizor
7249    ,p_rehire_recommendation     =>  p_rehire_recommendation
7250    ,p_rehire_reason     	=>  p_rehire_reason
7251    ,p_resume_exists     	=>  p_resume_exists
7252    ,p_resume_last_updated     	=>  p_resume_last_updated
7253    ,p_second_passport_exists    =>  p_second_passport_exists
7254    ,p_student_status     	=>  p_student_status
7255    ,p_town_of_birth     	=>  p_town_of_birth
7256    ,p_uses_tobacco_flag     	=>  p_uses_tobacco_flag
7257    ,p_vendor_id     		=>  p_vendor_id
7258    ,p_work_schedule     	=>  p_work_schedule ) ;
7259 
7260  IF l_con_rec_changed and
7261     nvl(p_save_mode, 'NVL') <> 'SAVE_FOR_LATER'
7262  THEN
7263     --
7264     -- Get the Employee number from the Database;
7265     --
7266     hr_utility.set_location('Declaring the Cursor c_pap'||l_proc,50);
7267     DECLARE
7268                CURSOR c_pap IS SELECT employee_number FROM per_all_people_f
7269                             WHERE person_id = p_per_person_id
7270                             AND  p_start_date BETWEEN
7271                                  effective_start_date AND effective_end_date ;
7272                l_pap    c_pap%ROWTYPE;
7273 
7274     BEGIN
7275                --
7276                OPEN c_pap ;
7277                FETCH c_pap INTO l_pap ;
7278                CLOSE c_pap ;
7279                --
7280                p_employee_number := l_pap.employee_number ;
7281                --
7282     EXCEPTION WHEN OTHERS THEN
7283     hr_utility.set_location('Exception in c_pap Cursor:'||l_proc,555);
7284              raise ;
7285     END;
7286     --
7287     hr_utility.set_location('Calling hr_person_api.update_person '||l_proc,55);
7288     hr_person_api.update_person (
7289       p_validate      			=>  l_validate_mode
7290      ,p_effective_date      		=>  l_start_date
7291                                            --p_start_date  --9999p_effective_date
7292      ,p_datetrack_update_mode      	=>  hr_api.g_correction
7293                                             -- 9999 p_datetrack_update_mode
7294      ,p_person_id      			=>  p_per_person_id
7295      ,p_object_version_number      	=>  p_per_object_version_number
7296      --  ,p_person_type_id       	=>  p_person_type_id
7297      -- ,p_last_name       		=>  p_last_name
7298      ,p_applicant_number       	        =>  p_applicant_number
7299      --,p_comments       		=>  p_ctr_comments
7300      ,p_date_employee_data_verified     =>  p_date_employee_data_verified
7301      --  ,p_date_of_birth       	=>  p_date_of_birth
7302      --  ,p_email_address       	=>  p_email_address
7303      ,p_employee_number       	        =>  p_employee_number    --in out nocopy Param
7304      ,p_expense_check_send_to_addres    =>  p_expense_check_send_to_addres
7305      --  ,p_first_name        	        =>  p_first_name
7306      --  ,p_known_as        	        =>  p_known_as
7307      --  ,p_marital_status              =>  p_marital_status
7308      --  ,p_middle_names                =>  p_middle_names
7309      --  ,p_nationality       		=>  p_nationality
7310      --  ,p_national_identifier       	=>  p_national_identifier
7311      --  ,p_previous_last_name       	=>  p_previous_last_name
7312      --  ,p_registered_disabled_flag    =>  p_registered_disabled_flag
7313      --  ,p_sex       			=>  p_sex
7314      --  ,p_title       		=>  p_title
7315      ,p_vendor_id       		=>  p_vendor_id
7316      --  ,p_work_telephone       	=>  p_work_telephone
7317      ,p_date_of_death       	        =>  p_date_of_death
7318      ,p_background_check_status         =>  p_background_check_status
7319      ,p_background_date_check           =>  p_background_date_check
7320      ,p_blood_type       		=>  p_blood_type
7321      --   ,p_correspondence_language    =>  p_correspondence_language
7322      ,p_fast_path_employee       	=>  p_fast_path_employee
7323      ,p_fte_capacity       	        =>  p_fte_capacity
7324      ,p_hold_applicant_date_until       =>  p_hold_applicant_date_until
7325      --   ,p_honors       		=>  p_honors
7326      ,p_internal_location       	=>  p_internal_location
7327      ,p_last_medical_test_by            =>  p_last_medical_test_by
7328      ,p_last_medical_test_date          =>  p_last_medical_test_date
7329      ,p_mailstop       		        =>  p_mailstop
7330      ,p_office_number       	        =>  p_office_number
7331      ,p_on_military_service       	=>  p_on_military_service
7332      --   ,p_pre_name_adjunct       	=>  p_pre_name_adjunct
7333      ,p_projected_start_date            =>  p_projected_start_date
7334      ,p_rehire_authorizor       	=>  p_rehire_authorizor
7335      ,p_rehire_recommendation           =>  p_rehire_recommendation
7336      ,p_resume_exists            	=>  p_resume_exists
7337      ,p_resume_last_updated             =>  p_resume_last_updated
7338      ,p_second_passport_exists          =>  p_second_passport_exists
7339      ,p_student_status       	        =>  p_student_status
7340      ,p_work_schedule       	        =>  p_work_schedule
7341      ,p_rehire_reason       	        =>  p_rehire_reason
7342      --   ,p_suffix       		=>  p_suffix
7343      ,p_benefit_group_id       	        =>  p_benefit_group_id
7344      ,p_receipt_of_death_cert_date      =>  p_receipt_of_death_cert_date
7345      ,p_coord_ben_med_pln_no            =>  p_coord_ben_med_pln_no
7346      ,p_coord_ben_no_cvg_flag           =>  p_coord_ben_no_cvg_flag
7347      ,p_uses_tobacco_flag       	=>  p_uses_tobacco_flag
7348      ,p_dpdnt_adoption_date       	=>  p_dpdnt_adoption_date
7349      ,p_dpdnt_vlntry_svce_flag          =>  p_dpdnt_vlntry_svce_flag
7350      ,p_original_date_of_hire           =>  p_original_date_of_hire
7351      ,p_adjusted_svc_date       	=>  p_adjusted_svc_date
7352      ,p_town_of_birth       	        =>  p_town_of_birth
7353      ,p_region_of_birth       	        =>  p_region_of_birth
7354      ,p_country_of_birth       	        =>  p_country_of_birth
7355      ,p_global_person_id       	        =>  p_global_person_id
7356      -- Out Parameters
7357      ,p_effective_start_date            =>  p_per_effective_start_date
7358      ,p_effective_end_date       	=>  p_per_effective_end_date
7359      ,p_full_name       		=>  p_full_name
7360      ,p_comment_id       		=>  p_per_comment_id
7361      ,p_name_combination_warning        =>  l_per_name_combination_warning
7362      ,p_assign_payroll_warning          =>  l_per_assign_payroll_warning
7363      ,p_orig_hire_warning       	=>  l_per_orig_hire_warning
7364     );
7365     --
7366     hr_utility.set_location('After calling validate proceses ', 65);
7367     --
7368     IF hr_errors_api.errorExists
7369     THEN
7370       hr_utility.set_location('api error exists  hr_person_api.update_person ', 67);
7371       rollback to create_contact_tt_start  ;
7372       raise g_data_error;
7373     END IF;
7374 
7375   END IF; -- End if for is_con_rec_changed
7376 
7377   rollback to create_contact_tt_start  ;
7378 
7379   if l_per_assign_payroll_warning then
7380      p_per_assign_payroll_warning := 'Y';
7381   else
7382      p_per_assign_payroll_warning := 'N';
7383   end if;
7384   --
7385   if l_con_name_combination_warning then
7386      p_con_name_combination_warning := 'Y';
7387   else
7388      p_con_name_combination_warning := 'N';
7389   end if;
7390   --
7391   if l_per_name_combination_warning then
7392      p_per_name_combination_warning := 'Y';
7393   else
7394      p_per_name_combination_warning := 'N';
7395   end if;
7396   --
7397   if l_con_orig_hire_warning then
7398      p_con_orig_hire_warning := 'Y';
7399   else
7400      p_con_orig_hire_warning := 'N';
7401   end if;
7402   --
7403   if l_per_orig_hire_warning then
7404      p_per_orig_hire_warning := 'Y';
7405   else
7406      p_per_orig_hire_warning := 'N';
7407   end if;
7408   --
7409   -- --------------------------------------------------------------------------
7410   -- We will write the data to transaction tables.
7411   -- Determine if a transaction step exists for this activity
7412   -- if a transaction step does exist then the transaction_step_id and
7413   -- object_version_number are set (i.e. not null).
7414   -- --------------------------------------------------------------------------
7415   --
7416   /* StartRegistration : Begin code addition */
7417   --
7418   -- First, check if transaction id exists or not
7419   l_transaction_id := hr_transaction_ss.get_transaction_id
7420                      (p_item_type   => p_item_type
7421                      ,p_item_key    => p_item_key);
7422   --
7423   IF l_transaction_id is null THEN
7424      -- Start a Transaction
7425         hr_transaction_ss.start_transaction
7426            (itemtype   => p_item_type
7427            ,itemkey    => p_item_key
7428            ,actid      => p_activity_id
7429            ,funmode    => 'RUN'
7430            ,p_api_addtnl_info => p_contact_operation  --TEST
7431            ,p_login_person_id => nvl(p_login_person_id, p_person_id)
7432            ,result     => l_result);
7433 
7434         l_transaction_id := hr_transaction_ss.get_transaction_id
7435                         (p_item_type   => p_item_type
7436                         ,p_item_key    => p_item_key);
7437   END IF;
7438   --
7439   -- Create a transaction step
7440   --
7441   hr_transaction_api.create_transaction_step
7442      (p_validate              => false
7443      ,p_creator_person_id     => nvl(p_login_person_id, p_person_id)
7444      ,p_transaction_id        => l_transaction_id
7445      ,p_api_name              => g_package || '.PROCESS_CREATE_CONTACT_API'
7446      ,p_item_type             => p_item_type
7447      ,p_item_key              => p_item_key
7448      ,p_activity_id           => p_activity_id
7449      ,p_transaction_step_id   => l_transaction_step_id
7450      ,p_object_version_number => l_trans_obj_vers_num);
7451 
7452   /* EndRegistration : code addition */
7453 
7454   SAVEPOINT create_contact_tt;
7455 
7456   --
7457   -- This parameter will be used in the process_api for calling update_person
7458   l_count := l_count + 1;
7459   l_transaction_table(l_count).param_name := 'P_CONT_REC_CHANGED';
7460   l_transaction_table(l_count).param_value := 'CHANGED';
7461   l_transaction_table(l_count).param_data_type := 'VARCHAR2';
7462   --
7463   --
7464   l_count := l_count + 1;
7465   l_transaction_table(l_count).param_name :=upper('p_contact_operation');
7466   l_transaction_table(l_count).param_value := p_contact_operation;
7467   l_transaction_table(l_count).param_data_type := upper('varchar2');
7468   --
7469   --
7470   l_count := l_count + 1;
7471   l_transaction_table(l_count).param_name :=upper('p_emrg_cont_flag');
7472   l_transaction_table(l_count).param_value := p_emrg_cont_flag;
7473   l_transaction_table(l_count).param_data_type := upper('varchar2');
7474   --
7475   --
7476   l_count := l_count + 1;
7477   l_transaction_table(l_count).param_name :=upper('p_dpdnt_bnf_flag');
7478   l_transaction_table(l_count).param_value := p_dpdnt_bnf_flag;
7479   l_transaction_table(l_count).param_data_type := upper('varchar2');
7480   --
7481   -- bug# 2315163
7482   --
7483   if p_contact_operation    in( 'EMER_CR_NEW_CONT','EMER_CR_NEW_REL', 'EMRG_OVRW_UPD')
7484      or p_emrg_cont_flag    =   'Y' then
7485 
7486       l_is_emergency_contact := 'Yes';
7487   else
7488       l_is_emergency_contact := 'No';
7489   end if;
7490 
7491   l_count := l_count + 1;
7492   l_transaction_table(l_count).param_name :=upper('p_is_emergency_contact');
7493   l_transaction_table(l_count).param_value := l_is_emergency_contact;
7494   l_transaction_table(l_count).param_data_type := upper('varchar2');
7495 
7496   if p_contact_operation  in ( 'DPDNT_CR_NEW_CONT', 'DPDNT_CR_NEW_REL',  'DPDNT_OVRW_UPD')
7497      or p_dpdnt_bnf_flag    =   'Y' then
7498 
7499       l_is_dpdnt_bnf := 'Yes';
7500   else
7501       l_is_dpdnt_bnf := 'No';
7502   end if;
7503 
7504   l_count := l_count + 1;
7505   l_transaction_table(l_count).param_name := upper('p_is_dpdnt_bnf');
7506   l_transaction_table(l_count).param_value := l_is_dpdnt_bnf;
7507   l_transaction_table(l_count).param_data_type := upper('varchar2');
7508   --
7509   --
7510   l_count:=l_count+1;
7511   l_transaction_table(l_count).param_name      := 'P_SAVE_MODE';
7512   l_transaction_table(l_count).param_value     :=  p_save_mode;
7513   l_transaction_table(l_count).param_data_type := 'VARCHAR2';
7514   --
7515   l_count := l_count + 1;
7516   l_transaction_table(l_count).param_name :=upper('p_contact_relationship_id');
7517   l_transaction_table(l_count).param_value := null ;
7518   l_transaction_table(l_count).param_data_type := upper('number');
7519   --
7520   l_count := l_count + 1;
7521   l_transaction_table(l_count).param_name :=upper('p_cont_object_version_number');
7522   l_transaction_table(l_count).param_value := null ;
7523   l_transaction_table(l_count).param_data_type := upper('number');
7524 
7525   --
7526   l_count := l_count + 1;
7527   l_transaction_table(l_count).param_name :=upper('p_start_date');
7528   --  l_transaction_table(l_count).param_value := to_char(p_start_date
7529   l_transaction_table(l_count).param_value := to_char(l_start_date
7530                       , hr_transaction_ss.g_date_format);
7531   l_transaction_table(l_count).param_data_type := upper('date');
7532   --
7533   --
7534   l_count := l_count + 1;
7535   l_transaction_table(l_count).param_name :=upper('p_business_group_id');
7536   l_transaction_table(l_count).param_value := p_business_group_id;
7537   l_transaction_table(l_count).param_data_type := upper('number');
7538   --
7539   --
7540   l_count := l_count + 1;
7541   l_transaction_table(l_count).param_name :=upper('p_person_id');
7542   l_transaction_table(l_count).param_value := p_person_id;
7543   l_transaction_table(l_count).param_data_type := upper('number');
7544   --
7545   --
7546   l_count := l_count + 1;
7547   l_transaction_table(l_count).param_name :=upper('p_contact_person_id');
7548   l_transaction_table(l_count).param_value := p_contact_person_id;
7549   l_transaction_table(l_count).param_data_type := upper('number');
7550   --
7551   --
7552   l_count := l_count + 1;
7553   l_transaction_table(l_count).param_name :=upper('p_contact_type');
7554   l_transaction_table(l_count).param_value := p_contact_type;
7555   l_transaction_table(l_count).param_data_type := upper('varchar2');
7556   --
7557   --
7558   l_count := l_count + 1;
7559   l_transaction_table(l_count).param_name :=upper('p_ctr_comments');
7560   l_transaction_table(l_count).param_value := p_ctr_comments;
7561   l_transaction_table(l_count).param_data_type := upper('varchar2');
7562   --
7563   --
7564   l_count := l_count + 1;
7565   l_transaction_table(l_count).param_name :=upper('p_primary_contact_flag');
7566   l_transaction_table(l_count).param_value := p_primary_contact_flag;
7567   l_transaction_table(l_count).param_data_type := upper('varchar2');
7568   --
7569   --
7570   l_count := l_count + 1;
7571   l_transaction_table(l_count).param_name :=upper('p_date_start');
7572   l_transaction_table(l_count).param_value := to_char(p_date_start
7573                                           , hr_transaction_ss.g_date_format);
7574   l_transaction_table(l_count).param_data_type := upper('date');
7575   --
7576   -- StartRegistration
7577   --
7578   l_count := l_count + 1;
7579   l_transaction_table(l_count).param_name :=upper('p_start_life_reason_id');
7580   l_transaction_table(l_count).param_value := l_start_life_reason_id;
7581   l_transaction_table(l_count).param_data_type := upper('number');
7582   --
7583   --
7584   l_count := l_count + 1;
7585   l_transaction_table(l_count).param_name :=upper('p_date_end');
7586   l_transaction_table(l_count).param_value := to_char(p_date_end
7587                                           , hr_transaction_ss.g_date_format);
7588   l_transaction_table(l_count).param_data_type := upper('date');
7589   --
7590   -- StartRegistration
7591   --
7592   l_count := l_count + 1;
7593   l_transaction_table(l_count).param_name :=upper('p_end_life_reason_id');
7594   l_transaction_table(l_count).param_value := l_end_life_reason_id;
7595   l_transaction_table(l_count).param_data_type := upper('number');
7596   --
7597   --
7598   l_count := l_count + 1;
7599   l_transaction_table(l_count).param_name :=upper('p_rltd_per_rsds_w_dsgntr_flag');
7600   l_transaction_table(l_count).param_value := p_rltd_per_rsds_w_dsgntr_flag;
7601   l_transaction_table(l_count).param_data_type := upper('varchar2');
7602   --
7603   --
7604   l_count := l_count + 1;
7605   l_transaction_table(l_count).param_name :=upper('p_personal_flag');
7606   l_transaction_table(l_count).param_value := p_personal_flag;
7607   l_transaction_table(l_count).param_data_type := upper('varchar2');
7608   --
7609   -- StartRegistration
7610   --
7611   l_count := l_count + 1;
7612   l_transaction_table(l_count).param_name :=upper('p_sequence_number');
7613   l_transaction_table(l_count).param_value := l_sequence_number;
7614   l_transaction_table(l_count).param_data_type := upper('number');
7615   --
7616   --
7617   l_count := l_count + 1;
7618   l_transaction_table(l_count).param_name :=upper('p_cont_attribute_category');
7619   l_transaction_table(l_count).param_value := p_cont_attribute_category;
7620   l_transaction_table(l_count).param_data_type := upper('varchar2');
7621   --
7622   --
7623   l_count := l_count + 1;
7624   l_transaction_table(l_count).param_name :=upper('p_cont_attribute1');
7625   l_transaction_table(l_count).param_value := p_cont_attribute1;
7626   l_transaction_table(l_count).param_data_type := upper('varchar2');
7627   --
7628   --
7629   l_count := l_count + 1;
7630   l_transaction_table(l_count).param_name :=upper('p_cont_attribute2');
7631   l_transaction_table(l_count).param_value := p_cont_attribute2;
7632   l_transaction_table(l_count).param_data_type := upper('varchar2');
7633   --
7634   --
7635   l_count := l_count + 1;
7636   l_transaction_table(l_count).param_name :=upper('p_cont_attribute3');
7637   l_transaction_table(l_count).param_value := p_cont_attribute3;
7638   l_transaction_table(l_count).param_data_type := upper('varchar2');
7639   --
7640   --
7641   l_count := l_count + 1;
7642   l_transaction_table(l_count).param_name :=upper('p_cont_attribute4');
7643   l_transaction_table(l_count).param_value := p_cont_attribute4;
7644   l_transaction_table(l_count).param_data_type := upper('varchar2');
7645   --
7646   --
7647   l_count := l_count + 1;
7648   l_transaction_table(l_count).param_name :=upper('p_cont_attribute5');
7649   l_transaction_table(l_count).param_value := p_cont_attribute5;
7650   l_transaction_table(l_count).param_data_type := upper('varchar2');
7651   --
7652   --
7653   l_count := l_count + 1;
7654   l_transaction_table(l_count).param_name :=upper('p_cont_attribute6');
7655   l_transaction_table(l_count).param_value := p_cont_attribute6;
7656   l_transaction_table(l_count).param_data_type := upper('varchar2');
7657   --
7658   --
7659   l_count := l_count + 1;
7660   l_transaction_table(l_count).param_name :=upper('p_cont_attribute7');
7661   l_transaction_table(l_count).param_value := p_cont_attribute7;
7662   l_transaction_table(l_count).param_data_type := upper('varchar2');
7663   --
7664   --
7665   l_count := l_count + 1;
7666   l_transaction_table(l_count).param_name :=upper('p_cont_attribute8');
7667   l_transaction_table(l_count).param_value := p_cont_attribute8;
7668   l_transaction_table(l_count).param_data_type := upper('varchar2');
7669   --
7670   --
7671   l_count := l_count + 1;
7672   l_transaction_table(l_count).param_name :=upper('p_cont_attribute9');
7673   l_transaction_table(l_count).param_value := p_cont_attribute9;
7674   l_transaction_table(l_count).param_data_type := upper('varchar2');
7675   --
7676   --
7677   l_count := l_count + 1;
7678   l_transaction_table(l_count).param_name :=upper('p_cont_attribute10');
7679   l_transaction_table(l_count).param_value := p_cont_attribute10;
7680   l_transaction_table(l_count).param_data_type := upper('varchar2');
7681   --
7682   --
7683   l_count := l_count + 1;
7684   l_transaction_table(l_count).param_name :=upper('p_cont_attribute11');
7685   l_transaction_table(l_count).param_value := p_cont_attribute11;
7686   l_transaction_table(l_count).param_data_type := upper('varchar2');
7687   --
7688   --
7689   l_count := l_count + 1;
7690   l_transaction_table(l_count).param_name :=upper('p_cont_attribute12');
7691   l_transaction_table(l_count).param_value := p_cont_attribute12;
7692   l_transaction_table(l_count).param_data_type := upper('varchar2');
7693   --
7694   --
7695   l_count := l_count + 1;
7696   l_transaction_table(l_count).param_name :=upper('p_cont_attribute13');
7697   l_transaction_table(l_count).param_value := p_cont_attribute13;
7698   l_transaction_table(l_count).param_data_type := upper('varchar2');
7699   --
7700   --
7701   l_count := l_count + 1;
7702   l_transaction_table(l_count).param_name :=upper('p_cont_attribute14');
7703   l_transaction_table(l_count).param_value := p_cont_attribute14;
7704   l_transaction_table(l_count).param_data_type := upper('varchar2');
7705   --
7706   --
7707   l_count := l_count + 1;
7708   l_transaction_table(l_count).param_name :=upper('p_cont_attribute15');
7709   l_transaction_table(l_count).param_value := p_cont_attribute15;
7710   l_transaction_table(l_count).param_data_type := upper('varchar2');
7711   --
7712   --
7713   l_count := l_count + 1;
7714   l_transaction_table(l_count).param_name :=upper('p_cont_attribute16');
7715   l_transaction_table(l_count).param_value := p_cont_attribute16;
7716   l_transaction_table(l_count).param_data_type := upper('varchar2');
7717   --
7718   --
7719   l_count := l_count + 1;
7720   l_transaction_table(l_count).param_name :=upper('p_cont_attribute17');
7721   l_transaction_table(l_count).param_value := p_cont_attribute17;
7722   l_transaction_table(l_count).param_data_type := upper('varchar2');
7723   --
7724   --
7725   l_count := l_count + 1;
7726   l_transaction_table(l_count).param_name :=upper('p_cont_attribute18');
7727   l_transaction_table(l_count).param_value := p_cont_attribute18;
7728   l_transaction_table(l_count).param_data_type := upper('varchar2');
7729   --
7730   --
7731   l_count := l_count + 1;
7732   l_transaction_table(l_count).param_name :=upper('p_cont_attribute19');
7733   l_transaction_table(l_count).param_value := p_cont_attribute19;
7734   l_transaction_table(l_count).param_data_type := upper('varchar2');
7735   --
7736   --
7737   l_count := l_count + 1;
7738   l_transaction_table(l_count).param_name :=upper('p_cont_attribute20');
7739   l_transaction_table(l_count).param_value := p_cont_attribute20;
7740   l_transaction_table(l_count).param_data_type := upper('varchar2');
7741   --
7742   --
7743   l_count := l_count + 1;
7744   l_transaction_table(l_count).param_name :=upper('p_third_party_pay_flag');
7745   l_transaction_table(l_count).param_value := p_third_party_pay_flag;
7746   l_transaction_table(l_count).param_data_type := upper('varchar2');
7747   --
7748   --
7749   l_count := l_count + 1;
7750   l_transaction_table(l_count).param_name :=upper('p_bondholder_flag');
7751   l_transaction_table(l_count).param_value := p_bondholder_flag;
7752   l_transaction_table(l_count).param_data_type := upper('varchar2');
7753   --
7754   --
7755   l_count := l_count + 1;
7756   l_transaction_table(l_count).param_name :=upper('p_dependent_flag');
7757   l_transaction_table(l_count).param_value := p_dependent_flag;
7758   l_transaction_table(l_count).param_data_type := upper('varchar2');
7759   --
7760   --
7761   l_count := l_count + 1;
7762   l_transaction_table(l_count).param_name :=upper('p_beneficiary_flag');
7763   l_transaction_table(l_count).param_value := p_beneficiary_flag;
7764   l_transaction_table(l_count).param_data_type := upper('varchar2');
7765   --
7766   --
7767   l_count := l_count + 1;
7768   l_transaction_table(l_count).param_name :=upper('p_last_name');
7769   l_transaction_table(l_count).param_value := p_last_name;
7770   l_transaction_table(l_count).param_data_type := upper('varchar2');
7771   --
7772   --
7773   l_count := l_count + 1;
7774   l_transaction_table(l_count).param_name :=upper('p_sex');
7775   l_transaction_table(l_count).param_value := p_sex;
7776   l_transaction_table(l_count).param_data_type := upper('varchar2');
7777   --
7778   -- StartRegistration
7779   --
7780   l_count := l_count + 1;
7781   l_transaction_table(l_count).param_name :=upper('p_person_type_id');
7782   l_transaction_table(l_count).param_value := l_person_type_id;
7783   l_transaction_table(l_count).param_data_type := upper('number');
7784   --
7785   --
7786   l_count := l_count + 1;
7787   l_transaction_table(l_count).param_name :=upper('p_per_comments');
7788   l_transaction_table(l_count).param_value := p_per_comments;
7789   l_transaction_table(l_count).param_data_type := upper('varchar2');
7790   --
7791   --
7792   l_count := l_count + 1;
7793   l_transaction_table(l_count).param_name :=upper('p_date_of_birth');
7794   l_transaction_table(l_count).param_value :=
7795                 to_char(p_date_of_birth , hr_transaction_ss.g_date_format);
7796   l_transaction_table(l_count).param_data_type := upper('date');
7797   --
7798   --
7799   l_count := l_count + 1;
7800   l_transaction_table(l_count).param_name :=upper('p_email_address');
7801   l_transaction_table(l_count).param_value := p_email_address;
7802   l_transaction_table(l_count).param_data_type := upper('varchar2');
7803   --
7804   --
7805   l_count := l_count + 1;
7806   l_transaction_table(l_count).param_name :=upper('p_first_name');
7807   l_transaction_table(l_count).param_value := p_first_name;
7808   l_transaction_table(l_count).param_data_type := upper('varchar2');
7809   --
7810   --
7811   l_count := l_count + 1;
7812   l_transaction_table(l_count).param_name :=upper('p_known_as');
7813   l_transaction_table(l_count).param_value := p_known_as;
7814   l_transaction_table(l_count).param_data_type := upper('varchar2');
7815   --
7816   --
7817   l_count := l_count + 1;
7818   l_transaction_table(l_count).param_name :=upper('p_marital_status');
7819   l_transaction_table(l_count).param_value := p_marital_status;
7820   l_transaction_table(l_count).param_data_type := upper('varchar2');
7821   --
7822   --
7823   l_count := l_count + 1;
7824   l_transaction_table(l_count).param_name :=upper('p_middle_names');
7825   l_transaction_table(l_count).param_value := p_middle_names;
7826   l_transaction_table(l_count).param_data_type := upper('varchar2');
7827   --
7828   --
7829   l_count := l_count + 1;
7830   l_transaction_table(l_count).param_name :=upper('p_nationality');
7831   l_transaction_table(l_count).param_value := p_nationality;
7832   l_transaction_table(l_count).param_data_type := upper('varchar2');
7833   --
7834   --
7835   l_count := l_count + 1;
7836   l_transaction_table(l_count).param_name :=upper('p_national_identifier');
7837   l_transaction_table(l_count).param_value := p_national_identifier;
7838   l_transaction_table(l_count).param_data_type := upper('varchar2');
7839   --
7840   --
7841   l_count := l_count + 1;
7842   l_transaction_table(l_count).param_name :=upper('p_previous_last_name');
7843   l_transaction_table(l_count).param_value := p_previous_last_name;
7844   l_transaction_table(l_count).param_data_type := upper('varchar2');
7845   --
7846   --
7847   l_count := l_count + 1;
7848   l_transaction_table(l_count).param_name :=upper('p_registered_disabled_flag');
7849   l_transaction_table(l_count).param_value := p_registered_disabled_flag;
7850   l_transaction_table(l_count).param_data_type := upper('varchar2');
7851   --
7852   --
7853   l_count := l_count + 1;
7854   l_transaction_table(l_count).param_name :=upper('p_title');
7855   l_transaction_table(l_count).param_value := p_title;
7856   l_transaction_table(l_count).param_data_type := upper('varchar2');
7857   --
7858   --
7859   l_count := l_count + 1;
7860   l_transaction_table(l_count).param_name :=upper('p_work_telephone');
7861   l_transaction_table(l_count).param_value := p_work_telephone;
7862   l_transaction_table(l_count).param_data_type := upper('varchar2');
7863   --
7864   --
7865   l_count := l_count + 1;
7866   l_transaction_table(l_count).param_name :=upper('p_attribute_category');
7867   l_transaction_table(l_count).param_value := p_attribute_category;
7868   l_transaction_table(l_count).param_data_type := upper('varchar2');
7869   --
7870   --
7871   l_count := l_count + 1;
7872   l_transaction_table(l_count).param_name :=upper('p_attribute1');
7873   l_transaction_table(l_count).param_value := p_attribute1;
7874   l_transaction_table(l_count).param_data_type := upper('varchar2');
7875   --
7876   --
7877   l_count := l_count + 1;
7878   l_transaction_table(l_count).param_name :=upper('p_attribute2');
7879   l_transaction_table(l_count).param_value := p_attribute2;
7880   l_transaction_table(l_count).param_data_type := upper('varchar2');
7881   --
7882   --
7883   l_count := l_count + 1;
7884   l_transaction_table(l_count).param_name :=upper('p_attribute3');
7885   l_transaction_table(l_count).param_value := p_attribute3;
7886   l_transaction_table(l_count).param_data_type := upper('varchar2');
7887   --
7888   --
7889   l_count := l_count + 1;
7890   l_transaction_table(l_count).param_name :=upper('p_attribute4');
7891   l_transaction_table(l_count).param_value := p_attribute4;
7892   l_transaction_table(l_count).param_data_type := upper('varchar2');
7893   --
7894   --
7895   l_count := l_count + 1;
7896   l_transaction_table(l_count).param_name :=upper('p_attribute5');
7897   l_transaction_table(l_count).param_value := p_attribute5;
7898   l_transaction_table(l_count).param_data_type := upper('varchar2');
7899   --
7900   --
7901   l_count := l_count + 1;
7902   l_transaction_table(l_count).param_name :=upper('p_attribute6');
7903   l_transaction_table(l_count).param_value := p_attribute6;
7904   l_transaction_table(l_count).param_data_type := upper('varchar2');
7905   --
7906   --
7907   l_count := l_count + 1;
7908   l_transaction_table(l_count).param_name :=upper('p_attribute7');
7909   l_transaction_table(l_count).param_value := p_attribute7;
7910   l_transaction_table(l_count).param_data_type := upper('varchar2');
7911   --
7912   --
7913   l_count := l_count + 1;
7914   l_transaction_table(l_count).param_name :=upper('p_attribute8');
7915   l_transaction_table(l_count).param_value := p_attribute8;
7916   l_transaction_table(l_count).param_data_type := upper('varchar2');
7917   --
7918   --
7919   l_count := l_count + 1;
7920   l_transaction_table(l_count).param_name :=upper('p_attribute9');
7921   l_transaction_table(l_count).param_value := p_attribute9;
7922   l_transaction_table(l_count).param_data_type := upper('varchar2');
7923   --
7924   --
7925   l_count := l_count + 1;
7926   l_transaction_table(l_count).param_name :=upper('p_attribute10');
7927   l_transaction_table(l_count).param_value := p_attribute10;
7928   l_transaction_table(l_count).param_data_type := upper('varchar2');
7929   --
7930   --
7931   l_count := l_count + 1;
7932   l_transaction_table(l_count).param_name :=upper('p_attribute11');
7933   l_transaction_table(l_count).param_value := p_attribute11;
7934   l_transaction_table(l_count).param_data_type := upper('varchar2');
7935   --
7936   --
7937   l_count := l_count + 1;
7938   l_transaction_table(l_count).param_name :=upper('p_attribute12');
7939   l_transaction_table(l_count).param_value := p_attribute12;
7940   l_transaction_table(l_count).param_data_type := upper('varchar2');
7941   --
7942   --
7943   l_count := l_count + 1;
7944   l_transaction_table(l_count).param_name :=upper('p_attribute13');
7945   l_transaction_table(l_count).param_value := p_attribute13;
7946   l_transaction_table(l_count).param_data_type := upper('varchar2');
7947   --
7948   --
7949   l_count := l_count + 1;
7950   l_transaction_table(l_count).param_name :=upper('p_attribute14');
7951   l_transaction_table(l_count).param_value := p_attribute14;
7952   l_transaction_table(l_count).param_data_type := upper('varchar2');
7953   --
7954   --
7955   l_count := l_count + 1;
7956   l_transaction_table(l_count).param_name :=upper('p_attribute15');
7957   l_transaction_table(l_count).param_value := p_attribute15;
7958   l_transaction_table(l_count).param_data_type := upper('varchar2');
7959   --
7960   --
7961   l_count := l_count + 1;
7962   l_transaction_table(l_count).param_name :=upper('p_attribute16');
7963   l_transaction_table(l_count).param_value := p_attribute16;
7964   l_transaction_table(l_count).param_data_type := upper('varchar2');
7965   --
7966   --
7967   l_count := l_count + 1;
7968   l_transaction_table(l_count).param_name :=upper('p_attribute17');
7969   l_transaction_table(l_count).param_value := p_attribute17;
7970   l_transaction_table(l_count).param_data_type := upper('varchar2');
7971   --
7972   --
7973   l_count := l_count + 1;
7974   l_transaction_table(l_count).param_name :=upper('p_attribute18');
7975   l_transaction_table(l_count).param_value := p_attribute18;
7976   l_transaction_table(l_count).param_data_type := upper('varchar2');
7977   --
7978   --
7979   l_count := l_count + 1;
7980   l_transaction_table(l_count).param_name :=upper('p_attribute19');
7981   l_transaction_table(l_count).param_value := p_attribute19;
7982   l_transaction_table(l_count).param_data_type := upper('varchar2');
7983   --
7984   --
7985   l_count := l_count + 1;
7986   l_transaction_table(l_count).param_name :=upper('p_attribute20');
7987   l_transaction_table(l_count).param_value := p_attribute20;
7988   l_transaction_table(l_count).param_data_type := upper('varchar2');
7989   --
7990   --
7991   l_count := l_count + 1;
7992   l_transaction_table(l_count).param_name :=upper('p_attribute21');
7993   l_transaction_table(l_count).param_value := p_attribute21;
7994   l_transaction_table(l_count).param_data_type := upper('varchar2');
7995   --
7996   --
7997   l_count := l_count + 1;
7998   l_transaction_table(l_count).param_name :=upper('p_attribute22');
7999   l_transaction_table(l_count).param_value := p_attribute22;
8000   l_transaction_table(l_count).param_data_type := upper('varchar2');
8001   --
8002   --
8003   l_count := l_count + 1;
8004   l_transaction_table(l_count).param_name :=upper('p_attribute23');
8005   l_transaction_table(l_count).param_value := p_attribute23;
8006   l_transaction_table(l_count).param_data_type := upper('varchar2');
8007   --
8008   --
8009   l_count := l_count + 1;
8010   l_transaction_table(l_count).param_name :=upper('p_attribute24');
8011   l_transaction_table(l_count).param_value := p_attribute24;
8012   l_transaction_table(l_count).param_data_type := upper('varchar2');
8013   --
8014   --
8015   l_count := l_count + 1;
8016   l_transaction_table(l_count).param_name :=upper('p_attribute25');
8017   l_transaction_table(l_count).param_value := p_attribute25;
8018   l_transaction_table(l_count).param_data_type := upper('varchar2');
8019   --
8020   --
8021   l_count := l_count + 1;
8022   l_transaction_table(l_count).param_name :=upper('p_attribute26');
8023   l_transaction_table(l_count).param_value := p_attribute26;
8024   l_transaction_table(l_count).param_data_type := upper('varchar2');
8025   --
8026   --
8027   l_count := l_count + 1;
8028   l_transaction_table(l_count).param_name :=upper('p_attribute27');
8029   l_transaction_table(l_count).param_value := p_attribute27;
8030   l_transaction_table(l_count).param_data_type := upper('varchar2');
8031   --
8032   --
8033   l_count := l_count + 1;
8034   l_transaction_table(l_count).param_name :=upper('p_attribute28');
8035   l_transaction_table(l_count).param_value := p_attribute28;
8036   l_transaction_table(l_count).param_data_type := upper('varchar2');
8037   --
8038   --
8039   l_count := l_count + 1;
8040   l_transaction_table(l_count).param_name :=upper('p_attribute29');
8041   l_transaction_table(l_count).param_value := p_attribute29;
8042   l_transaction_table(l_count).param_data_type := upper('varchar2');
8043   --
8044   --
8045   l_count := l_count + 1;
8046   l_transaction_table(l_count).param_name :=upper('p_attribute30');
8047   l_transaction_table(l_count).param_value := p_attribute30;
8048   l_transaction_table(l_count).param_data_type := upper('varchar2');
8049   --
8050   --
8051   l_count := l_count + 1;
8052   l_transaction_table(l_count).param_name :=upper('p_per_information_category');
8053   l_transaction_table(l_count).param_value := p_per_information_category;
8054   l_transaction_table(l_count).param_data_type := upper('varchar2');
8055   --
8056   --
8057   l_count := l_count + 1;
8058   l_transaction_table(l_count).param_name :=upper('p_per_information1');
8059   l_transaction_table(l_count).param_value := p_per_information1;
8060   l_transaction_table(l_count).param_data_type := upper('varchar2');
8061   --
8062   --
8063   l_count := l_count + 1;
8064   l_transaction_table(l_count).param_name :=upper('p_per_information2');
8065   l_transaction_table(l_count).param_value := p_per_information2;
8066   l_transaction_table(l_count).param_data_type := upper('varchar2');
8067   --
8068   --
8069   l_count := l_count + 1;
8070   l_transaction_table(l_count).param_name :=upper('p_per_information3');
8071   l_transaction_table(l_count).param_value := p_per_information3;
8072   l_transaction_table(l_count).param_data_type := upper('varchar2');
8073   --
8074   --
8075   l_count := l_count + 1;
8076   l_transaction_table(l_count).param_name :=upper('p_per_information4');
8077   l_transaction_table(l_count).param_value := p_per_information4;
8078   l_transaction_table(l_count).param_data_type := upper('varchar2');
8079   --
8080   --
8081   l_count := l_count + 1;
8082   l_transaction_table(l_count).param_name :=upper('p_per_information5');
8083   l_transaction_table(l_count).param_value := p_per_information5;
8084   l_transaction_table(l_count).param_data_type := upper('varchar2');
8085   --
8086   --
8087   l_count := l_count + 1;
8088   l_transaction_table(l_count).param_name :=upper('p_per_information6');
8089   l_transaction_table(l_count).param_value := p_per_information6;
8090   l_transaction_table(l_count).param_data_type := upper('varchar2');
8091   --
8092   --
8093   l_count := l_count + 1;
8094   l_transaction_table(l_count).param_name :=upper('p_per_information7');
8095   l_transaction_table(l_count).param_value := p_per_information7;
8096   l_transaction_table(l_count).param_data_type := upper('varchar2');
8097   --
8098   --
8099   l_count := l_count + 1;
8100   l_transaction_table(l_count).param_name :=upper('p_per_information8');
8101   l_transaction_table(l_count).param_value := p_per_information8;
8102   l_transaction_table(l_count).param_data_type := upper('varchar2');
8103   --
8104   --
8105   l_count := l_count + 1;
8106   l_transaction_table(l_count).param_name :=upper('p_per_information9');
8107   l_transaction_table(l_count).param_value := p_per_information9;
8108   l_transaction_table(l_count).param_data_type := upper('varchar2');
8109   --
8110   --
8111   l_count := l_count + 1;
8112   l_transaction_table(l_count).param_name :=upper('p_per_information10');
8113   l_transaction_table(l_count).param_value := p_per_information10;
8114   l_transaction_table(l_count).param_data_type := upper('varchar2');
8115   --
8116   --
8117   l_count := l_count + 1;
8118   l_transaction_table(l_count).param_name :=upper('p_per_information11');
8119   l_transaction_table(l_count).param_value := p_per_information11;
8120   l_transaction_table(l_count).param_data_type := upper('varchar2');
8121   --
8122   --
8123   l_count := l_count + 1;
8124   l_transaction_table(l_count).param_name :=upper('p_per_information12');
8125   l_transaction_table(l_count).param_value := p_per_information12;
8126   l_transaction_table(l_count).param_data_type := upper('varchar2');
8127   --
8128   --
8129   l_count := l_count + 1;
8130   l_transaction_table(l_count).param_name :=upper('p_per_information13');
8131   l_transaction_table(l_count).param_value := p_per_information13;
8132   l_transaction_table(l_count).param_data_type := upper('varchar2');
8133   --
8134   --
8135   l_count := l_count + 1;
8136   l_transaction_table(l_count).param_name :=upper('p_per_information14');
8137   l_transaction_table(l_count).param_value := p_per_information14;
8138   l_transaction_table(l_count).param_data_type := upper('varchar2');
8139   --
8140   --
8141   l_count := l_count + 1;
8142   l_transaction_table(l_count).param_name :=upper('p_per_information15');
8143   l_transaction_table(l_count).param_value := p_per_information15;
8144   l_transaction_table(l_count).param_data_type := upper('varchar2');
8145   --
8146   --
8147   l_count := l_count + 1;
8148   l_transaction_table(l_count).param_name :=upper('p_per_information16');
8149   l_transaction_table(l_count).param_value := p_per_information16;
8150   l_transaction_table(l_count).param_data_type := upper('varchar2');
8151   --
8152   --
8153   l_count := l_count + 1;
8154   l_transaction_table(l_count).param_name :=upper('p_per_information17');
8155   l_transaction_table(l_count).param_value := p_per_information17;
8156   l_transaction_table(l_count).param_data_type := upper('varchar2');
8157   --
8158   --
8159   l_count := l_count + 1;
8160   l_transaction_table(l_count).param_name :=upper('p_per_information18');
8161   l_transaction_table(l_count).param_value := p_per_information18;
8162   l_transaction_table(l_count).param_data_type := upper('varchar2');
8163   --
8164   --
8165   l_count := l_count + 1;
8166   l_transaction_table(l_count).param_name :=upper('p_per_information19');
8167   l_transaction_table(l_count).param_value := p_per_information19;
8168   l_transaction_table(l_count).param_data_type := upper('varchar2');
8169   --
8170   --
8171   l_count := l_count + 1;
8172   l_transaction_table(l_count).param_name :=upper('p_per_information20');
8173   l_transaction_table(l_count).param_value := p_per_information20;
8174   l_transaction_table(l_count).param_data_type := upper('varchar2');
8175   --
8176   --
8177   l_count := l_count + 1;
8178   l_transaction_table(l_count).param_name :=upper('p_per_information21');
8179   l_transaction_table(l_count).param_value := p_per_information21;
8180   l_transaction_table(l_count).param_data_type := upper('varchar2');
8181   --
8182   --
8183   l_count := l_count + 1;
8184   l_transaction_table(l_count).param_name :=upper('p_per_information22');
8185   l_transaction_table(l_count).param_value := p_per_information22;
8186   l_transaction_table(l_count).param_data_type := upper('varchar2');
8187   --
8188   --
8189   l_count := l_count + 1;
8190   l_transaction_table(l_count).param_name :=upper('p_per_information23');
8191   l_transaction_table(l_count).param_value := p_per_information23;
8192   l_transaction_table(l_count).param_data_type := upper('varchar2');
8193   --
8194   --
8195   l_count := l_count + 1;
8196   l_transaction_table(l_count).param_name :=upper('p_per_information24');
8197   l_transaction_table(l_count).param_value := p_per_information24;
8198   l_transaction_table(l_count).param_data_type := upper('varchar2');
8199   --
8200   --
8201   l_count := l_count + 1;
8202   l_transaction_table(l_count).param_name :=upper('p_per_information25');
8203   l_transaction_table(l_count).param_value := p_per_information25;
8204   l_transaction_table(l_count).param_data_type := upper('varchar2');
8205   --
8206   --
8207   l_count := l_count + 1;
8208   l_transaction_table(l_count).param_name :=upper('p_per_information26');
8209   l_transaction_table(l_count).param_value := p_per_information26;
8210   l_transaction_table(l_count).param_data_type := upper('varchar2');
8211   --
8212   --
8213   l_count := l_count + 1;
8214   l_transaction_table(l_count).param_name :=upper('p_per_information27');
8215   l_transaction_table(l_count).param_value := p_per_information27;
8216   l_transaction_table(l_count).param_data_type := upper('varchar2');
8217   --
8218   --
8219   l_count := l_count + 1;
8220   l_transaction_table(l_count).param_name :=upper('p_per_information28');
8221   l_transaction_table(l_count).param_value := p_per_information28;
8222   l_transaction_table(l_count).param_data_type := upper('varchar2');
8223   --
8224   --
8225   l_count := l_count + 1;
8226   l_transaction_table(l_count).param_name :=upper('p_per_information29');
8227   l_transaction_table(l_count).param_value := p_per_information29;
8228   l_transaction_table(l_count).param_data_type := upper('varchar2');
8229   --
8230   --
8231   l_count := l_count + 1;
8232   l_transaction_table(l_count).param_name :=upper('p_per_information30');
8233   l_transaction_table(l_count).param_value := p_per_information30;
8234   l_transaction_table(l_count).param_data_type := upper('varchar2');
8235   --
8236   --
8237   l_count := l_count + 1;
8238   l_transaction_table(l_count).param_name :=upper('p_correspondence_language');
8239   l_transaction_table(l_count).param_value := p_correspondence_language;
8240   l_transaction_table(l_count).param_data_type := upper('varchar2');
8241   --
8242   --
8243   l_count := l_count + 1;
8244   l_transaction_table(l_count).param_name :=upper('p_honors');
8245   l_transaction_table(l_count).param_value := p_honors;
8246   l_transaction_table(l_count).param_data_type := upper('varchar2');
8247   --
8248   --
8249   l_count := l_count + 1;
8250   l_transaction_table(l_count).param_name :=upper('p_pre_name_adjunct');
8251   l_transaction_table(l_count).param_value := p_pre_name_adjunct;
8252   l_transaction_table(l_count).param_data_type := upper('varchar2');
8253   --
8254   --
8255   l_count := l_count + 1;
8256   l_transaction_table(l_count).param_name :=upper('p_suffix');
8257   l_transaction_table(l_count).param_value := p_suffix;
8258   l_transaction_table(l_count).param_data_type := upper('varchar2');
8259   --
8260   --
8261   l_count := l_count + 1;
8262   l_transaction_table(l_count).param_name :=upper('p_create_mirror_flag');
8263   l_transaction_table(l_count).param_value := p_create_mirror_flag;
8264   l_transaction_table(l_count).param_data_type := upper('varchar2');
8265   --
8266   --
8267   l_count := l_count + 1;
8268   l_transaction_table(l_count).param_name :=upper('p_mirror_type');
8269   l_transaction_table(l_count).param_value := p_mirror_type;
8270   l_transaction_table(l_count).param_data_type := upper('varchar2');
8271   --
8272   --
8273   l_count := l_count + 1;
8274   l_transaction_table(l_count).param_name :=upper('p_mirror_cont_attribute_cat');
8275   l_transaction_table(l_count).param_value := p_mirror_cont_attribute_cat;
8276   l_transaction_table(l_count).param_data_type := upper('varchar2');
8277   --
8278   --
8279   l_count := l_count + 1;
8280   l_transaction_table(l_count).param_name :=upper('p_mirror_cont_attribute1');
8281   l_transaction_table(l_count).param_value := p_mirror_cont_attribute1;
8282   l_transaction_table(l_count).param_data_type := upper('varchar2');
8283   --
8284   --
8285   l_count := l_count + 1;
8286   l_transaction_table(l_count).param_name :=upper('p_mirror_cont_attribute2');
8287   l_transaction_table(l_count).param_value := p_mirror_cont_attribute2;
8288   l_transaction_table(l_count).param_data_type := upper('varchar2');
8289   --
8290   --
8291   l_count := l_count + 1;
8292   l_transaction_table(l_count).param_name :=upper('p_mirror_cont_attribute3');
8293   l_transaction_table(l_count).param_value := p_mirror_cont_attribute3;
8294   l_transaction_table(l_count).param_data_type := upper('varchar2');
8295   --
8296   --
8297   l_count := l_count + 1;
8298   l_transaction_table(l_count).param_name :=upper('p_mirror_cont_attribute4');
8299   l_transaction_table(l_count).param_value := p_mirror_cont_attribute4;
8300   l_transaction_table(l_count).param_data_type := upper('varchar2');
8301   --
8302   --
8303   l_count := l_count + 1;
8304   l_transaction_table(l_count).param_name :=upper('p_mirror_cont_attribute5');
8305   l_transaction_table(l_count).param_value := p_mirror_cont_attribute5;
8306   l_transaction_table(l_count).param_data_type := upper('varchar2');
8307   --
8308   --
8309   l_count := l_count + 1;
8310   l_transaction_table(l_count).param_name :=upper('p_mirror_cont_attribute6');
8311   l_transaction_table(l_count).param_value := p_mirror_cont_attribute6;
8312   l_transaction_table(l_count).param_data_type := upper('varchar2');
8313   --
8314   --
8315   l_count := l_count + 1;
8316   l_transaction_table(l_count).param_name :=upper('p_mirror_cont_attribute7');
8317   l_transaction_table(l_count).param_value := p_mirror_cont_attribute7;
8318   l_transaction_table(l_count).param_data_type := upper('varchar2');
8319   --
8320   --
8321   l_count := l_count + 1;
8322   l_transaction_table(l_count).param_name :=upper('p_mirror_cont_attribute8');
8323   l_transaction_table(l_count).param_value := p_mirror_cont_attribute8;
8324   l_transaction_table(l_count).param_data_type := upper('varchar2');
8325   --
8326   --
8327   l_count := l_count + 1;
8328   l_transaction_table(l_count).param_name :=upper('p_mirror_cont_attribute9');
8329   l_transaction_table(l_count).param_value := p_mirror_cont_attribute9;
8330   l_transaction_table(l_count).param_data_type := upper('varchar2');
8331   --
8332   --
8333   l_count := l_count + 1;
8334   l_transaction_table(l_count).param_name :=upper('p_mirror_cont_attribute10');
8335   l_transaction_table(l_count).param_value := p_mirror_cont_attribute10;
8336   l_transaction_table(l_count).param_data_type := upper('varchar2');
8337   --
8338   --
8339   l_count := l_count + 1;
8340   l_transaction_table(l_count).param_name :=upper('p_mirror_cont_attribute11');
8341   l_transaction_table(l_count).param_value := p_mirror_cont_attribute11;
8342   l_transaction_table(l_count).param_data_type := upper('varchar2');
8343   --
8344   --
8345   l_count := l_count + 1;
8346   l_transaction_table(l_count).param_name :=upper('p_mirror_cont_attribute12');
8347   l_transaction_table(l_count).param_value := p_mirror_cont_attribute12;
8348   l_transaction_table(l_count).param_data_type := upper('varchar2');
8349   --
8350   --
8351   l_count := l_count + 1;
8352   l_transaction_table(l_count).param_name :=upper('p_mirror_cont_attribute13');
8353   l_transaction_table(l_count).param_value := p_mirror_cont_attribute13;
8354   l_transaction_table(l_count).param_data_type := upper('varchar2');
8355   --
8356   --
8357   l_count := l_count + 1;
8358   l_transaction_table(l_count).param_name :=upper('p_mirror_cont_attribute14');
8359   l_transaction_table(l_count).param_value := p_mirror_cont_attribute14;
8360   l_transaction_table(l_count).param_data_type := upper('varchar2');
8361   --
8362   --
8363   l_count := l_count + 1;
8364   l_transaction_table(l_count).param_name :=upper('p_mirror_cont_attribute15');
8365   l_transaction_table(l_count).param_value := p_mirror_cont_attribute15;
8366   l_transaction_table(l_count).param_data_type := upper('varchar2');
8367   --
8368   --
8369   l_count := l_count + 1;
8370   l_transaction_table(l_count).param_name :=upper('p_mirror_cont_attribute16');
8371   l_transaction_table(l_count).param_value := p_mirror_cont_attribute16;
8372   l_transaction_table(l_count).param_data_type := upper('varchar2');
8373   --
8374   --
8375   l_count := l_count + 1;
8376   l_transaction_table(l_count).param_name :=upper('p_mirror_cont_attribute17');
8377   l_transaction_table(l_count).param_value := p_mirror_cont_attribute17;
8378   l_transaction_table(l_count).param_data_type := upper('varchar2');
8379   --
8380   --
8381   l_count := l_count + 1;
8382   l_transaction_table(l_count).param_name :=upper('p_mirror_cont_attribute18');
8383   l_transaction_table(l_count).param_value := p_mirror_cont_attribute18;
8384   l_transaction_table(l_count).param_data_type := upper('varchar2');
8385   --
8386   --
8387   l_count := l_count + 1;
8388   l_transaction_table(l_count).param_name :=upper('p_mirror_cont_attribute19');
8389   l_transaction_table(l_count).param_value := p_mirror_cont_attribute19;
8390   l_transaction_table(l_count).param_data_type := upper('varchar2');
8391   --
8392   --
8393   l_count := l_count + 1;
8394   l_transaction_table(l_count).param_name :=upper('p_mirror_cont_attribute20');
8395   l_transaction_table(l_count).param_value := p_mirror_cont_attribute20;
8396   l_transaction_table(l_count).param_data_type := upper('varchar2');
8397   --
8398   --
8399   l_count := l_count + 1;
8400   l_transaction_table(l_count).param_name :=upper('p_item_type');
8401   l_transaction_table(l_count).param_value := p_item_type;
8402   l_transaction_table(l_count).param_data_type := upper('varchar2');
8403   --
8404   --
8405   l_count := l_count + 1;
8406   l_transaction_table(l_count).param_name :=upper('p_item_key');
8407   l_transaction_table(l_count).param_value := p_item_key;
8408   l_transaction_table(l_count).param_data_type := upper('varchar2');
8409   --
8410   -- 9999 This may not be necessary as it is same as P_REVIEW_ACTID.
8411   -- Check it and delete it after complete testing.
8412   --
8413   l_count := l_count + 1;
8414   l_transaction_table(l_count).param_name :=upper('p_activity_id');
8415   l_transaction_table(l_count).param_value := p_activity_id;
8416   l_transaction_table(l_count).param_data_type := upper('number');
8417   --
8418   --
8419   l_count := l_count + 1;
8420   l_transaction_table(l_count).param_name :=upper('p_action');
8421   l_transaction_table(l_count).param_value := p_action;
8422   l_transaction_table(l_count).param_data_type := upper('varchar2');
8423   --
8424   --
8425   l_count := l_count + 1;
8426   l_transaction_table(l_count).param_name :=upper('p_login_person_id');
8427   l_transaction_table(l_count).param_value := p_login_person_id;
8428   l_transaction_table(l_count).param_data_type := upper('number');
8429   --
8430   --
8431   l_count := l_count + 1;
8432   l_transaction_table(l_count).param_name :=upper('p_process_section_name');
8433   l_transaction_table(l_count).param_value := p_process_section_name;
8434   l_transaction_table(l_count).param_data_type := upper('varchar2');
8435   --
8436   -- 77777
8437   --
8438   l_count := l_count + 1;
8439   l_transaction_table(l_count).param_name :=upper('P_REVIEW_PROC_CALL');
8440   l_transaction_table(l_count).param_value := p_review_page_region_code;
8441   l_transaction_table(l_count).param_data_type := upper('varchar2');
8442   --
8443   --
8444   l_count := l_count + 1;
8445   l_transaction_table(l_count).param_name := 'P_REVIEW_ACTID';
8446   l_transaction_table(l_count).param_value := P_ACTIVITY_ID;
8447   l_transaction_table(l_count).param_data_type := 'VARCHAR2';
8448   --
8449   --
8450   l_count := l_count + 1;
8451   l_transaction_table(l_count).param_name :=upper('p_adjusted_svc_date');
8452   l_transaction_table(l_count).param_value :=
8453             to_char(p_adjusted_svc_date , hr_transaction_ss.g_date_format);
8454   l_transaction_table(l_count).param_data_type := upper('date');
8455   --
8456   --
8457   l_count := l_count + 1;
8458   l_transaction_table(l_count).param_name :=upper('p_datetrack_update_mode');
8459   l_transaction_table(l_count).param_value := p_datetrack_update_mode;
8460   l_transaction_table(l_count).param_data_type := upper('varchar2');
8461   --
8462   --
8463   l_count := l_count + 1;
8464   l_transaction_table(l_count).param_name :=upper('p_applicant_number');
8465   l_transaction_table(l_count).param_value := p_applicant_number;
8466   l_transaction_table(l_count).param_data_type := upper('varchar2');
8467   --
8468   --
8469   l_count := l_count + 1;
8470   l_transaction_table(l_count).param_name :=upper('p_background_check_status');
8471   l_transaction_table(l_count).param_value := p_background_check_status;
8472   l_transaction_table(l_count).param_data_type := upper('varchar2');
8473   --
8474   --
8475   l_count := l_count + 1;
8476   l_transaction_table(l_count).param_name :=upper('p_background_date_check');
8477   l_transaction_table(l_count).param_value :=
8478             to_char(p_background_date_check , hr_transaction_ss.g_date_format);
8479   l_transaction_table(l_count).param_data_type := upper('date');
8480   --
8481   --
8482   l_count := l_count + 1;
8483   l_transaction_table(l_count).param_name :=upper('p_benefit_group_id');
8484   l_transaction_table(l_count).param_value := p_benefit_group_id;
8485   l_transaction_table(l_count).param_data_type := upper('number');
8486   --
8487   --
8488   l_count := l_count + 1;
8489   l_transaction_table(l_count).param_name :=upper('p_blood_type');
8490   l_transaction_table(l_count).param_value := p_blood_type;
8491   l_transaction_table(l_count).param_data_type := upper('varchar2');
8492   --
8493   --
8494   l_count := l_count + 1;
8495   l_transaction_table(l_count).param_name :=upper('p_coord_ben_med_pln_no');
8496   l_transaction_table(l_count).param_value := p_coord_ben_med_pln_no;
8497   l_transaction_table(l_count).param_data_type := upper('varchar2');
8498   --
8499   --
8500   l_count := l_count + 1;
8501   l_transaction_table(l_count).param_name :=upper('p_coord_ben_no_cvg_flag');
8502   l_transaction_table(l_count).param_value := p_coord_ben_no_cvg_flag;
8503   l_transaction_table(l_count).param_data_type := upper('varchar2');
8504   --
8505   --
8506   l_count := l_count + 1;
8507   l_transaction_table(l_count).param_name :=upper('p_country_of_birth');
8508   l_transaction_table(l_count).param_value := p_country_of_birth;
8509   l_transaction_table(l_count).param_data_type := upper('varchar2');
8510   --
8511   --
8512   l_count := l_count + 1;
8513   l_transaction_table(l_count).param_name :=upper('p_date_employee_data_verified');
8514   l_transaction_table(l_count).param_value :=
8515             to_char(p_date_employee_data_verified , hr_transaction_ss.g_date_format);
8516   l_transaction_table(l_count).param_data_type := upper('date');
8517   --
8518   --
8519   l_count := l_count + 1;
8520   l_transaction_table(l_count).param_name :=upper('p_date_of_death');
8521   l_transaction_table(l_count).param_value :=
8522             to_char(p_date_of_death , hr_transaction_ss.g_date_format);
8523   l_transaction_table(l_count).param_data_type := upper('date');
8524   --
8525   --
8526   l_count := l_count + 1;
8527   l_transaction_table(l_count).param_name :=upper('p_dpdnt_adoption_date');
8528   l_transaction_table(l_count).param_value :=
8529             to_char(p_dpdnt_adoption_date , hr_transaction_ss.g_date_format);
8530   l_transaction_table(l_count).param_data_type := upper('date');
8531   --
8532   --
8533   l_count := l_count + 1;
8534   l_transaction_table(l_count).param_name :=upper('p_dpdnt_vlntry_svce_flag');
8535   l_transaction_table(l_count).param_value := p_dpdnt_vlntry_svce_flag;
8536   l_transaction_table(l_count).param_data_type := upper('varchar2');
8537   --
8538   --
8539   l_count := l_count + 1;
8540   l_transaction_table(l_count).param_name :=upper('p_employee_number');
8541   l_transaction_table(l_count).param_value := p_employee_number;
8542   l_transaction_table(l_count).param_data_type := upper('varchar2');
8543   --
8544   --
8545   l_count := l_count + 1;
8546   l_transaction_table(l_count).param_name :=upper('p_expense_check_send_to_addres');
8547   l_transaction_table(l_count).param_value := p_expense_check_send_to_addres;
8548   l_transaction_table(l_count).param_data_type := upper('varchar2');
8549   --
8550   --
8551   l_count := l_count + 1;
8552   l_transaction_table(l_count).param_name :=upper('p_fast_path_employee');
8553   l_transaction_table(l_count).param_value := p_fast_path_employee;
8554   l_transaction_table(l_count).param_data_type := upper('varchar2');
8555   --
8556   --
8557   l_count := l_count + 1;
8558   l_transaction_table(l_count).param_name :=upper('p_fte_capacity');
8559   l_transaction_table(l_count).param_value := p_fte_capacity;
8560   l_transaction_table(l_count).param_data_type := upper('number');
8561   --
8562   --
8563   l_count := l_count + 1;
8564   l_transaction_table(l_count).param_name :=upper('p_global_person_id');
8565   l_transaction_table(l_count).param_value := p_global_person_id;
8566   l_transaction_table(l_count).param_data_type := upper('varchar2');
8567   --
8568   --
8569   l_count := l_count + 1;
8570   l_transaction_table(l_count).param_name :=upper('p_hold_applicant_date_until');
8571   l_transaction_table(l_count).param_value :=
8572             to_char(p_hold_applicant_date_until , hr_transaction_ss.g_date_format);
8573   l_transaction_table(l_count).param_data_type := upper('date');
8574   --
8575   --
8576   l_count := l_count + 1;
8577   l_transaction_table(l_count).param_name :=upper('p_internal_location');
8578   l_transaction_table(l_count).param_value := p_internal_location;
8579   l_transaction_table(l_count).param_data_type := upper('varchar2');
8580   --
8581   --
8582   l_count := l_count + 1;
8583   l_transaction_table(l_count).param_name :=upper('p_last_medical_test_by');
8584   l_transaction_table(l_count).param_value := p_last_medical_test_by;
8585   l_transaction_table(l_count).param_data_type := upper('varchar2');
8586   --
8587   --
8588   l_count := l_count + 1;
8589   l_transaction_table(l_count).param_name :=upper('p_last_medical_test_date');
8590   l_transaction_table(l_count).param_value :=
8591             to_char(p_last_medical_test_date , hr_transaction_ss.g_date_format);
8592   l_transaction_table(l_count).param_data_type := upper('date');
8593   --
8594   --
8595   l_count := l_count + 1;
8596   l_transaction_table(l_count).param_name :=upper('p_mailstop');
8597   l_transaction_table(l_count).param_value := p_mailstop;
8598   l_transaction_table(l_count).param_data_type := upper('varchar2');
8599   --
8600   --
8601   l_count := l_count + 1;
8602   l_transaction_table(l_count).param_name :=upper('p_office_number');
8603   l_transaction_table(l_count).param_value := p_office_number;
8604   l_transaction_table(l_count).param_data_type := upper('varchar2');
8605   --
8606   --
8607   l_count := l_count + 1;
8608   l_transaction_table(l_count).param_name :=upper('p_on_military_service');
8609   l_transaction_table(l_count).param_value := p_on_military_service;
8610   l_transaction_table(l_count).param_data_type := upper('varchar2');
8611   --
8612   --
8613   l_count := l_count + 1;
8614   l_transaction_table(l_count).param_name :=upper('p_original_date_of_hire');
8615   l_transaction_table(l_count).param_value :=
8616             to_char(p_original_date_of_hire , hr_transaction_ss.g_date_format);
8617   l_transaction_table(l_count).param_data_type := upper('date');
8618   --
8619   --
8620   l_count := l_count + 1;
8621   l_transaction_table(l_count).param_name :=upper('p_projected_start_date');
8622   l_transaction_table(l_count).param_value :=
8623             to_char(p_projected_start_date , hr_transaction_ss.g_date_format);
8624   l_transaction_table(l_count).param_data_type := upper('date');
8625   --
8626   --
8627   l_count := l_count + 1;
8628   l_transaction_table(l_count).param_name :=upper('p_receipt_of_death_cert_date');
8629   l_transaction_table(l_count).param_value :=
8630             to_char(p_receipt_of_death_cert_date , hr_transaction_ss.g_date_format);
8631   l_transaction_table(l_count).param_data_type := upper('date');
8632   --
8633   --
8634   l_count := l_count + 1;
8635   l_transaction_table(l_count).param_name :=upper('p_region_of_birth');
8636   l_transaction_table(l_count).param_value := p_region_of_birth;
8637   l_transaction_table(l_count).param_data_type := upper('varchar2');
8638   --
8639   --
8640   l_count := l_count + 1;
8641   l_transaction_table(l_count).param_name :=upper('p_rehire_authorizor');
8642   l_transaction_table(l_count).param_value := p_rehire_authorizor;
8643   l_transaction_table(l_count).param_data_type := upper('varchar2');
8644   --
8645   --
8646   l_count := l_count + 1;
8647   l_transaction_table(l_count).param_name :=upper('p_rehire_recommendation');
8648   l_transaction_table(l_count).param_value := p_rehire_recommendation;
8649   l_transaction_table(l_count).param_data_type := upper('varchar2');
8650   --
8651   --
8652   l_count := l_count + 1;
8653   l_transaction_table(l_count).param_name :=upper('p_rehire_reason');
8654   l_transaction_table(l_count).param_value := p_rehire_reason;
8655   l_transaction_table(l_count).param_data_type := upper('varchar2');
8656   --
8657   --
8658   l_count := l_count + 1;
8659   l_transaction_table(l_count).param_name :=upper('p_resume_exists');
8660   l_transaction_table(l_count).param_value := p_resume_exists;
8661   l_transaction_table(l_count).param_data_type := upper('varchar2');
8662   --
8663   --
8664   l_count := l_count + 1;
8665   l_transaction_table(l_count).param_name :=upper('p_resume_last_updated');
8666   l_transaction_table(l_count).param_value := to_char(p_resume_last_updated , hr_transaction_ss.g_date_format);
8667   l_transaction_table(l_count).param_data_type := upper('date');
8668   --
8669   --
8670   l_count := l_count + 1;
8671   l_transaction_table(l_count).param_name :=upper('p_second_passport_exists');
8672   l_transaction_table(l_count).param_value := p_second_passport_exists;
8673   l_transaction_table(l_count).param_data_type := upper('varchar2');
8674   --
8675   --
8676   l_count := l_count + 1;
8677   l_transaction_table(l_count).param_name :=upper('p_student_status');
8678   l_transaction_table(l_count).param_value := p_student_status;
8679   l_transaction_table(l_count).param_data_type := upper('varchar2');
8680   --
8681   --
8682   l_count := l_count + 1;
8683   l_transaction_table(l_count).param_name :=upper('p_town_of_birth');
8684   l_transaction_table(l_count).param_value := p_town_of_birth;
8685   l_transaction_table(l_count).param_data_type := upper('varchar2');
8686   --
8687   --
8688   l_count := l_count + 1;
8689   l_transaction_table(l_count).param_name :=upper('p_uses_tobacco_flag');
8690   l_transaction_table(l_count).param_value := p_uses_tobacco_flag;
8691   l_transaction_table(l_count).param_data_type := upper('varchar2');
8692   --
8693   --
8694   l_count := l_count + 1;
8695   l_transaction_table(l_count).param_name :=upper('p_vendor_id');
8696   l_transaction_table(l_count).param_value := p_vendor_id;
8697   l_transaction_table(l_count).param_data_type := upper('number');
8698   --
8699   --
8700   l_count := l_count + 1;
8701   l_transaction_table(l_count).param_name :=upper('p_work_schedule');
8702   l_transaction_table(l_count).param_value := p_work_schedule;
8703   l_transaction_table(l_count).param_data_type := upper('varchar2');
8704   --
8705   -- These are the parameters which are there in the update_contact.
8706   -- We need to populate null values so that we can have generic get
8707   -- function which works for create_contact and update_contact.
8708   --
8709   l_count := l_count + 1;
8710   l_transaction_table(l_count).param_name :=upper('p_cont_effective_date');
8711   l_transaction_table(l_count).param_value := null;
8712   l_transaction_table(l_count).param_data_type := upper('date');
8713   --
8714   l_transaction_table(l_count).param_name :=upper('p_cont_object_version_number');
8715   l_transaction_table(l_count).param_value := null;
8716   l_transaction_table(l_count).param_data_type := upper('number');
8717   --
8718   l_count := l_count + 1;
8719   l_transaction_table(l_count).param_name :=upper('p_per_effective_date');
8720   l_transaction_table(l_count).param_value := null;
8721   l_transaction_table(l_count).param_data_type := upper('date');
8722   --
8723   --
8724   l_count := l_count + 1;
8725   l_transaction_table(l_count).param_name :=upper('p_cont_person_id');
8726   l_transaction_table(l_count).param_value := p_contact_person_id;
8727   l_transaction_table(l_count).param_data_type := upper('number');
8728   --
8729   --
8730   l_count := l_count + 1;
8731   l_transaction_table(l_count).param_name :=upper('P_CONT_INFORMATION_CATEGORY');
8732   l_transaction_table(l_count).param_value := P_CONT_INFORMATION_CATEGORY;
8733   l_transaction_table(l_count).param_data_type := upper('varchar2');
8734 
8735   --
8736   --
8737 
8738   l_count := l_count + 1;
8739   l_transaction_table(l_count).param_name :=upper('P_CONT_INFORMATION1');
8740   l_transaction_table(l_count).param_value := P_CONT_INFORMATION1;
8741   l_transaction_table(l_count).param_data_type := upper('varchar2');
8742 
8743   --
8744   --
8745 
8746   l_count := l_count + 1;
8747   l_transaction_table(l_count).param_name :=upper('P_CONT_INFORMATION2');
8748   l_transaction_table(l_count).param_value := P_CONT_INFORMATION2;
8749   l_transaction_table(l_count).param_data_type := upper('varchar2');
8750 
8751   --
8752   --
8753 
8754   l_count := l_count + 1;
8755   l_transaction_table(l_count).param_name :=upper('P_CONT_INFORMATION3');
8756   l_transaction_table(l_count).param_value := P_CONT_INFORMATION3;
8757   l_transaction_table(l_count).param_data_type := upper('varchar2');
8758 
8759   --
8760   --
8761 
8762   l_count := l_count + 1;
8763   l_transaction_table(l_count).param_name :=upper('P_CONT_INFORMATION4');
8764   l_transaction_table(l_count).param_value := P_CONT_INFORMATION4;
8765   l_transaction_table(l_count).param_data_type := upper('varchar2');
8766 
8767   --
8768   --
8769 
8770   l_count := l_count + 1;
8771   l_transaction_table(l_count).param_name :=upper('P_CONT_INFORMATION5');
8772   l_transaction_table(l_count).param_value := P_CONT_INFORMATION5;
8773   l_transaction_table(l_count).param_data_type := upper('varchar2');
8774 
8775   --
8776   --
8777 
8778   l_count := l_count + 1;
8779   l_transaction_table(l_count).param_name :=upper('P_CONT_INFORMATION6');
8780   l_transaction_table(l_count).param_value := P_CONT_INFORMATION6;
8781   l_transaction_table(l_count).param_data_type := upper('varchar2');
8782 
8783   --
8784   --
8785 
8786   l_count := l_count + 1;
8787   l_transaction_table(l_count).param_name :=upper('P_CONT_INFORMATION7');
8788   l_transaction_table(l_count).param_value := P_CONT_INFORMATION7;
8789   l_transaction_table(l_count).param_data_type := upper('varchar2');
8790 
8791   --
8792   --
8793 
8794   l_count := l_count + 1;
8795   l_transaction_table(l_count).param_name :=upper('P_CONT_INFORMATION8');
8796   l_transaction_table(l_count).param_value := P_CONT_INFORMATION8;
8797   l_transaction_table(l_count).param_data_type := upper('varchar2');
8798 
8799   --
8800   --
8801 
8802   l_count := l_count + 1;
8803   l_transaction_table(l_count).param_name :=upper('P_CONT_INFORMATION9');
8804   l_transaction_table(l_count).param_value := P_CONT_INFORMATION9;
8805   l_transaction_table(l_count).param_data_type := upper('varchar2');
8806 
8807   --
8808   --
8809 
8810   l_count := l_count + 1;
8811   l_transaction_table(l_count).param_name :=upper('P_CONT_INFORMATION10');
8812   l_transaction_table(l_count).param_value := P_CONT_INFORMATION10;
8813   l_transaction_table(l_count).param_data_type := upper('varchar2');
8814 
8815   --
8816   --
8817 
8818   l_count := l_count + 1;
8819   l_transaction_table(l_count).param_name :=upper('P_CONT_INFORMATION11');
8820   l_transaction_table(l_count).param_value := P_CONT_INFORMATION11;
8821   l_transaction_table(l_count).param_data_type := upper('varchar2');
8822 
8823   --
8824   --
8825 
8826   l_count := l_count + 1;
8827   l_transaction_table(l_count).param_name :=upper('P_CONT_INFORMATION12');
8828   l_transaction_table(l_count).param_value := P_CONT_INFORMATION12;
8829   l_transaction_table(l_count).param_data_type := upper('varchar2');
8830 
8831   --
8832   --
8833 
8834   l_count := l_count + 1;
8835   l_transaction_table(l_count).param_name :=upper('P_CONT_INFORMATION13');
8836   l_transaction_table(l_count).param_value := P_CONT_INFORMATION13;
8837   l_transaction_table(l_count).param_data_type := upper('varchar2');
8838 
8839   --
8840   --
8841 
8842   l_count := l_count + 1;
8843   l_transaction_table(l_count).param_name :=upper('P_CONT_INFORMATION14');
8844   l_transaction_table(l_count).param_value := P_CONT_INFORMATION14;
8845   l_transaction_table(l_count).param_data_type := upper('varchar2');
8846 
8847   --
8848   --
8849 
8850   l_count := l_count + 1;
8851   l_transaction_table(l_count).param_name :=upper('P_CONT_INFORMATION15');
8852   l_transaction_table(l_count).param_value := P_CONT_INFORMATION15;
8853   l_transaction_table(l_count).param_data_type := upper('varchar2');
8854 
8855   --
8856   --
8857 
8858   l_count := l_count + 1;
8859   l_transaction_table(l_count).param_name :=upper('P_CONT_INFORMATION16');
8860   l_transaction_table(l_count).param_value := P_CONT_INFORMATION16;
8861   l_transaction_table(l_count).param_data_type := upper('varchar2');
8862 
8863   --
8864   --
8865 
8866   l_count := l_count + 1;
8867   l_transaction_table(l_count).param_name :=upper('P_CONT_INFORMATION17');
8868   l_transaction_table(l_count).param_value := P_CONT_INFORMATION17;
8869   l_transaction_table(l_count).param_data_type := upper('varchar2');
8870 
8871   --
8872   --
8873 
8874   l_count := l_count + 1;
8875   l_transaction_table(l_count).param_name :=upper('P_CONT_INFORMATION18');
8876   l_transaction_table(l_count).param_value := P_CONT_INFORMATION18;
8877   l_transaction_table(l_count).param_data_type := upper('varchar2');
8878 
8879   --
8880   --
8881 
8882   l_count := l_count + 1;
8883   l_transaction_table(l_count).param_name :=upper('P_CONT_INFORMATION19');
8884   l_transaction_table(l_count).param_value := P_CONT_INFORMATION19;
8885   l_transaction_table(l_count).param_data_type := upper('varchar2');
8886 
8887   --
8888   --
8889 
8890   l_count := l_count + 1;
8891   l_transaction_table(l_count).param_name :=upper('P_CONT_INFORMATION20');
8892   l_transaction_table(l_count).param_value := P_CONT_INFORMATION20;
8893   l_transaction_table(l_count).param_data_type := upper('varchar2');
8894 
8895   --
8896   --
8897 
8898   l_count := l_count + 1;
8899   l_transaction_table(l_count).param_name :=upper('P_MIRROR_CONT_INFORMATION_CAT');
8900   l_transaction_table(l_count).param_value := P_MIRROR_CONT_INFORMATION_CAT;
8901   l_transaction_table(l_count).param_data_type := upper('varchar2');
8902 
8903   --
8904   --
8905 
8906   l_count := l_count + 1;
8907   l_transaction_table(l_count).param_name :=upper('P_MIRROR_CONT_INFORMATION1');
8908   l_transaction_table(l_count).param_value := P_CONT_INFORMATION1;
8909   l_transaction_table(l_count).param_data_type := upper('varchar2');
8910 
8911   --
8912   --
8913 
8914   l_count := l_count + 1;
8915   l_transaction_table(l_count).param_name :=upper('P_MIRROR_CONT_INFORMATION2');
8916   l_transaction_table(l_count).param_value := P_MIRROR_CONT_INFORMATION2;
8917   l_transaction_table(l_count).param_data_type := upper('varchar2');
8918 
8919   --
8920   --
8921 
8922   l_count := l_count + 1;
8923   l_transaction_table(l_count).param_name :=upper('P_MIRROR_CONT_INFORMATION3');
8924   l_transaction_table(l_count).param_value := P_MIRROR_CONT_INFORMATION3;
8925   l_transaction_table(l_count).param_data_type := upper('varchar2');
8926 
8927   --
8928   --
8929 
8930   l_count := l_count + 1;
8931   l_transaction_table(l_count).param_name :=upper('P_MIRROR_CONT_INFORMATION4');
8932   l_transaction_table(l_count).param_value := P_MIRROR_CONT_INFORMATION4;
8933   l_transaction_table(l_count).param_data_type := upper('varchar2');
8934 
8935   --
8936   --
8937 
8938   l_count := l_count + 1;
8939   l_transaction_table(l_count).param_name :=upper('P_MIRROR_CONT_INFORMATION5');
8940   l_transaction_table(l_count).param_value := P_MIRROR_CONT_INFORMATION5;
8941   l_transaction_table(l_count).param_data_type := upper('varchar2');
8942 
8943   --
8944   --
8945 
8946   l_count := l_count + 1;
8947   l_transaction_table(l_count).param_name :=upper('P_MIRROR_CONT_INFORMATION6');
8948   l_transaction_table(l_count).param_value := P_MIRROR_CONT_INFORMATION6;
8949   l_transaction_table(l_count).param_data_type := upper('varchar2');
8950 
8951   --
8952   --
8953 
8954   l_count := l_count + 1;
8955   l_transaction_table(l_count).param_name :=upper('P_MIRROR_CONT_INFORMATION7');
8956   l_transaction_table(l_count).param_value := P_MIRROR_CONT_INFORMATION7;
8957   l_transaction_table(l_count).param_data_type := upper('varchar2');
8958 
8959   --
8960   --
8961 
8962   l_count := l_count + 1;
8963   l_transaction_table(l_count).param_name :=upper('P_MIRROR_CONT_INFORMATION8');
8964   l_transaction_table(l_count).param_value := P_MIRROR_CONT_INFORMATION8;
8965   l_transaction_table(l_count).param_data_type := upper('varchar2');
8966 
8967   --
8968   --
8969 
8970   l_count := l_count + 1;
8971   l_transaction_table(l_count).param_name :=upper('P_MIRROR_CONT_INFORMATION9');
8972   l_transaction_table(l_count).param_value := P_MIRROR_CONT_INFORMATION9;
8973   l_transaction_table(l_count).param_data_type := upper('varchar2');
8974 
8975   --
8976   --
8977 
8978   l_count := l_count + 1;
8979   l_transaction_table(l_count).param_name :=upper('P_MIRROR_CONT_INFORMATION10');
8980   l_transaction_table(l_count).param_value := P_MIRROR_CONT_INFORMATION10;
8981   l_transaction_table(l_count).param_data_type := upper('varchar2');
8982 
8983   --
8984   --
8985 
8986   l_count := l_count + 1;
8987   l_transaction_table(l_count).param_name :=upper('P_MIRROR_CONT_INFORMATION11');
8988   l_transaction_table(l_count).param_value := P_MIRROR_CONT_INFORMATION11;
8989   l_transaction_table(l_count).param_data_type := upper('varchar2');
8990 
8991   --
8992   --
8993 
8994   l_count := l_count + 1;
8995   l_transaction_table(l_count).param_name :=upper('P_MIRROR_CONT_INFORMATION12');
8996   l_transaction_table(l_count).param_value := P_MIRROR_CONT_INFORMATION12;
8997   l_transaction_table(l_count).param_data_type := upper('varchar2');
8998 
8999   --
9000   --
9001 
9002   l_count := l_count + 1;
9003   l_transaction_table(l_count).param_name :=upper('P_MIRROR_CONT_INFORMATION13');
9004   l_transaction_table(l_count).param_value := P_MIRROR_CONT_INFORMATION13;
9005   l_transaction_table(l_count).param_data_type := upper('varchar2');
9006 
9007   --
9008   --
9009 
9010   l_count := l_count + 1;
9011   l_transaction_table(l_count).param_name :=upper('P_MIRROR_CONT_INFORMATION14');
9012   l_transaction_table(l_count).param_value := P_MIRROR_CONT_INFORMATION14;
9013   l_transaction_table(l_count).param_data_type := upper('varchar2');
9014 
9015   --
9016   --
9017 
9018   l_count := l_count + 1;
9019   l_transaction_table(l_count).param_name :=upper('P_MIRROR_CONT_INFORMATION15');
9020   l_transaction_table(l_count).param_value := P_MIRROR_CONT_INFORMATION15;
9021   l_transaction_table(l_count).param_data_type := upper('varchar2');
9022 
9023   --
9024   --
9025 
9026   l_count := l_count + 1;
9027   l_transaction_table(l_count).param_name :=upper('P_MIRROR_CONT_INFORMATION16');
9028   l_transaction_table(l_count).param_value := P_MIRROR_CONT_INFORMATION16;
9029   l_transaction_table(l_count).param_data_type := upper('varchar2');
9030 
9031   --
9032   --
9033 
9034   l_count := l_count + 1;
9035   l_transaction_table(l_count).param_name :=upper('P_MIRROR_CONT_INFORMATION17');
9036   l_transaction_table(l_count).param_value := P_MIRROR_CONT_INFORMATION17;
9037   l_transaction_table(l_count).param_data_type := upper('varchar2');
9038 
9039   --
9040   --
9041 
9042   l_count := l_count + 1;
9043   l_transaction_table(l_count).param_name :=upper('P_MIRROR_CONT_INFORMATION18');
9044   l_transaction_table(l_count).param_value := P_MIRROR_CONT_INFORMATION18;
9045   l_transaction_table(l_count).param_data_type := upper('varchar2');
9046 
9047   --
9048   --
9049 
9050   l_count := l_count + 1;
9051   l_transaction_table(l_count).param_name :=upper('P_MIRROR_CONT_INFORMATION19');
9052   l_transaction_table(l_count).param_value := P_MIRROR_CONT_INFORMATION19;
9053   l_transaction_table(l_count).param_data_type := upper('varchar2');
9054 
9055   --
9056   --
9057 
9058   l_count := l_count + 1;
9059   l_transaction_table(l_count).param_name :=upper('P_MIRROR_CONT_INFORMATION20');
9060   l_transaction_table(l_count).param_value := P_MIRROR_CONT_INFORMATION20;
9061   l_transaction_table(l_count).param_data_type := upper('varchar2');
9062 
9063   --StartRegistration
9064   --  This is a marker for the contact person to be used to identify the Address
9065   --  to be retrieved for the contact person in context in review page.
9066   --  The HR_LAST_CONTACT_SET is in from the work flow attribute
9067   begin
9068        l_contact_set := wf_engine.GetItemAttrNumber(itemtype => p_item_type,
9069                                                     itemkey  => p_item_key,
9070                                                     aname    => 'HR_CONTACT_SET');
9071 
9072        exception when others then
9073             hr_utility.set_location('Exception:'||l_proc,560);
9074             l_contact_set := 0;
9075 
9076   end;
9077 
9078   l_count := l_count + 1;
9079   l_transaction_table(l_count).param_name := 'P_CONTACT_SET';
9080   l_transaction_table(l_count).param_value := l_contact_set;
9081   l_transaction_table(l_count).param_data_type := 'VARCHAR2';
9082   --EndRegistration
9083   hr_utility.set_location('Before Calling :hr_transaction_ss.save_transaction_step', 90);
9084   --
9085   hr_transaction_ss.save_transaction_step
9086                 (p_item_type            => p_item_type
9087                 ,p_item_key             => p_item_key
9088                 ,p_login_person_id      => nvl(p_login_person_id, p_person_id) -- Registration
9089                 -- ,p_login_person_id      =>  p_person_id
9090                 ,p_actid                => p_activity_id
9091                 ,p_transaction_step_id  => l_transaction_step_id
9092                 ,p_api_name             => g_package || '.PROCESS_CREATE_CONTACT_API'
9093                 ,p_transaction_data     => l_transaction_table);
9094   --
9095 --  hr_utility.set_location('Leaving hr_contact_rel_api.create_contact_tt', 100);
9096 
9097   hr_utility.set_location('Exiting:'||l_proc,100);
9098   --
9099   -- 9999 What full_name code is doing? Do we need to add?
9100   -- 9999 Any warnings do we need to pass back to java code?
9101   -- 9999 Reset the object version number.
9102   --
9103   EXCEPTION
9104     WHEN hr_utility.hr_error THEN
9105          -- -------------------------------------------
9106          -- an application error has been raised so we must
9107          -- redisplay the web form to display the error
9108          -- --------------------------------------------
9109          hr_utility.set_location('Exception:'||l_proc,565);
9110          hr_message.provide_error;
9111          l_message_number := hr_message.last_message_number;
9112          --
9113          -- 99999 What error messages I have to trap here.
9114          --
9115          IF l_message_number = 'APP-7165' OR
9116             l_message_number = 'APP-7155' THEN
9117             hr_utility.set_message(800, 'HR_UPDATE_NOT_ALLOWED');
9118             hr_utility.raise_error;
9119          ELSE
9120             hr_utility.raise_error;
9121          END IF;
9122     WHEN OTHERS THEN
9123       hr_utility.set_location('Exception:'||l_proc,570);
9124       fnd_message.set_name('PER', SQLERRM ||' '||to_char(SQLCODE));
9125       hr_utility.raise_error;
9126       --RAISE;  -- Raise error here relevant to the new tech stack.
9127  --
9128  END create_contact_tt;
9129 --
9130 
9131 Function is_con_rec_changed (
9132   p_adjusted_svc_date            in      date     default hr_api.g_date
9133   ,p_applicant_number             in      varchar2 default hr_api.g_varchar2
9134   ,p_background_check_status      in      varchar2 default hr_api.g_varchar2
9135   ,p_background_date_check        in      date     default hr_api.g_date
9136   ,p_benefit_group_id             in      number   default hr_api.g_number
9137   ,p_blood_type                   in      varchar2 default hr_api.g_varchar2
9138   ,p_coord_ben_med_pln_no         in      varchar2 default hr_api.g_varchar2
9139   ,p_coord_ben_no_cvg_flag        in      varchar2 default hr_api.g_varchar2
9140   ,p_country_of_birth             in      varchar2 default hr_api.g_varchar2
9141   ,p_date_employee_data_verified  in      date     default hr_api.g_date
9142   ,p_date_of_death                in      date     default hr_api.g_date
9143   ,p_dpdnt_adoption_date          in      date     default hr_api.g_date
9144   ,p_dpdnt_vlntry_svce_flag       in      varchar2 default hr_api.g_varchar2
9145   ,p_expense_check_send_to_addres in      varchar2 default hr_api.g_varchar2
9146   ,p_fast_path_employee           in      varchar2 default hr_api.g_varchar2
9147   ,p_fte_capacity                 in      number   default hr_api.g_number
9148   ,p_global_person_id             in      varchar2 default hr_api.g_varchar2
9149   ,p_hold_applicant_date_until    in      date     default hr_api.g_date
9150   ,p_internal_location            in      varchar2 default hr_api.g_varchar2
9151   ,p_last_medical_test_by         in      varchar2 default hr_api.g_varchar2
9152   ,p_last_medical_test_date       in      date     default hr_api.g_date
9153   ,p_mailstop                     in      varchar2 default hr_api.g_varchar2
9154   ,p_office_number                in      varchar2 default hr_api.g_varchar2
9155   ,p_on_military_service          in      varchar2 default hr_api.g_varchar2
9156   ,p_original_date_of_hire        in      date     default hr_api.g_date
9157   ,p_projected_start_date         in      date     default hr_api.g_date
9158   ,p_receipt_of_death_cert_date   in      date     default hr_api.g_date
9159   ,p_region_of_birth              in      varchar2 default hr_api.g_varchar2
9160   ,p_rehire_authorizor            in      varchar2 default hr_api.g_varchar2
9161   ,p_rehire_recommendation        in      varchar2 default hr_api.g_varchar2
9162   ,p_rehire_reason                in      varchar2 default hr_api.g_varchar2
9163   ,p_resume_exists                in      varchar2 default hr_api.g_varchar2
9164   ,p_resume_last_updated          in      date     default hr_api.g_date
9165   ,p_second_passport_exists       in      varchar2 default hr_api.g_varchar2
9166   ,p_student_status               in      varchar2 default hr_api.g_varchar2
9167   ,p_town_of_birth                in      varchar2 default hr_api.g_varchar2
9168   ,p_uses_tobacco_flag            in      varchar2 default hr_api.g_varchar2
9169   ,p_vendor_id                    in      number   default hr_api.g_number
9170   ,p_work_schedule                in      varchar2 default hr_api.g_varchar2  )
9171   return boolean is
9172   --
9173   l_rec_changed                    boolean default FALSE;
9174   l_proc   varchar2(72)  := g_package||'is_con_rec_changed';
9175 
9176 BEGIN
9177    --
9178    hr_utility.set_location('Entering:'||l_proc, 5);
9179    IF p_adjusted_svc_date <> hr_api.g_date
9180    THEN
9181             l_rec_changed := TRUE;
9182             goto finish;
9183    END IF;
9184    --
9185    --
9186    IF p_applicant_number <> hr_api.g_varchar2
9187    THEN
9188             l_rec_changed := TRUE;
9189             goto finish;
9190    END IF;
9191    --
9192    --
9193    IF p_background_check_status <> hr_api.g_varchar2
9194    THEN
9195             l_rec_changed := TRUE;
9196             goto finish;
9197    END IF;
9198    --
9199    --
9200    IF p_background_date_check <> hr_api.g_date
9201    THEN
9202             l_rec_changed := TRUE;
9203             goto finish;
9204    END IF;
9205    --
9206    --
9207    IF p_benefit_group_id <> hr_api.g_number
9208    THEN
9209             l_rec_changed := TRUE;
9210             goto finish;
9211    END IF;
9212    --
9213    --
9214    IF p_blood_type <> hr_api.g_varchar2
9215    THEN
9216             l_rec_changed := TRUE;
9217             goto finish;
9218    END IF;
9219    --
9220    --
9221    IF p_coord_ben_med_pln_no <> hr_api.g_varchar2
9222    THEN
9223             l_rec_changed := TRUE;
9224             goto finish;
9225    END IF;
9226    --
9227    --
9228    IF p_coord_ben_no_cvg_flag <> hr_api.g_varchar2
9229    THEN
9230             l_rec_changed := TRUE;
9231             goto finish;
9232    END IF;
9233    --
9234    --
9235    IF p_country_of_birth <> hr_api.g_varchar2
9236    THEN
9237             l_rec_changed := TRUE;
9238             goto finish;
9239    END IF;
9240    --
9241    --
9242    IF p_date_employee_data_verified <> hr_api.g_date
9243    THEN
9244             l_rec_changed := TRUE;
9245             goto finish;
9246    END IF;
9247    --
9248    --
9249    IF p_date_of_death <> hr_api.g_date
9250    THEN
9251             l_rec_changed := TRUE;
9252             goto finish;
9253    END IF;
9254    --
9255    --
9256    IF p_dpdnt_adoption_date <> hr_api.g_date
9257    THEN
9258             l_rec_changed := TRUE;
9259             goto finish;
9260    END IF;
9261    --
9262    --
9263    IF p_dpdnt_vlntry_svce_flag <> hr_api.g_varchar2
9264    THEN
9265             l_rec_changed := TRUE;
9266             goto finish;
9267    END IF;
9268    --
9269    --
9270    IF p_expense_check_send_to_addres <> hr_api.g_varchar2
9271    THEN
9272             l_rec_changed := TRUE;
9273             goto finish;
9274    END IF;
9275    --
9276    --
9277    IF p_fast_path_employee <> hr_api.g_varchar2
9278    THEN
9279             l_rec_changed := TRUE;
9280             goto finish;
9281    END IF;
9282    --
9283    --
9284    IF p_fte_capacity <> hr_api.g_number
9285    THEN
9286             l_rec_changed := TRUE;
9287             goto finish;
9288    END IF;
9289    --
9290    --
9291    IF p_global_person_id <> hr_api.g_varchar2
9292    THEN
9293             l_rec_changed := TRUE;
9294             goto finish;
9295    END IF;
9296    --
9297    --
9298    IF p_hold_applicant_date_until <> hr_api.g_date
9299    THEN
9300             l_rec_changed := TRUE;
9301             goto finish;
9302    END IF;
9303    --
9304    --
9305    IF p_internal_location <> hr_api.g_varchar2
9306    THEN
9307             l_rec_changed := TRUE;
9308             goto finish;
9309    END IF;
9310    --
9311    --
9312    IF p_last_medical_test_by <> hr_api.g_varchar2
9313    THEN
9314             l_rec_changed := TRUE;
9315             goto finish;
9316    END IF;
9317    --
9318    --
9319    IF p_last_medical_test_date <> hr_api.g_date
9320    THEN
9321             l_rec_changed := TRUE;
9322             goto finish;
9323    END IF;
9324    --
9325    --
9326    IF p_mailstop <> hr_api.g_varchar2
9327    THEN
9328             l_rec_changed := TRUE;
9329             goto finish;
9330    END IF;
9331    --
9332    --
9333    IF p_office_number <> hr_api.g_varchar2
9334    THEN
9335             l_rec_changed := TRUE;
9336             goto finish;
9337    END IF;
9338    --
9339    --
9340    IF p_on_military_service <> hr_api.g_varchar2
9341    THEN
9342             l_rec_changed := TRUE;
9343             goto finish;
9344    END IF;
9345    --
9346    --
9347    IF p_original_date_of_hire <> hr_api.g_date
9348    THEN
9349             l_rec_changed := TRUE;
9350             goto finish;
9351    END IF;
9352    --
9353    --
9354    IF p_projected_start_date <> hr_api.g_date
9355    THEN
9356             l_rec_changed := TRUE;
9357             goto finish;
9358    END IF;
9359    --
9360    --
9361    IF p_receipt_of_death_cert_date <> hr_api.g_date
9362    THEN
9363             l_rec_changed := TRUE;
9364             goto finish;
9365    END IF;
9366    --
9367    --
9368    IF p_region_of_birth <> hr_api.g_varchar2
9369    THEN
9370             l_rec_changed := TRUE;
9371             goto finish;
9372    END IF;
9373    --
9374    --
9375    IF p_rehire_authorizor <> hr_api.g_varchar2
9376    THEN
9377             l_rec_changed := TRUE;
9378             goto finish;
9379    END IF;
9380    --
9381    --
9382    IF p_rehire_recommendation <> hr_api.g_varchar2
9383    THEN
9384             l_rec_changed := TRUE;
9385             goto finish;
9386    END IF;
9387    --
9388    --
9389    IF p_rehire_reason <> hr_api.g_varchar2
9390    THEN
9391             l_rec_changed := TRUE;
9392             goto finish;
9393    END IF;
9394    --
9395    --
9396    IF p_resume_exists <> hr_api.g_varchar2
9397    THEN
9398             l_rec_changed := TRUE;
9399             goto finish;
9400    END IF;
9401    --
9402    --
9403    IF p_resume_last_updated <> hr_api.g_date
9404    THEN
9405             l_rec_changed := TRUE;
9406             goto finish;
9407    END IF;
9408    --
9409    --
9410    IF p_second_passport_exists <> hr_api.g_varchar2
9411    THEN
9412             l_rec_changed := TRUE;
9413             goto finish;
9414    END IF;
9415    --
9416    --
9417    IF p_student_status <> hr_api.g_varchar2
9418    THEN
9419             l_rec_changed := TRUE;
9420             goto finish;
9421    END IF;
9422    --
9423    --
9424    IF p_town_of_birth <> hr_api.g_varchar2
9425    THEN
9426             l_rec_changed := TRUE;
9427             goto finish;
9428    END IF;
9429    --
9430    --
9431    IF p_uses_tobacco_flag <> hr_api.g_varchar2
9432    THEN
9433             l_rec_changed := TRUE;
9434             goto finish;
9435    END IF;
9436    --
9437    --
9438    IF p_vendor_id <> hr_api.g_number
9439    THEN
9440             l_rec_changed := TRUE;
9441             goto finish;
9442    END IF;
9443    --
9444    --
9445    IF p_work_schedule <> hr_api.g_varchar2
9446    THEN
9447             l_rec_changed := TRUE;
9448             goto finish;
9449    END IF;
9450    --
9451    hr_utility.set_location('Exiting:'||l_proc, 10);
9452     <<finish>>
9453     return l_rec_changed ;
9454 EXCEPTION
9455   When g_data_error THEN
9456   hr_utility.set_location('Exception g_data_error:'||l_proc,555);
9457        raise;
9458 
9459   When others THEN
9460        hr_utility.set_location('Exception others:'||l_proc,555);
9461       fnd_message.set_name('PER', SQLERRM ||' '||to_char(SQLCODE));
9462       hr_utility.raise_error;
9463        --raise;
9464 
9465 END is_con_rec_changed;
9466 --
9467 -- ---------------------------------------------------------------------------
9468 -- ----------------------------- < process_create_contact_api > --------------
9469 -- ---------------------------------------------------------------------------
9470 -- Purpose: This procedure will be invoked in workflow notification
9471 --          when an approver approves all the changes.  This procedure
9472 --          will call the api to update to the database with p_validate
9473 --          equal to false.
9474 -- ---------------------------------------------------------------------------
9475 PROCEDURE process_create_contact_api
9476           (p_validate IN BOOLEAN DEFAULT FALSE
9477           ,p_transaction_step_id IN NUMBER
9478           ,p_effective_date      in varchar2 default null
9479 )
9480 IS
9481 --
9482   l_person_id                        per_all_people_f.person_id%type
9483                                      default null;
9484   l_full_name                        per_all_people_f.full_name%type;
9485   l_per_comment_id                   per_all_people_f.comment_id%type;
9486   l_con_name_combination_warning boolean;
9487   l_per_name_combination_warning boolean;
9488   l_con_orig_hire_warning        boolean;
9489   l_per_orig_hire_warning        boolean;
9490   l_con_assign_payroll_warning   boolean;
9491   l_per_assign_payroll_warning   boolean;
9492 
9493   l_ovn                              number default null;
9494   l_per_person_id                    per_all_people_f.person_id%type
9495                                      default null;
9496   l_contact_relationship_id          number default null;
9497   l_ctr_object_version_number        number default null;
9498   l_per_object_version_number        number default null;
9499   l_per_effective_start_date         date default null;
9500   l_per_effective_end_date           date default null;
9501   l_con_rec_changed                  VARCHAR2(100) default null;
9502   l_effective_date                   date default null ;
9503   l_employee_number	             per_all_people_f.employee_number%type default null ;
9504   -- Bug 1919795
9505   l_contact_type                     varchar2(100);
9506   l_MIRROR_TYPE                      varchar2(100);
9507   l_CREATE_MIRROR_FLAG               varchar2(100);
9508   --
9509   l_contact_operation                varchar2(100);
9510   l_dpdnt_bnf_flag                   varchar2(100);
9511   l_emrg_cont_flag                   varchar2(100);
9512   l_dpdnt_bnf_contact_type           varchar2(100);
9513   l_dpdnt_bnf_personal_flag          varchar2(100);
9514   l_personal_flag                    varchar2(100);
9515   l_primary_contact_flag             varchar2(100);
9516   --
9517   l_full_name1                       per_all_people_f.full_name%type;
9518   l_per_comment_id1                  per_all_people_f.comment_id%type;
9519   l_con_name_combination_warnin1    boolean;
9520   l_con_orig_hire_warning1           boolean;
9521   l_per_person_id1                   per_all_people_f.person_id%type
9522                                      default null;
9523   l_contact_relationship_id1         number default null;
9524   l_ctr_object_version_number1       number default null;
9525   l_per_object_version_number1       number default null;
9526   l_per_effective_start_date1        date default null;
9527   l_per_effective_end_date1          date default null;
9528   -- bug# 2115552
9529   -- Using this value for  P_PRIMARY_CONTACT_FLAG for addl relationship
9530   l_addl_primary_contact_flag        varchar2(100);
9531   l_proc   varchar2(72)  := g_package||'process_create_contact_api';
9532   --
9533 BEGIN
9534   hr_utility.set_location('Entering:'||l_proc, 5);
9535   --
9536   --
9537   SAVEPOINT process_create_contact_api;
9538 
9539   --
9540   -- Get the person_id first.  If it is null, that means we'll create a new
9541   -- contact.  If it is not null, error out.
9542 
9543   l_person_id := hr_transaction_api.get_number_value
9544                                 (p_transaction_step_id => p_transaction_step_id
9545                                 ,p_name => 'P_PERSON_ID');
9546   --
9547   -- StartRegistration
9548   --
9549   if l_person_id is null or l_person_id < 0 then
9550   hr_utility.set_location('l_person_id is null or l_person_id < 0:'||l_proc,10 );
9551      --
9552       --
9553       -- l_person_id := hr_process_person_ss.g_person_id;
9554       -- Adding the session id check to avoid connection pooling problems.
9555         if (( hr_process_person_ss.g_person_id is not null) and
9556                 (hr_process_person_ss.g_session_id= ICX_SEC.G_SESSION_ID)) then
9557             l_person_id := hr_process_person_ss.g_person_id;
9558         end if;
9559 
9560      --
9561   end if;
9562   --
9563   -- EndRegistration
9564   --
9565   begin
9566     l_con_rec_changed := hr_transaction_api.get_VARCHAR2_value
9567                                 (p_transaction_step_id => p_transaction_step_id
9568                                 ,p_name                => 'P_CONT_REC_CHANGED') ;
9569   exception when others then
9570     hr_utility.set_location('Exception Others:'||l_proc,555);
9571     l_con_rec_changed := 'NOTCHANGED';
9572   end;
9573   --
9574   l_effective_date  := hr_transaction_api.get_DATE_value
9575                                 (p_transaction_step_id => p_transaction_step_id
9576                                 ,p_name                => 'P_START_DATE') ;
9577   --
9578   -- SFL changes.
9579   --
9580   if (p_effective_date is not null) then
9581   hr_utility.set_location('p_effective_date is not null:'||l_proc,15 );
9582     l_effective_date:= to_date(p_effective_date,g_date_format);
9583     --
9584   else
9585        --
9586        l_effective_date:= to_date(
9587         hr_transaction_ss.get_wf_effective_date
9588         (p_transaction_step_id => p_transaction_step_id),g_date_format);
9589        --
9590   end if;
9591   --
9592   -- For normal commit the effective date should come from txn tbales.
9593   --
9594   if not p_validate then
9595      --
9596      hr_utility.set_location('if not p_validate then:'||l_proc,20 );
9597      l_effective_date := hr_transaction_api.get_DATE_value
9598            (p_transaction_step_id => p_transaction_step_id
9599            ,p_name                => 'P_START_DATE');
9600      --
9601   end if;
9602   --
9603   --
9604   -- Bug 1919795 : create mirror relationship for contact types of
9605   --               P,C,S.
9606   --
9607   l_contact_type :=   hr_transaction_api.get_VARCHAR2_value
9608            (p_transaction_step_id => p_transaction_step_id
9609            ,p_name                => 'P_CONTACT_TYPE');
9610   --
9611   l_MIRROR_TYPE := hr_transaction_api.get_VARCHAR2_value
9612            (p_transaction_step_id => p_transaction_step_id
9613            ,p_name                => 'P_MIRROR_TYPE');
9614   --
9615   l_CREATE_MIRROR_FLAG := hr_transaction_api.get_VARCHAR2_value
9616            (p_transaction_step_id => p_transaction_step_id
9617            ,p_name                => 'P_MIRROR_TYPE');
9618   --
9619   if l_contact_type in ('P', 'C', 'S') then
9620       --
9621       l_CREATE_MIRROR_FLAG := 'Y';
9622       --
9623       if l_contact_type = 'P' then
9624          l_MIRROR_TYPE := 'C';
9625       elsif l_contact_type = 'C' then
9626          l_MIRROR_TYPE := 'P';
9627       elsif l_contact_type = 'S' then
9628          l_MIRROR_TYPE := 'S';
9629       end if;
9630       --
9631   end if;
9632   --
9633   --
9634   l_contact_operation :=   hr_transaction_api.get_VARCHAR2_value
9635            (p_transaction_step_id => p_transaction_step_id
9636            ,p_name                => 'P_CONTACT_OPERATION');
9637   --
9638   l_dpdnt_bnf_flag    :=   hr_transaction_api.get_VARCHAR2_value
9639            (p_transaction_step_id => p_transaction_step_id
9640            ,p_name                => 'P_DPDNT_BNF_FLAG');
9641   --
9642   l_emrg_cont_flag    :=   hr_transaction_api.get_VARCHAR2_value
9643            (p_transaction_step_id => p_transaction_step_id
9644            ,p_name                => 'P_EMRG_CONT_FLAG');
9645   --
9646   l_personal_flag     := hr_transaction_api.get_VARCHAR2_value
9647            (p_transaction_step_id => p_transaction_step_id
9648            ,p_name                => 'P_PERSONAL_FLAG');
9649   --
9650   l_primary_contact_flag :=hr_transaction_api.get_VARCHAR2_value
9651            (p_transaction_step_id => p_transaction_step_id
9652            ,p_name                => 'P_PRIMARY_CONTACT_FLAG');
9653   --
9654 
9655   if l_contact_operation = 'EMER_CR_NEW_CONT' then
9656        hr_utility.set_location('if l_contact_operation is EMER_CR_NEW_CONT:'||l_proc,25 );
9657      --
9658  -- Bug 3152505 : When in Emergency contact, we always will create two relationship.
9659  -- One as "Emergency" and other the selected Relationship.
9660      if /*l_dpdnt_bnf_flag = 'Y' and */l_contact_type <> 'EMRG' then
9661         --
9662         l_dpdnt_bnf_contact_type   := l_contact_type;
9663         l_dpdnt_bnf_personal_flag  := 'Y';
9664         --
9665      end if;
9666      l_contact_type  := 'EMRG';
9667      l_personal_flag := 'N';
9668      l_MIRROR_TYPE := null ;
9669      l_CREATE_MIRROR_FLAG := 'N';
9670      --
9671   end if;
9672   --
9673   -- l_dpdnt_bnf_contact_type and  l_dpdnt_bnf_personal_flag are reused for
9674   -- Creation of Emergency Relation in the Depenendents process also.
9675   -- In this case for the Dependent Creation we need to change the
9676   -- primaryContactFlag to 'N' and what ever primaryContactFlag is passed
9677   -- from the java site, we need to pass it to the Emregency contact
9678   -- Creation.
9679   if l_contact_operation = 'DPDNT_CR_NEW_CONT' then
9680      --
9681      if l_emrg_cont_flag = 'Y' and l_contact_type <> 'EMRG' then
9682         --
9683         l_dpdnt_bnf_contact_type   := 'EMRG';
9684         l_dpdnt_bnf_personal_flag  := 'N';
9685         l_primary_contact_flag := 'N' ; -- This is not used for EMRG
9686         --
9687      end if;
9688      --
9689   end if;
9690   --
9691   IF l_person_id IS NOT NULL
9692   THEN
9693     hr_contact_rel_api.create_contact(
9694       P_VALIDATE  => p_validate
9695       --
9696       ,P_START_DATE  => l_effective_date
9697       --
9698       ,P_BUSINESS_GROUP_ID  =>
9699          hr_transaction_api.get_NUMBER_value
9700            (p_transaction_step_id => p_transaction_step_id
9701            ,p_name                => 'P_BUSINESS_GROUP_ID')
9702       --
9703       ,P_PERSON_ID  =>  l_person_id
9704       /* StartRegistration
9705          hr_transaction_api.get_NUMBER_value
9706            (p_transaction_step_id => p_transaction_step_id
9707            ,p_name                => 'P_PERSON_ID')
9708       EndRegistration */
9709       --
9710       -- 9999 In case of P_CONTACT_PERSON_ID is -1 then
9711       -- pass null value rather than -1
9712       --
9713       ,P_CONTACT_PERSON_ID  =>
9714          hr_transaction_api.get_NUMBER_value
9715            (p_transaction_step_id => p_transaction_step_id
9716            ,p_name                => 'P_CONTACT_PERSON_ID')
9717       --
9718       ,P_CONTACT_TYPE  =>  l_contact_type /*
9719          hr_transaction_api.get_VARCHAR2_value
9720            (p_transaction_step_id => p_transaction_step_id
9721            ,p_name                => 'P_CONTACT_TYPE') */
9722       --
9723       ,P_CTR_COMMENTS  =>
9724          hr_transaction_api.get_VARCHAR2_value
9725            (p_transaction_step_id => p_transaction_step_id
9726            ,p_name                => 'P_CTR_COMMENTS')
9727       --
9728       ,P_PRIMARY_CONTACT_FLAG  => l_primary_contact_flag /*
9729          hr_transaction_api.get_VARCHAR2_value
9730            (p_transaction_step_id => p_transaction_step_id
9731            ,p_name                => 'P_PRIMARY_CONTACT_FLAG')  */
9732       --
9733       ,P_DATE_START  =>
9734          hr_transaction_api.get_DATE_value
9735            (p_transaction_step_id => p_transaction_step_id
9736            ,p_name                => 'P_DATE_START')
9737       --
9738       ,P_START_LIFE_REASON_ID  =>
9739          hr_transaction_api.get_NUMBER_value
9740            (p_transaction_step_id => p_transaction_step_id
9741            ,p_name                => 'P_START_LIFE_REASON_ID')
9742       --
9743       ,P_DATE_END  =>
9744          hr_transaction_api.get_DATE_value
9745            (p_transaction_step_id => p_transaction_step_id
9746            ,p_name                => 'P_DATE_END')
9747       --
9748       ,P_END_LIFE_REASON_ID  =>
9749          hr_transaction_api.get_NUMBER_value
9750            (p_transaction_step_id => p_transaction_step_id
9751            ,p_name                => 'P_END_LIFE_REASON_ID')
9752       --
9753       ,P_RLTD_PER_RSDS_W_DSGNTR_FLAG  =>
9754          hr_transaction_api.get_VARCHAR2_value
9755            (p_transaction_step_id => p_transaction_step_id
9756            ,p_name                => 'P_RLTD_PER_RSDS_W_DSGNTR_FLAG')
9757       --
9758       ,P_PERSONAL_FLAG  =>  l_personal_flag /*
9759          hr_transaction_api.get_VARCHAR2_value
9760            (p_transaction_step_id => p_transaction_step_id
9761            ,p_name                => 'P_PERSONAL_FLAG') */
9762       --
9763       ,P_SEQUENCE_NUMBER  =>
9764          hr_transaction_api.get_NUMBER_value
9765            (p_transaction_step_id => p_transaction_step_id
9766            ,p_name                => 'P_SEQUENCE_NUMBER')
9767       --
9768       ,P_CONT_ATTRIBUTE_CATEGORY  =>
9769          hr_transaction_api.get_VARCHAR2_value
9770            (p_transaction_step_id => p_transaction_step_id
9771            ,p_name                => 'P_CONT_ATTRIBUTE_CATEGORY')
9772       --
9773       ,P_CONT_ATTRIBUTE1  =>
9774          hr_transaction_api.get_VARCHAR2_value
9775            (p_transaction_step_id => p_transaction_step_id
9776            ,p_name                => 'P_CONT_ATTRIBUTE1')
9777       --
9778       ,P_CONT_ATTRIBUTE2  =>
9779          hr_transaction_api.get_VARCHAR2_value
9780            (p_transaction_step_id => p_transaction_step_id
9781            ,p_name                => 'P_CONT_ATTRIBUTE2')
9782       --
9783       ,P_CONT_ATTRIBUTE3  =>
9784          hr_transaction_api.get_VARCHAR2_value
9785            (p_transaction_step_id => p_transaction_step_id
9786            ,p_name                => 'P_CONT_ATTRIBUTE3')
9787       --
9788       ,P_CONT_ATTRIBUTE4  =>
9789          hr_transaction_api.get_VARCHAR2_value
9790            (p_transaction_step_id => p_transaction_step_id
9791            ,p_name                => 'P_CONT_ATTRIBUTE4')
9792       --
9793       ,P_CONT_ATTRIBUTE5  =>
9794          hr_transaction_api.get_VARCHAR2_value
9795            (p_transaction_step_id => p_transaction_step_id
9796            ,p_name                => 'P_CONT_ATTRIBUTE5')
9797       --
9798       ,P_CONT_ATTRIBUTE6  =>
9799          hr_transaction_api.get_VARCHAR2_value
9800            (p_transaction_step_id => p_transaction_step_id
9801            ,p_name                => 'P_CONT_ATTRIBUTE6')
9802       --
9803       ,P_CONT_ATTRIBUTE7  =>
9804          hr_transaction_api.get_VARCHAR2_value
9805            (p_transaction_step_id => p_transaction_step_id
9806            ,p_name                => 'P_CONT_ATTRIBUTE7')
9807       --
9808       ,P_CONT_ATTRIBUTE8  =>
9809          hr_transaction_api.get_VARCHAR2_value
9810            (p_transaction_step_id => p_transaction_step_id
9811            ,p_name                => 'P_CONT_ATTRIBUTE8')
9812       --
9813       ,P_CONT_ATTRIBUTE9  =>
9814          hr_transaction_api.get_VARCHAR2_value
9815            (p_transaction_step_id => p_transaction_step_id
9816            ,p_name                => 'P_CONT_ATTRIBUTE9')
9817       --
9818       ,P_CONT_ATTRIBUTE10  =>
9819          hr_transaction_api.get_VARCHAR2_value
9820            (p_transaction_step_id => p_transaction_step_id
9821            ,p_name                => 'P_CONT_ATTRIBUTE10')
9822       --
9823       ,P_CONT_ATTRIBUTE11  =>
9824          hr_transaction_api.get_VARCHAR2_value
9825            (p_transaction_step_id => p_transaction_step_id
9826            ,p_name                => 'P_CONT_ATTRIBUTE11')
9827       --
9828       ,P_CONT_ATTRIBUTE12  =>
9829          hr_transaction_api.get_VARCHAR2_value
9830            (p_transaction_step_id => p_transaction_step_id
9831            ,p_name                => 'P_CONT_ATTRIBUTE12')
9832       --
9833       ,P_CONT_ATTRIBUTE13  =>
9834          hr_transaction_api.get_VARCHAR2_value
9835            (p_transaction_step_id => p_transaction_step_id
9836            ,p_name                => 'P_CONT_ATTRIBUTE13')
9837       --
9838       ,P_CONT_ATTRIBUTE14  =>
9839          hr_transaction_api.get_VARCHAR2_value
9840            (p_transaction_step_id => p_transaction_step_id
9841            ,p_name                => 'P_CONT_ATTRIBUTE14')
9842       --
9843       ,P_CONT_ATTRIBUTE15  =>
9844          hr_transaction_api.get_VARCHAR2_value
9845            (p_transaction_step_id => p_transaction_step_id
9846            ,p_name                => 'P_CONT_ATTRIBUTE15')
9847       --
9848       ,P_CONT_ATTRIBUTE16  =>
9849          hr_transaction_api.get_VARCHAR2_value
9850            (p_transaction_step_id => p_transaction_step_id
9851            ,p_name                => 'P_CONT_ATTRIBUTE16')
9852       --
9853       ,P_CONT_ATTRIBUTE17  =>
9854          hr_transaction_api.get_VARCHAR2_value
9855            (p_transaction_step_id => p_transaction_step_id
9856            ,p_name                => 'P_CONT_ATTRIBUTE17')
9857       --
9858       ,P_CONT_ATTRIBUTE18  =>
9859          hr_transaction_api.get_VARCHAR2_value
9860            (p_transaction_step_id => p_transaction_step_id
9861            ,p_name                => 'P_CONT_ATTRIBUTE18')
9862       --
9863       ,P_CONT_ATTRIBUTE19  =>
9864          hr_transaction_api.get_VARCHAR2_value
9865            (p_transaction_step_id => p_transaction_step_id
9866            ,p_name                => 'P_CONT_ATTRIBUTE19')
9867       --
9868       ,P_CONT_ATTRIBUTE20  =>
9869          hr_transaction_api.get_VARCHAR2_value
9870            (p_transaction_step_id => p_transaction_step_id
9871            ,p_name                => 'P_CONT_ATTRIBUTE20')
9872       --
9873       ,P_THIRD_PARTY_PAY_FLAG  =>
9874          hr_transaction_api.get_VARCHAR2_value
9875            (p_transaction_step_id => p_transaction_step_id
9876            ,p_name                => 'P_THIRD_PARTY_PAY_FLAG')
9877       --
9878       ,P_BONDHOLDER_FLAG  =>
9879          hr_transaction_api.get_VARCHAR2_value
9880            (p_transaction_step_id => p_transaction_step_id
9881            ,p_name                => 'P_BONDHOLDER_FLAG')
9882       --
9883       ,P_DEPENDENT_FLAG  =>
9884          hr_transaction_api.get_VARCHAR2_value
9885            (p_transaction_step_id => p_transaction_step_id
9886            ,p_name                => 'P_DEPENDENT_FLAG')
9887       --
9888       ,P_BENEFICIARY_FLAG  =>
9889          hr_transaction_api.get_VARCHAR2_value
9890            (p_transaction_step_id => p_transaction_step_id
9891            ,p_name                => 'P_BENEFICIARY_FLAG')
9892       --
9893       ,P_LAST_NAME  =>
9894          hr_transaction_api.get_VARCHAR2_value
9895            (p_transaction_step_id => p_transaction_step_id
9896            ,p_name                => 'P_LAST_NAME')
9897       --
9898       ,P_SEX  =>
9899          hr_transaction_api.get_VARCHAR2_value
9900            (p_transaction_step_id => p_transaction_step_id
9901            ,p_name                => 'P_SEX')
9902       --
9903       ,P_PERSON_TYPE_ID  =>
9904          hr_transaction_api.get_NUMBER_value
9905            (p_transaction_step_id => p_transaction_step_id
9906            ,p_name                => 'P_PERSON_TYPE_ID')
9907       --
9908       ,P_PER_COMMENTS  =>
9909          hr_transaction_api.get_VARCHAR2_value
9910            (p_transaction_step_id => p_transaction_step_id
9911            ,p_name                => 'P_PER_COMMENTS')
9912       --
9913       ,P_DATE_OF_BIRTH  =>
9914          hr_transaction_api.get_DATE_value
9915            (p_transaction_step_id => p_transaction_step_id
9916            ,p_name                => 'P_DATE_OF_BIRTH')
9917       --
9918       ,P_EMAIL_ADDRESS  =>
9919          hr_transaction_api.get_VARCHAR2_value
9920            (p_transaction_step_id => p_transaction_step_id
9921            ,p_name                => 'P_EMAIL_ADDRESS')
9922       --
9923       ,P_FIRST_NAME  =>
9924          hr_transaction_api.get_VARCHAR2_value
9925            (p_transaction_step_id => p_transaction_step_id
9926            ,p_name                => 'P_FIRST_NAME')
9927       --
9928       ,P_KNOWN_AS  =>
9929          hr_transaction_api.get_VARCHAR2_value
9930            (p_transaction_step_id => p_transaction_step_id
9931            ,p_name                => 'P_KNOWN_AS')
9932       --
9933       ,P_MARITAL_STATUS  =>
9934          hr_transaction_api.get_VARCHAR2_value
9935            (p_transaction_step_id => p_transaction_step_id
9936            ,p_name                => 'P_MARITAL_STATUS')
9937       --
9938       ,P_MIDDLE_NAMES  =>
9939          hr_transaction_api.get_VARCHAR2_value
9940            (p_transaction_step_id => p_transaction_step_id
9941            ,p_name                => 'P_MIDDLE_NAMES')
9942       --
9943       ,P_NATIONALITY  =>
9944          hr_transaction_api.get_VARCHAR2_value
9945            (p_transaction_step_id => p_transaction_step_id
9946            ,p_name                => 'P_NATIONALITY')
9947       --
9948       ,P_NATIONAL_IDENTIFIER  =>
9949          hr_transaction_api.get_VARCHAR2_value
9950            (p_transaction_step_id => p_transaction_step_id
9951            ,p_name                => 'P_NATIONAL_IDENTIFIER')
9952       --
9953       ,P_PREVIOUS_LAST_NAME  =>
9954          hr_transaction_api.get_VARCHAR2_value
9955            (p_transaction_step_id => p_transaction_step_id
9956            ,p_name                => 'P_PREVIOUS_LAST_NAME')
9957       --
9958       ,P_REGISTERED_DISABLED_FLAG  =>
9959          hr_transaction_api.get_VARCHAR2_value
9960            (p_transaction_step_id => p_transaction_step_id
9961            ,p_name                => 'P_REGISTERED_DISABLED_FLAG')
9962       --
9963       ,P_TITLE  =>
9964          hr_transaction_api.get_VARCHAR2_value
9965            (p_transaction_step_id => p_transaction_step_id
9966            ,p_name                => 'P_TITLE')
9967       --
9968       ,P_WORK_TELEPHONE  =>
9969          hr_transaction_api.get_VARCHAR2_value
9970            (p_transaction_step_id => p_transaction_step_id
9971            ,p_name                => 'P_WORK_TELEPHONE')
9972       --
9973       ,P_ATTRIBUTE_CATEGORY  =>
9974          hr_transaction_api.get_VARCHAR2_value
9975            (p_transaction_step_id => p_transaction_step_id
9976            ,p_name                => 'P_ATTRIBUTE_CATEGORY')
9977       --
9978       ,P_ATTRIBUTE1  =>
9979          hr_transaction_api.get_VARCHAR2_value
9980            (p_transaction_step_id => p_transaction_step_id
9981            ,p_name                => 'P_ATTRIBUTE1')
9982       --
9983       ,P_ATTRIBUTE2  =>
9984          hr_transaction_api.get_VARCHAR2_value
9985            (p_transaction_step_id => p_transaction_step_id
9986            ,p_name                => 'P_ATTRIBUTE2')
9987       --
9988       ,P_ATTRIBUTE3  =>
9989          hr_transaction_api.get_VARCHAR2_value
9990            (p_transaction_step_id => p_transaction_step_id
9991            ,p_name                => 'P_ATTRIBUTE3')
9992       --
9993       ,P_ATTRIBUTE4  =>
9994          hr_transaction_api.get_VARCHAR2_value
9995            (p_transaction_step_id => p_transaction_step_id
9996            ,p_name                => 'P_ATTRIBUTE4')
9997       --
9998       ,P_ATTRIBUTE5  =>
9999          hr_transaction_api.get_VARCHAR2_value
10000            (p_transaction_step_id => p_transaction_step_id
10001            ,p_name                => 'P_ATTRIBUTE5')
10002       --
10003       ,P_ATTRIBUTE6  =>
10004          hr_transaction_api.get_VARCHAR2_value
10005            (p_transaction_step_id => p_transaction_step_id
10006            ,p_name                => 'P_ATTRIBUTE6')
10007       --
10008       ,P_ATTRIBUTE7  =>
10009          hr_transaction_api.get_VARCHAR2_value
10010            (p_transaction_step_id => p_transaction_step_id
10011            ,p_name                => 'P_ATTRIBUTE7')
10012       --
10013       ,P_ATTRIBUTE8  =>
10014          hr_transaction_api.get_VARCHAR2_value
10015            (p_transaction_step_id => p_transaction_step_id
10016            ,p_name                => 'P_ATTRIBUTE8')
10017       --
10018       ,P_ATTRIBUTE9  =>
10019          hr_transaction_api.get_VARCHAR2_value
10020            (p_transaction_step_id => p_transaction_step_id
10021            ,p_name                => 'P_ATTRIBUTE9')
10022       --
10023       ,P_ATTRIBUTE10  =>
10024          hr_transaction_api.get_VARCHAR2_value
10025            (p_transaction_step_id => p_transaction_step_id
10026            ,p_name                => 'P_ATTRIBUTE10')
10027       --
10028       ,P_ATTRIBUTE11  =>
10029          hr_transaction_api.get_VARCHAR2_value
10030            (p_transaction_step_id => p_transaction_step_id
10031            ,p_name                => 'P_ATTRIBUTE11')
10032       --
10033       ,P_ATTRIBUTE12  =>
10034          hr_transaction_api.get_VARCHAR2_value
10035            (p_transaction_step_id => p_transaction_step_id
10036            ,p_name                => 'P_ATTRIBUTE12')
10037       --
10038       ,P_ATTRIBUTE13  =>
10039          hr_transaction_api.get_VARCHAR2_value
10040            (p_transaction_step_id => p_transaction_step_id
10041            ,p_name                => 'P_ATTRIBUTE13')
10042       --
10043       ,P_ATTRIBUTE14  =>
10044          hr_transaction_api.get_VARCHAR2_value
10045            (p_transaction_step_id => p_transaction_step_id
10046            ,p_name                => 'P_ATTRIBUTE14')
10047       --
10048       ,P_ATTRIBUTE15  =>
10049          hr_transaction_api.get_VARCHAR2_value
10050            (p_transaction_step_id => p_transaction_step_id
10051            ,p_name                => 'P_ATTRIBUTE15')
10052       --
10053       ,P_ATTRIBUTE16  =>
10054          hr_transaction_api.get_VARCHAR2_value
10055            (p_transaction_step_id => p_transaction_step_id
10056            ,p_name                => 'P_ATTRIBUTE16')
10057       --
10058       ,P_ATTRIBUTE17  =>
10059          hr_transaction_api.get_VARCHAR2_value
10060            (p_transaction_step_id => p_transaction_step_id
10061            ,p_name                => 'P_ATTRIBUTE17')
10062       --
10063       ,P_ATTRIBUTE18  =>
10064          hr_transaction_api.get_VARCHAR2_value
10065            (p_transaction_step_id => p_transaction_step_id
10066            ,p_name                => 'P_ATTRIBUTE18')
10067       --
10068       ,P_ATTRIBUTE19  =>
10069          hr_transaction_api.get_VARCHAR2_value
10070            (p_transaction_step_id => p_transaction_step_id
10071            ,p_name                => 'P_ATTRIBUTE19')
10072       --
10073       ,P_ATTRIBUTE20  =>
10074          hr_transaction_api.get_VARCHAR2_value
10075            (p_transaction_step_id => p_transaction_step_id
10076            ,p_name                => 'P_ATTRIBUTE20')
10077       --
10078       ,P_ATTRIBUTE21  =>
10079          hr_transaction_api.get_VARCHAR2_value
10080            (p_transaction_step_id => p_transaction_step_id
10081            ,p_name                => 'P_ATTRIBUTE21')
10082       --
10083       ,P_ATTRIBUTE22  =>
10084          hr_transaction_api.get_VARCHAR2_value
10085            (p_transaction_step_id => p_transaction_step_id
10086            ,p_name                => 'P_ATTRIBUTE22')
10087       --
10088       ,P_ATTRIBUTE23  =>
10089          hr_transaction_api.get_VARCHAR2_value
10090            (p_transaction_step_id => p_transaction_step_id
10091            ,p_name                => 'P_ATTRIBUTE23')
10092       --
10093       ,P_ATTRIBUTE24  =>
10094          hr_transaction_api.get_VARCHAR2_value
10095            (p_transaction_step_id => p_transaction_step_id
10096            ,p_name                => 'P_ATTRIBUTE24')
10097       --
10098       ,P_ATTRIBUTE25  =>
10099          hr_transaction_api.get_VARCHAR2_value
10100            (p_transaction_step_id => p_transaction_step_id
10101            ,p_name                => 'P_ATTRIBUTE25')
10102       --
10103       ,P_ATTRIBUTE26  =>
10104          hr_transaction_api.get_VARCHAR2_value
10105            (p_transaction_step_id => p_transaction_step_id
10106            ,p_name                => 'P_ATTRIBUTE26')
10107       --
10108       ,P_ATTRIBUTE27  =>
10109          hr_transaction_api.get_VARCHAR2_value
10110            (p_transaction_step_id => p_transaction_step_id
10111            ,p_name                => 'P_ATTRIBUTE27')
10112       --
10113       ,P_ATTRIBUTE28  =>
10114          hr_transaction_api.get_VARCHAR2_value
10115            (p_transaction_step_id => p_transaction_step_id
10116            ,p_name                => 'P_ATTRIBUTE28')
10117       --
10118       ,P_ATTRIBUTE29  =>
10119          hr_transaction_api.get_VARCHAR2_value
10120            (p_transaction_step_id => p_transaction_step_id
10121            ,p_name                => 'P_ATTRIBUTE29')
10122       --
10123       ,P_ATTRIBUTE30  =>
10124          hr_transaction_api.get_VARCHAR2_value
10125            (p_transaction_step_id => p_transaction_step_id
10126            ,p_name                => 'P_ATTRIBUTE30')
10127       --
10128       ,P_PER_INFORMATION_CATEGORY  =>
10129          hr_transaction_api.get_VARCHAR2_value
10130            (p_transaction_step_id => p_transaction_step_id
10131            ,p_name                => 'P_PER_INFORMATION_CATEGORY')
10132       --
10133       ,P_PER_INFORMATION1  =>
10134          hr_transaction_api.get_VARCHAR2_value
10135            (p_transaction_step_id => p_transaction_step_id
10136            ,p_name                => 'P_PER_INFORMATION1')
10137       --
10138       ,P_PER_INFORMATION2  =>
10139          hr_transaction_api.get_VARCHAR2_value
10140            (p_transaction_step_id => p_transaction_step_id
10141            ,p_name                => 'P_PER_INFORMATION2')
10142       --
10143       ,P_PER_INFORMATION3  =>
10144          hr_transaction_api.get_VARCHAR2_value
10145            (p_transaction_step_id => p_transaction_step_id
10146            ,p_name                => 'P_PER_INFORMATION3')
10147       --
10148       ,P_PER_INFORMATION4  =>
10149          hr_transaction_api.get_VARCHAR2_value
10150            (p_transaction_step_id => p_transaction_step_id
10151            ,p_name                => 'P_PER_INFORMATION4')
10152       --
10153       ,P_PER_INFORMATION5  =>
10154          hr_transaction_api.get_VARCHAR2_value
10155            (p_transaction_step_id => p_transaction_step_id
10156            ,p_name                => 'P_PER_INFORMATION5')
10157       --
10158       ,P_PER_INFORMATION6  =>
10159          hr_transaction_api.get_VARCHAR2_value
10160            (p_transaction_step_id => p_transaction_step_id
10161            ,p_name                => 'P_PER_INFORMATION6')
10162       --
10163       ,P_PER_INFORMATION7  =>
10164          hr_transaction_api.get_VARCHAR2_value
10165            (p_transaction_step_id => p_transaction_step_id
10166            ,p_name                => 'P_PER_INFORMATION7')
10167       --
10168       ,P_PER_INFORMATION8  =>
10169          hr_transaction_api.get_VARCHAR2_value
10170            (p_transaction_step_id => p_transaction_step_id
10171            ,p_name                => 'P_PER_INFORMATION8')
10172       --
10173       ,P_PER_INFORMATION9  =>
10174          hr_transaction_api.get_VARCHAR2_value
10175            (p_transaction_step_id => p_transaction_step_id
10176            ,p_name                => 'P_PER_INFORMATION9')
10177       --
10178       ,P_PER_INFORMATION10  =>
10179          hr_transaction_api.get_VARCHAR2_value
10180            (p_transaction_step_id => p_transaction_step_id
10181            ,p_name                => 'P_PER_INFORMATION10')
10182       --
10183       ,P_PER_INFORMATION11  =>
10184          hr_transaction_api.get_VARCHAR2_value
10185            (p_transaction_step_id => p_transaction_step_id
10186            ,p_name                => 'P_PER_INFORMATION11')
10187       --
10188       ,P_PER_INFORMATION12  =>
10189          hr_transaction_api.get_VARCHAR2_value
10190            (p_transaction_step_id => p_transaction_step_id
10191            ,p_name                => 'P_PER_INFORMATION12')
10192       --
10193       ,P_PER_INFORMATION13  =>
10194          hr_transaction_api.get_VARCHAR2_value
10195            (p_transaction_step_id => p_transaction_step_id
10196            ,p_name                => 'P_PER_INFORMATION13')
10197       --
10198       ,P_PER_INFORMATION14  =>
10199          hr_transaction_api.get_VARCHAR2_value
10200            (p_transaction_step_id => p_transaction_step_id
10201            ,p_name                => 'P_PER_INFORMATION14')
10202       --
10203       ,P_PER_INFORMATION15  =>
10204          hr_transaction_api.get_VARCHAR2_value
10205            (p_transaction_step_id => p_transaction_step_id
10206            ,p_name                => 'P_PER_INFORMATION15')
10207       --
10208       ,P_PER_INFORMATION16  =>
10209          hr_transaction_api.get_VARCHAR2_value
10210            (p_transaction_step_id => p_transaction_step_id
10211            ,p_name                => 'P_PER_INFORMATION16')
10212       --
10213       ,P_PER_INFORMATION17  =>
10214          hr_transaction_api.get_VARCHAR2_value
10215            (p_transaction_step_id => p_transaction_step_id
10216            ,p_name                => 'P_PER_INFORMATION17')
10217       --
10218       ,P_PER_INFORMATION18  =>
10219          hr_transaction_api.get_VARCHAR2_value
10220            (p_transaction_step_id => p_transaction_step_id
10221            ,p_name                => 'P_PER_INFORMATION18')
10222       --
10223       ,P_PER_INFORMATION19  =>
10224          hr_transaction_api.get_VARCHAR2_value
10225            (p_transaction_step_id => p_transaction_step_id
10226            ,p_name                => 'P_PER_INFORMATION19')
10227       --
10228       ,P_PER_INFORMATION20  =>
10229          hr_transaction_api.get_VARCHAR2_value
10230            (p_transaction_step_id => p_transaction_step_id
10231            ,p_name                => 'P_PER_INFORMATION20')
10232       --
10233       ,P_PER_INFORMATION21  =>
10234          hr_transaction_api.get_VARCHAR2_value
10235            (p_transaction_step_id => p_transaction_step_id
10236            ,p_name                => 'P_PER_INFORMATION21')
10237       --
10238       ,P_PER_INFORMATION22  =>
10239          hr_transaction_api.get_VARCHAR2_value
10240            (p_transaction_step_id => p_transaction_step_id
10241            ,p_name                => 'P_PER_INFORMATION22')
10242       --
10243       ,P_PER_INFORMATION23  =>
10244          hr_transaction_api.get_VARCHAR2_value
10245            (p_transaction_step_id => p_transaction_step_id
10246            ,p_name                => 'P_PER_INFORMATION23')
10247       --
10248       ,P_PER_INFORMATION24  =>
10249          hr_transaction_api.get_VARCHAR2_value
10250            (p_transaction_step_id => p_transaction_step_id
10251            ,p_name                => 'P_PER_INFORMATION24')
10252       --
10253       ,P_PER_INFORMATION25  =>
10254          hr_transaction_api.get_VARCHAR2_value
10255            (p_transaction_step_id => p_transaction_step_id
10256            ,p_name                => 'P_PER_INFORMATION25')
10257       --
10258       ,P_PER_INFORMATION26  =>
10259          hr_transaction_api.get_VARCHAR2_value
10260            (p_transaction_step_id => p_transaction_step_id
10261            ,p_name                => 'P_PER_INFORMATION26')
10262       --
10263       ,P_PER_INFORMATION27  =>
10264          hr_transaction_api.get_VARCHAR2_value
10265            (p_transaction_step_id => p_transaction_step_id
10266            ,p_name                => 'P_PER_INFORMATION27')
10267       --
10268       ,P_PER_INFORMATION28  =>
10269          hr_transaction_api.get_VARCHAR2_value
10270            (p_transaction_step_id => p_transaction_step_id
10271            ,p_name                => 'P_PER_INFORMATION28')
10272       --
10273       ,P_PER_INFORMATION29  =>
10274          hr_transaction_api.get_VARCHAR2_value
10275            (p_transaction_step_id => p_transaction_step_id
10276            ,p_name                => 'P_PER_INFORMATION29')
10277       --
10278       ,P_PER_INFORMATION30  =>
10279          hr_transaction_api.get_VARCHAR2_value
10280            (p_transaction_step_id => p_transaction_step_id
10281            ,p_name                => 'P_PER_INFORMATION30')
10282       --
10283       ,P_CORRESPONDENCE_LANGUAGE  =>
10284          hr_transaction_api.get_VARCHAR2_value
10285            (p_transaction_step_id => p_transaction_step_id
10286            ,p_name                => 'P_CORRESPONDENCE_LANGUAGE')
10287       --
10288       ,P_HONORS  =>
10289          hr_transaction_api.get_VARCHAR2_value
10290            (p_transaction_step_id => p_transaction_step_id
10291            ,p_name                => 'P_HONORS')
10292       --
10293       ,P_PRE_NAME_ADJUNCT  =>
10294          hr_transaction_api.get_VARCHAR2_value
10295            (p_transaction_step_id => p_transaction_step_id
10296            ,p_name                => 'P_PRE_NAME_ADJUNCT')
10297       --
10298       ,P_SUFFIX  =>
10299          hr_transaction_api.get_VARCHAR2_value
10300            (p_transaction_step_id => p_transaction_step_id
10301            ,p_name                => 'P_SUFFIX')
10302       --
10303       ,P_CREATE_MIRROR_FLAG  =>  l_CREATE_MIRROR_FLAG
10304       /* Bug 1919795
10305          hr_transaction_api.get_VARCHAR2_value
10306            (p_transaction_step_id => p_transaction_step_id
10307            ,p_name                => 'P_CREATE_MIRROR_FLAG')
10308       */
10309       --
10310       ,P_MIRROR_TYPE  => l_MIRROR_TYPE
10311       /* Bug 1919795
10312          hr_transaction_api.get_VARCHAR2_value
10313            (p_transaction_step_id => p_transaction_step_id
10314            ,p_name                => 'P_MIRROR_TYPE')
10315       */
10316       --
10317       ,P_MIRROR_CONT_ATTRIBUTE_CAT  =>
10318          hr_transaction_api.get_VARCHAR2_value
10319            (p_transaction_step_id => p_transaction_step_id
10320            ,p_name                => 'P_MIRROR_CONT_ATTRIBUTE_CAT')
10321       --
10322       ,P_MIRROR_CONT_ATTRIBUTE1  =>
10323          hr_transaction_api.get_VARCHAR2_value
10324            (p_transaction_step_id => p_transaction_step_id
10325            ,p_name                => 'P_MIRROR_CONT_ATTRIBUTE1')
10326       --
10327       ,P_MIRROR_CONT_ATTRIBUTE2  =>
10328          hr_transaction_api.get_VARCHAR2_value
10329            (p_transaction_step_id => p_transaction_step_id
10330            ,p_name                => 'P_MIRROR_CONT_ATTRIBUTE2')
10331       --
10332       ,P_MIRROR_CONT_ATTRIBUTE3  =>
10333          hr_transaction_api.get_VARCHAR2_value
10334            (p_transaction_step_id => p_transaction_step_id
10335            ,p_name                => 'P_MIRROR_CONT_ATTRIBUTE3')
10336       --
10337       ,P_MIRROR_CONT_ATTRIBUTE4  =>
10338          hr_transaction_api.get_VARCHAR2_value
10339            (p_transaction_step_id => p_transaction_step_id
10340            ,p_name                => 'P_MIRROR_CONT_ATTRIBUTE4')
10341       --
10342       ,P_MIRROR_CONT_ATTRIBUTE5  =>
10343          hr_transaction_api.get_VARCHAR2_value
10344            (p_transaction_step_id => p_transaction_step_id
10345            ,p_name                => 'P_MIRROR_CONT_ATTRIBUTE5')
10346       --
10347       ,P_MIRROR_CONT_ATTRIBUTE6  =>
10348          hr_transaction_api.get_VARCHAR2_value
10349            (p_transaction_step_id => p_transaction_step_id
10350            ,p_name                => 'P_MIRROR_CONT_ATTRIBUTE6')
10351       --
10352       ,P_MIRROR_CONT_ATTRIBUTE7  =>
10353          hr_transaction_api.get_VARCHAR2_value
10354            (p_transaction_step_id => p_transaction_step_id
10355            ,p_name                => 'P_MIRROR_CONT_ATTRIBUTE7')
10356       --
10357       ,P_MIRROR_CONT_ATTRIBUTE8  =>
10358          hr_transaction_api.get_VARCHAR2_value
10359            (p_transaction_step_id => p_transaction_step_id
10360            ,p_name                => 'P_MIRROR_CONT_ATTRIBUTE8')
10361       --
10362       ,P_MIRROR_CONT_ATTRIBUTE9  =>
10363          hr_transaction_api.get_VARCHAR2_value
10364            (p_transaction_step_id => p_transaction_step_id
10365            ,p_name                => 'P_MIRROR_CONT_ATTRIBUTE9')
10366       --
10367       ,P_MIRROR_CONT_ATTRIBUTE10  =>
10368          hr_transaction_api.get_VARCHAR2_value
10369            (p_transaction_step_id => p_transaction_step_id
10370            ,p_name                => 'P_MIRROR_CONT_ATTRIBUTE10')
10371       --
10372       ,P_MIRROR_CONT_ATTRIBUTE11  =>
10373          hr_transaction_api.get_VARCHAR2_value
10374            (p_transaction_step_id => p_transaction_step_id
10375            ,p_name                => 'P_MIRROR_CONT_ATTRIBUTE11')
10376       --
10377       ,P_MIRROR_CONT_ATTRIBUTE12  =>
10378          hr_transaction_api.get_VARCHAR2_value
10379            (p_transaction_step_id => p_transaction_step_id
10380            ,p_name                => 'P_MIRROR_CONT_ATTRIBUTE12')
10381       --
10382       ,P_MIRROR_CONT_ATTRIBUTE13  =>
10383          hr_transaction_api.get_VARCHAR2_value
10384            (p_transaction_step_id => p_transaction_step_id
10385            ,p_name                => 'P_MIRROR_CONT_ATTRIBUTE13')
10386       --
10387       ,P_MIRROR_CONT_ATTRIBUTE14  =>
10388          hr_transaction_api.get_VARCHAR2_value
10389            (p_transaction_step_id => p_transaction_step_id
10390            ,p_name                => 'P_MIRROR_CONT_ATTRIBUTE14')
10391       --
10392       ,P_MIRROR_CONT_ATTRIBUTE15  =>
10393          hr_transaction_api.get_VARCHAR2_value
10394            (p_transaction_step_id => p_transaction_step_id
10395            ,p_name                => 'P_MIRROR_CONT_ATTRIBUTE15')
10396       --
10397       ,P_MIRROR_CONT_ATTRIBUTE16  =>
10398          hr_transaction_api.get_VARCHAR2_value
10399            (p_transaction_step_id => p_transaction_step_id
10400            ,p_name                => 'P_MIRROR_CONT_ATTRIBUTE16')
10401       --
10402       ,P_MIRROR_CONT_ATTRIBUTE17  =>
10403          hr_transaction_api.get_VARCHAR2_value
10404            (p_transaction_step_id => p_transaction_step_id
10405            ,p_name                => 'P_MIRROR_CONT_ATTRIBUTE17')
10406       --
10407       ,P_MIRROR_CONT_ATTRIBUTE18  =>
10408          hr_transaction_api.get_VARCHAR2_value
10409            (p_transaction_step_id => p_transaction_step_id
10410            ,p_name                => 'P_MIRROR_CONT_ATTRIBUTE18')
10411       --
10412       ,P_MIRROR_CONT_ATTRIBUTE19  =>
10413          hr_transaction_api.get_VARCHAR2_value
10414            (p_transaction_step_id => p_transaction_step_id
10415            ,p_name                => 'P_MIRROR_CONT_ATTRIBUTE19')
10416       --
10417       ,P_MIRROR_CONT_ATTRIBUTE20  =>
10418          hr_transaction_api.get_VARCHAR2_value
10419            (p_transaction_step_id => p_transaction_step_id
10420            ,p_name                => 'P_MIRROR_CONT_ATTRIBUTE20')
10421       --
10422       ,P_CONTACT_RELATIONSHIP_ID  	=> L_CONTACT_RELATIONSHIP_ID
10423       --
10424       ,P_CTR_OBJECT_VERSION_NUMBER  	=> L_CTR_OBJECT_VERSION_NUMBER
10425       --
10426       ,P_PER_PERSON_ID  		=> L_PER_PERSON_ID
10427       --
10428       ,P_PER_OBJECT_VERSION_NUMBER  	=> L_PER_OBJECT_VERSION_NUMBER
10429       --
10430       ,P_PER_EFFECTIVE_START_DATE  	=> L_PER_EFFECTIVE_START_DATE
10431       --
10432       ,P_PER_EFFECTIVE_END_DATE  	=> L_PER_EFFECTIVE_END_DATE
10433       --
10434       ,P_FULL_NAME  			=> L_FULL_NAME
10435       --
10436       ,P_PER_COMMENT_ID  		=> L_PER_COMMENT_ID
10437       --
10438       ,P_NAME_COMBINATION_WARNING  	=> L_CON_NAME_COMBINATION_WARNING
10439       --
10440       ,P_ORIG_HIRE_WARNING  		=> L_CON_ORIG_HIRE_WARNING
10441       --
10442 	,P_CONT_INFORMATION_CATEGORY  =>
10443                  hr_transaction_api.get_VARCHAR2_value
10444                    (p_transaction_step_id => p_transaction_step_id
10445                    ,p_name                => 'P_CONT_INFORMATION_CATEGORY')
10446               --
10447       ,P_CONT_INFORMATION1  =>
10448                  hr_transaction_api.get_VARCHAR2_value
10449                    (p_transaction_step_id => p_transaction_step_id
10450                    ,p_name                => 'P_CONT_INFORMATION1')
10451               --
10452       ,P_CONT_INFORMATION2  =>
10453                  hr_transaction_api.get_VARCHAR2_value
10454                    (p_transaction_step_id => p_transaction_step_id
10455                    ,p_name                => 'P_CONT_INFORMATION2')
10456               --
10457       ,P_CONT_INFORMATION3  =>
10458                  hr_transaction_api.get_VARCHAR2_value
10459                    (p_transaction_step_id => p_transaction_step_id
10460                    ,p_name                => 'P_CONT_INFORMATION3')
10461               --
10462       ,P_CONT_INFORMATION4  =>
10463                  hr_transaction_api.get_VARCHAR2_value
10464                    (p_transaction_step_id => p_transaction_step_id
10465                    ,p_name                => 'P_CONT_INFORMATION4')
10466               --
10467       ,P_CONT_INFORMATION5  =>
10468                  hr_transaction_api.get_VARCHAR2_value
10469                    (p_transaction_step_id => p_transaction_step_id
10470                    ,p_name                => 'P_CONT_INFORMATION5')
10471               --
10472       ,P_CONT_INFORMATION6  =>
10473                  hr_transaction_api.get_VARCHAR2_value
10474                    (p_transaction_step_id => p_transaction_step_id
10475                    ,p_name                => 'P_CONT_INFORMATION6')
10476               --
10477       ,P_CONT_INFORMATION7  =>
10478                  hr_transaction_api.get_VARCHAR2_value
10479                    (p_transaction_step_id => p_transaction_step_id
10480                    ,p_name                => 'P_CONT_INFORMATION7')
10481               --
10482       ,P_CONT_INFORMATION8  =>
10483                  hr_transaction_api.get_VARCHAR2_value
10484                    (p_transaction_step_id => p_transaction_step_id
10485                    ,p_name                => 'P_CONT_INFORMATION8')
10486               --
10487       ,P_CONT_INFORMATION9  =>
10488                  hr_transaction_api.get_VARCHAR2_value
10489                    (p_transaction_step_id => p_transaction_step_id
10490                    ,p_name                => 'P_CONT_INFORMATION9')
10491               --
10492       ,P_CONT_INFORMATION10  =>
10493                  hr_transaction_api.get_VARCHAR2_value
10494                    (p_transaction_step_id => p_transaction_step_id
10495                    ,p_name                => 'P_CONT_INFORMATION10')
10496               --
10497       ,P_CONT_INFORMATION11  =>
10498                  hr_transaction_api.get_VARCHAR2_value
10499                    (p_transaction_step_id => p_transaction_step_id
10500                    ,p_name                => 'P_CONT_INFORMATION11')
10501               --
10502       ,P_CONT_INFORMATION12  =>
10503                  hr_transaction_api.get_VARCHAR2_value
10504                    (p_transaction_step_id => p_transaction_step_id
10505                    ,p_name                => 'P_CONT_INFORMATION12')
10506               --
10507       ,P_CONT_INFORMATION13  =>
10508                  hr_transaction_api.get_VARCHAR2_value
10509                    (p_transaction_step_id => p_transaction_step_id
10510                    ,p_name                => 'P_CONT_INFORMATION13')
10511               --
10512       ,P_CONT_INFORMATION14  =>
10513                  hr_transaction_api.get_VARCHAR2_value
10514                    (p_transaction_step_id => p_transaction_step_id
10515                    ,p_name                => 'P_CONT_INFORMATION14')
10516               --
10517       ,P_CONT_INFORMATION15  =>
10518                  hr_transaction_api.get_VARCHAR2_value
10519                    (p_transaction_step_id => p_transaction_step_id
10520                    ,p_name                => 'P_CONT_INFORMATION15')
10521               --
10522       ,P_CONT_INFORMATION16  =>
10523                  hr_transaction_api.get_VARCHAR2_value
10524                    (p_transaction_step_id => p_transaction_step_id
10525                    ,p_name                => 'P_CONT_INFORMATION16')
10526               --
10527       ,P_CONT_INFORMATION17  =>
10528                  hr_transaction_api.get_VARCHAR2_value
10529                    (p_transaction_step_id => p_transaction_step_id
10530                    ,p_name                => 'P_CONT_INFORMATION17')
10531               --
10532       ,P_CONT_INFORMATION18  =>
10533                 hr_transaction_api.get_VARCHAR2_value
10534                    (p_transaction_step_id => p_transaction_step_id
10535                    ,p_name                => 'P_CONT_INFORMATION18')
10536               --
10537       ,P_CONT_INFORMATION19  =>
10538                  hr_transaction_api.get_VARCHAR2_value
10539                    (p_transaction_step_id => p_transaction_step_id
10540                    ,p_name                => 'P_CONT_INFORMATION19')
10541               --
10542       ,P_CONT_INFORMATION20  =>
10543                  hr_transaction_api.get_VARCHAR2_value
10544                    (p_transaction_step_id => p_transaction_step_id
10545                    ,p_name                => 'P_CONT_INFORMATION20')
10546               --
10547       ,P_MIRROR_CONT_INFORMATION_CAT  =>
10548                  hr_transaction_api.get_VARCHAR2_value
10549                    (p_transaction_step_id => p_transaction_step_id
10550                    ,p_name                => 'P_MIRROR_CONT_INFORMATION_CAT')
10551               --
10552       ,P_MIRROR_CONT_INFORMATION1  =>
10553                  hr_transaction_api.get_VARCHAR2_value
10554                    (p_transaction_step_id => p_transaction_step_id
10555                    ,p_name                => 'P_MIRROR_CONT_INFORMATION1')
10556               --
10557       ,P_MIRROR_CONT_INFORMATION2  =>
10558                  hr_transaction_api.get_VARCHAR2_value
10559                    (p_transaction_step_id => p_transaction_step_id
10560                    ,p_name                => 'P_MIRROR_CONT_INFORMATION2')
10561               --
10562       ,P_MIRROR_CONT_INFORMATION3  =>
10563                  hr_transaction_api.get_VARCHAR2_value
10564                    (p_transaction_step_id => p_transaction_step_id
10565                    ,p_name                => 'P_MIRROR_CONT_INFORMATION3')
10566               --
10567       ,P_MIRROR_CONT_INFORMATION4  =>
10568                  hr_transaction_api.get_VARCHAR2_value
10569                    (p_transaction_step_id => p_transaction_step_id
10570                    ,p_name                => 'P_MIRROR_CONT_INFORMATION4')
10571               --
10572       ,P_MIRROR_CONT_INFORMATION5  =>
10573                  hr_transaction_api.get_VARCHAR2_value
10574                    (p_transaction_step_id => p_transaction_step_id
10575                    ,p_name                => 'P_MIRROR_CONT_INFORMATION5')
10576               --
10577       ,P_MIRROR_CONT_INFORMATION6  =>
10578                  hr_transaction_api.get_VARCHAR2_value
10579                    (p_transaction_step_id => p_transaction_step_id
10580                    ,p_name                => 'P_MIRROR_CONT_INFORMATION6')
10581               --
10582       ,P_MIRROR_CONT_INFORMATION7  =>
10583                  hr_transaction_api.get_VARCHAR2_value
10584                    (p_transaction_step_id => p_transaction_step_id
10585                    ,p_name                => 'P_MIRROR_CONT_INFORMATION7')
10586               --
10587       ,P_MIRROR_CONT_INFORMATION8  =>
10588                  hr_transaction_api.get_VARCHAR2_value
10589                    (p_transaction_step_id => p_transaction_step_id
10590                    ,p_name                => 'P_MIRROR_CONT_INFORMATION8')
10591               --
10592       ,P_MIRROR_CONT_INFORMATION9  =>
10593                  hr_transaction_api.get_VARCHAR2_value
10594                    (p_transaction_step_id => p_transaction_step_id
10595                    ,p_name                => 'P_MIRROR_CONT_INFORMATION9')
10596               --
10597       ,P_MIRROR_CONT_INFORMATION10  =>
10598                  hr_transaction_api.get_VARCHAR2_value
10599                    (p_transaction_step_id => p_transaction_step_id
10600                    ,p_name                => 'P_MIRROR_CONT_INFORMATION10')
10601               --
10602       ,P_MIRROR_CONT_INFORMATION11  =>
10603                  hr_transaction_api.get_VARCHAR2_value
10604                    (p_transaction_step_id => p_transaction_step_id
10605                    ,p_name                => 'P_MIRROR_CONT_INFORMATION11')
10606               --
10607       ,P_MIRROR_CONT_INFORMATION12  =>
10608                  hr_transaction_api.get_VARCHAR2_value
10609                    (p_transaction_step_id => p_transaction_step_id
10610                    ,p_name                => 'P_MIRROR_CONT_INFORMATION12')
10611               --
10612       ,P_MIRROR_CONT_INFORMATION13  =>
10613                  hr_transaction_api.get_VARCHAR2_value
10614                    (p_transaction_step_id => p_transaction_step_id
10615                    ,p_name                => 'P_MIRROR_CONT_INFORMATION13')
10616               --
10617       ,P_MIRROR_CONT_INFORMATION14  =>
10618                  hr_transaction_api.get_VARCHAR2_value
10619                    (p_transaction_step_id => p_transaction_step_id
10620                    ,p_name                => 'P_MIRROR_CONT_INFORMATION14')
10621               --
10622       ,P_MIRROR_CONT_INFORMATION15  =>
10623                  hr_transaction_api.get_VARCHAR2_value
10624                    (p_transaction_step_id => p_transaction_step_id
10625                    ,p_name                => 'P_MIRROR_CONT_INFORMATION15')
10626               --
10627       ,P_MIRROR_CONT_INFORMATION16  =>
10628                  hr_transaction_api.get_VARCHAR2_value
10629                    (p_transaction_step_id => p_transaction_step_id
10630                    ,p_name                => 'P_MIRROR_CONT_INFORMATION16')
10631               --
10632       ,P_MIRROR_CONT_INFORMATION17  =>
10633                  hr_transaction_api.get_VARCHAR2_value
10634                    (p_transaction_step_id => p_transaction_step_id
10635                    ,p_name                => 'P_MIRROR_CONT_INFORMATION17')
10636               --
10637       ,P_MIRROR_CONT_INFORMATION18  =>
10638                  hr_transaction_api.get_VARCHAR2_value
10639                    (p_transaction_step_id => p_transaction_step_id
10640                    ,p_name                => 'P_MIRROR_CONT_INFORMATION18')
10641               --
10642       ,P_MIRROR_CONT_INFORMATION19 =>
10643                  hr_transaction_api.get_VARCHAR2_value
10644                    (p_transaction_step_id => p_transaction_step_id
10645                    ,p_name                => 'P_MIRROR_CONT_INFORMATION19')
10646               --
10647       ,P_MIRROR_CONT_INFORMATION20  =>
10648                  hr_transaction_api.get_VARCHAR2_value
10649                    (p_transaction_step_id => p_transaction_step_id
10650                    ,p_name                => 'P_MIRROR_CONT_INFORMATION20')
10651      );
10652      --
10653      IF l_con_rec_changed = 'CHANGED'
10654      THEN
10655         --
10656         -- Get the Employee number from the Database;
10657         --
10658         hr_utility.set_location('Before declaring the Cursor c_pap:'||l_proc, 30);
10659         DECLARE
10660                CURSOR c_pap IS SELECT employee_number FROM per_all_people_f
10661 			    WHERE person_id = L_PER_PERSON_ID
10662 			    AND  l_effective_date BETWEEN
10663 				 effective_start_date AND effective_end_date ;
10664                l_pap    c_pap%ROWTYPE;
10665 
10666         BEGIN
10667                --
10668         hr_utility.set_location('Working on the Cursor c_pap:'||l_proc, 35);
10669                OPEN c_pap ;
10670 	       FETCH c_pap INTO l_pap ;
10671                CLOSE c_pap ;
10672                --
10673                l_employee_number := l_pap.employee_number ;
10674                --
10675         EXCEPTION WHEN OTHERS THEN
10676         hr_utility.set_location('Exception: Others'||l_proc,555);
10677              raise ;
10678         END;
10679 
10680         -- For processing the update_person_api
10681         hr_person_api.update_person (
10682    	  p_validate                          =>  p_validate
10683    	 ,p_effective_date                    =>  l_effective_date
10684    	 ,p_datetrack_update_mode             =>  hr_api.g_correction
10685                                               -- 9999 p_datetrack_update_mode
10686    	 ,p_person_id                         =>  L_PER_PERSON_ID
10687      	 ,p_object_version_number             =>  L_PER_OBJECT_VERSION_NUMBER
10688          ,p_employee_number		      =>  l_employee_number
10689          -- Bug 2652114
10690          /*
10691          ,p_adjusted_svc_date  =>
10692              hr_transaction_api.get_date_value
10693                   (p_transaction_step_id   => p_transaction_step_id
10694                     ,p_name                =>upper('p_adjusted_svc_date'))
10695          */
10696          --
10697          ,p_applicant_number  =>
10698              hr_transaction_api.get_varchar2_value
10699                   (p_transaction_step_id   => p_transaction_step_id
10700                     ,p_name                =>upper('p_applicant_number'))
10701          --
10702          ,p_background_check_status  =>
10703              hr_transaction_api.get_varchar2_value
10704                   (p_transaction_step_id   => p_transaction_step_id
10705                     ,p_name                =>upper('p_background_check_status'))
10706          --
10707          ,p_background_date_check  =>
10708              hr_transaction_api.get_date_value
10709                   (p_transaction_step_id   => p_transaction_step_id
10710                     ,p_name                =>upper('p_background_date_check'))
10711          --
10712          ,p_benefit_group_id  =>
10713              hr_transaction_api.get_number_value
10714                   (p_transaction_step_id   => p_transaction_step_id
10715                     ,p_name                =>upper('p_benefit_group_id'))
10716          --
10717          ,p_blood_type  =>
10718              hr_transaction_api.get_varchar2_value
10719                   (p_transaction_step_id   => p_transaction_step_id
10720                     ,p_name                =>upper('p_blood_type'))
10721          --
10722          ,p_coord_ben_med_pln_no  =>
10723              hr_transaction_api.get_varchar2_value
10724                   (p_transaction_step_id   => p_transaction_step_id
10725                     ,p_name                =>upper('p_coord_ben_med_pln_no'))
10726          --
10727          ,p_coord_ben_no_cvg_flag  =>
10728              hr_transaction_api.get_varchar2_value
10729                   (p_transaction_step_id   => p_transaction_step_id
10730                     ,p_name                =>upper('p_coord_ben_no_cvg_flag'))
10731          --
10732          ,p_country_of_birth  =>
10733              hr_transaction_api.get_varchar2_value
10734                   (p_transaction_step_id   => p_transaction_step_id
10735                     ,p_name                =>upper('p_country_of_birth'))
10736          --
10737          ,p_date_employee_data_verified  =>
10738              hr_transaction_api.get_date_value
10739                   (p_transaction_step_id   => p_transaction_step_id
10740                     ,p_name                =>upper('p_date_employee_data_verified'))
10741          --
10742          ,p_date_of_death  =>
10743              hr_transaction_api.get_date_value
10744                   (p_transaction_step_id   => p_transaction_step_id
10745                     ,p_name                =>upper('p_date_of_death'))
10746          --
10747          ,p_dpdnt_adoption_date  =>
10748              hr_transaction_api.get_date_value
10749                   (p_transaction_step_id   => p_transaction_step_id
10750                     ,p_name                =>upper('p_dpdnt_adoption_date'))
10751          --
10752          ,p_dpdnt_vlntry_svce_flag  =>
10753              hr_transaction_api.get_varchar2_value
10754                   (p_transaction_step_id   => p_transaction_step_id
10755                     ,p_name                =>upper('p_dpdnt_vlntry_svce_flag'))
10756          --
10757          ,p_expense_check_send_to_addres  =>
10758              hr_transaction_api.get_varchar2_value
10759                   (p_transaction_step_id   => p_transaction_step_id
10760                     ,p_name                =>upper('p_expense_check_send_to_addres'))
10761          --
10762          ,p_fast_path_employee  =>
10763              hr_transaction_api.get_varchar2_value
10764                   (p_transaction_step_id   => p_transaction_step_id
10765                     ,p_name                =>upper('p_fast_path_employee'))
10766           --
10767          ,p_fte_capacity  =>
10768              hr_transaction_api.get_number_value
10769                   (p_transaction_step_id   => p_transaction_step_id
10770                     ,p_name                =>upper('p_fte_capacity'))
10771          --
10772          ,p_global_person_id  =>
10773              hr_transaction_api.get_varchar2_value
10774                   (p_transaction_step_id   => p_transaction_step_id
10775                     ,p_name                =>upper('p_global_person_id'))
10776          --
10777          ,p_hold_applicant_date_until  =>
10778              hr_transaction_api.get_date_value
10779                   (p_transaction_step_id   => p_transaction_step_id
10780                     ,p_name                =>upper('p_hold_applicant_date_until'))
10781          --
10782          ,p_internal_location  =>
10783              hr_transaction_api.get_varchar2_value
10784                   (p_transaction_step_id   => p_transaction_step_id
10785                     ,p_name                =>upper('p_internal_location'))
10786          --
10787          ,p_last_medical_test_by  =>
10788              hr_transaction_api.get_varchar2_value
10789                   (p_transaction_step_id   => p_transaction_step_id
10790                     ,p_name                =>upper('p_last_medical_test_by'))
10791          --
10792          ,p_last_medical_test_date  =>
10793              hr_transaction_api.get_date_value
10794                   (p_transaction_step_id   => p_transaction_step_id
10795                     ,p_name                =>upper('p_last_medical_test_date'))
10796          --
10797          ,p_mailstop  =>
10798              hr_transaction_api.get_varchar2_value
10799                   (p_transaction_step_id   => p_transaction_step_id
10800                     ,p_name                =>upper('p_mailstop'))
10801          --
10802          ,p_office_number  =>
10803              hr_transaction_api.get_varchar2_value
10804                   (p_transaction_step_id   => p_transaction_step_id
10805                     ,p_name                =>upper('p_office_number'))
10806          --
10807          ,p_on_military_service  =>
10808              hr_transaction_api.get_varchar2_value
10809                   (p_transaction_step_id   => p_transaction_step_id
10810                     ,p_name                =>upper('p_on_military_service'))
10811          --
10812          -- Bug 2652114
10813          /*
10814          ,p_original_date_of_hire  =>
10815              hr_transaction_api.get_date_value
10816                   (p_transaction_step_id   => p_transaction_step_id
10817                     ,p_name                =>upper('p_original_date_of_hire'))
10818          */
10819          --
10820          ,p_projected_start_date  =>
10821              hr_transaction_api.get_date_value
10822                   (p_transaction_step_id   => p_transaction_step_id
10823                     ,p_name                =>upper('p_projected_start_date'))
10824          --
10825          ,p_receipt_of_death_cert_date  =>
10826              hr_transaction_api.get_date_value
10827                   (p_transaction_step_id   => p_transaction_step_id
10828                     ,p_name                =>upper('p_receipt_of_death_cert_date'))
10829          --
10830          ,p_region_of_birth  =>
10831              hr_transaction_api.get_varchar2_value
10832                   (p_transaction_step_id   => p_transaction_step_id
10833                     ,p_name                =>upper('p_region_of_birth'))
10834          --
10835          ,p_rehire_authorizor  =>
10836              hr_transaction_api.get_varchar2_value
10837                   (p_transaction_step_id   => p_transaction_step_id
10838                     ,p_name                =>upper('p_rehire_authorizor'))
10839          --
10840          ,p_rehire_recommendation  =>
10841              hr_transaction_api.get_varchar2_value
10842                   (p_transaction_step_id   => p_transaction_step_id
10843                     ,p_name                =>upper('p_rehire_recommendation'))
10844          --
10845          ,p_rehire_reason  =>
10846              hr_transaction_api.get_varchar2_value
10847                   (p_transaction_step_id   => p_transaction_step_id
10848                     ,p_name                =>upper('p_rehire_reason'))
10849          --
10850          ,p_resume_exists  =>
10851              hr_transaction_api.get_varchar2_value
10852                   (p_transaction_step_id   => p_transaction_step_id
10853                     ,p_name                =>upper('p_resume_exists'))
10854          --
10855          ,p_resume_last_updated  =>
10856              hr_transaction_api.get_date_value
10857                   (p_transaction_step_id   => p_transaction_step_id
10858                     ,p_name                =>upper('p_resume_last_updated'))
10859          --
10860          ,p_second_passport_exists  =>
10861              hr_transaction_api.get_varchar2_value
10862                   (p_transaction_step_id   => p_transaction_step_id
10863                     ,p_name                =>upper('p_second_passport_exists'))
10864          --
10865          ,p_student_status  =>
10866              hr_transaction_api.get_varchar2_value
10867                   (p_transaction_step_id   => p_transaction_step_id
10868                     ,p_name                =>upper('p_student_status'))
10869          --
10870          ,p_town_of_birth  =>
10871              hr_transaction_api.get_varchar2_value
10872                   (p_transaction_step_id   => p_transaction_step_id
10873                     ,p_name                =>upper('p_town_of_birth'))
10874          --
10875          ,p_uses_tobacco_flag  =>
10876              hr_transaction_api.get_varchar2_value
10877                   (p_transaction_step_id   => p_transaction_step_id
10878                     ,p_name                =>upper('p_uses_tobacco_flag'))
10879          --
10880          ,p_vendor_id  =>
10881              hr_transaction_api.get_number_value
10882                   (p_transaction_step_id   => p_transaction_step_id
10883                     ,p_name                =>upper('p_vendor_id'))
10884          --
10885          ,p_work_schedule  =>
10886              hr_transaction_api.get_varchar2_value
10887                   (p_transaction_step_id   => p_transaction_step_id
10888                     ,p_name                =>upper('p_work_schedule'))
10889          --
10890          ,p_effective_start_date              =>  l_per_effective_start_date
10891          ,p_effective_end_date                =>  l_per_effective_end_date
10892          ,p_full_name                         =>  l_full_name
10893          ,p_comment_id                        =>  l_per_comment_id
10894          ,p_name_combination_warning          =>  l_per_name_combination_warning
10895          ,p_assign_payroll_warning            =>  l_per_assign_payroll_warning
10896          ,p_orig_hire_warning                 =>  l_per_orig_hire_warning
10897          );
10898 
10899        END IF ;
10900        --
10901        if l_contact_operation = 'EMER_CR_NEW_CONT' OR
10902           l_contact_operation = 'DPDNT_CR_NEW_CONT' then
10903           --
10904 
10905           hr_utility.set_location('EMER_CR_NEW_CONT or DPDNT_CR_NEW_CONT:'||l_proc, 35);
10906 -- Bug 3152505 : When in Emergency contact, we always will create two relationship.
10907 -- One as "Emergency" and other the selected Relationship.
10908           if ( /*l_dpdnt_bnf_flag = 'Y' and*/ l_dpdnt_bnf_contact_type <> 'EMRG'
10909                                       and l_contact_operation = 'EMER_CR_NEW_CONT' ) OR
10910              ( l_emrg_cont_flag = 'Y' and l_contact_operation = 'DPDNT_CR_NEW_CONT' ) then
10911 
10912 
10913             if l_dpdnt_bnf_contact_type in ('P', 'C', 'S') then
10914                 --
10915                 l_CREATE_MIRROR_FLAG := 'Y';
10916                 --
10917                 if l_dpdnt_bnf_contact_type = 'P' then
10918                    l_MIRROR_TYPE := 'C';
10919                 elsif l_dpdnt_bnf_contact_type = 'C' then
10920                    l_MIRROR_TYPE := 'P';
10921                 elsif l_dpdnt_bnf_contact_type = 'S' then
10922                    l_MIRROR_TYPE := 'S';
10923                 end if;
10924                 --
10925             else
10926                 --
10927                 l_CREATE_MIRROR_FLAG := 'N' ;
10928                 l_MIRROR_TYPE := null ;
10929                 --
10930             end if;
10931 
10932 --             l_CREATE_MIRROR_FLAG := 'N' ;
10933 --             l_MIRROR_TYPE := null ;
10934 --
10935 -- Bug # 2115552
10936           if l_contact_operation = 'EMER_CR_NEW_CONT' then
10937 
10938              l_addl_primary_contact_flag := 'N';
10939           else
10940              l_addl_primary_contact_flag  :=
10941                    hr_transaction_api.get_VARCHAR2_value
10942                      (p_transaction_step_id => p_transaction_step_id
10943                      ,p_name                => 'P_PRIMARY_CONTACT_FLAG');
10944           end if;
10945 --
10946 --
10947                hr_contact_rel_api.create_contact(
10948                 P_VALIDATE  => p_validate
10949                 --
10950                 ,P_START_DATE  =>          l_effective_date
10951                 --
10952                 ,P_BUSINESS_GROUP_ID  =>
10953                    hr_transaction_api.get_NUMBER_value
10954                      (p_transaction_step_id => p_transaction_step_id
10955                      ,p_name                => 'P_BUSINESS_GROUP_ID')
10956                 --
10957                 ,P_PERSON_ID  =>  l_person_id
10958                 --
10959                 ,P_CONTACT_PERSON_ID  =>   l_per_person_id
10960                 --
10961                 ,P_CONTACT_TYPE  => l_dpdnt_bnf_contact_type
10962                 --
10963                 ,P_CTR_COMMENTS  =>
10964                    hr_transaction_api.get_VARCHAR2_value
10965                      (p_transaction_step_id => p_transaction_step_id
10966                      ,p_name                => 'P_CTR_COMMENTS')
10967                 --
10968  -- Bug # 2115552
10969                 ,P_PRIMARY_CONTACT_FLAG  => l_addl_primary_contact_flag
10970 
10971 /*                ,P_PRIMARY_CONTACT_FLAG  =>
10972                    hr_transaction_api.get_VARCHAR2_value
10973                      (p_transaction_step_id => p_transaction_step_id
10974                      ,p_name                => 'P_PRIMARY_CONTACT_FLAG')
10975 */
10976                 --
10977                 ,P_DATE_START  =>
10978                    hr_transaction_api.get_DATE_value
10979                      (p_transaction_step_id => p_transaction_step_id
10980                      ,p_name                => 'P_DATE_START')
10981                 --
10982                 ,P_START_LIFE_REASON_ID  =>
10983                    hr_transaction_api.get_NUMBER_value
10984                      (p_transaction_step_id => p_transaction_step_id
10985                      ,p_name                => 'P_START_LIFE_REASON_ID')
10986                 --
10987                 ,P_DATE_END  =>
10988                    hr_transaction_api.get_DATE_value
10989                      (p_transaction_step_id => p_transaction_step_id
10990                      ,p_name                => 'P_DATE_END')
10991                 --
10992                 ,P_END_LIFE_REASON_ID  =>
10993                    hr_transaction_api.get_NUMBER_value
10994                      (p_transaction_step_id => p_transaction_step_id
10995                      ,p_name                => 'P_END_LIFE_REASON_ID')
10996                 --
10997                 ,P_RLTD_PER_RSDS_W_DSGNTR_FLAG  =>
10998                    hr_transaction_api.get_VARCHAR2_value
10999                      (p_transaction_step_id => p_transaction_step_id
11000                      ,p_name                => 'P_RLTD_PER_RSDS_W_DSGNTR_FLAG')
11001                 --
11002                 ,P_PERSONAL_FLAG  =>  l_dpdnt_bnf_personal_flag
11003                 --
11004                 ,P_SEQUENCE_NUMBER  =>
11005                    hr_transaction_api.get_NUMBER_value
11006                      (p_transaction_step_id => p_transaction_step_id
11007                      ,p_name                => 'P_SEQUENCE_NUMBER')
11008                 --
11009                 ,P_CONT_ATTRIBUTE_CATEGORY  =>
11010                    hr_transaction_api.get_VARCHAR2_value
11011                      (p_transaction_step_id => p_transaction_step_id
11012                      ,p_name                => 'P_CONT_ATTRIBUTE_CATEGORY')
11013                 --
11014                 ,P_CONT_ATTRIBUTE1  =>
11015                    hr_transaction_api.get_VARCHAR2_value
11016                      (p_transaction_step_id => p_transaction_step_id
11017                      ,p_name                => 'P_CONT_ATTRIBUTE1')
11018                 --
11019                 ,P_CONT_ATTRIBUTE2  =>
11020                    hr_transaction_api.get_VARCHAR2_value
11021                      (p_transaction_step_id => p_transaction_step_id
11022                      ,p_name                => 'P_CONT_ATTRIBUTE2')
11023                 --
11024                 ,P_CONT_ATTRIBUTE3  =>
11025                    hr_transaction_api.get_VARCHAR2_value
11026                      (p_transaction_step_id => p_transaction_step_id
11027                      ,p_name                => 'P_CONT_ATTRIBUTE3')
11028                 --
11029                 ,P_CONT_ATTRIBUTE4  =>
11030                    hr_transaction_api.get_VARCHAR2_value
11031                      (p_transaction_step_id => p_transaction_step_id
11032                      ,p_name                => 'P_CONT_ATTRIBUTE4')
11033                 --
11034                 ,P_CONT_ATTRIBUTE5  =>
11035                    hr_transaction_api.get_VARCHAR2_value
11036                      (p_transaction_step_id => p_transaction_step_id
11037                      ,p_name                => 'P_CONT_ATTRIBUTE5')
11038                 --
11039                 ,P_CONT_ATTRIBUTE6  =>
11040                    hr_transaction_api.get_VARCHAR2_value
11041                      (p_transaction_step_id => p_transaction_step_id
11042                      ,p_name                => 'P_CONT_ATTRIBUTE6')
11043                 --
11044                 ,P_CONT_ATTRIBUTE7  =>
11045                    hr_transaction_api.get_VARCHAR2_value
11046                      (p_transaction_step_id => p_transaction_step_id
11047                      ,p_name                => 'P_CONT_ATTRIBUTE7')
11048                 --
11049                 ,P_CONT_ATTRIBUTE8  =>
11050                    hr_transaction_api.get_VARCHAR2_value
11051                      (p_transaction_step_id => p_transaction_step_id
11052                      ,p_name                => 'P_CONT_ATTRIBUTE8')
11053                 --
11054                 ,P_CONT_ATTRIBUTE9  =>
11055                    hr_transaction_api.get_VARCHAR2_value
11056                      (p_transaction_step_id => p_transaction_step_id
11057                      ,p_name                => 'P_CONT_ATTRIBUTE9')
11058                 --
11059                 ,P_CONT_ATTRIBUTE10  =>
11060                    hr_transaction_api.get_VARCHAR2_value
11061                      (p_transaction_step_id => p_transaction_step_id
11062                      ,p_name                => 'P_CONT_ATTRIBUTE10')
11063                 --
11064                 ,P_CONT_ATTRIBUTE11  =>
11065                    hr_transaction_api.get_VARCHAR2_value
11066                      (p_transaction_step_id => p_transaction_step_id
11067                      ,p_name                => 'P_CONT_ATTRIBUTE11')
11068                 --
11069                 ,P_CONT_ATTRIBUTE12  =>
11070                    hr_transaction_api.get_VARCHAR2_value
11071                      (p_transaction_step_id => p_transaction_step_id
11072                      ,p_name                => 'P_CONT_ATTRIBUTE12')
11073                 --
11074                 ,P_CONT_ATTRIBUTE13  =>
11075                    hr_transaction_api.get_VARCHAR2_value
11076                      (p_transaction_step_id => p_transaction_step_id
11077                      ,p_name                => 'P_CONT_ATTRIBUTE13')
11078                 --
11079                 ,P_CONT_ATTRIBUTE14  =>
11080                    hr_transaction_api.get_VARCHAR2_value
11081                      (p_transaction_step_id => p_transaction_step_id
11082                      ,p_name                => 'P_CONT_ATTRIBUTE14')
11083                 --
11084                 ,P_CONT_ATTRIBUTE15  =>
11085                    hr_transaction_api.get_VARCHAR2_value
11086                      (p_transaction_step_id => p_transaction_step_id
11087                      ,p_name                => 'P_CONT_ATTRIBUTE15')
11088                 --
11089                 ,P_CONT_ATTRIBUTE16  =>
11090                    hr_transaction_api.get_VARCHAR2_value
11091                      (p_transaction_step_id => p_transaction_step_id
11092                      ,p_name                => 'P_CONT_ATTRIBUTE16')
11093                 --
11094                 ,P_CONT_ATTRIBUTE17  =>
11095                    hr_transaction_api.get_VARCHAR2_value
11096                      (p_transaction_step_id => p_transaction_step_id
11097                      ,p_name                => 'P_CONT_ATTRIBUTE17')
11098                 --
11099                 ,P_CONT_ATTRIBUTE18  =>
11100                    hr_transaction_api.get_VARCHAR2_value
11101                      (p_transaction_step_id => p_transaction_step_id
11102                      ,p_name                => 'P_CONT_ATTRIBUTE18')
11103                 --
11104                 ,P_CONT_ATTRIBUTE19  =>
11105                    hr_transaction_api.get_VARCHAR2_value
11106                      (p_transaction_step_id => p_transaction_step_id
11107                      ,p_name                => 'P_CONT_ATTRIBUTE19')
11108                 --
11109                 ,P_CONT_ATTRIBUTE20  =>
11110                    hr_transaction_api.get_VARCHAR2_value
11111                      (p_transaction_step_id => p_transaction_step_id
11112                      ,p_name                => 'P_CONT_ATTRIBUTE20')
11113                 --
11114                 ,P_THIRD_PARTY_PAY_FLAG  =>
11115                    hr_transaction_api.get_VARCHAR2_value
11116                      (p_transaction_step_id => p_transaction_step_id
11117                      ,p_name                => 'P_THIRD_PARTY_PAY_FLAG')
11118                 --
11119                 ,P_BONDHOLDER_FLAG  =>
11120                    hr_transaction_api.get_VARCHAR2_value
11121                      (p_transaction_step_id => p_transaction_step_id
11122                      ,p_name                => 'P_BONDHOLDER_FLAG')
11123                 --
11124                 ,P_DEPENDENT_FLAG  =>
11125                    hr_transaction_api.get_VARCHAR2_value
11126                      (p_transaction_step_id => p_transaction_step_id
11127                      ,p_name                => 'P_DEPENDENT_FLAG')
11128                 --
11129                 ,P_BENEFICIARY_FLAG  =>
11130                    hr_transaction_api.get_VARCHAR2_value
11131                      (p_transaction_step_id => p_transaction_step_id
11132                      ,p_name                => 'P_BENEFICIARY_FLAG')
11133                 --
11134                 ,P_CREATE_MIRROR_FLAG  =>  l_CREATE_MIRROR_FLAG
11135                 --
11136                 ,P_MIRROR_TYPE  => l_MIRROR_TYPE
11137                 --
11138                 ,P_MIRROR_CONT_ATTRIBUTE_CAT  =>
11139                    hr_transaction_api.get_VARCHAR2_value
11140                      (p_transaction_step_id => p_transaction_step_id
11141                      ,p_name                => 'P_MIRROR_CONT_ATTRIBUTE_CAT')
11142                 --
11143                 ,P_MIRROR_CONT_ATTRIBUTE1  =>
11144                    hr_transaction_api.get_VARCHAR2_value
11145                      (p_transaction_step_id => p_transaction_step_id
11146                      ,p_name                => 'P_MIRROR_CONT_ATTRIBUTE1')
11147                 --
11148                 ,P_MIRROR_CONT_ATTRIBUTE2  =>
11149                    hr_transaction_api.get_VARCHAR2_value
11150                      (p_transaction_step_id => p_transaction_step_id
11151                      ,p_name                => 'P_MIRROR_CONT_ATTRIBUTE2')
11152                 --
11153                 ,P_MIRROR_CONT_ATTRIBUTE3  =>
11154                    hr_transaction_api.get_VARCHAR2_value
11155                      (p_transaction_step_id => p_transaction_step_id
11156                      ,p_name                => 'P_MIRROR_CONT_ATTRIBUTE3')
11157                 --
11158                 ,P_MIRROR_CONT_ATTRIBUTE4  =>
11159                    hr_transaction_api.get_VARCHAR2_value
11160                      (p_transaction_step_id => p_transaction_step_id
11161                      ,p_name                => 'P_MIRROR_CONT_ATTRIBUTE4')
11162                 --
11163                 ,P_MIRROR_CONT_ATTRIBUTE5  =>
11164                    hr_transaction_api.get_VARCHAR2_value
11165                      (p_transaction_step_id => p_transaction_step_id
11166                      ,p_name                => 'P_MIRROR_CONT_ATTRIBUTE5')
11167                 --
11168                 ,P_MIRROR_CONT_ATTRIBUTE6  =>
11169                    hr_transaction_api.get_VARCHAR2_value
11170                      (p_transaction_step_id => p_transaction_step_id
11171                      ,p_name                => 'P_MIRROR_CONT_ATTRIBUTE6')
11172                 --
11173                 ,P_MIRROR_CONT_ATTRIBUTE7  =>
11174                    hr_transaction_api.get_VARCHAR2_value
11175                      (p_transaction_step_id => p_transaction_step_id
11176                      ,p_name                => 'P_MIRROR_CONT_ATTRIBUTE7')
11177                 --
11178                 ,P_MIRROR_CONT_ATTRIBUTE8  =>
11179                    hr_transaction_api.get_VARCHAR2_value
11180                      (p_transaction_step_id => p_transaction_step_id
11181                      ,p_name                => 'P_MIRROR_CONT_ATTRIBUTE8')
11182                 --
11183                 ,P_MIRROR_CONT_ATTRIBUTE9  =>
11184                    hr_transaction_api.get_VARCHAR2_value
11185                      (p_transaction_step_id => p_transaction_step_id
11186                      ,p_name                => 'P_MIRROR_CONT_ATTRIBUTE9')
11187                 --
11188                 ,P_MIRROR_CONT_ATTRIBUTE10  =>
11189                    hr_transaction_api.get_VARCHAR2_value
11190                      (p_transaction_step_id => p_transaction_step_id
11191                      ,p_name                => 'P_MIRROR_CONT_ATTRIBUTE10')
11192                 --
11193                 ,P_MIRROR_CONT_ATTRIBUTE11  =>
11194                    hr_transaction_api.get_VARCHAR2_value
11195                      (p_transaction_step_id => p_transaction_step_id
11196                      ,p_name                => 'P_MIRROR_CONT_ATTRIBUTE11')
11197                 --
11198                 ,P_MIRROR_CONT_ATTRIBUTE12  =>
11199                    hr_transaction_api.get_VARCHAR2_value
11200                      (p_transaction_step_id => p_transaction_step_id
11201                      ,p_name                => 'P_MIRROR_CONT_ATTRIBUTE12')
11202                 --
11203                 ,P_MIRROR_CONT_ATTRIBUTE13  =>
11204                    hr_transaction_api.get_VARCHAR2_value
11205                      (p_transaction_step_id => p_transaction_step_id
11206                      ,p_name                => 'P_MIRROR_CONT_ATTRIBUTE13')
11207                 --
11208                 ,P_MIRROR_CONT_ATTRIBUTE14  =>
11209                    hr_transaction_api.get_VARCHAR2_value
11210                      (p_transaction_step_id => p_transaction_step_id
11211                      ,p_name                => 'P_MIRROR_CONT_ATTRIBUTE14')
11212                 --
11213                 ,P_MIRROR_CONT_ATTRIBUTE15  =>
11214                    hr_transaction_api.get_VARCHAR2_value
11215                      (p_transaction_step_id => p_transaction_step_id
11216                      ,p_name                => 'P_MIRROR_CONT_ATTRIBUTE15')
11217                 --
11218                 ,P_MIRROR_CONT_ATTRIBUTE16  =>
11219                    hr_transaction_api.get_VARCHAR2_value
11220                      (p_transaction_step_id => p_transaction_step_id
11221                      ,p_name                => 'P_MIRROR_CONT_ATTRIBUTE16')
11222                 --
11223                 ,P_MIRROR_CONT_ATTRIBUTE17  =>
11224                    hr_transaction_api.get_VARCHAR2_value
11225                      (p_transaction_step_id => p_transaction_step_id
11226                      ,p_name                => 'P_MIRROR_CONT_ATTRIBUTE17')
11227                 --
11228                 ,P_MIRROR_CONT_ATTRIBUTE18  =>
11229                    hr_transaction_api.get_VARCHAR2_value
11230                      (p_transaction_step_id => p_transaction_step_id
11231                      ,p_name                => 'P_MIRROR_CONT_ATTRIBUTE18')
11232                 --
11233                 ,P_MIRROR_CONT_ATTRIBUTE19  =>
11234                    hr_transaction_api.get_VARCHAR2_value
11235                      (p_transaction_step_id => p_transaction_step_id
11236                      ,p_name                => 'P_MIRROR_CONT_ATTRIBUTE19')
11237                 --
11238                 ,P_MIRROR_CONT_ATTRIBUTE20  =>
11239                    hr_transaction_api.get_VARCHAR2_value
11240                      (p_transaction_step_id => p_transaction_step_id
11241                      ,p_name                => 'P_MIRROR_CONT_ATTRIBUTE20')
11242                 --
11243 
11244                 ,P_CONTACT_RELATIONSHIP_ID  	=> L_CONTACT_RELATIONSHIP_ID1
11245                 --
11246                 ,P_CTR_OBJECT_VERSION_NUMBER 	=> L_CTR_OBJECT_VERSION_NUMBER1
11247                 --
11248                 ,P_PER_PERSON_ID  		=> L_PER_PERSON_ID1
11249                 --
11250                 ,P_PER_OBJECT_VERSION_NUMBER 	=> L_PER_OBJECT_VERSION_NUMBER1
11251                 --
11252                 ,P_PER_EFFECTIVE_START_DATE  	=> L_PER_EFFECTIVE_START_DATE1
11253                 --
11254                 ,P_PER_EFFECTIVE_END_DATE  	=> L_PER_EFFECTIVE_END_DATE1
11255                 --
11256                 ,P_FULL_NAME  		=> L_FULL_NAME1
11257                 --
11258                 ,P_PER_COMMENT_ID  		=> L_PER_COMMENT_ID1
11259                 --
11260                 ,P_NAME_COMBINATION_WARNING  	=> L_CON_NAME_COMBINATION_WARNIN1
11261                 --
11262                 ,P_ORIG_HIRE_WARNING  	=> L_CON_ORIG_HIRE_WARNING1
11263 		--
11264                ,P_CONT_INFORMATION_CATEGORY  =>
11265                  hr_transaction_api.get_VARCHAR2_value
11266                    (p_transaction_step_id => p_transaction_step_id
11267                    ,p_name                => 'P_CONT_INFORMATION_CATEGORY')
11268               --
11269               ,P_CONT_INFORMATION1  =>
11270                  hr_transaction_api.get_VARCHAR2_value
11271                    (p_transaction_step_id => p_transaction_step_id
11272                    ,p_name                => 'P_CONT_INFORMATION1')
11273               --
11274               ,P_CONT_INFORMATION2  =>
11275                  hr_transaction_api.get_VARCHAR2_value
11276                    (p_transaction_step_id => p_transaction_step_id
11277                    ,p_name                => 'P_CONT_INFORMATION2')
11278               --
11279               ,P_CONT_INFORMATION3  =>
11280                  hr_transaction_api.get_VARCHAR2_value
11281                    (p_transaction_step_id => p_transaction_step_id
11282                    ,p_name                => 'P_CONT_INFORMATION3')
11283               --
11284               ,P_CONT_INFORMATION4  =>
11285                  hr_transaction_api.get_VARCHAR2_value
11286                    (p_transaction_step_id => p_transaction_step_id
11287                    ,p_name                => 'P_CONT_INFORMATION4')
11288               --
11289               ,P_CONT_INFORMATION5  =>
11290                  hr_transaction_api.get_VARCHAR2_value
11291                    (p_transaction_step_id => p_transaction_step_id
11292                    ,p_name                => 'P_CONT_INFORMATION5')
11293               --
11294               ,P_CONT_INFORMATION6  =>
11295                  hr_transaction_api.get_VARCHAR2_value
11296                    (p_transaction_step_id => p_transaction_step_id
11297                    ,p_name                => 'P_CONT_INFORMATION6')
11298               --
11299               ,P_CONT_INFORMATION7  =>
11300                  hr_transaction_api.get_VARCHAR2_value
11301                    (p_transaction_step_id => p_transaction_step_id
11302                    ,p_name                => 'P_CONT_INFORMATION7')
11303               --
11304               ,P_CONT_INFORMATION8  =>
11305                  hr_transaction_api.get_VARCHAR2_value
11306                    (p_transaction_step_id => p_transaction_step_id
11307                    ,p_name                => 'P_CONT_INFORMATION8')
11308               --
11309               ,P_CONT_INFORMATION9  =>
11310                  hr_transaction_api.get_VARCHAR2_value
11311                    (p_transaction_step_id => p_transaction_step_id
11312                    ,p_name                => 'P_CONT_INFORMATION9')
11313               --
11314               ,P_CONT_INFORMATION10  =>
11315                  hr_transaction_api.get_VARCHAR2_value
11316                    (p_transaction_step_id => p_transaction_step_id
11317                    ,p_name                => 'P_CONT_INFORMATION10')
11318               --
11319               ,P_CONT_INFORMATION11  =>
11320                  hr_transaction_api.get_VARCHAR2_value
11321                    (p_transaction_step_id => p_transaction_step_id
11322                    ,p_name                => 'P_CONT_INFORMATION11')
11323               --
11324               ,P_CONT_INFORMATION12  =>
11325                  hr_transaction_api.get_VARCHAR2_value
11326                    (p_transaction_step_id => p_transaction_step_id
11327                    ,p_name                => 'P_CONT_INFORMATION12')
11328               --
11329               ,P_CONT_INFORMATION13  =>
11330                  hr_transaction_api.get_VARCHAR2_value
11331                    (p_transaction_step_id => p_transaction_step_id
11332                    ,p_name                => 'P_CONT_INFORMATION13')
11333               --
11334               ,P_CONT_INFORMATION14  =>
11335                  hr_transaction_api.get_VARCHAR2_value
11336                    (p_transaction_step_id => p_transaction_step_id
11337                    ,p_name                => 'P_CONT_INFORMATION14')
11338               --
11339               ,P_CONT_INFORMATION15  =>
11340                  hr_transaction_api.get_VARCHAR2_value
11341                    (p_transaction_step_id => p_transaction_step_id
11342                    ,p_name                => 'P_CONT_INFORMATION15')
11343               --
11344               ,P_CONT_INFORMATION16  =>
11345                  hr_transaction_api.get_VARCHAR2_value
11346                    (p_transaction_step_id => p_transaction_step_id
11347                    ,p_name                => 'P_CONT_INFORMATION16')
11348               --
11349               ,P_CONT_INFORMATION17  =>
11350                  hr_transaction_api.get_VARCHAR2_value
11351                    (p_transaction_step_id => p_transaction_step_id
11352                    ,p_name                => 'P_CONT_INFORMATION17')
11353               --
11354               ,P_CONT_INFORMATION18  =>
11355                  hr_transaction_api.get_VARCHAR2_value
11356                    (p_transaction_step_id => p_transaction_step_id
11357                    ,p_name                => 'P_CONT_INFORMATION18')
11358               --
11359               ,P_CONT_INFORMATION19  =>
11360                  hr_transaction_api.get_VARCHAR2_value
11361                    (p_transaction_step_id => p_transaction_step_id
11362                    ,p_name                => 'P_CONT_INFORMATION19')
11363               --
11364               ,P_CONT_INFORMATION20  =>
11365                  hr_transaction_api.get_VARCHAR2_value
11366                    (p_transaction_step_id => p_transaction_step_id
11367                    ,p_name                => 'P_CONT_INFORMATION20')
11368 	      --
11369       	     ,P_MIRROR_CONT_INFORMATION_CAT  =>
11370                  hr_transaction_api.get_VARCHAR2_value
11371                    (p_transaction_step_id => p_transaction_step_id
11372                    ,p_name                => 'P_MIRROR_CONT_INFORMATION_CAT')
11373               --
11374              ,P_MIRROR_CONT_INFORMATION1  =>
11375                  hr_transaction_api.get_VARCHAR2_value
11376                    (p_transaction_step_id => p_transaction_step_id
11377                    ,p_name                => 'P_MIRROR_CONT_INFORMATION1')
11378               --
11379              ,P_MIRROR_CONT_INFORMATION2  =>
11380                  hr_transaction_api.get_VARCHAR2_value
11381                    (p_transaction_step_id => p_transaction_step_id
11382                    ,p_name                => 'P_MIRROR_CONT_INFORMATION2')
11383               --
11384              ,P_MIRROR_CONT_INFORMATION3  =>
11385                  hr_transaction_api.get_VARCHAR2_value
11386                    (p_transaction_step_id => p_transaction_step_id
11387                    ,p_name                => 'P_MIRROR_CONT_INFORMATION3')
11388               --
11389              ,P_MIRROR_CONT_INFORMATION4  =>
11390                  hr_transaction_api.get_VARCHAR2_value
11391                    (p_transaction_step_id => p_transaction_step_id
11392                    ,p_name                => 'P_MIRROR_CONT_INFORMATION4')
11393               --
11394              ,P_MIRROR_CONT_INFORMATION5  =>
11395                  hr_transaction_api.get_VARCHAR2_value
11396                    (p_transaction_step_id => p_transaction_step_id
11397                    ,p_name                => 'P_MIRROR_CONT_INFORMATION5')
11398               --
11399              ,P_MIRROR_CONT_INFORMATION6  =>
11400                  hr_transaction_api.get_VARCHAR2_value
11401                    (p_transaction_step_id => p_transaction_step_id
11402                    ,p_name                => 'P_MIRROR_CONT_INFORMATION6')
11403               --
11404              ,P_MIRROR_CONT_INFORMATION7  =>
11405                  hr_transaction_api.get_VARCHAR2_value
11406                    (p_transaction_step_id => p_transaction_step_id
11407                    ,p_name                => 'P_MIRROR_CONT_INFORMATION7')
11408               --
11409              ,P_MIRROR_CONT_INFORMATION8  =>
11410                  hr_transaction_api.get_VARCHAR2_value
11411                    (p_transaction_step_id => p_transaction_step_id
11412                    ,p_name                => 'P_MIRROR_CONT_INFORMATION8')
11413               --
11414              ,P_MIRROR_CONT_INFORMATION9  =>
11415                  hr_transaction_api.get_VARCHAR2_value
11416                    (p_transaction_step_id => p_transaction_step_id
11417                    ,p_name                => 'P_MIRROR_CONT_INFORMATION9')
11418               --
11419              ,P_MIRROR_CONT_INFORMATION10  =>
11420                  hr_transaction_api.get_VARCHAR2_value
11421                    (p_transaction_step_id => p_transaction_step_id
11422                    ,p_name                => 'P_MIRROR_CONT_INFORMATION10')
11423               --
11424              ,P_MIRROR_CONT_INFORMATION11  =>
11425                  hr_transaction_api.get_VARCHAR2_value
11426                    (p_transaction_step_id => p_transaction_step_id
11427                    ,p_name                => 'P_MIRROR_CONT_INFORMATION11')
11428               --
11429              ,P_MIRROR_CONT_INFORMATION12  =>
11430                  hr_transaction_api.get_VARCHAR2_value
11431                    (p_transaction_step_id => p_transaction_step_id
11432                    ,p_name                => 'P_MIRROR_CONT_INFORMATION12')
11433               --
11434              ,P_MIRROR_CONT_INFORMATION13  =>
11435                  hr_transaction_api.get_VARCHAR2_value
11436                    (p_transaction_step_id => p_transaction_step_id
11437                    ,p_name                => 'P_MIRROR_CONT_INFORMATION13')
11438               --
11439              ,P_MIRROR_CONT_INFORMATION14  =>
11440                  hr_transaction_api.get_VARCHAR2_value
11441                    (p_transaction_step_id => p_transaction_step_id
11442                    ,p_name                => 'P_MIRROR_CONT_INFORMATION14')
11443               --
11444              ,P_MIRROR_CONT_INFORMATION15  =>
11445                  hr_transaction_api.get_VARCHAR2_value
11446                    (p_transaction_step_id => p_transaction_step_id
11447                    ,p_name                => 'P_MIRROR_CONT_INFORMATION15')
11448               --
11449              ,P_MIRROR_CONT_INFORMATION16  =>
11450                  hr_transaction_api.get_VARCHAR2_value
11451                    (p_transaction_step_id => p_transaction_step_id
11452                    ,p_name                => 'P_MIRROR_CONT_INFORMATION16')
11453               --
11454              ,P_MIRROR_CONT_INFORMATION17  =>
11455                  hr_transaction_api.get_VARCHAR2_value
11456                    (p_transaction_step_id => p_transaction_step_id
11457                    ,p_name                => 'P_MIRROR_CONT_INFORMATION17')
11458               --
11459              ,P_MIRROR_CONT_INFORMATION18  =>
11460                  hr_transaction_api.get_VARCHAR2_value
11461                    (p_transaction_step_id => p_transaction_step_id
11462                    ,p_name                => 'P_MIRROR_CONT_INFORMATION18')
11463               --
11464              ,P_MIRROR_CONT_INFORMATION19 =>
11465                  hr_transaction_api.get_VARCHAR2_value
11466                    (p_transaction_step_id => p_transaction_step_id
11467                    ,p_name                => 'P_MIRROR_CONT_INFORMATION19')
11468               --
11469              ,P_MIRROR_CONT_INFORMATION20  =>
11470                  hr_transaction_api.get_VARCHAR2_value
11471                    (p_transaction_step_id => p_transaction_step_id
11472                    ,p_name                => 'P_MIRROR_CONT_INFORMATION20')
11473                );
11474              --
11475           end if;
11476           --
11477   end if;
11478   --
11479        --
11480        -- Store the l_per_person_id in package global so that it
11481        -- can be used by create phone.
11482        --
11483        g_contact_person_id := L_PER_PERSON_ID;
11484        --
11485   END IF;
11486   --
11487   IF l_per_assign_payroll_warning THEN
11488      -- ------------------------------------------------------------
11489      -- The assign payroll warning has been set so we must set the
11490      -- error so we can retrieve the text using fnd_message.get
11491      -- -------------------------------------------------------------
11492      -- as of now, 09/07/00, we don't know how to handle warnings yet. So, we
11493      -- just don't do anything.
11494      null;
11495   END IF;
11496   --
11497   IF p_validate = true THEN
11498      ROLLBACK TO process_create_contact_api;
11499   END IF;
11500 --
11501 
11502 EXCEPTION
11503   WHEN hr_utility.hr_error THEN
11504   hr_utility.set_location('Exception:WHEN hr_utility.hr_error THEN'||l_proc,565);
11505     -- -----------------------------------------------------------------
11506     -- An application error has been raised by the API so we must set
11507     -- the error.
11508     -- -----------------------------------------------------------------
11509         ROLLBACK TO process_create_contact_api;
11510         RAISE;
11511 
11512 END process_create_contact_api;
11513 --
11514 
11515 -- ---------------------------------------------------------------------------
11516 -- ----------------------------- < process_api > -----------------------------
11517 -- ---------------------------------------------------------------------------
11518 -- Purpose: This procedure will be invoked in workflow notification
11519 --          when an approver approves all the changes.  This procedure
11520 --          will call the api to update to the database with p_validate
11521 --          equal to false.
11522 -- ---------------------------------------------------------------------------
11523 PROCEDURE process_api
11524   (p_validate IN BOOLEAN DEFAULT FALSE
11525   ,p_transaction_step_id IN NUMBER
11526   ,p_effective_date      in varchar2 default null
11527 )
11528 IS
11529    cursor get_emrg_relid_ovn(p_contact_relationship_id     number
11530                             ,p_contact_person_id           number
11531                             ,p_person_id number)
11532    is
11533    select contact_relationship_id,
11534           object_version_number,
11535           primary_contact_flag
11536    from PER_CONTACT_RELATIONSHIPS
11537    where person_id = p_person_id
11538    and contact_person_id = p_contact_person_id
11539    and contact_type = 'EMRG'
11540    and trunc(sysdate) >= decode(date_start,null,trunc(sysdate),trunc(date_start))
11541    and trunc(sysdate) <  decode(date_end,null,trunc(sysdate)+1,trunc(date_end));
11542 
11543    cursor get_other_relid_ovn(p_contact_person_id           number
11544                             ,p_person_id number)
11545    is
11546    select contact_relationship_id,
11547           object_version_number
11548    from PER_CONTACT_RELATIONSHIPS
11549    where person_id = p_person_id
11550    and contact_person_id = p_contact_person_id
11551    and trunc(sysdate) >= decode(date_start,null,trunc(sysdate),trunc(date_start))
11552    and trunc(sysdate) <  decode(date_end,null,trunc(sysdate)+1,trunc(date_end));
11553 
11554   --
11555   l_effective_start_date             date default null;
11556   l_effective_end_date               date default null;
11557   l_ovn                              number default null;
11558   l_per_ovn			     number default null;
11559   l_employee_number		     per_all_people_f.employee_number%type default null;
11560   l_contact_relationship_id          number default null;
11561   l_per_rec_changed	             varchar2(100) default 'NOTCHANGED' ;
11562   l_cont_rec_changed                 varchar2(100) default 'NOTCHANGED' ;
11563   l_full_name                        per_all_people_f.full_name%type default null;
11564   l_comment_id                       number default null;
11565   l_name_combination_warning         boolean default null ;
11566   l_assign_payroll_warning           boolean default null ;
11567   l_orig_hire_warning                boolean default null ;
11568   l_datetrack_update_mode            varchar2(100);
11569   l_process_section                  varchar2(100);
11570   --
11571   l_contact_operation                varchar2(100);
11572   l_contact_type                     varchar2(100);
11573   l_personal_flag                    varchar2(100);
11574   l_full_name1                       per_all_people_f.full_name%type;
11575   l_per_comment_id1                  per_all_people_f.comment_id%type;
11576   l_con_name_combination_warnin1    boolean;
11577   l_con_orig_hire_warning1           boolean;
11578   l_per_person_id1                   per_all_people_f.person_id%type
11579                                      default null;
11580   l_contact_relationship_id1         number default null;
11581   l_ctr_object_version_number1       number default null;
11582   l_per_object_version_number1       number default null;
11583   l_per_effective_start_date1        date default null;
11584   l_per_effective_end_date1          date default null;
11585   l_effective_date                   date default null;
11586   --
11587   l_date_sart                        date;
11588   l_date_end                         date;
11589   l_action                           varchar2(20);
11590   l_orig_rel_type                    varchar2(30);
11591   l_primary_contact_flag             varchar2(100);
11592   l_emrg_ovn                         number default null;
11593   l_emrg_relid                       number default null;
11594   l_other_ovn                         number default null;
11595   l_other_relid                       number default null;
11596   l_emrg_primary_cont_flag           varchar2(100);
11597   l_proc   varchar2(72)  := g_package||'process_api';
11598 
11599 --- bug 5894873
11600   l_start_contact_date                date;
11601   l_old_contact_relationship_id       number;
11602 
11603   p_rowid varchar2(300);
11604   l_CONTACT_RELATIONSHIP_ID_1 number;
11605   skip_contact_create_flg number := 0;
11606 
11607 --- bug 5894873
11608 
11609 BEGIN
11610   --
11611   --  hr_utility.set_location('Entering hr_process_contact_ss.process_api', 100);
11612     hr_utility.set_location('Entering:'||l_proc, 5);
11613   --
11614   SAVEPOINT update_cont_relationship;
11615 
11616   -- Change for Approvals for contact.
11617   -- Get the process section.
11618   --
11619   l_process_section := hr_transaction_api.get_varchar2_value
11620                         (p_transaction_step_id => p_transaction_step_id
11621                          ,p_name =>upper( 'P_PROCESS_SECTION_NAME'));
11622   --
11623   if l_process_section = 'DELETE_CONTACTS' then
11624      --
11625      hr_utility.set_location('DELETE_CONTACTS:'||l_proc, 10);
11626      process_end_api
11627           (p_validate            => p_validate
11628           ,p_transaction_step_id => p_transaction_step_id
11629           -- SFL changes
11630           ,p_effective_date      => p_effective_date
11631      );
11632      --
11633      hr_utility.set_location('Leaving hr_process_contact_ss.process_api', 100);
11634      return;
11635      --
11636  -- end if;
11637   else -- l_process_section is not 'DELETE_CONTACTS'
11638  --
11639   -- SFL changes
11640 
11641          is_address_updated(
11642                                  P_CONTACT_RELATIONSHIP_ID  => hr_transaction_api.get_NUMBER_value
11643                                                                                                (p_transaction_step_id => p_transaction_step_id
11644 			                 ,p_name                => 'P_CONTACT_RELATIONSHIP_ID')
11645                                 ,P_DATE_START  =>                            hr_transaction_api.get_DATE_value
11646 			                 (p_transaction_step_id => p_transaction_step_id
11647          	                                                                     ,p_name                => 'P_DATE_START')
11648                                ,p_transaction_step_id => p_transaction_step_id
11649  	    ,p_CONTACT_PERSON_ID =>                hr_transaction_api.get_NUMBER_value
11650 			                (p_transaction_step_id => p_transaction_step_id
11651         			                 ,p_name                => 'P_CONTACT_PERSON_ID')
11652            	    , p_PERSON_ID =>       	                  hr_transaction_api.get_NUMBER_value
11653 			                 (p_transaction_step_id => p_transaction_step_id
11654          			                 ,p_name                => 'P_PERSON_ID'));
11655   begin
11656      --
11657      l_per_rec_changed   := hr_transaction_api.get_varchar2_value
11658 	   (p_transaction_step_id => p_transaction_step_id
11659 	   ,p_name                => 'p_per_rec_changed') ;
11660      --
11661   exception
11662      when others then
11663        l_per_rec_changed   := 'NULL';
11664   end;
11665 
11666   IF l_per_rec_changed = 'CHANGED' THEN
11667            --
11668     l_per_ovn           :=  hr_transaction_api.get_number_value
11669 	   (p_transaction_step_id => p_transaction_step_id
11670 	   ,p_name                => 'p_per_object_version_number') ;
11671          --
11672     l_employee_number   :=  hr_transaction_api.get_varchar2_value
11673 	   (p_transaction_step_id => p_transaction_step_id
11674 	   ,p_name                => 'p_employee_number') ;
11675 
11676     l_datetrack_update_mode :=
11677 		 hr_transaction_api.get_varchar2_value
11678 		 (p_transaction_step_id   => p_transaction_step_id
11679 		  ,p_name                 =>upper('p_datetrack_update_mode'));
11680     --
11681     if l_datetrack_update_mode = 'CORRECT' then
11682        l_datetrack_update_mode := 'CORRECTION';
11683     else
11684        -- 9999 Do we need a different mode.
11685        l_datetrack_update_mode := 'CORRECTION';
11686     end if;
11687     --
11688     if not p_validate then
11689      --
11690      l_effective_date := hr_transaction_api.get_DATE_value
11691            (p_transaction_step_id => p_transaction_step_id
11692            ,p_name                => 'P_PER_EFFECTIVE_DATE');
11693      --
11694     end if;
11695     --
11696     hr_person_api.update_person(
11697 
11698 	 p_validate  =>  p_validate
11699       --
11700 	 ,p_effective_date  => l_effective_date
11701                  /*
11702 		 hr_transaction_api.get_date_value
11703 		 (p_transaction_step_id   => p_transaction_step_id
11704 		  ,p_name                 =>upper('p_per_effective_date'))
11705                  */
11706       --
11707 	 ,p_datetrack_update_mode  =>  l_datetrack_update_mode
11708       -- 9999
11709       --          hr_transaction_api.get_varchar2_value
11710       --          (p_transaction_step_id   => p_transaction_step_id
11711       --               ,p_name             =>upper('p_datetrack_update_mode'))
11712       --
11713 	 ,p_person_id  =>
11714 		 hr_transaction_api.get_number_value
11715 		 (p_transaction_step_id   => p_transaction_step_id
11716 		  ,p_name                 =>upper('p_cont_person_id'))
11717       --
11718 	 ,p_object_version_number  => l_per_ovn
11719       --
11720 
11721     ---------------------------------------------------------------------------
11722     -- Bug 1937643 Fix Begins - 08/04/2002
11723     -- With the PTU model, the per_all_people_f.person_type_id stores only the
11724     -- default user flavor of the system_person_type.  The true user flavor
11725     -- for the system_person_type is stored in per_person_type_usages_f table.
11726     -- Since the current Personal Information Contacts region
11727     -- does not allow a user to choose any user flavor, so we do not pass in
11728     -- p_person_type_id when calling the hr_person_api.update_person.  That way,
11729     -- the api will understand that the person_type is not changed and will not
11730     -- update the person_type_id in per_person_type_usages_f table as is.  If we
11731     -- pass the per_all_people_f.person_type_id to the api,the person_type_id in
11732     -- per_person_type_usages_f table will be updated with that value which will
11733     -- overwrite the true user flavor of the system person type with the
11734     -- default user flavor person type.  This may not be desirable.
11735     -- When we allow a user to select user flavors of person type in Contacts
11736     -- region, the commented out code needs to change and the whole package
11737     -- of this hrconwrs.pkb needs to get the true person_type_id from the
11738     -- per_person_type_usages_f table.
11739     ---------------------------------------------------------------------------
11740     /*
11741 	 ,p_person_type_id  =>
11742 		 hr_transaction_api.get_number_value
11743 		 (p_transaction_step_id   => p_transaction_step_id
11744 		  ,p_name                 =>upper('p_person_type_id'))
11745     */
11746       --
11747 	 ,p_last_name  =>
11748 		 hr_transaction_api.get_varchar2_value
11749                 (p_transaction_step_id   => p_transaction_step_id
11750                  ,p_name                 =>upper('p_last_name'))
11751       --
11752         ,p_applicant_number  =>
11753                  hr_transaction_api.get_varchar2_value
11754                  (p_transaction_step_id   => p_transaction_step_id
11755                   ,p_name                 =>upper('p_applicant_number'))
11756       --
11757          ,p_comments  =>
11758                  hr_transaction_api.get_varchar2_value
11759                  (p_transaction_step_id   => p_transaction_step_id
11760                   ,p_name                 =>upper('p_per_comments'))
11761       --
11762          ,p_date_employee_data_verified  =>
11763                  hr_transaction_api.get_date_value
11764                  (p_transaction_step_id   => p_transaction_step_id
11765                   ,p_name                 =>upper('p_date_employee_data_verified'))
11766       --
11767          ,p_date_of_birth  =>
11768                  hr_transaction_api.get_date_value
11769                  (p_transaction_step_id   => p_transaction_step_id
11770                   ,p_name                 =>upper('p_date_of_birth'))
11771       --
11772          ,p_email_address  =>
11773                  hr_transaction_api.get_varchar2_value
11774                  (p_transaction_step_id   => p_transaction_step_id
11775                   ,p_name                 =>upper('p_email_address'))
11776       --
11777          ,p_employee_number  =>  l_employee_number
11778       --
11779          ,p_expense_check_send_to_addres  =>
11780                  hr_transaction_api.get_varchar2_value
11781                  (p_transaction_step_id   => p_transaction_step_id
11782                   ,p_name                 =>upper('p_expense_check_send_to_addres'))
11783       --
11784          ,p_first_name  =>
11785                  hr_transaction_api.get_varchar2_value
11786                  (p_transaction_step_id   => p_transaction_step_id
11787                   ,p_name                 =>upper('p_first_name'))
11788       --
11789          ,p_known_as  =>
11790                  hr_transaction_api.get_varchar2_value
11791                  (p_transaction_step_id   => p_transaction_step_id
11792                   ,p_name                 =>upper('p_known_as'))
11793       --
11794          ,p_marital_status  =>
11795                  hr_transaction_api.get_varchar2_value
11796                  (p_transaction_step_id   => p_transaction_step_id
11797                   ,p_name                 =>upper('p_marital_status'))
11798       --
11799          ,p_middle_names  =>
11800                  hr_transaction_api.get_varchar2_value
11801                  (p_transaction_step_id   => p_transaction_step_id
11802                   ,p_name                 =>upper('p_middle_names'))
11803       --
11804          ,p_nationality  =>
11805                  hr_transaction_api.get_varchar2_value
11806                  (p_transaction_step_id   => p_transaction_step_id
11807                   ,p_name                 =>upper('p_nationality'))
11808       --
11809          ,p_national_identifier  =>
11810                  hr_transaction_api.get_varchar2_value
11811                  (p_transaction_step_id   => p_transaction_step_id
11812                   ,p_name                 =>upper('p_national_identifier'))
11813       --
11814          ,p_previous_last_name  =>
11815                  hr_transaction_api.get_varchar2_value
11816                  (p_transaction_step_id   => p_transaction_step_id
11817                   ,p_name                 =>upper('p_previous_last_name'))
11818       --
11819          ,p_registered_disabled_flag  =>
11820                  hr_transaction_api.get_varchar2_value
11821                  (p_transaction_step_id   => p_transaction_step_id
11822                   ,p_name                 =>upper('p_registered_disabled_flag'))
11823       --
11824          ,p_sex  =>
11825                  hr_transaction_api.get_varchar2_value
11826                  (p_transaction_step_id   => p_transaction_step_id
11827                   ,p_name                 =>upper('p_sex'))
11828       --
11829          ,p_title  =>
11830                  hr_transaction_api.get_varchar2_value
11831                  (p_transaction_step_id   => p_transaction_step_id
11832                   ,p_name                 =>upper('p_title'))
11833       --
11834          ,p_vendor_id  =>
11835                  hr_transaction_api.get_number_value
11836                  (p_transaction_step_id   => p_transaction_step_id
11837                   ,p_name                 =>upper('p_vendor_id'))
11838       --
11839          ,p_work_telephone  =>
11840                  hr_transaction_api.get_varchar2_value
11841                  (p_transaction_step_id   => p_transaction_step_id
11842                   ,p_name                 =>upper('p_work_telephone'))
11843       --
11844          ,p_attribute_category  =>
11845                  hr_transaction_api.get_varchar2_value
11846                  (p_transaction_step_id   => p_transaction_step_id
11847                   ,p_name                 =>upper('p_attribute_category'))
11848       --
11849          ,p_attribute1  =>
11850                  hr_transaction_api.get_varchar2_value
11851                  (p_transaction_step_id   => p_transaction_step_id
11852                   ,p_name                 =>upper('p_attribute1'))
11853       --
11854          ,p_attribute2  =>
11855                  hr_transaction_api.get_varchar2_value
11856                  (p_transaction_step_id   => p_transaction_step_id
11857                   ,p_name                 =>upper('p_attribute2'))
11858       --
11859          ,p_attribute3  =>
11860                  hr_transaction_api.get_varchar2_value
11861                  (p_transaction_step_id   => p_transaction_step_id
11862                   ,p_name                 =>upper('p_attribute3'))
11863       --
11864          ,p_attribute4  =>
11865                  hr_transaction_api.get_varchar2_value
11866                  (p_transaction_step_id   => p_transaction_step_id
11867                   ,p_name                 =>upper('p_attribute4'))
11868       --
11869          ,p_attribute5  =>
11870                  hr_transaction_api.get_varchar2_value
11871                  (p_transaction_step_id   => p_transaction_step_id
11872                   ,p_name                 =>upper('p_attribute5'))
11873       --
11874          ,p_attribute6  =>
11875                  hr_transaction_api.get_varchar2_value
11876                  (p_transaction_step_id   => p_transaction_step_id
11877                   ,p_name                 =>upper('p_attribute6'))
11878       --
11879          ,p_attribute7  =>
11880                  hr_transaction_api.get_varchar2_value
11881                  (p_transaction_step_id   => p_transaction_step_id
11882                   ,p_name                 =>upper('p_attribute7'))
11883       --
11884          ,p_attribute8  =>
11885                  hr_transaction_api.get_varchar2_value
11886                  (p_transaction_step_id   => p_transaction_step_id
11887                   ,p_name                 =>upper('p_attribute8'))
11888       --
11889          ,p_attribute9  =>
11890                  hr_transaction_api.get_varchar2_value
11891                  (p_transaction_step_id   => p_transaction_step_id
11892                   ,p_name                 =>upper('p_attribute9'))
11893       --
11894          ,p_attribute10  =>
11895                  hr_transaction_api.get_varchar2_value
11896                  (p_transaction_step_id   => p_transaction_step_id
11897                   ,p_name                 =>upper('p_attribute10'))
11898       --
11899          ,p_attribute11  =>
11900                  hr_transaction_api.get_varchar2_value
11901                  (p_transaction_step_id   => p_transaction_step_id
11902                   ,p_name                 =>upper('p_attribute11'))
11903       --
11904          ,p_attribute12  =>
11905                  hr_transaction_api.get_varchar2_value
11906                  (p_transaction_step_id   => p_transaction_step_id
11907                   ,p_name                 =>upper('p_attribute12'))
11908       --
11909          ,p_attribute13  =>
11910                  hr_transaction_api.get_varchar2_value
11911                  (p_transaction_step_id   => p_transaction_step_id
11912                   ,p_name                 =>upper('p_attribute13'))
11913       --
11914          ,p_attribute14  =>
11915                  hr_transaction_api.get_varchar2_value
11916                  (p_transaction_step_id   => p_transaction_step_id
11917                   ,p_name                 =>upper('p_attribute14'))
11918       --
11919          ,p_attribute15  =>
11920                  hr_transaction_api.get_varchar2_value
11921                  (p_transaction_step_id   => p_transaction_step_id
11922                   ,p_name                 =>upper('p_attribute15'))
11923       --
11924          ,p_attribute16  =>
11925                  hr_transaction_api.get_varchar2_value
11926                  (p_transaction_step_id   => p_transaction_step_id
11927                   ,p_name                 =>upper('p_attribute16'))
11928       --
11929          ,p_attribute17  =>
11930                  hr_transaction_api.get_varchar2_value
11931                  (p_transaction_step_id   => p_transaction_step_id
11932                   ,p_name                 =>upper('p_attribute17'))
11933       --
11934          ,p_attribute18  =>
11935                  hr_transaction_api.get_varchar2_value
11936                  (p_transaction_step_id   => p_transaction_step_id
11937                   ,p_name                 =>upper('p_attribute18'))
11938       --
11939          ,p_attribute19  =>
11940                  hr_transaction_api.get_varchar2_value
11941                  (p_transaction_step_id   => p_transaction_step_id
11942                   ,p_name                 =>upper('p_attribute19'))
11943       --
11944          ,p_attribute20  =>
11945                  hr_transaction_api.get_varchar2_value
11946                  (p_transaction_step_id   => p_transaction_step_id
11947                   ,p_name                 =>upper('p_attribute20'))
11948       --
11949          ,p_attribute21  =>
11950                  hr_transaction_api.get_varchar2_value
11951                  (p_transaction_step_id   => p_transaction_step_id
11952                   ,p_name                 =>upper('p_attribute21'))
11953       --
11954          ,p_attribute22  =>
11955                  hr_transaction_api.get_varchar2_value
11956                  (p_transaction_step_id   => p_transaction_step_id
11957                   ,p_name                 =>upper('p_attribute22'))
11958       --
11959          ,p_attribute23  =>
11960                  hr_transaction_api.get_varchar2_value
11961                  (p_transaction_step_id   => p_transaction_step_id
11962                   ,p_name                 =>upper('p_attribute23'))
11963       --
11964          ,p_attribute24  =>
11965                  hr_transaction_api.get_varchar2_value
11966                  (p_transaction_step_id   => p_transaction_step_id
11967                   ,p_name                 =>upper('p_attribute24'))
11968       --
11969          ,p_attribute25  =>
11970                  hr_transaction_api.get_varchar2_value
11971                  (p_transaction_step_id   => p_transaction_step_id
11972                   ,p_name                 =>upper('p_attribute25'))
11973       --
11974          ,p_attribute26  =>
11975                  hr_transaction_api.get_varchar2_value
11976                  (p_transaction_step_id   => p_transaction_step_id
11977                   ,p_name                 =>upper('p_attribute26'))
11978       --
11979          ,p_attribute27  =>
11980                  hr_transaction_api.get_varchar2_value
11981                  (p_transaction_step_id   => p_transaction_step_id
11982                   ,p_name                 =>upper('p_attribute27'))
11983       --
11984          ,p_attribute28  =>
11985                  hr_transaction_api.get_varchar2_value
11986                  (p_transaction_step_id   => p_transaction_step_id
11987                   ,p_name                 =>upper('p_attribute28'))
11988       --
11989          ,p_attribute29  =>
11990                  hr_transaction_api.get_varchar2_value
11991                  (p_transaction_step_id   => p_transaction_step_id
11992                   ,p_name                 =>upper('p_attribute29'))
11993       --
11994          ,p_attribute30  =>
11995                  hr_transaction_api.get_varchar2_value
11996                  (p_transaction_step_id   => p_transaction_step_id
11997                   ,p_name                 =>upper('p_attribute30'))
11998       --
11999          ,p_per_information_category  =>
12000                  hr_transaction_api.get_varchar2_value
12001                  (p_transaction_step_id   => p_transaction_step_id
12002                   ,p_name                 =>upper('p_per_information_category'))
12003       --
12004          ,p_per_information1  =>
12005                  hr_transaction_api.get_varchar2_value
12006                  (p_transaction_step_id   => p_transaction_step_id
12007                   ,p_name                 =>upper('p_per_information1'))
12008       --
12009          ,p_per_information2  =>
12010                  hr_transaction_api.get_varchar2_value
12011                  (p_transaction_step_id   => p_transaction_step_id
12012                   ,p_name                 =>upper('p_per_information2'))
12013       --
12014          ,p_per_information3  =>
12015                  hr_transaction_api.get_varchar2_value
12016                  (p_transaction_step_id   => p_transaction_step_id
12017                   ,p_name                 =>upper('p_per_information3'))
12018       --
12019          ,p_per_information4  =>
12020                  hr_transaction_api.get_varchar2_value
12021                  (p_transaction_step_id   => p_transaction_step_id
12022                   ,p_name                 =>upper('p_per_information4'))
12023       --
12024          ,p_per_information5  =>
12025                  hr_transaction_api.get_varchar2_value
12026                  (p_transaction_step_id   => p_transaction_step_id
12027                   ,p_name                 =>upper('p_per_information5'))
12028       --
12029          ,p_per_information6  =>
12030                  hr_transaction_api.get_varchar2_value
12031                  (p_transaction_step_id   => p_transaction_step_id
12032                   ,p_name                 =>upper('p_per_information6'))
12033       --
12034          ,p_per_information7  =>
12035                  hr_transaction_api.get_varchar2_value
12036                  (p_transaction_step_id   => p_transaction_step_id
12037                   ,p_name                 =>upper('p_per_information7'))
12038       --
12039          ,p_per_information8  =>
12040                  hr_transaction_api.get_varchar2_value
12041                  (p_transaction_step_id   => p_transaction_step_id
12042                   ,p_name                 =>upper('p_per_information8'))
12043       --
12044          ,p_per_information9  =>
12045                  hr_transaction_api.get_varchar2_value
12046                  (p_transaction_step_id   => p_transaction_step_id
12047                   ,p_name                 =>upper('p_per_information9'))
12048       --
12049          ,p_per_information10  =>
12050                  hr_transaction_api.get_varchar2_value
12051                  (p_transaction_step_id   => p_transaction_step_id
12052                   ,p_name                 =>upper('p_per_information10'))
12053       --
12054          ,p_per_information11  =>
12055                  hr_transaction_api.get_varchar2_value
12056                  (p_transaction_step_id   => p_transaction_step_id
12057                   ,p_name                 =>upper('p_per_information11'))
12058       --
12059          ,p_per_information12  =>
12060                  hr_transaction_api.get_varchar2_value
12061                  (p_transaction_step_id   => p_transaction_step_id
12062                   ,p_name                 =>upper('p_per_information12'))
12063       --
12064          ,p_per_information13  =>
12065                  hr_transaction_api.get_varchar2_value
12066                  (p_transaction_step_id   => p_transaction_step_id
12067                   ,p_name                 =>upper('p_per_information13'))
12068       --
12069          ,p_per_information14  =>
12070                  hr_transaction_api.get_varchar2_value
12071                  (p_transaction_step_id   => p_transaction_step_id
12072                   ,p_name                 =>upper('p_per_information14'))
12073       --
12074          ,p_per_information15  =>
12075                  hr_transaction_api.get_varchar2_value
12076                  (p_transaction_step_id   => p_transaction_step_id
12077                   ,p_name                 =>upper('p_per_information15'))
12078       --
12079          ,p_per_information16  =>
12080                  hr_transaction_api.get_varchar2_value
12081                  (p_transaction_step_id   => p_transaction_step_id
12082                   ,p_name                 =>upper('p_per_information16'))
12083       --
12084          ,p_per_information17  =>
12085                  hr_transaction_api.get_varchar2_value
12086                  (p_transaction_step_id   => p_transaction_step_id
12087                   ,p_name                 =>upper('p_per_information17'))
12088       --
12089          ,p_per_information18  =>
12090                  hr_transaction_api.get_varchar2_value
12091                  (p_transaction_step_id   => p_transaction_step_id
12092                   ,p_name                 =>upper('p_per_information18'))
12093       --
12094          ,p_per_information19  =>
12095                  hr_transaction_api.get_varchar2_value
12096                  (p_transaction_step_id   => p_transaction_step_id
12097                   ,p_name                 =>upper('p_per_information19'))
12098       --
12099          ,p_per_information20  =>
12100                  hr_transaction_api.get_varchar2_value
12101                  (p_transaction_step_id   => p_transaction_step_id
12102                   ,p_name                 =>upper('p_per_information20'))
12103       --
12104          ,p_per_information21  =>
12105                  hr_transaction_api.get_varchar2_value
12106                  (p_transaction_step_id   => p_transaction_step_id
12107                   ,p_name                 =>upper('p_per_information21'))
12108       --
12109          ,p_per_information22  =>
12110                  hr_transaction_api.get_varchar2_value
12111                  (p_transaction_step_id   => p_transaction_step_id
12112                   ,p_name                 =>upper('p_per_information22'))
12113       --
12114          ,p_per_information23  =>
12115                  hr_transaction_api.get_varchar2_value
12116                  (p_transaction_step_id   => p_transaction_step_id
12117                   ,p_name                 =>upper('p_per_information23'))
12118       --
12119          ,p_per_information24  =>
12120                  hr_transaction_api.get_varchar2_value
12121                  (p_transaction_step_id   => p_transaction_step_id
12122                   ,p_name                 =>upper('p_per_information24'))
12123       --
12124          ,p_per_information25  =>
12125                  hr_transaction_api.get_varchar2_value
12126                  (p_transaction_step_id   => p_transaction_step_id
12127                   ,p_name                 =>upper('p_per_information25'))
12128       --
12129          ,p_per_information26  =>
12130                  hr_transaction_api.get_varchar2_value
12131                  (p_transaction_step_id   => p_transaction_step_id
12132                   ,p_name                 =>upper('p_per_information26'))
12133       --
12134          ,p_per_information27  =>
12135                  hr_transaction_api.get_varchar2_value
12136                  (p_transaction_step_id   => p_transaction_step_id
12137                   ,p_name                 =>upper('p_per_information27'))
12138       --
12139          ,p_per_information28  =>
12140                  hr_transaction_api.get_varchar2_value
12141                  (p_transaction_step_id   => p_transaction_step_id
12142                   ,p_name                 =>upper('p_per_information28'))
12143       --
12144          ,p_per_information29  =>
12145                  hr_transaction_api.get_varchar2_value
12146                  (p_transaction_step_id   => p_transaction_step_id
12147                   ,p_name                 =>upper('p_per_information29'))
12148       --
12149          ,p_per_information30  =>
12150                  hr_transaction_api.get_varchar2_value
12151                  (p_transaction_step_id   => p_transaction_step_id
12152                   ,p_name                 =>upper('p_per_information30'))
12153       --
12154          ,p_date_of_death  =>
12155                  hr_transaction_api.get_date_value
12156                  (p_transaction_step_id   => p_transaction_step_id
12157                   ,p_name                 =>upper('p_date_of_death'))
12158       --
12159          ,p_background_check_status  =>
12160                  hr_transaction_api.get_varchar2_value
12161                  (p_transaction_step_id   => p_transaction_step_id
12162                   ,p_name                 =>upper('p_background_check_status'))
12163       --
12164          ,p_background_date_check  =>
12165                  hr_transaction_api.get_date_value
12166                  (p_transaction_step_id   => p_transaction_step_id
12167                   ,p_name                 =>upper('p_background_date_check'))
12168       --
12169          ,p_blood_type  =>
12170                  hr_transaction_api.get_varchar2_value
12171                  (p_transaction_step_id   => p_transaction_step_id
12172                   ,p_name                 =>upper('p_blood_type'))
12173       --
12174          ,p_correspondence_language  =>
12175                  hr_transaction_api.get_varchar2_value
12176                  (p_transaction_step_id   => p_transaction_step_id
12177                   ,p_name                 =>upper('p_correspondence_language'))
12178       --
12179          ,p_fast_path_employee  =>
12180                  hr_transaction_api.get_varchar2_value
12181                  (p_transaction_step_id   => p_transaction_step_id
12182                   ,p_name                 =>upper('p_fast_path_employee'))
12183       --
12184          ,p_fte_capacity  =>
12185                  hr_transaction_api.get_number_value
12186                  (p_transaction_step_id   => p_transaction_step_id
12187                   ,p_name                 =>upper('p_fte_capacity'))
12188       --
12189          ,p_hold_applicant_date_until  =>
12190                  hr_transaction_api.get_date_value
12191                  (p_transaction_step_id   => p_transaction_step_id
12192                   ,p_name                 =>upper('p_hold_applicant_date_until'))
12193       --
12194          ,p_honors  =>
12195                  hr_transaction_api.get_varchar2_value
12196                  (p_transaction_step_id   => p_transaction_step_id
12197                   ,p_name                 =>upper('p_honors'))
12198       --
12199          ,p_internal_location  =>
12200                  hr_transaction_api.get_varchar2_value
12201                  (p_transaction_step_id   => p_transaction_step_id
12202                   ,p_name                 =>upper('p_internal_location'))
12203       --
12204          ,p_last_medical_test_by  =>
12205                  hr_transaction_api.get_varchar2_value
12206                  (p_transaction_step_id   => p_transaction_step_id
12207                   ,p_name                 =>upper('p_last_medical_test_by'))
12208       --
12209          ,p_last_medical_test_date  =>
12210                  hr_transaction_api.get_date_value
12211                  (p_transaction_step_id   => p_transaction_step_id
12212                   ,p_name                 =>upper('p_last_medical_test_date'))
12213       --
12214          ,p_mailstop  =>
12215                  hr_transaction_api.get_varchar2_value
12216                  (p_transaction_step_id   => p_transaction_step_id
12217                   ,p_name                 =>upper('p_mailstop'))
12218       --
12219          ,p_office_number  =>
12220                  hr_transaction_api.get_varchar2_value
12221                  (p_transaction_step_id   => p_transaction_step_id
12222                   ,p_name                 =>upper('p_office_number'))
12223       --
12224          ,p_on_military_service  =>
12225                  hr_transaction_api.get_varchar2_value
12226                  (p_transaction_step_id   => p_transaction_step_id
12227                   ,p_name                 =>upper('p_on_military_service'))
12228       --
12229          ,p_pre_name_adjunct  =>
12230                  hr_transaction_api.get_varchar2_value
12231                  (p_transaction_step_id   => p_transaction_step_id
12232                   ,p_name                 =>upper('p_pre_name_adjunct'))
12233       --
12234          ,p_projected_start_date  =>
12235                  hr_transaction_api.get_date_value
12236                  (p_transaction_step_id   => p_transaction_step_id
12237                   ,p_name                 =>upper('p_projected_start_date'))
12238       --
12239          ,p_rehire_authorizor  =>
12240                  hr_transaction_api.get_varchar2_value
12241                  (p_transaction_step_id   => p_transaction_step_id
12242                   ,p_name                 =>upper('p_rehire_authorizor'))
12243       --
12244          ,p_rehire_recommendation  =>
12245                  hr_transaction_api.get_varchar2_value
12246                  (p_transaction_step_id   => p_transaction_step_id
12247                   ,p_name                 =>upper('p_rehire_recommendation'))
12248       --
12249          ,p_resume_exists  =>
12250                  hr_transaction_api.get_varchar2_value
12251                  (p_transaction_step_id   => p_transaction_step_id
12252                   ,p_name                 =>upper('p_resume_exists'))
12253       --
12254          ,p_resume_last_updated  =>
12255                  hr_transaction_api.get_date_value
12256                  (p_transaction_step_id   => p_transaction_step_id
12257                   ,p_name                 =>upper('p_resume_last_updated'))
12258       --
12259          ,p_second_passport_exists  =>
12260                  hr_transaction_api.get_varchar2_value
12261                  (p_transaction_step_id   => p_transaction_step_id
12262                   ,p_name                 =>upper('p_second_passport_exists'))
12263       --
12264          ,p_student_status  =>
12265                  hr_transaction_api.get_varchar2_value
12266                  (p_transaction_step_id   => p_transaction_step_id
12267                   ,p_name                 =>upper('p_student_status'))
12268       --
12269          ,p_work_schedule  =>
12270                  hr_transaction_api.get_varchar2_value
12271                  (p_transaction_step_id   => p_transaction_step_id
12272                   ,p_name                 =>upper('p_work_schedule'))
12273       --
12274          ,p_rehire_reason  =>
12275                  hr_transaction_api.get_varchar2_value
12276                  (p_transaction_step_id   => p_transaction_step_id
12277                   ,p_name                 =>upper('p_rehire_reason'))
12278       --
12279          ,p_suffix  =>
12280                  hr_transaction_api.get_varchar2_value
12281                  (p_transaction_step_id   => p_transaction_step_id
12282                   ,p_name                 =>upper('p_suffix'))
12283       --
12284          ,p_benefit_group_id  =>
12285                  hr_transaction_api.get_number_value
12286                  (p_transaction_step_id   => p_transaction_step_id
12287                   ,p_name                 =>upper('p_benefit_group_id'))
12288       --
12289          ,p_receipt_of_death_cert_date  =>
12290                  hr_transaction_api.get_date_value
12291                  (p_transaction_step_id   => p_transaction_step_id
12292                   ,p_name                 =>upper('p_receipt_of_death_cert_date'))
12293       --
12294          ,p_coord_ben_med_pln_no  =>
12295                  hr_transaction_api.get_varchar2_value
12296                  (p_transaction_step_id   => p_transaction_step_id
12297                   ,p_name                 =>upper('p_coord_ben_med_pln_no'))
12298       --
12299          ,p_coord_ben_no_cvg_flag  =>
12300                  hr_transaction_api.get_varchar2_value
12301                  (p_transaction_step_id   => p_transaction_step_id
12302                   ,p_name                 =>upper('p_coord_ben_no_cvg_flag'))
12303       --
12304          ,p_uses_tobacco_flag  =>
12305                  hr_transaction_api.get_varchar2_value
12306                  (p_transaction_step_id   => p_transaction_step_id
12307                   ,p_name                 =>upper('p_uses_tobacco_flag'))
12308       --
12309          ,p_dpdnt_adoption_date  =>
12310                  hr_transaction_api.get_date_value
12311                  (p_transaction_step_id   => p_transaction_step_id
12312                   ,p_name                 =>upper('p_dpdnt_adoption_date'))
12313       --
12314          ,p_dpdnt_vlntry_svce_flag  =>
12315                  hr_transaction_api.get_varchar2_value
12316                  (p_transaction_step_id   => p_transaction_step_id
12317                   ,p_name                 =>upper('p_dpdnt_vlntry_svce_flag'))
12318       --
12319       /*
12320       -- Bug 2652114 : As the java code passes null value do not pass the null value
12321       -- to api. SS contacts module is not allowed to modify adjusted service date
12322       -- and original_date_of_hire
12323       -- So not necessary to pass the parameter.
12324       --
12325          ,p_original_date_of_hire  =>
12326                  hr_transaction_api.get_date_value
12327                  (p_transaction_step_id   => p_transaction_step_id
12328                   ,p_name                 =>upper('p_original_date_of_hire'))
12329       --
12330          ,p_adjusted_svc_date  =>
12331                  hr_transaction_api.get_date_value
12332                  (p_transaction_step_id   => p_transaction_step_id
12333                   ,p_name                 =>upper('p_adjusted_svc_date'))
12334       */
12335       --
12336          ,p_town_of_birth  =>
12337                  hr_transaction_api.get_varchar2_value
12338                  (p_transaction_step_id   => p_transaction_step_id
12339                   ,p_name                 =>upper('p_town_of_birth'))
12340       --
12341          ,p_region_of_birth  =>
12342                  hr_transaction_api.get_varchar2_value
12343                  (p_transaction_step_id   => p_transaction_step_id
12344                   ,p_name                 =>upper('p_region_of_birth'))
12345       --
12346          ,p_country_of_birth  =>
12347                  hr_transaction_api.get_varchar2_value
12348                  (p_transaction_step_id   => p_transaction_step_id
12349                   ,p_name                 =>upper('p_country_of_birth'))
12350       --
12351          ,p_global_person_id  =>
12352                  hr_transaction_api.get_varchar2_value
12353                  (p_transaction_step_id   => p_transaction_step_id
12354                   ,p_name                 =>upper('p_global_person_id'))
12355       --
12356          ,p_effective_start_date  =>      l_effective_start_date
12357       --
12358          ,p_effective_end_date  =>        l_effective_end_date
12359       --
12360          ,p_full_name  =>                 l_full_name
12361       --
12362          ,p_comment_id  =>                l_comment_id
12363       --
12364          ,p_name_combination_warning  =>  l_name_combination_warning
12365       --
12366          ,p_assign_payroll_warning  =>    l_assign_payroll_warning
12367       --
12368          ,p_orig_hire_warning  =>         l_orig_hire_warning
12369       --
12370     );
12371     --
12372   END IF;
12373 
12374   hr_utility.set_location('p_effective_date = ' || p_effective_date, 999);
12375   if (p_effective_date is not null) then
12376 
12377     l_effective_date:= to_date(p_effective_date,g_date_format);
12378 
12379   else
12380        l_effective_date:= to_date(
12381          hr_transaction_ss.get_wf_effective_date
12382         (p_transaction_step_id => p_transaction_step_id),g_date_format);
12383 
12384   end if;
12385   --
12386   -- For normal commit the effective date should come from txn tbales.
12387   --
12388   if not p_validate then
12389   --
12390      l_effective_date := hr_transaction_api.get_DATE_value
12391            (p_transaction_step_id => p_transaction_step_id
12392            ,p_name                => 'P_CONT_EFFECTIVE_DATE');
12393   --
12394   end if;
12395   hr_utility.set_location('l_effective_date = ' || l_effective_date, 999);
12396   --
12397   --
12398   -- Get the contact_relationship_id  first.  If it is null, that means
12399   -- this is error and raise the error. -- add the error name 99999.
12400   --
12401   l_cont_rec_changed := hr_transaction_api.get_varchar2_value
12402                          (p_transaction_step_id => p_transaction_step_id
12403                          ,p_name =>upper( 'p_cont_rec_changed'));
12404 
12405   --
12406   l_contact_relationship_id := hr_transaction_api.get_number_value
12407 			(p_transaction_step_id => p_transaction_step_id
12408 				,p_name => 'P_CONTACT_RELATIONSHIP_ID');
12409   --
12410   l_ovn := hr_transaction_api.get_number_value
12411 	     (p_transaction_step_id => p_transaction_step_id
12412 	     ,p_name => 'P_CONT_OBJECT_VERSION_NUMBER');
12413 
12414   --
12415   l_action := hr_transaction_api.get_varchar2_value
12416              (p_transaction_step_id => p_transaction_step_id
12417              ,p_name =>upper( 'p_action'));
12418   --
12419   l_orig_rel_type :=  hr_transaction_api.get_VARCHAR2_value
12420 	       (p_transaction_step_id => p_transaction_step_id
12421                ,p_name                => upper('p_orig_rel_type'));
12422 
12423    --
12424   l_contact_operation  :=
12425       hr_transaction_api.get_varchar2_value
12426         (p_transaction_step_id => p_transaction_step_id
12427         ,p_name                =>upper( 'p_contact_operation'));
12428 
12429 
12430   IF l_contact_relationship_id IS NOT NULL AND
12431      l_cont_rec_changed = 'CHANGED' and l_contact_relationship_id > 0
12432   THEN
12433     --
12434     -- If shared residence flag is yes then delete the contacts primary
12435     -- address.
12436     --
12437     if (hr_transaction_api.get_VARCHAR2_value
12438            (p_transaction_step_id => p_transaction_step_id
12439            ,p_name                => 'P_RLTD_PER_RSDS_W_DSGNTR_FLAG') = 'Y') then
12440        --
12441        p_del_cont_primary_addr
12442        (p_contact_relationship_id
12443             => hr_transaction_api.get_NUMBER_value
12444                (p_transaction_step_id => p_transaction_step_id
12445                ,p_name                => 'P_CONTACT_RELATIONSHIP_ID')
12446        );
12447        --
12448     end if;
12449 
12450     l_date_sart := hr_transaction_api.get_DATE_value
12451            (p_transaction_step_id => p_transaction_step_id
12452            ,p_name                => 'P_DATE_START');
12453     --
12454    l_primary_contact_flag :=
12455          hr_transaction_api.get_VARCHAR2_value
12456            (p_transaction_step_id => p_transaction_step_id
12457            ,p_name                => 'P_PRIMARY_CONTACT_FLAG');
12458    if l_primary_contact_flag = null then
12459       l_primary_contact_flag := 'N';
12460    end if;
12461 
12462 
12463   if l_action = 'UPDATE' then
12464    if l_orig_rel_type <> 'EMRG' then
12465 
12466 ---bug 5894873
12467 ---if earlier start date of contact is greater than or equals to the new date, then delete the contact,
12468 ---and create a new one. Else update the contact, and then create one.
12469 
12470    l_old_contact_relationship_id :=
12471         hr_transaction_api.get_NUMBER_value
12472            (p_transaction_step_id => p_transaction_step_id
12473            ,p_name                => 'P_CONTACT_RELATIONSHIP_ID');
12474 
12475     begin
12476         select nvl(date_start,trunc(sysdate))
12477         into l_start_contact_date
12478         from per_contact_relationships
12479         where contact_relationship_id = l_old_contact_relationship_id
12480         and object_version_number = l_ovn;
12481     exception
12482      when others then
12483      l_start_contact_date := l_date_sart;
12484     end;
12485 
12486 
12487     if l_start_contact_date > l_date_sart then
12488     /***********************************************************************************************
12489      hr_contact_rel_api.delete_contact_relationship method is commented out as this method
12490      did not support when contact is only one, i.e, it is not dual maintained. So from now
12491      PER_CONTACT_RELATIONSHIPS_PKG.Update_Row is called as core HR team is use it for the same pourpose.
12492      This row handler makes all necessary changes of the per_all_people_f and per_contact_relationships table
12493      One new check is add here with the help of the variable of skip_contact_create_flg
12494      This is, do not create a contact if already did so with this row handler method and has not set
12495      the end date of that row
12496      ***********************************************************************************************
12497      */
12498 
12499     /*hr_contact_rel_api.delete_contact_relationship(
12500        p_validate                => p_validate
12501       ,P_CONTACT_RELATIONSHIP_ID  =>
12502          hr_transaction_api.get_NUMBER_value
12503            (p_transaction_step_id => p_transaction_step_id
12504            ,p_name                => 'P_CONTACT_RELATIONSHIP_ID')
12505       ,p_object_version_number   => l_ovn
12506      );
12507     */
12508         l_CONTACT_RELATIONSHIP_ID_1 := hr_transaction_api.get_number_value
12509          (p_transaction_step_id => p_transaction_step_id
12510     	 ,p_name => 'P_CONTACT_RELATIONSHIP_ID');
12511 
12512     select rowid
12513     into p_rowid
12514     from per_contact_relationships
12515     where CONTACT_RELATIONSHIP_ID = l_CONTACT_RELATIONSHIP_ID_1;
12516 
12517     hr_utility.set_location('before call PER_CONTACT_RELATIONSHIPS_PKG.Update_Row:X_Contact_Relationship_Id:' || l_CONTACT_RELATIONSHIP_ID_1 , 5);
12518 
12519     PER_CONTACT_RELATIONSHIPS_PKG.Update_Row(
12520                      X_Rowid => p_rowid
12521                      , X_Contact_Relationship_Id => l_CONTACT_RELATIONSHIP_ID_1
12522                      , X_Business_Group_Id => hr_transaction_api.get_NUMBER_value
12523            					   (p_transaction_step_id => p_transaction_step_id
12524            					   ,p_name                => 'P_BUSINESS_GROUP_ID')
12525                      , X_Person_Id => hr_transaction_api.get_number_value
12526 	                                           (p_transaction_step_id   => p_transaction_step_id
12527                                                    ,p_name                 =>upper('p_person_id'))
12528                      , X_Contact_Person_Id => hr_transaction_api.get_number_value
12529                                               (p_transaction_step_id   => p_transaction_step_id
12530                                               ,p_name                 =>upper('p_cont_person_id'))
12531                      , X_Contact_Type => hr_transaction_api.get_VARCHAR2_value
12532 	   			       (p_transaction_step_id => p_transaction_step_id
12533            			       ,p_name                => 'P_CONTACT_TYPE')
12534                      , X_Comments => hr_transaction_api.get_VARCHAR2_value
12535                                    (p_transaction_step_id => p_transaction_step_id
12536            		           ,p_name                => 'P_CTR_COMMENTS')
12537                      , X_Bondholder_Flag => hr_transaction_api.get_VARCHAR2_value
12538            				  (p_transaction_step_id => p_transaction_step_id
12539 		           		  ,p_name                => 'P_BONDHOLDER_FLAG')
12540                      , X_Third_Party_Pay_Flag => hr_transaction_api.get_VARCHAR2_value
12541            				       (p_transaction_step_id => p_transaction_step_id
12542            				       ,p_name                => 'P_THIRD_PARTY_PAY_FLAG')
12543                      , X_Primary_Contact_Flag => hr_transaction_api.get_VARCHAR2_value
12544                                                (p_transaction_step_id => p_transaction_step_id
12545                                                ,p_name                => 'P_PRIMARY_CONTACT_FLAG')
12546                      , X_Cont_Attribute_Category => hr_transaction_api.get_VARCHAR2_value
12547            					  (p_transaction_step_id => p_transaction_step_id
12548            				          ,p_name                => 'P_CONT_ATTRIBUTE_CATEGORY')
12549                      , X_Cont_Attribute1 => hr_transaction_api.get_VARCHAR2_value
12550                                           (p_transaction_step_id => p_transaction_step_id
12551                                           ,p_name                => 'P_CONT_ATTRIBUTE1')
12552                      , X_Cont_Attribute2 => hr_transaction_api.get_VARCHAR2_value
12553                                           (p_transaction_step_id => p_transaction_step_id
12554                                           ,p_name                => 'P_CONT_ATTRIBUTE2')
12555                      , X_Cont_Attribute3 => hr_transaction_api.get_VARCHAR2_value
12556                                           (p_transaction_step_id => p_transaction_step_id
12557                                           ,p_name                => 'P_CONT_ATTRIBUTE3')
12558                      , X_Cont_Attribute4 => hr_transaction_api.get_VARCHAR2_value
12559                                           (p_transaction_step_id => p_transaction_step_id
12560                                           ,p_name                => 'P_CONT_ATTRIBUTE4')
12561                      , X_Cont_Attribute5 => hr_transaction_api.get_VARCHAR2_value
12562                                           (p_transaction_step_id => p_transaction_step_id
12563                                           ,p_name                => 'P_CONT_ATTRIBUTE5')
12564                      , X_Cont_Attribute6 => hr_transaction_api.get_VARCHAR2_value
12565                                           (p_transaction_step_id => p_transaction_step_id
12566                                           ,p_name                => 'P_CONT_ATTRIBUTE6')
12567                      , X_Cont_Attribute7 => hr_transaction_api.get_VARCHAR2_value
12568                                           (p_transaction_step_id => p_transaction_step_id
12569                                           ,p_name                => 'P_CONT_ATTRIBUTE7')
12570                      , X_Cont_Attribute8 => hr_transaction_api.get_VARCHAR2_value
12571                                           (p_transaction_step_id => p_transaction_step_id
12572                                           ,p_name                => 'P_CONT_ATTRIBUTE8')
12573                      , X_Cont_Attribute9 => hr_transaction_api.get_VARCHAR2_value
12574                                           (p_transaction_step_id => p_transaction_step_id
12575                                           ,p_name                => 'P_CONT_ATTRIBUTE9')
12576                      , X_Cont_Attribute10 => hr_transaction_api.get_VARCHAR2_value
12577                                           (p_transaction_step_id => p_transaction_step_id
12578                                           ,p_name                => 'P_CONT_ATTRIBUTE10')
12579                      , X_Cont_Attribute11 => hr_transaction_api.get_VARCHAR2_value
12580                                           (p_transaction_step_id => p_transaction_step_id
12581                                           ,p_name                => 'P_CONT_ATTRIBUTE11')
12582                      , X_Cont_Attribute12 => hr_transaction_api.get_VARCHAR2_value
12583                                           (p_transaction_step_id => p_transaction_step_id
12584                                           ,p_name                => 'P_CONT_ATTRIBUTE12')
12585                      , X_Cont_Attribute13 => hr_transaction_api.get_VARCHAR2_value
12586                                           (p_transaction_step_id => p_transaction_step_id
12587                                           ,p_name                => 'P_CONT_ATTRIBUTE13')
12588                      , X_Cont_Attribute14 => hr_transaction_api.get_VARCHAR2_value
12589                                           (p_transaction_step_id => p_transaction_step_id
12590                                           ,p_name                => 'P_CONT_ATTRIBUTE14')
12591                      , X_Cont_Attribute15 => hr_transaction_api.get_VARCHAR2_value
12592                                           (p_transaction_step_id => p_transaction_step_id
12593                                           ,p_name                => 'P_CONT_ATTRIBUTE15')
12594                      , X_Cont_Attribute16 => hr_transaction_api.get_VARCHAR2_value
12595                                           (p_transaction_step_id => p_transaction_step_id
12596                                           ,p_name                => 'P_CONT_ATTRIBUTE16')
12597                      , X_Cont_Attribute17 => hr_transaction_api.get_VARCHAR2_value
12598                                           (p_transaction_step_id => p_transaction_step_id
12599                                           ,p_name                => 'P_CONT_ATTRIBUTE17')
12600                      , X_Cont_Attribute18 => hr_transaction_api.get_VARCHAR2_value
12601                                           (p_transaction_step_id => p_transaction_step_id
12602                                           ,p_name                => 'P_CONT_ATTRIBUTE18')
12603                      , X_Cont_Attribute19 => hr_transaction_api.get_VARCHAR2_value
12604                                           (p_transaction_step_id => p_transaction_step_id
12605                                           ,p_name                => 'P_CONT_ATTRIBUTE19')
12606                      , X_Cont_Attribute20 => hr_transaction_api.get_VARCHAR2_value
12607                                           (p_transaction_step_id => p_transaction_step_id
12608                                           ,p_name                => 'P_CONT_ATTRIBUTE20')
12609                      , X_Cont_Information_Category => hr_transaction_api.get_VARCHAR2_value
12610            				  (p_transaction_step_id => p_transaction_step_id
12611            				  ,p_name                => 'P_PER_INFORMATION_CATEGORY')
12612                      , X_Cont_Information1 => hr_transaction_api.get_VARCHAR2_value
12613             				    (p_transaction_step_id => p_transaction_step_id
12614            				    ,p_name                => 'P_CONT_INFORMATION1')
12615                      , X_Cont_Information2 => hr_transaction_api.get_VARCHAR2_value
12616             				    (p_transaction_step_id => p_transaction_step_id
12617            				    ,p_name                => 'P_CONT_INFORMATION2')
12618                      , X_Cont_Information3 => hr_transaction_api.get_VARCHAR2_value
12619             				    (p_transaction_step_id => p_transaction_step_id
12620            				    ,p_name                => 'P_CONT_INFORMATION3')
12621                      , X_Cont_Information4 => hr_transaction_api.get_VARCHAR2_value
12622             				    (p_transaction_step_id => p_transaction_step_id
12623            				    ,p_name                => 'P_CONT_INFORMATION4')
12624                      , X_Cont_Information5 => hr_transaction_api.get_VARCHAR2_value
12625             				    (p_transaction_step_id => p_transaction_step_id
12626            				    ,p_name                => 'P_CONT_INFORMATION5')
12627                      , X_Cont_Information6 => hr_transaction_api.get_VARCHAR2_value
12628             				    (p_transaction_step_id => p_transaction_step_id
12629            				    ,p_name                => 'P_CONT_INFORMATION6')
12630                      , X_Cont_Information7 => hr_transaction_api.get_VARCHAR2_value
12631             				    (p_transaction_step_id => p_transaction_step_id
12632            				    ,p_name                => 'P_CONT_INFORMATION7')
12633                      , X_Cont_Information8 => hr_transaction_api.get_VARCHAR2_value
12634             				    (p_transaction_step_id => p_transaction_step_id
12635            				    ,p_name                => 'P_CONT_INFORMATION8')
12636                      , X_Cont_Information9 => hr_transaction_api.get_VARCHAR2_value
12637             				    (p_transaction_step_id => p_transaction_step_id
12638            				    ,p_name                => 'P_CONT_INFORMATION9')
12639                      , X_Cont_Information10 => hr_transaction_api.get_VARCHAR2_value
12640             				    (p_transaction_step_id => p_transaction_step_id
12641            				    ,p_name                => 'P_CONT_INFORMATION10')
12642                      , X_Cont_Information11 => hr_transaction_api.get_VARCHAR2_value
12643             				    (p_transaction_step_id => p_transaction_step_id
12644            				    ,p_name                => 'P_CONT_INFORMATION11')
12645                      , X_Cont_Information12 => hr_transaction_api.get_VARCHAR2_value
12646             				    (p_transaction_step_id => p_transaction_step_id
12647            				    ,p_name                => 'P_CONT_INFORMATION12')
12648                      , X_Cont_Information13 => hr_transaction_api.get_VARCHAR2_value
12649             				    (p_transaction_step_id => p_transaction_step_id
12650            				    ,p_name                => 'P_CONT_INFORMATION13')
12651                      , X_Cont_Information14 => hr_transaction_api.get_VARCHAR2_value
12652             				    (p_transaction_step_id => p_transaction_step_id
12653            				    ,p_name                => 'P_CONT_INFORMATION14')
12654                      , X_Cont_Information15 => hr_transaction_api.get_VARCHAR2_value
12655             				    (p_transaction_step_id => p_transaction_step_id
12656            				    ,p_name                => 'P_CONT_INFORMATION15')
12657                      , X_Cont_Information16 => hr_transaction_api.get_VARCHAR2_value
12658             				    (p_transaction_step_id => p_transaction_step_id
12659            				    ,p_name                => 'P_CONT_INFORMATION16')
12660                      , X_Cont_Information17 => hr_transaction_api.get_VARCHAR2_value
12661             				    (p_transaction_step_id => p_transaction_step_id
12662            				    ,p_name                => 'P_CONT_INFORMATION17')
12663                      , X_Cont_Information18 => hr_transaction_api.get_VARCHAR2_value
12664             				    (p_transaction_step_id => p_transaction_step_id
12665            				    ,p_name                => 'P_CONT_INFORMATION18')
12666                      , X_Cont_Information19 => hr_transaction_api.get_VARCHAR2_value
12667             				    (p_transaction_step_id => p_transaction_step_id
12668            				    ,p_name                => 'P_CONT_INFORMATION19')
12669                      , X_Cont_Information20 => hr_transaction_api.get_VARCHAR2_value
12670             				    (p_transaction_step_id => p_transaction_step_id
12671            				    ,p_name                => 'P_CONT_INFORMATION20')
12672                      , X_Session_Date => null --- this session_date is not used in PER_CONTACT_RELATIONSHIPS_PKG.update_row method, so null is pass here
12673                      , X_Date_Start => hr_transaction_api.get_DATE_value
12674            			     (p_transaction_step_id => p_transaction_step_id
12675            			     ,p_name                => 'P_DATE_START')
12676                      , X_Start_Life_Reason_Id => hr_transaction_api.get_NUMBER_value
12677            				       (p_transaction_step_id => p_transaction_step_id
12678            				       ,p_name                => 'P_START_LIFE_REASON_ID')
12679                      , X_Date_End => hr_transaction_api.get_DATE_value
12680            			   (p_transaction_step_id => p_transaction_step_id
12681            			   ,p_name                => 'P_DATE_END')
12682                      , X_End_Life_Reason_Id => hr_transaction_api.get_NUMBER_value
12683            				     (p_transaction_step_id => p_transaction_step_id
12684            				     ,p_name                => 'P_END_LIFE_REASON_ID')
12685                      , X_Rltd_Per_Rsds_W_Dsgntr_Flag => hr_transaction_api.get_VARCHAR2_value
12686            					      (p_transaction_step_id => p_transaction_step_id
12687            					      ,p_name                => 'P_RLTD_PER_RSDS_W_DSGNTR_FLAG')
12688                      , X_Personal_Flag => hr_transaction_api.get_VARCHAR2_value
12689            				(p_transaction_step_id => p_transaction_step_id
12690            				,p_name                => 'P_PERSONAL_FLAG')
12691 		     , X_Sequence_Number => hr_transaction_api.get_NUMBER_value
12692                                         (p_transaction_step_id => p_transaction_step_id
12693            				,p_name                => 'P_SEQUENCE_NUMBER')
12694                      , X_Dependent_Flag => hr_transaction_api.get_varchar2_value
12695         				 (p_transaction_step_id => p_transaction_step_id
12696         				 ,p_name                => 'P_DEPENDENT_FLAG')
12697                      , X_Beneficiary_Flag => hr_transaction_api.get_varchar2_value
12698         				   (p_transaction_step_id => p_transaction_step_id
12699         				   ,p_name                => 'P_BENEFICIARY_FLAG')
12700     );
12701     skip_contact_create_flg := 1;
12702 
12703     else
12704     l_date_end := trunc(l_date_sart) -1;
12705     hr_contact_rel_api.update_contact_relationship(
12706        p_validate                => p_validate
12707       ,P_EFFECTIVE_DATE         =>l_effective_date
12708       ,p_object_version_number   => l_ovn
12709       ,P_CONTACT_RELATIONSHIP_ID  =>
12710          hr_transaction_api.get_NUMBER_value
12711            (p_transaction_step_id => p_transaction_step_id
12712            ,p_name                => 'P_CONTACT_RELATIONSHIP_ID')
12713       ,p_date_end     => l_date_end
12714      );
12715      end if;
12716 ---bug 5894873
12717 
12718 
12719     -- end date the old relationship
12720 /* commented for the bug bug 5894873
12721     l_date_end := trunc(l_date_sart) -1;
12722     hr_contact_rel_api.update_contact_relationship(
12723        p_validate                => p_validate
12724       ,P_EFFECTIVE_DATE         =>l_effective_date
12725       ,p_object_version_number   => l_ovn
12726       ,P_CONTACT_RELATIONSHIP_ID  =>
12727          hr_transaction_api.get_NUMBER_value
12728            (p_transaction_step_id => p_transaction_step_id
12729            ,p_name                => 'P_CONTACT_RELATIONSHIP_ID')
12730       ,p_date_end     => l_date_end
12731      );
12732 commented for the bug bug 5894873
12733 */
12734    end if;
12735    -- if primary contact flag is checked/unchecked apply it emrg record and not for
12736    -- other personal relationship record
12737     open get_emrg_relid_ovn(
12738             hr_transaction_api.get_NUMBER_value
12739            (p_transaction_step_id => p_transaction_step_id
12740            ,p_name                => 'P_CONTACT_RELATIONSHIP_ID')
12741            ,hr_transaction_api.get_number_value
12742                  (p_transaction_step_id   => p_transaction_step_id
12743                   ,p_name                 => 'P_CONTACT_PERSON_ID')
12744            ,hr_transaction_api.get_number_value
12745                  (p_transaction_step_id   => p_transaction_step_id
12746                   ,p_name                 => 'P_PERSON_ID'));
12747     fetch get_emrg_relid_ovn into l_emrg_relid, l_emrg_ovn, l_emrg_primary_cont_flag;
12748     if get_emrg_relid_ovn%found then
12749      if((l_emrg_primary_cont_flag <> 'Y' and l_primary_contact_flag = 'Y') OR
12750         (l_emrg_primary_cont_flag <> 'N' and l_primary_contact_flag = 'N')) then
12751 -- Bug 3504216 :  passing date_start as sysdate
12752         hr_contact_rel_api.update_contact_relationship(
12753          p_validate                => p_validate
12754         ,P_EFFECTIVE_DATE         =>l_effective_date
12755         ,p_object_version_number   => l_emrg_ovn
12756         ,P_CONTACT_RELATIONSHIP_ID  => l_emrg_relid
12757         ,P_PRIMARY_CONTACT_FLAG     => l_primary_contact_flag
12758 	,P_DATE_START              => sysdate
12759        );
12760      end if;
12761      l_primary_contact_flag := 'N';
12762     end if;
12763     close get_emrg_relid_ovn;
12764    if skip_contact_create_flg <> 1 then -- 5894873
12765     hr_contact_rel_api.create_contact(
12766       P_VALIDATE  => p_validate
12767       --
12768       ,P_START_DATE  => l_effective_date
12769       --
12770       ,P_BUSINESS_GROUP_ID  =>
12771          hr_transaction_api.get_NUMBER_value
12772            (p_transaction_step_id => p_transaction_step_id
12773            ,p_name                => 'P_BUSINESS_GROUP_ID')
12774       --
12775       ,P_PERSON_ID  =>
12776           hr_transaction_api.get_number_value
12777 	          (p_transaction_step_id   => p_transaction_step_id
12778                   ,p_name                 =>upper('p_person_id'))
12779       --
12780       ,P_CONTACT_PERSON_ID  =>
12781          hr_transaction_api.get_number_value
12782 	          (p_transaction_step_id   => p_transaction_step_id
12783                   ,p_name                 =>upper('p_cont_person_id'))
12784       --
12785       ,P_CONTACT_TYPE  =>
12786          hr_transaction_api.get_VARCHAR2_value
12787 	   (p_transaction_step_id => p_transaction_step_id
12788            ,p_name                => 'P_CONTACT_TYPE')
12789       --
12790       ,P_CTR_COMMENTS  =>
12791          hr_transaction_api.get_VARCHAR2_value
12792            (p_transaction_step_id => p_transaction_step_id
12793            ,p_name                => 'P_CTR_COMMENTS')
12794       --
12795       ,P_PRIMARY_CONTACT_FLAG  => l_primary_contact_flag
12796       --
12797       ,P_DATE_START  => l_date_sart
12798 
12799       --
12800       ,P_START_LIFE_REASON_ID  =>
12801          hr_transaction_api.get_NUMBER_value
12802            (p_transaction_step_id => p_transaction_step_id
12803            ,p_name                => 'P_START_LIFE_REASON_ID')
12804       --
12805       ,P_DATE_END  =>
12806          hr_transaction_api.get_DATE_value
12807            (p_transaction_step_id => p_transaction_step_id
12808            ,p_name                => 'P_DATE_END')
12809       --
12810       ,P_END_LIFE_REASON_ID  =>
12811          hr_transaction_api.get_NUMBER_value
12812            (p_transaction_step_id => p_transaction_step_id
12813            ,p_name                => 'P_END_LIFE_REASON_ID')
12814       --
12815       ,P_RLTD_PER_RSDS_W_DSGNTR_FLAG  =>
12816          hr_transaction_api.get_VARCHAR2_value
12817            (p_transaction_step_id => p_transaction_step_id
12818            ,p_name                => 'P_RLTD_PER_RSDS_W_DSGNTR_FLAG')
12819       --
12820       ,P_PERSONAL_FLAG  =>
12821          hr_transaction_api.get_VARCHAR2_value
12822            (p_transaction_step_id => p_transaction_step_id
12823            ,p_name                => 'P_PERSONAL_FLAG')
12824       --
12825       ,P_SEQUENCE_NUMBER  =>
12826          hr_transaction_api.get_NUMBER_value
12827            (p_transaction_step_id => p_transaction_step_id
12828            ,p_name                => 'P_SEQUENCE_NUMBER')
12829       --
12830       ,P_CONT_ATTRIBUTE_CATEGORY  =>
12831          hr_transaction_api.get_VARCHAR2_value
12832            (p_transaction_step_id => p_transaction_step_id
12833            ,p_name                => 'P_CONT_ATTRIBUTE_CATEGORY')
12834       --
12835       ,P_CONT_ATTRIBUTE1  =>
12836          hr_transaction_api.get_VARCHAR2_value
12837            (p_transaction_step_id => p_transaction_step_id
12838            ,p_name                => 'P_CONT_ATTRIBUTE1')
12839       --
12840       ,P_CONT_ATTRIBUTE2  =>
12841          hr_transaction_api.get_VARCHAR2_value
12842            (p_transaction_step_id => p_transaction_step_id
12843            ,p_name                => 'P_CONT_ATTRIBUTE2')
12844       --
12845       ,P_CONT_ATTRIBUTE3  =>
12846          hr_transaction_api.get_VARCHAR2_value
12847            (p_transaction_step_id => p_transaction_step_id
12848            ,p_name                => 'P_CONT_ATTRIBUTE3')
12849       --
12850       ,P_CONT_ATTRIBUTE4  =>
12851          hr_transaction_api.get_VARCHAR2_value
12852            (p_transaction_step_id => p_transaction_step_id
12853            ,p_name                => 'P_CONT_ATTRIBUTE4')
12854       --
12855       ,P_CONT_ATTRIBUTE5  =>
12856          hr_transaction_api.get_VARCHAR2_value
12857            (p_transaction_step_id => p_transaction_step_id
12858            ,p_name                => 'P_CONT_ATTRIBUTE5')
12859       --
12860       ,P_CONT_ATTRIBUTE6  =>
12861          hr_transaction_api.get_VARCHAR2_value
12862            (p_transaction_step_id => p_transaction_step_id
12863            ,p_name                => 'P_CONT_ATTRIBUTE6')
12864       --
12865       ,P_CONT_ATTRIBUTE7  =>
12866          hr_transaction_api.get_VARCHAR2_value
12867            (p_transaction_step_id => p_transaction_step_id
12868            ,p_name                => 'P_CONT_ATTRIBUTE7')
12869       --
12870       ,P_CONT_ATTRIBUTE8  =>
12871          hr_transaction_api.get_VARCHAR2_value
12872            (p_transaction_step_id => p_transaction_step_id
12873            ,p_name                => 'P_CONT_ATTRIBUTE8')
12874       --
12875       ,P_CONT_ATTRIBUTE9  =>
12876          hr_transaction_api.get_VARCHAR2_value
12877            (p_transaction_step_id => p_transaction_step_id
12878            ,p_name                => 'P_CONT_ATTRIBUTE9')
12879       --
12880       ,P_CONT_ATTRIBUTE10  =>
12881          hr_transaction_api.get_VARCHAR2_value
12882            (p_transaction_step_id => p_transaction_step_id
12883            ,p_name                => 'P_CONT_ATTRIBUTE10')
12884       --
12885       ,P_CONT_ATTRIBUTE11  =>
12886          hr_transaction_api.get_VARCHAR2_value
12887            (p_transaction_step_id => p_transaction_step_id
12888            ,p_name                => 'P_CONT_ATTRIBUTE11')
12889       --
12890       ,P_CONT_ATTRIBUTE12  =>
12891          hr_transaction_api.get_VARCHAR2_value
12892            (p_transaction_step_id => p_transaction_step_id
12893            ,p_name                => 'P_CONT_ATTRIBUTE12')
12894       --
12895       ,P_CONT_ATTRIBUTE13  =>
12896          hr_transaction_api.get_VARCHAR2_value
12897            (p_transaction_step_id => p_transaction_step_id
12898            ,p_name                => 'P_CONT_ATTRIBUTE13')
12899       --
12900       ,P_CONT_ATTRIBUTE14  =>
12901          hr_transaction_api.get_VARCHAR2_value
12902            (p_transaction_step_id => p_transaction_step_id
12903            ,p_name                => 'P_CONT_ATTRIBUTE14')
12904       --
12905       ,P_CONT_ATTRIBUTE15  =>
12906          hr_transaction_api.get_VARCHAR2_value
12907            (p_transaction_step_id => p_transaction_step_id
12908            ,p_name                => 'P_CONT_ATTRIBUTE15')
12909       --
12910       ,P_CONT_ATTRIBUTE16  =>
12911          hr_transaction_api.get_VARCHAR2_value
12912            (p_transaction_step_id => p_transaction_step_id
12913            ,p_name                => 'P_CONT_ATTRIBUTE16')
12914       --
12915       ,P_CONT_ATTRIBUTE17  =>
12916          hr_transaction_api.get_VARCHAR2_value
12917            (p_transaction_step_id => p_transaction_step_id
12918            ,p_name                => 'P_CONT_ATTRIBUTE17')
12919       --
12920       ,P_CONT_ATTRIBUTE18  =>
12921          hr_transaction_api.get_VARCHAR2_value
12922            (p_transaction_step_id => p_transaction_step_id
12923            ,p_name                => 'P_CONT_ATTRIBUTE18')
12924       --
12925       ,P_CONT_ATTRIBUTE19  =>
12926          hr_transaction_api.get_VARCHAR2_value
12927            (p_transaction_step_id => p_transaction_step_id
12928            ,p_name                => 'P_CONT_ATTRIBUTE19')
12929       --
12930       ,P_CONT_ATTRIBUTE20  =>
12931          hr_transaction_api.get_VARCHAR2_value
12932            (p_transaction_step_id => p_transaction_step_id
12933            ,p_name                => 'P_CONT_ATTRIBUTE20')
12934       --
12935       ,P_THIRD_PARTY_PAY_FLAG  =>
12936          hr_transaction_api.get_VARCHAR2_value
12937            (p_transaction_step_id => p_transaction_step_id
12938            ,p_name                => 'P_THIRD_PARTY_PAY_FLAG')
12939       --
12940       ,P_BONDHOLDER_FLAG  =>
12941          hr_transaction_api.get_VARCHAR2_value
12942            (p_transaction_step_id => p_transaction_step_id
12943            ,p_name                => 'P_BONDHOLDER_FLAG')
12944       --
12945       ,P_DEPENDENT_FLAG  =>
12946          hr_transaction_api.get_VARCHAR2_value
12947            (p_transaction_step_id => p_transaction_step_id
12948            ,p_name                => 'P_DEPENDENT_FLAG')
12949       --
12950       ,P_BENEFICIARY_FLAG  =>
12951          hr_transaction_api.get_VARCHAR2_value
12952            (p_transaction_step_id => p_transaction_step_id
12953            ,p_name                => 'P_BENEFICIARY_FLAG')
12954       --
12955       ,P_LAST_NAME  =>
12956          hr_transaction_api.get_VARCHAR2_value
12957            (p_transaction_step_id => p_transaction_step_id
12958            ,p_name                => 'P_LAST_NAME')
12959       --
12960       ,P_SEX  =>
12961          hr_transaction_api.get_VARCHAR2_value
12962            (p_transaction_step_id => p_transaction_step_id
12963            ,p_name                => 'P_SEX')
12964       --
12965       ,P_PERSON_TYPE_ID  =>
12966          hr_transaction_api.get_NUMBER_value
12967            (p_transaction_step_id => p_transaction_step_id
12968            ,p_name                => 'P_PERSON_TYPE_ID')
12969       --
12970       ,P_PER_COMMENTS  =>
12971          hr_transaction_api.get_VARCHAR2_value
12972            (p_transaction_step_id => p_transaction_step_id
12973            ,p_name                => 'P_PER_COMMENTS')
12974       --
12975       ,P_DATE_OF_BIRTH  =>
12976          hr_transaction_api.get_DATE_value
12977            (p_transaction_step_id => p_transaction_step_id
12978            ,p_name                => 'P_DATE_OF_BIRTH')
12979       --
12980       ,P_EMAIL_ADDRESS  =>
12981          hr_transaction_api.get_VARCHAR2_value
12982            (p_transaction_step_id => p_transaction_step_id
12983            ,p_name                => 'P_EMAIL_ADDRESS')
12984       --
12985       ,P_FIRST_NAME  =>
12986          hr_transaction_api.get_VARCHAR2_value
12987            (p_transaction_step_id => p_transaction_step_id
12988            ,p_name                => 'P_FIRST_NAME')
12989       --
12990       ,P_KNOWN_AS  =>
12991          hr_transaction_api.get_VARCHAR2_value
12992            (p_transaction_step_id => p_transaction_step_id
12993            ,p_name                => 'P_KNOWN_AS')
12994       --
12995       ,P_MARITAL_STATUS  =>
12996          hr_transaction_api.get_VARCHAR2_value
12997            (p_transaction_step_id => p_transaction_step_id
12998            ,p_name                => 'P_MARITAL_STATUS')
12999       --
13000       ,P_MIDDLE_NAMES  =>
13001          hr_transaction_api.get_VARCHAR2_value
13002            (p_transaction_step_id => p_transaction_step_id
13003            ,p_name                => 'P_MIDDLE_NAMES')
13004       --
13005       ,P_NATIONALITY  =>
13006          hr_transaction_api.get_VARCHAR2_value
13007            (p_transaction_step_id => p_transaction_step_id
13008            ,p_name                => 'P_NATIONALITY')
13009       --
13010       ,P_NATIONAL_IDENTIFIER  =>
13011          hr_transaction_api.get_VARCHAR2_value
13012            (p_transaction_step_id => p_transaction_step_id
13013            ,p_name                => 'P_NATIONAL_IDENTIFIER')
13014       --
13015       ,P_PREVIOUS_LAST_NAME  =>
13016          hr_transaction_api.get_VARCHAR2_value
13017            (p_transaction_step_id => p_transaction_step_id
13018            ,p_name                => 'P_PREVIOUS_LAST_NAME')
13019       --
13020       ,P_REGISTERED_DISABLED_FLAG  =>
13021          hr_transaction_api.get_VARCHAR2_value
13022            (p_transaction_step_id => p_transaction_step_id
13023            ,p_name                => 'P_REGISTERED_DISABLED_FLAG')
13024       --
13025       ,P_TITLE  =>
13026          hr_transaction_api.get_VARCHAR2_value
13027            (p_transaction_step_id => p_transaction_step_id
13028            ,p_name                => 'P_TITLE')
13029       --
13030       ,P_WORK_TELEPHONE  =>
13031          hr_transaction_api.get_VARCHAR2_value
13032            (p_transaction_step_id => p_transaction_step_id
13033            ,p_name                => 'P_WORK_TELEPHONE')
13034       --
13035       ,P_ATTRIBUTE_CATEGORY  =>
13036          hr_transaction_api.get_VARCHAR2_value
13037            (p_transaction_step_id => p_transaction_step_id
13038            ,p_name                => 'P_ATTRIBUTE_CATEGORY')
13039       --
13040       ,P_ATTRIBUTE1  =>
13041          hr_transaction_api.get_VARCHAR2_value
13042            (p_transaction_step_id => p_transaction_step_id
13043            ,p_name                => 'P_ATTRIBUTE1')
13044       --
13045       ,P_ATTRIBUTE2  =>
13046          hr_transaction_api.get_VARCHAR2_value
13047            (p_transaction_step_id => p_transaction_step_id
13048            ,p_name                => 'P_ATTRIBUTE2')
13049       --
13050       ,P_ATTRIBUTE3  =>
13051          hr_transaction_api.get_VARCHAR2_value
13052            (p_transaction_step_id => p_transaction_step_id
13053            ,p_name                => 'P_ATTRIBUTE3')
13054       --
13055       ,P_ATTRIBUTE4  =>
13056          hr_transaction_api.get_VARCHAR2_value
13057            (p_transaction_step_id => p_transaction_step_id
13058            ,p_name                => 'P_ATTRIBUTE4')
13059       --
13060       ,P_ATTRIBUTE5  =>
13061          hr_transaction_api.get_VARCHAR2_value
13062            (p_transaction_step_id => p_transaction_step_id
13063            ,p_name                => 'P_ATTRIBUTE5')
13064       --
13065       ,P_ATTRIBUTE6  =>
13066          hr_transaction_api.get_VARCHAR2_value
13067            (p_transaction_step_id => p_transaction_step_id
13068            ,p_name                => 'P_ATTRIBUTE6')
13069       --
13070       ,P_ATTRIBUTE7  =>
13071          hr_transaction_api.get_VARCHAR2_value
13072            (p_transaction_step_id => p_transaction_step_id
13073            ,p_name                => 'P_ATTRIBUTE7')
13074       --
13075       ,P_ATTRIBUTE8  =>
13076          hr_transaction_api.get_VARCHAR2_value
13077            (p_transaction_step_id => p_transaction_step_id
13078            ,p_name                => 'P_ATTRIBUTE8')
13079       --
13080       ,P_ATTRIBUTE9  =>
13081          hr_transaction_api.get_VARCHAR2_value
13082            (p_transaction_step_id => p_transaction_step_id
13083            ,p_name                => 'P_ATTRIBUTE9')
13084       --
13085       ,P_ATTRIBUTE10  =>
13086          hr_transaction_api.get_VARCHAR2_value
13087            (p_transaction_step_id => p_transaction_step_id
13088            ,p_name                => 'P_ATTRIBUTE10')
13089       --
13090       ,P_ATTRIBUTE11  =>
13091          hr_transaction_api.get_VARCHAR2_value
13092            (p_transaction_step_id => p_transaction_step_id
13093            ,p_name                => 'P_ATTRIBUTE11')
13094       --
13095       ,P_ATTRIBUTE12  =>
13096          hr_transaction_api.get_VARCHAR2_value
13097            (p_transaction_step_id => p_transaction_step_id
13098            ,p_name                => 'P_ATTRIBUTE12')
13099       --
13100       ,P_ATTRIBUTE13  =>
13101          hr_transaction_api.get_VARCHAR2_value
13102            (p_transaction_step_id => p_transaction_step_id
13103            ,p_name                => 'P_ATTRIBUTE13')
13104       --
13105       ,P_ATTRIBUTE14  =>
13106          hr_transaction_api.get_VARCHAR2_value
13107            (p_transaction_step_id => p_transaction_step_id
13108            ,p_name                => 'P_ATTRIBUTE14')
13109       --
13110       ,P_ATTRIBUTE15  =>
13111          hr_transaction_api.get_VARCHAR2_value
13112            (p_transaction_step_id => p_transaction_step_id
13113            ,p_name                => 'P_ATTRIBUTE15')
13114       --
13115       ,P_ATTRIBUTE16  =>
13116          hr_transaction_api.get_VARCHAR2_value
13117            (p_transaction_step_id => p_transaction_step_id
13118            ,p_name                => 'P_ATTRIBUTE16')
13119       --
13120       ,P_ATTRIBUTE17  =>
13121          hr_transaction_api.get_VARCHAR2_value
13122            (p_transaction_step_id => p_transaction_step_id
13123            ,p_name                => 'P_ATTRIBUTE17')
13124       --
13125       ,P_ATTRIBUTE18  =>
13126          hr_transaction_api.get_VARCHAR2_value
13127            (p_transaction_step_id => p_transaction_step_id
13128            ,p_name                => 'P_ATTRIBUTE18')
13129       --
13130       ,P_ATTRIBUTE19  =>
13131          hr_transaction_api.get_VARCHAR2_value
13132            (p_transaction_step_id => p_transaction_step_id
13133            ,p_name                => 'P_ATTRIBUTE19')
13134       --
13135       ,P_ATTRIBUTE20  =>
13136          hr_transaction_api.get_VARCHAR2_value
13137            (p_transaction_step_id => p_transaction_step_id
13138            ,p_name                => 'P_ATTRIBUTE20')
13139       --
13140       ,P_ATTRIBUTE21  =>
13141          hr_transaction_api.get_VARCHAR2_value
13142            (p_transaction_step_id => p_transaction_step_id
13143            ,p_name                => 'P_ATTRIBUTE21')
13144       --
13145       ,P_ATTRIBUTE22  =>
13146          hr_transaction_api.get_VARCHAR2_value
13147            (p_transaction_step_id => p_transaction_step_id
13148            ,p_name                => 'P_ATTRIBUTE22')
13149       --
13150       ,P_ATTRIBUTE23  =>
13151          hr_transaction_api.get_VARCHAR2_value
13152            (p_transaction_step_id => p_transaction_step_id
13153            ,p_name                => 'P_ATTRIBUTE23')
13154       --
13155       ,P_ATTRIBUTE24  =>
13156          hr_transaction_api.get_VARCHAR2_value
13157            (p_transaction_step_id => p_transaction_step_id
13158            ,p_name                => 'P_ATTRIBUTE24')
13159       --
13160       ,P_ATTRIBUTE25  =>
13161          hr_transaction_api.get_VARCHAR2_value
13162            (p_transaction_step_id => p_transaction_step_id
13163            ,p_name                => 'P_ATTRIBUTE25')
13164       --
13165       ,P_ATTRIBUTE26  =>
13166          hr_transaction_api.get_VARCHAR2_value
13167            (p_transaction_step_id => p_transaction_step_id
13168            ,p_name                => 'P_ATTRIBUTE26')
13169       --
13170       ,P_ATTRIBUTE27  =>
13171          hr_transaction_api.get_VARCHAR2_value
13172            (p_transaction_step_id => p_transaction_step_id
13173            ,p_name                => 'P_ATTRIBUTE27')
13174       --
13175       ,P_ATTRIBUTE28  =>
13176          hr_transaction_api.get_VARCHAR2_value
13177            (p_transaction_step_id => p_transaction_step_id
13178            ,p_name                => 'P_ATTRIBUTE28')
13179       --
13180       ,P_ATTRIBUTE29  =>
13181          hr_transaction_api.get_VARCHAR2_value
13182            (p_transaction_step_id => p_transaction_step_id
13183            ,p_name                => 'P_ATTRIBUTE29')
13184       --
13185       ,P_ATTRIBUTE30  =>
13186          hr_transaction_api.get_VARCHAR2_value
13187            (p_transaction_step_id => p_transaction_step_id
13188            ,p_name                => 'P_ATTRIBUTE30')
13189       --
13190       ,P_PER_INFORMATION_CATEGORY  =>
13191          hr_transaction_api.get_VARCHAR2_value
13192            (p_transaction_step_id => p_transaction_step_id
13193            ,p_name                => 'P_PER_INFORMATION_CATEGORY')
13194       --
13195       ,P_PER_INFORMATION1  =>
13196          hr_transaction_api.get_VARCHAR2_value
13197            (p_transaction_step_id => p_transaction_step_id
13198            ,p_name                => 'P_PER_INFORMATION1')
13199       --
13200       ,P_PER_INFORMATION2  =>
13201          hr_transaction_api.get_VARCHAR2_value
13202            (p_transaction_step_id => p_transaction_step_id
13203            ,p_name                => 'P_PER_INFORMATION2')
13204       --
13205       ,P_PER_INFORMATION3  =>
13206          hr_transaction_api.get_VARCHAR2_value
13207            (p_transaction_step_id => p_transaction_step_id
13208            ,p_name                => 'P_PER_INFORMATION3')
13209       --
13210       ,P_PER_INFORMATION4  =>
13211          hr_transaction_api.get_VARCHAR2_value
13212            (p_transaction_step_id => p_transaction_step_id
13213            ,p_name                => 'P_PER_INFORMATION4')
13214       --
13215       ,P_PER_INFORMATION5  =>
13216          hr_transaction_api.get_VARCHAR2_value
13217            (p_transaction_step_id => p_transaction_step_id
13218            ,p_name                => 'P_PER_INFORMATION5')
13219       --
13220       ,P_PER_INFORMATION6  =>
13221          hr_transaction_api.get_VARCHAR2_value
13222            (p_transaction_step_id => p_transaction_step_id
13223            ,p_name                => 'P_PER_INFORMATION6')
13224       --
13225       ,P_PER_INFORMATION7  =>
13226          hr_transaction_api.get_VARCHAR2_value
13227            (p_transaction_step_id => p_transaction_step_id
13228            ,p_name                => 'P_PER_INFORMATION7')
13229       --
13230       ,P_PER_INFORMATION8  =>
13231          hr_transaction_api.get_VARCHAR2_value
13232            (p_transaction_step_id => p_transaction_step_id
13233            ,p_name                => 'P_PER_INFORMATION8')
13234       --
13235       ,P_PER_INFORMATION9  =>
13236          hr_transaction_api.get_VARCHAR2_value
13237            (p_transaction_step_id => p_transaction_step_id
13238            ,p_name                => 'P_PER_INFORMATION9')
13239       --
13240       ,P_PER_INFORMATION10  =>
13241          hr_transaction_api.get_VARCHAR2_value
13242            (p_transaction_step_id => p_transaction_step_id
13243            ,p_name                => 'P_PER_INFORMATION10')
13244       --
13245       ,P_PER_INFORMATION11  =>
13246          hr_transaction_api.get_VARCHAR2_value
13247            (p_transaction_step_id => p_transaction_step_id
13248            ,p_name                => 'P_PER_INFORMATION11')
13249       --
13250       ,P_PER_INFORMATION12  =>
13251          hr_transaction_api.get_VARCHAR2_value
13252            (p_transaction_step_id => p_transaction_step_id
13253            ,p_name                => 'P_PER_INFORMATION12')
13254       --
13255       ,P_PER_INFORMATION13  =>
13256          hr_transaction_api.get_VARCHAR2_value
13257            (p_transaction_step_id => p_transaction_step_id
13258            ,p_name                => 'P_PER_INFORMATION13')
13259       --
13260       ,P_PER_INFORMATION14  =>
13261          hr_transaction_api.get_VARCHAR2_value
13262            (p_transaction_step_id => p_transaction_step_id
13263            ,p_name                => 'P_PER_INFORMATION14')
13264       --
13265       ,P_PER_INFORMATION15  =>
13266          hr_transaction_api.get_VARCHAR2_value
13267            (p_transaction_step_id => p_transaction_step_id
13268            ,p_name                => 'P_PER_INFORMATION15')
13269       --
13270       ,P_PER_INFORMATION16  =>
13271          hr_transaction_api.get_VARCHAR2_value
13272            (p_transaction_step_id => p_transaction_step_id
13273            ,p_name                => 'P_PER_INFORMATION16')
13274       --
13275       ,P_PER_INFORMATION17  =>
13276          hr_transaction_api.get_VARCHAR2_value
13277            (p_transaction_step_id => p_transaction_step_id
13278            ,p_name                => 'P_PER_INFORMATION17')
13279       --
13280       ,P_PER_INFORMATION18  =>
13281          hr_transaction_api.get_VARCHAR2_value
13282            (p_transaction_step_id => p_transaction_step_id
13283            ,p_name                => 'P_PER_INFORMATION18')
13284       --
13285       ,P_PER_INFORMATION19  =>
13286          hr_transaction_api.get_VARCHAR2_value
13287            (p_transaction_step_id => p_transaction_step_id
13288            ,p_name                => 'P_PER_INFORMATION19')
13289       --
13290       ,P_PER_INFORMATION20  =>
13291          hr_transaction_api.get_VARCHAR2_value
13292            (p_transaction_step_id => p_transaction_step_id
13293            ,p_name                => 'P_PER_INFORMATION20')
13294       --
13295       ,P_PER_INFORMATION21  =>
13296          hr_transaction_api.get_VARCHAR2_value
13297            (p_transaction_step_id => p_transaction_step_id
13298            ,p_name                => 'P_PER_INFORMATION21')
13299       --
13300       ,P_PER_INFORMATION22  =>
13301          hr_transaction_api.get_VARCHAR2_value
13302            (p_transaction_step_id => p_transaction_step_id
13303            ,p_name                => 'P_PER_INFORMATION22')
13304       --
13305       ,P_PER_INFORMATION23  =>
13306          hr_transaction_api.get_VARCHAR2_value
13307            (p_transaction_step_id => p_transaction_step_id
13308            ,p_name                => 'P_PER_INFORMATION23')
13309       --
13310       ,P_PER_INFORMATION24  =>
13311          hr_transaction_api.get_VARCHAR2_value
13312            (p_transaction_step_id => p_transaction_step_id
13313            ,p_name                => 'P_PER_INFORMATION24')
13314       --
13315       ,P_PER_INFORMATION25  =>
13316          hr_transaction_api.get_VARCHAR2_value
13317            (p_transaction_step_id => p_transaction_step_id
13318            ,p_name                => 'P_PER_INFORMATION25')
13319       --
13320       ,P_PER_INFORMATION26  =>
13321          hr_transaction_api.get_VARCHAR2_value
13322            (p_transaction_step_id => p_transaction_step_id
13323            ,p_name                => 'P_PER_INFORMATION26')
13324       --
13325       ,P_PER_INFORMATION27  =>
13326          hr_transaction_api.get_VARCHAR2_value
13327            (p_transaction_step_id => p_transaction_step_id
13328            ,p_name                => 'P_PER_INFORMATION27')
13329       --
13330       ,P_PER_INFORMATION28  =>
13331          hr_transaction_api.get_VARCHAR2_value
13332            (p_transaction_step_id => p_transaction_step_id
13333            ,p_name                => 'P_PER_INFORMATION28')
13334       --
13335       ,P_PER_INFORMATION29  =>
13336          hr_transaction_api.get_VARCHAR2_value
13337            (p_transaction_step_id => p_transaction_step_id
13338            ,p_name                => 'P_PER_INFORMATION29')
13339       --
13340       ,P_PER_INFORMATION30  =>
13341          hr_transaction_api.get_VARCHAR2_value
13342            (p_transaction_step_id => p_transaction_step_id
13343            ,p_name                => 'P_PER_INFORMATION30')
13344       --
13345       ,P_CORRESPONDENCE_LANGUAGE  =>
13346          hr_transaction_api.get_VARCHAR2_value
13347            (p_transaction_step_id => p_transaction_step_id
13348            ,p_name                => 'P_CORRESPONDENCE_LANGUAGE')
13349       --
13350       ,P_HONORS  =>
13351          hr_transaction_api.get_VARCHAR2_value
13352            (p_transaction_step_id => p_transaction_step_id
13353            ,p_name                => 'P_HONORS')
13354       --
13355       ,P_PRE_NAME_ADJUNCT  =>
13356          hr_transaction_api.get_VARCHAR2_value
13357            (p_transaction_step_id => p_transaction_step_id
13358            ,p_name                => 'P_PRE_NAME_ADJUNCT')
13359       --
13360       ,P_SUFFIX  =>
13361          hr_transaction_api.get_VARCHAR2_value
13362            (p_transaction_step_id => p_transaction_step_id
13363            ,p_name                => 'P_SUFFIX')
13364       --
13365       ,P_CREATE_MIRROR_FLAG  =>
13366          hr_transaction_api.get_VARCHAR2_value
13367            (p_transaction_step_id => p_transaction_step_id
13368            ,p_name                => 'P_CREATE_MIRROR_FLAG')
13369 
13370       --
13371       ,P_MIRROR_TYPE  =>
13372          hr_transaction_api.get_VARCHAR2_value
13373            (p_transaction_step_id => p_transaction_step_id
13374            ,p_name                => 'P_MIRROR_TYPE')
13375 
13376       --
13377       ,P_MIRROR_CONT_ATTRIBUTE_CAT  =>
13378          hr_transaction_api.get_VARCHAR2_value
13379            (p_transaction_step_id => p_transaction_step_id
13380            ,p_name                => 'P_MIRROR_CONT_ATTRIBUTE_CAT')
13381       --
13382       ,P_MIRROR_CONT_ATTRIBUTE1  =>
13383          hr_transaction_api.get_VARCHAR2_value
13384            (p_transaction_step_id => p_transaction_step_id
13385            ,p_name                => 'P_MIRROR_CONT_ATTRIBUTE1')
13386       --
13387       ,P_MIRROR_CONT_ATTRIBUTE2  =>
13388          hr_transaction_api.get_VARCHAR2_value
13389            (p_transaction_step_id => p_transaction_step_id
13390            ,p_name                => 'P_MIRROR_CONT_ATTRIBUTE2')
13391       --
13392       ,P_MIRROR_CONT_ATTRIBUTE3  =>
13393          hr_transaction_api.get_VARCHAR2_value
13394            (p_transaction_step_id => p_transaction_step_id
13395            ,p_name                => 'P_MIRROR_CONT_ATTRIBUTE3')
13396       --
13397       ,P_MIRROR_CONT_ATTRIBUTE4  =>
13398          hr_transaction_api.get_VARCHAR2_value
13399            (p_transaction_step_id => p_transaction_step_id
13400            ,p_name                => 'P_MIRROR_CONT_ATTRIBUTE4')
13401       --
13402       ,P_MIRROR_CONT_ATTRIBUTE5  =>
13403          hr_transaction_api.get_VARCHAR2_value
13404            (p_transaction_step_id => p_transaction_step_id
13405            ,p_name                => 'P_MIRROR_CONT_ATTRIBUTE5')
13406       --
13407       ,P_MIRROR_CONT_ATTRIBUTE6  =>
13408          hr_transaction_api.get_VARCHAR2_value
13409            (p_transaction_step_id => p_transaction_step_id
13410            ,p_name                => 'P_MIRROR_CONT_ATTRIBUTE6')
13411       --
13412       ,P_MIRROR_CONT_ATTRIBUTE7  =>
13413          hr_transaction_api.get_VARCHAR2_value
13414            (p_transaction_step_id => p_transaction_step_id
13415            ,p_name                => 'P_MIRROR_CONT_ATTRIBUTE7')
13416       --
13417       ,P_MIRROR_CONT_ATTRIBUTE8  =>
13418          hr_transaction_api.get_VARCHAR2_value
13419            (p_transaction_step_id => p_transaction_step_id
13420            ,p_name                => 'P_MIRROR_CONT_ATTRIBUTE8')
13421       --
13422       ,P_MIRROR_CONT_ATTRIBUTE9  =>
13423          hr_transaction_api.get_VARCHAR2_value
13424            (p_transaction_step_id => p_transaction_step_id
13425            ,p_name                => 'P_MIRROR_CONT_ATTRIBUTE9')
13426       --
13427       ,P_MIRROR_CONT_ATTRIBUTE10  =>
13428          hr_transaction_api.get_VARCHAR2_value
13429            (p_transaction_step_id => p_transaction_step_id
13430            ,p_name                => 'P_MIRROR_CONT_ATTRIBUTE10')
13431       --
13432       ,P_MIRROR_CONT_ATTRIBUTE11  =>
13433          hr_transaction_api.get_VARCHAR2_value
13434            (p_transaction_step_id => p_transaction_step_id
13435            ,p_name                => 'P_MIRROR_CONT_ATTRIBUTE11')
13436       --
13437       ,P_MIRROR_CONT_ATTRIBUTE12  =>
13438          hr_transaction_api.get_VARCHAR2_value
13439            (p_transaction_step_id => p_transaction_step_id
13440            ,p_name                => 'P_MIRROR_CONT_ATTRIBUTE12')
13441       --
13442       ,P_MIRROR_CONT_ATTRIBUTE13  =>
13443          hr_transaction_api.get_VARCHAR2_value
13444            (p_transaction_step_id => p_transaction_step_id
13445            ,p_name                => 'P_MIRROR_CONT_ATTRIBUTE13')
13446       --
13447       ,P_MIRROR_CONT_ATTRIBUTE14  =>
13448          hr_transaction_api.get_VARCHAR2_value
13449            (p_transaction_step_id => p_transaction_step_id
13450            ,p_name                => 'P_MIRROR_CONT_ATTRIBUTE14')
13451       --
13452       ,P_MIRROR_CONT_ATTRIBUTE15  =>
13453          hr_transaction_api.get_VARCHAR2_value
13454            (p_transaction_step_id => p_transaction_step_id
13455            ,p_name                => 'P_MIRROR_CONT_ATTRIBUTE15')
13456       --
13457       ,P_MIRROR_CONT_ATTRIBUTE16  =>
13458          hr_transaction_api.get_VARCHAR2_value
13459            (p_transaction_step_id => p_transaction_step_id
13460            ,p_name                => 'P_MIRROR_CONT_ATTRIBUTE16')
13461       --
13462       ,P_MIRROR_CONT_ATTRIBUTE17  =>
13463          hr_transaction_api.get_VARCHAR2_value
13464            (p_transaction_step_id => p_transaction_step_id
13465            ,p_name                => 'P_MIRROR_CONT_ATTRIBUTE17')
13466       --
13467       ,P_MIRROR_CONT_ATTRIBUTE18  =>
13468          hr_transaction_api.get_VARCHAR2_value
13469            (p_transaction_step_id => p_transaction_step_id
13470            ,p_name                => 'P_MIRROR_CONT_ATTRIBUTE18')
13471       --
13472       ,P_MIRROR_CONT_ATTRIBUTE19  =>
13473          hr_transaction_api.get_VARCHAR2_value
13474            (p_transaction_step_id => p_transaction_step_id
13475            ,p_name                => 'P_MIRROR_CONT_ATTRIBUTE19')
13476       --
13477       ,P_MIRROR_CONT_ATTRIBUTE20  =>
13478          hr_transaction_api.get_VARCHAR2_value
13479            (p_transaction_step_id => p_transaction_step_id
13480            ,p_name                => 'P_MIRROR_CONT_ATTRIBUTE20')
13481       --
13482       ,P_CONTACT_RELATIONSHIP_ID  	=> l_contact_relationship_id1
13483       --
13484       ,P_CTR_OBJECT_VERSION_NUMBER  	=> l_ctr_object_version_number1
13485       --
13486       ,P_PER_PERSON_ID  		=> l_per_person_id1
13487       --
13488       ,P_PER_OBJECT_VERSION_NUMBER  	=> l_per_object_version_number1
13489       --
13490       ,P_PER_EFFECTIVE_START_DATE  	=> l_per_effective_start_date1
13491       --
13492       ,P_PER_EFFECTIVE_END_DATE  	=> l_per_effective_end_date1
13493       --
13494       ,P_FULL_NAME  			=> l_full_name
13495       --
13496       ,P_PER_COMMENT_ID  		=> l_per_comment_id1
13497       --
13498       ,P_NAME_COMBINATION_WARNING  	=> l_con_name_combination_warnin1
13499       --
13500       ,P_ORIG_HIRE_WARNING  		=> l_con_orig_hire_warning1
13501       --
13502       ,P_CONT_INFORMATION_CATEGORY  =>
13503          hr_transaction_api.get_VARCHAR2_value
13504            (p_transaction_step_id => p_transaction_step_id
13505            ,p_name                => 'P_CONT_INFORMATION_CATEGORY')
13506       --
13507       ,P_CONT_INFORMATION1  =>
13508          hr_transaction_api.get_VARCHAR2_value
13509            (p_transaction_step_id => p_transaction_step_id
13510            ,p_name                => 'P_CONT_INFORMATION1')
13511       --
13512       ,P_CONT_INFORMATION2  =>
13513          hr_transaction_api.get_VARCHAR2_value
13514            (p_transaction_step_id => p_transaction_step_id
13515            ,p_name                => 'P_CONT_INFORMATION2')
13516       --
13517       ,P_CONT_INFORMATION3  =>
13518          hr_transaction_api.get_VARCHAR2_value
13519            (p_transaction_step_id => p_transaction_step_id
13520            ,p_name                => 'P_CONT_INFORMATION3')
13521       --
13522       ,P_CONT_INFORMATION4  =>
13523          hr_transaction_api.get_VARCHAR2_value
13524            (p_transaction_step_id => p_transaction_step_id
13525            ,p_name                => 'P_CONT_INFORMATION4')
13526       --
13527       ,P_CONT_INFORMATION5  =>
13528          hr_transaction_api.get_VARCHAR2_value
13529            (p_transaction_step_id => p_transaction_step_id
13530            ,p_name                => 'P_CONT_INFORMATION5')
13531       --
13532       ,P_CONT_INFORMATION6  =>
13533          hr_transaction_api.get_VARCHAR2_value
13534            (p_transaction_step_id => p_transaction_step_id
13535            ,p_name                => 'P_CONT_INORMATION6')
13536       --
13537       ,P_CONT_INFORMATION7  =>
13538          hr_transaction_api.get_VARCHAR2_value
13539            (p_transaction_step_id => p_transaction_step_id
13540            ,p_name                => 'P_CONT_INFORMATION7')
13541       --
13542       ,P_CONT_INFORMATION8  =>
13543          hr_transaction_api.get_VARCHAR2_value
13544            (p_transaction_step_id => p_transaction_step_id
13545            ,p_name                => 'P_CONT_INFORMATION8')
13546       --
13547       ,P_CONT_INFORMATION9  =>
13548          hr_transaction_api.get_VARCHAR2_value
13549            (p_transaction_step_id => p_transaction_step_id
13550            ,p_name                => 'P_CONT_INFORMATION9')
13551       --
13552       ,P_CONT_INFORMATION10  =>
13553          hr_transaction_api.get_VARCHAR2_value
13554            (p_transaction_step_id => p_transaction_step_id
13555            ,p_name                => 'P_CONT_INFORMATION10')
13556       --
13557       ,P_CONT_INFORMATION11  =>
13558          hr_transaction_api.get_VARCHAR2_value
13559            (p_transaction_step_id => p_transaction_step_id
13560            ,p_name                => 'P_CONT_INFORMATION11')
13561       --
13562       ,P_CONT_INFORMATION12  =>
13563          hr_transaction_api.get_VARCHAR2_value
13564            (p_transaction_step_id => p_transaction_step_id
13565            ,p_name                => 'P_CONT_INFORMATION12')
13566       --
13567       ,P_CONT_INFORMATION13  =>
13568          hr_transaction_api.get_VARCHAR2_value
13569            (p_transaction_step_id => p_transaction_step_id
13570            ,p_name                => 'P_CONT_INFORMATION13')
13571       --
13572       ,P_CONT_INFORMATION14  =>
13573          hr_transaction_api.get_VARCHAR2_value
13574            (p_transaction_step_id => p_transaction_step_id
13575            ,p_name                => 'P_CONT_INFORMATION14')
13576       --
13577       ,P_CONT_INFORMATION15  =>
13578          hr_transaction_api.get_VARCHAR2_value
13579            (p_transaction_step_id => p_transaction_step_id
13580            ,p_name                => 'P_CONT_INFORMATION15')
13581       --
13582       ,P_CONT_INFORMATION16  =>
13583          hr_transaction_api.get_VARCHAR2_value
13584            (p_transaction_step_id => p_transaction_step_id
13585            ,p_name                => 'P_CONT_INFORMATION16')
13586       --
13587       ,P_CONT_INFORMATION17  =>
13588          hr_transaction_api.get_VARCHAR2_value
13589            (p_transaction_step_id => p_transaction_step_id
13590            ,p_name                => 'P_CONT_INFORMATION17')
13591       --
13592       ,P_CONT_INFORMATION18  =>
13593          hr_transaction_api.get_VARCHAR2_value
13594            (p_transaction_step_id => p_transaction_step_id
13595            ,p_name                => 'P_CONT_INFORMATION18')
13596       --
13597       ,P_CONT_INFORMATION19  =>
13598          hr_transaction_api.get_VARCHAR2_value
13599            (p_transaction_step_id => p_transaction_step_id
13600            ,p_name                => 'P_CONT_INFORMATION19')
13601       --
13602       ,P_CONT_INFORMATION20  =>
13603          hr_transaction_api.get_VARCHAR2_value
13604            (p_transaction_step_id => p_transaction_step_id
13605            ,p_name                => 'P_CONT_INFORMATION20')
13606      );
13607 
13608     end if; -- end if of skip_contact_create_flg --- 5894873
13609 
13610     else
13611 
13612    -- if primary contact flag is checked apply it emrg record and not for
13613    -- other personal relationship record
13614 
13615    if (l_contact_operation = 'EMRG_OVRW_UPD' and (l_primary_contact_flag = 'Y' or
13616        l_primary_contact_flag = 'N')) then
13617     open get_emrg_relid_ovn(
13618             hr_transaction_api.get_NUMBER_value
13619            (p_transaction_step_id => p_transaction_step_id
13620            ,p_name                => 'P_CONTACT_RELATIONSHIP_ID')
13621            ,hr_transaction_api.get_number_value
13622                  (p_transaction_step_id   => p_transaction_step_id
13623                   ,p_name                 => 'P_CONTACT_PERSON_ID')
13624            ,hr_transaction_api.get_number_value
13625                  (p_transaction_step_id   => p_transaction_step_id
13626                   ,p_name                 => 'P_PERSON_ID'));
13627 -- Bug 3469145 : updating the primary cont flag if it has changed.
13628 -- Bug 3504216 :  passing date_start as sysdate
13629     fetch get_emrg_relid_ovn into l_emrg_relid, l_emrg_ovn, l_emrg_primary_cont_flag;
13630     if get_emrg_relid_ovn%found then
13631      if((l_emrg_primary_cont_flag <> 'Y' and l_primary_contact_flag = 'Y') OR
13632         (l_emrg_primary_cont_flag <> 'N' and l_primary_contact_flag = 'N')) then
13633         hr_contact_rel_api.update_contact_relationship(
13634          p_validate                => p_validate
13635         ,P_EFFECTIVE_DATE          =>l_effective_date
13636         ,p_object_version_number   => l_emrg_ovn
13637         ,P_CONTACT_RELATIONSHIP_ID => l_emrg_relid
13638         ,P_PRIMARY_CONTACT_FLAG    => l_primary_contact_flag
13639 	,P_DATE_START              => sysdate
13640        );
13641      end if;
13642      l_primary_contact_flag := 'N';
13643     end if;
13644     close get_emrg_relid_ovn;
13645    end if;
13646 
13647     hr_contact_rel_api.update_contact_relationship(
13648 
13649       P_VALIDATE  =>  p_validate
13650       --
13651       ,P_EFFECTIVE_DATE  =>  l_effective_date
13652          /* SFL changes
13653          hr_transaction_api.get_DATE_value
13654            (p_transaction_step_id => p_transaction_step_id
13655            ,p_name                => 'p_cont_EFFECTIVE_DATE')
13656          */
13657       --
13658       ,P_CONTACT_RELATIONSHIP_ID  =>
13659          hr_transaction_api.get_NUMBER_value
13660            (p_transaction_step_id => p_transaction_step_id
13661            ,p_name                => 'P_CONTACT_RELATIONSHIP_ID')
13662       --
13663       ,P_CONTACT_TYPE  =>
13664          hr_transaction_api.get_VARCHAR2_value
13665            (p_transaction_step_id => p_transaction_step_id
13666            ,p_name                => 'P_CONTACT_TYPE')
13667       --
13668 
13669       ,P_COMMENTS  =>
13670          hr_transaction_api.get_VARCHAR2_value
13671            (p_transaction_step_id => p_transaction_step_id
13672            ,p_name                => 'P_CTR_COMMENTS')
13673       --
13674  -- Bug 3617667 : Not passign Primary Cont flag.Its only availaible in Emerg region.
13675  --     ,P_PRIMARY_CONTACT_FLAG  => l_primary_contact_flag
13676       --
13677       ,P_THIRD_PARTY_PAY_FLAG  =>
13678          hr_transaction_api.get_VARCHAR2_value
13679            (p_transaction_step_id => p_transaction_step_id
13680            ,p_name                => 'P_THIRD_PARTY_PAY_FLAG')
13681       --
13682       ,P_BONDHOLDER_FLAG  =>
13683          hr_transaction_api.get_VARCHAR2_value
13684            (p_transaction_step_id => p_transaction_step_id
13685            ,p_name                => 'P_BONDHOLDER_FLAG')
13686       --
13687       ,P_DATE_START  =>
13688          hr_transaction_api.get_DATE_value
13689            (p_transaction_step_id => p_transaction_step_id
13690            ,p_name                => 'P_DATE_START')
13691       --
13692       ,P_START_LIFE_REASON_ID  =>
13693          hr_transaction_api.get_NUMBER_value
13694            (p_transaction_step_id => p_transaction_step_id
13695            ,p_name                => 'P_START_LIFE_REASON_ID')
13696       --
13697       ,P_DATE_END  =>
13698          hr_transaction_api.get_DATE_value
13699            (p_transaction_step_id => p_transaction_step_id
13700            ,p_name                => 'P_DATE_END')
13701       --
13702       ,P_END_LIFE_REASON_ID  =>
13703          hr_transaction_api.get_NUMBER_value
13704            (p_transaction_step_id => p_transaction_step_id
13705            ,p_name                => 'P_END_LIFE_REASON_ID')
13706       --
13707       ,P_RLTD_PER_RSDS_W_DSGNTR_FLAG  =>
13708          hr_transaction_api.get_VARCHAR2_value
13709            (p_transaction_step_id => p_transaction_step_id
13710            ,p_name                => 'P_RLTD_PER_RSDS_W_DSGNTR_FLAG')
13711       --
13712       ,P_PERSONAL_FLAG  =>
13713          hr_transaction_api.get_VARCHAR2_value
13714            (p_transaction_step_id => p_transaction_step_id
13715            ,p_name                => 'P_PERSONAL_FLAG')
13716       --
13717    /*   ,P_SEQUENCE_NUMBER  =>
13718          hr_transaction_api.get_NUMBER_value
13719            (p_transaction_step_id => p_transaction_step_id
13720            ,p_name                => 'P_SEQUENCE_NUMBER') */
13721 
13722       --
13723       ,P_DEPENDENT_FLAG  =>
13724          hr_transaction_api.get_VARCHAR2_value
13725            (p_transaction_step_id => p_transaction_step_id
13726            ,p_name                => 'P_DEPENDENT_FLAG')
13727       --
13728       ,P_BENEFICIARY_FLAG  =>
13729          hr_transaction_api.get_VARCHAR2_value
13730            (p_transaction_step_id => p_transaction_step_id
13731            ,p_name                => 'P_BENEFICIARY_FLAG')
13732       --
13733       ,P_CONT_ATTRIBUTE_CATEGORY  =>
13734          hr_transaction_api.get_VARCHAR2_value
13735            (p_transaction_step_id => p_transaction_step_id
13736            ,p_name                => 'P_CONT_ATTRIBUTE_CATEGORY')
13737       --
13738       ,P_CONT_ATTRIBUTE1  =>
13739          hr_transaction_api.get_VARCHAR2_value
13740            (p_transaction_step_id => p_transaction_step_id
13741            ,p_name                => 'P_CONT_ATTRIBUTE1')
13742       --
13743       ,P_CONT_ATTRIBUTE2  =>
13744          hr_transaction_api.get_VARCHAR2_value
13745            (p_transaction_step_id => p_transaction_step_id
13746            ,p_name                => 'P_CONT_ATTRIBUTE2')
13747       --
13748       ,P_CONT_ATTRIBUTE3  =>
13749          hr_transaction_api.get_VARCHAR2_value
13750            (p_transaction_step_id => p_transaction_step_id
13751            ,p_name                => 'P_CONT_ATTRIBUTE3')
13752       --
13753       ,P_CONT_ATTRIBUTE4  =>
13754          hr_transaction_api.get_VARCHAR2_value
13755            (p_transaction_step_id => p_transaction_step_id
13756            ,p_name                => 'P_CONT_ATTRIBUTE4')
13757       --
13758       ,P_CONT_ATTRIBUTE5  =>
13759          hr_transaction_api.get_VARCHAR2_value
13760            (p_transaction_step_id => p_transaction_step_id
13761            ,p_name                => 'P_CONT_ATTRIBUTE5')
13762       --
13763       ,P_CONT_ATTRIBUTE6  =>
13764          hr_transaction_api.get_VARCHAR2_value
13765            (p_transaction_step_id => p_transaction_step_id
13766            ,p_name                => 'P_CONT_ATTRIBUTE6')
13767       --
13768       ,P_CONT_ATTRIBUTE7  =>
13769          hr_transaction_api.get_VARCHAR2_value
13770            (p_transaction_step_id => p_transaction_step_id
13771            ,p_name                => 'P_CONT_ATTRIBUTE7')
13772       --
13773       ,P_CONT_ATTRIBUTE8  =>
13774          hr_transaction_api.get_VARCHAR2_value
13775            (p_transaction_step_id => p_transaction_step_id
13776            ,p_name                => 'P_CONT_ATTRIBUTE8')
13777       --
13778       ,P_CONT_ATTRIBUTE9  =>
13779          hr_transaction_api.get_VARCHAR2_value
13780            (p_transaction_step_id => p_transaction_step_id
13781            ,p_name                => 'P_CONT_ATTRIBUTE9')
13782       --
13783       ,P_CONT_ATTRIBUTE10  =>
13784          hr_transaction_api.get_VARCHAR2_value
13785            (p_transaction_step_id => p_transaction_step_id
13786            ,p_name                => 'P_CONT_ATTRIBUTE10')
13787       --
13788       ,P_CONT_ATTRIBUTE11  =>
13789          hr_transaction_api.get_VARCHAR2_value
13790            (p_transaction_step_id => p_transaction_step_id
13791            ,p_name                => 'P_CONT_ATTRIBUTE11')
13792       --
13793       ,P_CONT_ATTRIBUTE12  =>
13794          hr_transaction_api.get_VARCHAR2_value
13795            (p_transaction_step_id => p_transaction_step_id
13796            ,p_name                => 'P_CONT_ATTRIBUTE12')
13797       --
13798       ,P_CONT_ATTRIBUTE13  =>
13799          hr_transaction_api.get_VARCHAR2_value
13800            (p_transaction_step_id => p_transaction_step_id
13801            ,p_name                => 'P_CONT_ATTRIBUTE13')
13802       --
13803       ,P_CONT_ATTRIBUTE14  =>
13804          hr_transaction_api.get_VARCHAR2_value
13805            (p_transaction_step_id => p_transaction_step_id
13806            ,p_name                => 'P_CONT_ATTRIBUTE14')
13807       --
13808       ,P_CONT_ATTRIBUTE15  =>
13809          hr_transaction_api.get_VARCHAR2_value
13810            (p_transaction_step_id => p_transaction_step_id
13811            ,p_name                => 'P_CONT_ATTRIBUTE15')
13812       --
13813       ,P_CONT_ATTRIBUTE16  =>
13814          hr_transaction_api.get_VARCHAR2_value
13815            (p_transaction_step_id => p_transaction_step_id
13816            ,p_name                => 'P_CONT_ATTRIBUTE16')
13817       --
13818       ,P_CONT_ATTRIBUTE17  =>
13819          hr_transaction_api.get_VARCHAR2_value
13820            (p_transaction_step_id => p_transaction_step_id
13821            ,p_name                => 'P_CONT_ATTRIBUTE17')
13822       --
13823       ,P_CONT_ATTRIBUTE18  =>
13824          hr_transaction_api.get_VARCHAR2_value
13825            (p_transaction_step_id => p_transaction_step_id
13826            ,p_name                => 'P_CONT_ATTRIBUTE18')
13827       --
13828       ,P_CONT_ATTRIBUTE19  =>
13829          hr_transaction_api.get_VARCHAR2_value
13830            (p_transaction_step_id => p_transaction_step_id
13831            ,p_name                => 'P_CONT_ATTRIBUTE19')
13832       --
13833       ,P_CONT_ATTRIBUTE20  =>
13834          hr_transaction_api.get_VARCHAR2_value
13835            (p_transaction_step_id => p_transaction_step_id
13836            ,p_name                => 'P_CONT_ATTRIBUTE20')
13837       --
13838       ,P_CONT_INFORMATION_CATEGORY  =>
13839          hr_transaction_api.get_VARCHAR2_value
13840            (p_transaction_step_id => p_transaction_step_id
13841            ,p_name                => 'P_CONT_INFORMATION_CATEGORY')
13842       --
13843       ,P_CONT_INFORMATION1  =>
13844          hr_transaction_api.get_VARCHAR2_value
13845            (p_transaction_step_id => p_transaction_step_id
13846            ,p_name                => 'P_CONT_INFORMATION1')
13847       --
13848       ,P_CONT_INFORMATION2  =>
13849          hr_transaction_api.get_VARCHAR2_value
13850            (p_transaction_step_id => p_transaction_step_id
13851            ,p_name                => 'P_CONT_INFORMATION2')
13852       --
13853       ,P_CONT_INFORMATION3  =>
13854          hr_transaction_api.get_VARCHAR2_value
13855            (p_transaction_step_id => p_transaction_step_id
13856            ,p_name                => 'P_CONT_INFORMATION3')
13857       --
13858       ,P_CONT_INFORMATION4  =>
13859          hr_transaction_api.get_VARCHAR2_value
13860            (p_transaction_step_id => p_transaction_step_id
13861            ,p_name                => 'P_CONT_INFORMATION4')
13862       --
13863       ,P_CONT_INFORMATION5  =>
13864          hr_transaction_api.get_VARCHAR2_value
13865            (p_transaction_step_id => p_transaction_step_id
13866            ,p_name                => 'P_CONT_INFORMATION5')
13867       --
13868       ,P_CONT_INFORMATION6  =>
13869          hr_transaction_api.get_VARCHAR2_value
13870            (p_transaction_step_id => p_transaction_step_id
13871            ,p_name                => 'P_CONT_INFORMATION6')
13872       --
13873       ,P_CONT_INFORMATION7  =>
13874          hr_transaction_api.get_VARCHAR2_value
13875            (p_transaction_step_id => p_transaction_step_id
13876            ,p_name                => 'P_CONT_INFORMATION7')
13877       --
13878       ,P_CONT_INFORMATION8  =>
13879          hr_transaction_api.get_VARCHAR2_value
13880            (p_transaction_step_id => p_transaction_step_id
13881            ,p_name                => 'P_CONT_INFORMATION8')
13882       --
13883       ,P_CONT_INFORMATION9  =>
13884          hr_transaction_api.get_VARCHAR2_value
13885            (p_transaction_step_id => p_transaction_step_id
13886            ,p_name                => 'P_CONT_INFORMATION9')
13887       --
13888       ,P_CONT_INFORMATION10  =>
13889          hr_transaction_api.get_VARCHAR2_value
13890            (p_transaction_step_id => p_transaction_step_id
13891            ,p_name                => 'P_CONT_INFORMATION10')
13892       --
13893       ,P_CONT_INFORMATION11  =>
13894          hr_transaction_api.get_VARCHAR2_value
13895            (p_transaction_step_id => p_transaction_step_id
13896            ,p_name                => 'P_CONT_INFORMATION11')
13897       --
13898       ,P_CONT_INFORMATION12  =>
13899          hr_transaction_api.get_VARCHAR2_value
13900            (p_transaction_step_id => p_transaction_step_id
13901            ,p_name                => 'P_CONT_INFORMATION12')
13902       --
13903       ,P_CONT_INFORMATION13  =>
13904          hr_transaction_api.get_VARCHAR2_value
13905            (p_transaction_step_id => p_transaction_step_id
13906            ,p_name                => 'P_CONT_INFORMATION13')
13907       --
13908       ,P_CONT_INFORMATION14  =>
13909          hr_transaction_api.get_VARCHAR2_value
13910            (p_transaction_step_id => p_transaction_step_id
13911            ,p_name                => 'P_CONT_INFORMATION14')
13912       --
13913       ,P_CONT_INFORMATION15  =>
13914          hr_transaction_api.get_VARCHAR2_value
13915            (p_transaction_step_id => p_transaction_step_id
13916            ,p_name                => 'P_CONT_INFORMATION15')
13917       --
13918       ,P_CONT_INFORMATION16  =>
13919          hr_transaction_api.get_VARCHAR2_value
13920            (p_transaction_step_id => p_transaction_step_id
13921            ,p_name                => 'P_CONT_INFORMATION16')
13922       --
13923       ,P_CONT_INFORMATION17  =>
13924          hr_transaction_api.get_VARCHAR2_value
13925            (p_transaction_step_id => p_transaction_step_id
13926            ,p_name                => 'P_CONT_INFORMATION17')
13927       --
13928       ,P_CONT_INFORMATION18  =>
13929          hr_transaction_api.get_VARCHAR2_value
13930            (p_transaction_step_id => p_transaction_step_id
13931            ,p_name                => 'P_CONT_INFORMATION18')
13932       --
13933       ,P_CONT_INFORMATION19  =>
13934          hr_transaction_api.get_VARCHAR2_value
13935            (p_transaction_step_id => p_transaction_step_id
13936            ,p_name                => 'P_CONT_INFORMATION19')
13937       --
13938       ,P_CONT_INFORMATION20  =>
13939          hr_transaction_api.get_VARCHAR2_value
13940            (p_transaction_step_id => p_transaction_step_id
13941            ,p_name                => 'P_CONT_INFORMATION20')
13942       --
13943       ,P_OBJECT_VERSION_NUMBER  =>  l_ovn
13944       --
13945     );
13946   end if;
13947   ELSE
13948     --
13949     l_contact_type :=
13950        hr_transaction_api.get_VARCHAR2_value
13951          (p_transaction_step_id => p_transaction_step_id
13952           ,p_name                => 'P_CONTACT_TYPE') ;
13953 
13954     --
13955     l_personal_flag :=
13956        hr_transaction_api.get_VARCHAR2_value
13957           (p_transaction_step_id => p_transaction_step_id
13958            ,p_name                => 'P_PERSONAL_FLAG') ;
13959     --
13960     if l_contact_operation = 'EMER_CR_NEW_REL' then
13961       --
13962       l_contact_type := 'EMRG' ;
13963       l_personal_flag:= 'N' ;
13964       --
13965     else
13966       --
13967       l_personal_flag := 'Y' ;
13968       --
13969     end if;
13970     --
13971     if  l_contact_operation in ( 'EMER_CR_NEW_REL', 'DPDNT_CR_NEW_REL') then
13972         --
13973 
13974 	open get_other_relid_ovn(
13975             hr_transaction_api.get_number_value
13976                  (p_transaction_step_id   => p_transaction_step_id
13977                   ,p_name                 => 'P_CONTACT_PERSON_ID')
13978            ,hr_transaction_api.get_number_value
13979                  (p_transaction_step_id   => p_transaction_step_id
13980                   ,p_name                 => 'P_PERSON_ID'));
13981     fetch get_other_relid_ovn into l_other_relid, l_other_ovn;
13982     if get_other_relid_ovn%found then
13983          hr_contact_rel_api.update_contact_relationship(
13984 
13985       P_VALIDATE  =>  p_validate
13986       --
13987       ,P_EFFECTIVE_DATE  =>  l_effective_date
13988 
13989       ,P_CONTACT_RELATIONSHIP_ID  =>     l_other_relid
13990       --
13991       ,P_CONTACT_TYPE  =>
13992             hr_transaction_api.get_VARCHAR2_value
13993                 (p_transaction_step_id => p_transaction_step_id
13994                 ,p_name                => 'P_CONTACT_TYPE')
13995       --
13996       ,P_COMMENTS  =>
13997          hr_transaction_api.get_VARCHAR2_value
13998            (p_transaction_step_id => p_transaction_step_id
13999            ,p_name                => 'P_CTR_COMMENTS')
14000 
14001       ,P_THIRD_PARTY_PAY_FLAG  =>
14002          hr_transaction_api.get_VARCHAR2_value
14003            (p_transaction_step_id => p_transaction_step_id
14004            ,p_name                => 'P_THIRD_PARTY_PAY_FLAG')
14005       --
14006       ,P_BONDHOLDER_FLAG  =>
14007          hr_transaction_api.get_VARCHAR2_value
14008            (p_transaction_step_id => p_transaction_step_id
14009            ,p_name                => 'P_BONDHOLDER_FLAG')
14010       --
14011       ,P_DATE_START  =>
14012          hr_transaction_api.get_DATE_value
14013            (p_transaction_step_id => p_transaction_step_id
14014            ,p_name                => 'P_DATE_START')
14015       --
14016      -- bug 4775133 ,P_START_LIFE_REASON_ID  =>
14017        --  hr_transaction_api.get_NUMBER_value
14018        --    (p_transaction_step_id => p_transaction_step_id
14019        --    ,p_name                => 'P_START_LIFE_REASON_ID')
14020       --
14021       ,P_DATE_END  =>
14022          hr_transaction_api.get_DATE_value
14023            (p_transaction_step_id => p_transaction_step_id
14024            ,p_name                => 'P_DATE_END')
14025       --
14026       ,P_END_LIFE_REASON_ID  =>
14027          hr_transaction_api.get_NUMBER_value
14028            (p_transaction_step_id => p_transaction_step_id
14029            ,p_name                => 'P_END_LIFE_REASON_ID')
14030       --
14031       ,P_RLTD_PER_RSDS_W_DSGNTR_FLAG  =>
14032          hr_transaction_api.get_VARCHAR2_value
14033            (p_transaction_step_id => p_transaction_step_id
14034            ,p_name                => 'P_RLTD_PER_RSDS_W_DSGNTR_FLAG')
14035       --
14036       ,P_PERSONAL_FLAG  => 'Y'
14037       --
14038       ,P_DEPENDENT_FLAG  =>
14039          hr_transaction_api.get_VARCHAR2_value
14040            (p_transaction_step_id => p_transaction_step_id
14041            ,p_name                => 'P_DEPENDENT_FLAG')
14042       --
14043       ,P_BENEFICIARY_FLAG  =>
14044          hr_transaction_api.get_VARCHAR2_value
14045            (p_transaction_step_id => p_transaction_step_id
14046            ,p_name                => 'P_BENEFICIARY_FLAG')
14047       --
14048       ,P_CONT_ATTRIBUTE_CATEGORY  =>
14049          hr_transaction_api.get_VARCHAR2_value
14050            (p_transaction_step_id => p_transaction_step_id
14051            ,p_name                => 'P_CONT_ATTRIBUTE_CATEGORY')
14052       --
14053       ,P_CONT_ATTRIBUTE1  =>
14054          hr_transaction_api.get_VARCHAR2_value
14055            (p_transaction_step_id => p_transaction_step_id
14056            ,p_name                => 'P_CONT_ATTRIBUTE1')
14057       --
14058       ,P_CONT_ATTRIBUTE2  =>
14059          hr_transaction_api.get_VARCHAR2_value
14060            (p_transaction_step_id => p_transaction_step_id
14061            ,p_name                => 'P_CONT_ATTRIBUTE2')
14062       --
14063       ,P_CONT_ATTRIBUTE3  =>
14064          hr_transaction_api.get_VARCHAR2_value
14065            (p_transaction_step_id => p_transaction_step_id
14066            ,p_name                => 'P_CONT_ATTRIBUTE3')
14067       --
14068       ,P_CONT_ATTRIBUTE4  =>
14069          hr_transaction_api.get_VARCHAR2_value
14070            (p_transaction_step_id => p_transaction_step_id
14071            ,p_name                => 'P_CONT_ATTRIBUTE4')
14072       --
14073       ,P_CONT_ATTRIBUTE5  =>
14074          hr_transaction_api.get_VARCHAR2_value
14075            (p_transaction_step_id => p_transaction_step_id
14076            ,p_name                => 'P_CONT_ATTRIBUTE5')
14077       --
14078       ,P_CONT_ATTRIBUTE6  =>
14079          hr_transaction_api.get_VARCHAR2_value
14080            (p_transaction_step_id => p_transaction_step_id
14081            ,p_name                => 'P_CONT_ATTRIBUTE6')
14082       --
14083       ,P_CONT_ATTRIBUTE7  =>
14084          hr_transaction_api.get_VARCHAR2_value
14085            (p_transaction_step_id => p_transaction_step_id
14086            ,p_name                => 'P_CONT_ATTRIBUTE7')
14087       --
14088       ,P_CONT_ATTRIBUTE8  =>
14089          hr_transaction_api.get_VARCHAR2_value
14090            (p_transaction_step_id => p_transaction_step_id
14091            ,p_name                => 'P_CONT_ATTRIBUTE8')
14092       --
14093       ,P_CONT_ATTRIBUTE9  =>
14094          hr_transaction_api.get_VARCHAR2_value
14095            (p_transaction_step_id => p_transaction_step_id
14096            ,p_name                => 'P_CONT_ATTRIBUTE9')
14097       --
14098       ,P_CONT_ATTRIBUTE10  =>
14099          hr_transaction_api.get_VARCHAR2_value
14100            (p_transaction_step_id => p_transaction_step_id
14101            ,p_name                => 'P_CONT_ATTRIBUTE10')
14102       --
14103       ,P_CONT_ATTRIBUTE11  =>
14104          hr_transaction_api.get_VARCHAR2_value
14105            (p_transaction_step_id => p_transaction_step_id
14106            ,p_name                => 'P_CONT_ATTRIBUTE11')
14107       --
14108       ,P_CONT_ATTRIBUTE12  =>
14109          hr_transaction_api.get_VARCHAR2_value
14110            (p_transaction_step_id => p_transaction_step_id
14111            ,p_name                => 'P_CONT_ATTRIBUTE12')
14112       --
14113       ,P_CONT_ATTRIBUTE13  =>
14114          hr_transaction_api.get_VARCHAR2_value
14115            (p_transaction_step_id => p_transaction_step_id
14116            ,p_name                => 'P_CONT_ATTRIBUTE13')
14117       --
14118       ,P_CONT_ATTRIBUTE14  =>
14119          hr_transaction_api.get_VARCHAR2_value
14120            (p_transaction_step_id => p_transaction_step_id
14121            ,p_name                => 'P_CONT_ATTRIBUTE14')
14122       --
14123       ,P_CONT_ATTRIBUTE15  =>
14124          hr_transaction_api.get_VARCHAR2_value
14125            (p_transaction_step_id => p_transaction_step_id
14126            ,p_name                => 'P_CONT_ATTRIBUTE15')
14127       --
14128       ,P_CONT_ATTRIBUTE16  =>
14129          hr_transaction_api.get_VARCHAR2_value
14130            (p_transaction_step_id => p_transaction_step_id
14131            ,p_name                => 'P_CONT_ATTRIBUTE16')
14132       --
14133       ,P_CONT_ATTRIBUTE17  =>
14134          hr_transaction_api.get_VARCHAR2_value
14135            (p_transaction_step_id => p_transaction_step_id
14136            ,p_name                => 'P_CONT_ATTRIBUTE17')
14137       --
14138       ,P_CONT_ATTRIBUTE18  =>
14139          hr_transaction_api.get_VARCHAR2_value
14140            (p_transaction_step_id => p_transaction_step_id
14141            ,p_name                => 'P_CONT_ATTRIBUTE18')
14142       --
14143       ,P_CONT_ATTRIBUTE19  =>
14144          hr_transaction_api.get_VARCHAR2_value
14145            (p_transaction_step_id => p_transaction_step_id
14146            ,p_name                => 'P_CONT_ATTRIBUTE19')
14147       --
14148       ,P_CONT_ATTRIBUTE20  =>
14149          hr_transaction_api.get_VARCHAR2_value
14150            (p_transaction_step_id => p_transaction_step_id
14151            ,p_name                => 'P_CONT_ATTRIBUTE20')
14152       --
14153       ,P_CONT_INFORMATION_CATEGORY  =>
14154          hr_transaction_api.get_VARCHAR2_value
14155            (p_transaction_step_id => p_transaction_step_id
14156            ,p_name                => 'P_CONT_INFORMATION_CATEGORY')
14157       --
14158       ,P_CONT_INFORMATION1  =>
14159          hr_transaction_api.get_VARCHAR2_value
14160            (p_transaction_step_id => p_transaction_step_id
14161            ,p_name                => 'P_CONT_INFORMATION1')
14162       --
14163       ,P_CONT_INFORMATION2  =>
14164          hr_transaction_api.get_VARCHAR2_value
14165            (p_transaction_step_id => p_transaction_step_id
14166            ,p_name                => 'P_CONT_INFORMATION2')
14167       --
14168       ,P_CONT_INFORMATION3  =>
14169          hr_transaction_api.get_VARCHAR2_value
14170            (p_transaction_step_id => p_transaction_step_id
14171            ,p_name                => 'P_CONT_INFORMATION3')
14172       --
14173       ,P_CONT_INFORMATION4  =>
14174          hr_transaction_api.get_VARCHAR2_value
14175            (p_transaction_step_id => p_transaction_step_id
14176            ,p_name                => 'P_CONT_INFORMATION4')
14177       --
14178       ,P_CONT_INFORMATION5  =>
14179          hr_transaction_api.get_VARCHAR2_value
14180            (p_transaction_step_id => p_transaction_step_id
14181            ,p_name                => 'P_CONT_INFORMATION5')
14182       --
14183       ,P_CONT_INFORMATION6  =>
14184          hr_transaction_api.get_VARCHAR2_value
14185            (p_transaction_step_id => p_transaction_step_id
14186            ,p_name                => 'P_CONT_INFORMATION6')
14187       --
14188       ,P_CONT_INFORMATION7  =>
14189          hr_transaction_api.get_VARCHAR2_value
14190            (p_transaction_step_id => p_transaction_step_id
14191            ,p_name                => 'P_CONT_INFORMATION7')
14192       --
14193       ,P_CONT_INFORMATION8  =>
14194          hr_transaction_api.get_VARCHAR2_value
14195            (p_transaction_step_id => p_transaction_step_id
14196            ,p_name                => 'P_CONT_INFORMATION8')
14197       --
14198       ,P_CONT_INFORMATION9  =>
14199          hr_transaction_api.get_VARCHAR2_value
14200            (p_transaction_step_id => p_transaction_step_id
14201            ,p_name                => 'P_CONT_INFORMATION9')
14202       --
14203       ,P_CONT_INFORMATION10  =>
14204          hr_transaction_api.get_VARCHAR2_value
14205            (p_transaction_step_id => p_transaction_step_id
14206            ,p_name                => 'P_CONT_INFORMATION10')
14207       --
14208       ,P_CONT_INFORMATION11  =>
14209          hr_transaction_api.get_VARCHAR2_value
14210            (p_transaction_step_id => p_transaction_step_id
14211            ,p_name                => 'P_CONT_INFORMATION11')
14212       --
14213       ,P_CONT_INFORMATION12  =>
14214          hr_transaction_api.get_VARCHAR2_value
14215            (p_transaction_step_id => p_transaction_step_id
14216            ,p_name                => 'P_CONT_INFORMATION12')
14217       --
14218       ,P_CONT_INFORMATION13  =>
14219          hr_transaction_api.get_VARCHAR2_value
14220            (p_transaction_step_id => p_transaction_step_id
14221            ,p_name                => 'P_CONT_INFORMATION13')
14222       --
14223       ,P_CONT_INFORMATION14  =>
14224          hr_transaction_api.get_VARCHAR2_value
14225            (p_transaction_step_id => p_transaction_step_id
14226            ,p_name                => 'P_CONT_INFORMATION14')
14227       --
14228       ,P_CONT_INFORMATION15  =>
14229          hr_transaction_api.get_VARCHAR2_value
14230            (p_transaction_step_id => p_transaction_step_id
14231            ,p_name                => 'P_CONT_INFORMATION15')
14232       --
14233       ,P_CONT_INFORMATION16  =>
14234          hr_transaction_api.get_VARCHAR2_value
14235            (p_transaction_step_id => p_transaction_step_id
14236            ,p_name                => 'P_CONT_INFORMATION16')
14237       --
14238       ,P_CONT_INFORMATION17  =>
14239          hr_transaction_api.get_VARCHAR2_value
14240            (p_transaction_step_id => p_transaction_step_id
14241            ,p_name                => 'P_CONT_INFORMATION17')
14242       --
14243       ,P_CONT_INFORMATION18  =>
14244          hr_transaction_api.get_VARCHAR2_value
14245            (p_transaction_step_id => p_transaction_step_id
14246            ,p_name                => 'P_CONT_INFORMATION18')
14247       --
14248       ,P_CONT_INFORMATION19  =>
14249          hr_transaction_api.get_VARCHAR2_value
14250            (p_transaction_step_id => p_transaction_step_id
14251            ,p_name                => 'P_CONT_INFORMATION19')
14252       --
14253       ,P_CONT_INFORMATION20  =>
14254          hr_transaction_api.get_VARCHAR2_value
14255            (p_transaction_step_id => p_transaction_step_id
14256            ,p_name                => 'P_CONT_INFORMATION20')
14257       --
14258       ,P_OBJECT_VERSION_NUMBER  =>  l_other_ovn
14259       --
14260     );
14261     end if;
14262       close get_other_relid_ovn;
14263 
14264          hr_contact_rel_api.create_contact(
14265           P_VALIDATE  => p_validate
14266           --
14267           ,P_START_DATE  =>          l_effective_date
14268              /*
14269              hr_transaction_api.get_DATE_value
14270                (p_transaction_step_id => p_transaction_step_id
14271                ,p_name                => 'P_CONT_EFFECTIVE_DATE')
14272              */
14273           --
14274           ,P_BUSINESS_GROUP_ID  =>
14275              hr_transaction_api.get_NUMBER_value
14276                (p_transaction_step_id => p_transaction_step_id
14277                ,p_name                => 'P_BUSINESS_GROUP_ID')
14278           --
14279           ,P_PERSON_ID  =>
14280               hr_transaction_api.get_number_value
14281                  (p_transaction_step_id   => p_transaction_step_id
14282                   ,p_name                 =>upper('p_person_id'))
14283           --
14284           ,P_CONTACT_PERSON_ID  =>
14285               hr_transaction_api.get_number_value
14286                  (p_transaction_step_id   => p_transaction_step_id
14287                   ,p_name                 =>upper('p_cont_person_id'))
14288           --
14289           ,P_CONTACT_TYPE  => l_contact_type
14290           --
14291           ,P_CTR_COMMENTS  =>
14292              hr_transaction_api.get_VARCHAR2_value
14293                (p_transaction_step_id => p_transaction_step_id
14294                ,p_name                => 'P_CTR_COMMENTS')
14295           --
14296           ,P_PRIMARY_CONTACT_FLAG  =>
14297              hr_transaction_api.get_VARCHAR2_value
14298                (p_transaction_step_id => p_transaction_step_id
14299                ,p_name                => 'P_PRIMARY_CONTACT_FLAG')
14300           --
14301           ,P_DATE_START  =>
14302              hr_transaction_api.get_DATE_value
14303                (p_transaction_step_id => p_transaction_step_id
14304                ,p_name                => 'P_DATE_START')
14305           --
14306           ,P_START_LIFE_REASON_ID  =>
14307              hr_transaction_api.get_NUMBER_value
14308                (p_transaction_step_id => p_transaction_step_id
14309                ,p_name                => 'P_START_LIFE_REASON_ID')
14310           --
14311           ,P_DATE_END  =>
14312              hr_transaction_api.get_DATE_value
14313                (p_transaction_step_id => p_transaction_step_id
14314                ,p_name                => 'P_DATE_END')
14315           --
14316           ,P_END_LIFE_REASON_ID  =>
14317              hr_transaction_api.get_NUMBER_value
14318                (p_transaction_step_id => p_transaction_step_id
14319                ,p_name                => 'P_END_LIFE_REASON_ID')
14320           --
14321           ,P_RLTD_PER_RSDS_W_DSGNTR_FLAG  =>
14322              hr_transaction_api.get_VARCHAR2_value
14323                (p_transaction_step_id => p_transaction_step_id
14324                ,p_name                => 'P_RLTD_PER_RSDS_W_DSGNTR_FLAG')
14325           --
14326           ,P_PERSONAL_FLAG  =>  l_personal_flag
14327           --
14328           ,P_SEQUENCE_NUMBER  =>
14329              hr_transaction_api.get_NUMBER_value
14330                (p_transaction_step_id => p_transaction_step_id
14331                ,p_name                => 'P_SEQUENCE_NUMBER')
14332           --
14333           ,P_CONT_ATTRIBUTE_CATEGORY  =>
14334              hr_transaction_api.get_VARCHAR2_value
14335                (p_transaction_step_id => p_transaction_step_id
14336                ,p_name                => 'P_CONT_ATTRIBUTE_CATEGORY')
14337           --
14338           ,P_CONT_ATTRIBUTE1  =>
14339              hr_transaction_api.get_VARCHAR2_value
14340                (p_transaction_step_id => p_transaction_step_id
14341                ,p_name                => 'P_CONT_ATTRIBUTE1')
14342           --
14343           ,P_CONT_ATTRIBUTE2  =>
14344              hr_transaction_api.get_VARCHAR2_value
14345                (p_transaction_step_id => p_transaction_step_id
14346                ,p_name                => 'P_CONT_ATTRIBUTE2')
14347           --
14348           ,P_CONT_ATTRIBUTE3  =>
14349              hr_transaction_api.get_VARCHAR2_value
14350                (p_transaction_step_id => p_transaction_step_id
14351                ,p_name                => 'P_CONT_ATTRIBUTE3')
14352           --
14353           ,P_CONT_ATTRIBUTE4  =>
14354              hr_transaction_api.get_VARCHAR2_value
14355                (p_transaction_step_id => p_transaction_step_id
14356                ,p_name                => 'P_CONT_ATTRIBUTE4')
14357           --
14358           ,P_CONT_ATTRIBUTE5  =>
14359              hr_transaction_api.get_VARCHAR2_value
14360                (p_transaction_step_id => p_transaction_step_id
14361                ,p_name                => 'P_CONT_ATTRIBUTE5')
14362           --
14363           ,P_CONT_ATTRIBUTE6  =>
14364              hr_transaction_api.get_VARCHAR2_value
14365                (p_transaction_step_id => p_transaction_step_id
14366                ,p_name                => 'P_CONT_ATTRIBUTE6')
14367           --
14368           ,P_CONT_ATTRIBUTE7  =>
14369              hr_transaction_api.get_VARCHAR2_value
14370                (p_transaction_step_id => p_transaction_step_id
14371                ,p_name                => 'P_CONT_ATTRIBUTE7')
14372           --
14373           ,P_CONT_ATTRIBUTE8  =>
14374              hr_transaction_api.get_VARCHAR2_value
14375                (p_transaction_step_id => p_transaction_step_id
14376                ,p_name                => 'P_CONT_ATTRIBUTE8')
14377           --
14378           ,P_CONT_ATTRIBUTE9  =>
14379              hr_transaction_api.get_VARCHAR2_value
14380                (p_transaction_step_id => p_transaction_step_id
14381                ,p_name                => 'P_CONT_ATTRIBUTE9')
14382           --
14383           ,P_CONT_ATTRIBUTE10  =>
14384              hr_transaction_api.get_VARCHAR2_value
14385                (p_transaction_step_id => p_transaction_step_id
14386                ,p_name                => 'P_CONT_ATTRIBUTE10')
14387           --
14388           ,P_CONT_ATTRIBUTE11  =>
14389              hr_transaction_api.get_VARCHAR2_value
14390                (p_transaction_step_id => p_transaction_step_id
14391                ,p_name                => 'P_CONT_ATTRIBUTE11')
14392           --
14393           ,P_CONT_ATTRIBUTE12  =>
14394              hr_transaction_api.get_VARCHAR2_value
14395                (p_transaction_step_id => p_transaction_step_id
14396                ,p_name                => 'P_CONT_ATTRIBUTE12')
14397           --
14398           ,P_CONT_ATTRIBUTE13  =>
14399              hr_transaction_api.get_VARCHAR2_value
14400                (p_transaction_step_id => p_transaction_step_id
14401                ,p_name                => 'P_CONT_ATTRIBUTE13')
14402           --
14403           ,P_CONT_ATTRIBUTE14  =>
14404              hr_transaction_api.get_VARCHAR2_value
14405                (p_transaction_step_id => p_transaction_step_id
14406                ,p_name                => 'P_CONT_ATTRIBUTE14')
14407           --
14408           ,P_CONT_ATTRIBUTE15  =>
14409              hr_transaction_api.get_VARCHAR2_value
14410                (p_transaction_step_id => p_transaction_step_id
14411                ,p_name                => 'P_CONT_ATTRIBUTE15')
14412           --
14413           ,P_CONT_ATTRIBUTE16  =>
14414              hr_transaction_api.get_VARCHAR2_value
14415                (p_transaction_step_id => p_transaction_step_id
14416                ,p_name                => 'P_CONT_ATTRIBUTE16')
14417           --
14418           ,P_CONT_ATTRIBUTE17  =>
14419              hr_transaction_api.get_VARCHAR2_value
14420                (p_transaction_step_id => p_transaction_step_id
14421                ,p_name                => 'P_CONT_ATTRIBUTE17')
14422           --
14423           ,P_CONT_ATTRIBUTE18  =>
14424              hr_transaction_api.get_VARCHAR2_value
14425                (p_transaction_step_id => p_transaction_step_id
14426                ,p_name                => 'P_CONT_ATTRIBUTE18')
14427           --
14428           ,P_CONT_ATTRIBUTE19  =>
14429              hr_transaction_api.get_VARCHAR2_value
14430                (p_transaction_step_id => p_transaction_step_id
14431                ,p_name                => 'P_CONT_ATTRIBUTE19')
14432           --
14433           ,P_CONT_ATTRIBUTE20  =>
14434              hr_transaction_api.get_VARCHAR2_value
14435                (p_transaction_step_id => p_transaction_step_id
14436                ,p_name                => 'P_CONT_ATTRIBUTE20')
14437           --
14438           ,P_THIRD_PARTY_PAY_FLAG  =>
14439              hr_transaction_api.get_VARCHAR2_value
14440                (p_transaction_step_id => p_transaction_step_id
14441                ,p_name                => 'P_THIRD_PARTY_PAY_FLAG')
14442           --
14443           ,P_BONDHOLDER_FLAG  =>
14444              hr_transaction_api.get_VARCHAR2_value
14445                (p_transaction_step_id => p_transaction_step_id
14446                ,p_name                => 'P_BONDHOLDER_FLAG')
14447           --
14448           ,P_DEPENDENT_FLAG  =>
14449              hr_transaction_api.get_VARCHAR2_value
14450                (p_transaction_step_id => p_transaction_step_id
14451                ,p_name                => 'P_DEPENDENT_FLAG')
14452           --
14453           ,P_BENEFICIARY_FLAG  =>
14454              hr_transaction_api.get_VARCHAR2_value
14455                (p_transaction_step_id => p_transaction_step_id
14456                ,p_name                => 'P_BENEFICIARY_FLAG')
14457           --
14458           ,P_CREATE_MIRROR_FLAG  =>  'N' -- Change later get from txn tables.
14459           --
14460           ,P_MIRROR_TYPE  => null
14461           --
14462           ,P_MIRROR_CONT_ATTRIBUTE_CAT  =>
14463              hr_transaction_api.get_VARCHAR2_value
14464                (p_transaction_step_id => p_transaction_step_id
14465                ,p_name                => 'P_MIRROR_CONT_ATTRIBUTE_CAT')
14466           --
14467           ,P_MIRROR_CONT_ATTRIBUTE1  =>
14468              hr_transaction_api.get_VARCHAR2_value
14469                (p_transaction_step_id => p_transaction_step_id
14470                ,p_name                => 'P_MIRROR_CONT_ATTRIBUTE1')
14471           --
14472           ,P_MIRROR_CONT_ATTRIBUTE2  =>
14473              hr_transaction_api.get_VARCHAR2_value
14474                (p_transaction_step_id => p_transaction_step_id
14475                ,p_name                => 'P_MIRROR_CONT_ATTRIBUTE2')
14476           --
14477           ,P_MIRROR_CONT_ATTRIBUTE3  =>
14478              hr_transaction_api.get_VARCHAR2_value
14479                (p_transaction_step_id => p_transaction_step_id
14480                ,p_name                => 'P_MIRROR_CONT_ATTRIBUTE3')
14481           --
14482           ,P_MIRROR_CONT_ATTRIBUTE4  =>
14483              hr_transaction_api.get_VARCHAR2_value
14484                (p_transaction_step_id => p_transaction_step_id
14485                ,p_name                => 'P_MIRROR_CONT_ATTRIBUTE4')
14486           --
14487           ,P_MIRROR_CONT_ATTRIBUTE5  =>
14488              hr_transaction_api.get_VARCHAR2_value
14489                (p_transaction_step_id => p_transaction_step_id
14490                ,p_name                => 'P_MIRROR_CONT_ATTRIBUTE5')
14491           --
14492           ,P_MIRROR_CONT_ATTRIBUTE6  =>
14493              hr_transaction_api.get_VARCHAR2_value
14494                (p_transaction_step_id => p_transaction_step_id
14495                ,p_name                => 'P_MIRROR_CONT_ATTRIBUTE6')
14496           --
14497           ,P_MIRROR_CONT_ATTRIBUTE7  =>
14498              hr_transaction_api.get_VARCHAR2_value
14499                (p_transaction_step_id => p_transaction_step_id
14500                ,p_name                => 'P_MIRROR_CONT_ATTRIBUTE7')
14501           --
14502           ,P_MIRROR_CONT_ATTRIBUTE8  =>
14503              hr_transaction_api.get_VARCHAR2_value
14504                (p_transaction_step_id => p_transaction_step_id
14505                ,p_name                => 'P_MIRROR_CONT_ATTRIBUTE8')
14506           --
14507           ,P_MIRROR_CONT_ATTRIBUTE9  =>
14508              hr_transaction_api.get_VARCHAR2_value
14509                (p_transaction_step_id => p_transaction_step_id
14510                ,p_name                => 'P_MIRROR_CONT_ATTRIBUTE9')
14511           --
14512           ,P_MIRROR_CONT_ATTRIBUTE10  =>
14513              hr_transaction_api.get_VARCHAR2_value
14514                (p_transaction_step_id => p_transaction_step_id
14515                ,p_name                => 'P_MIRROR_CONT_ATTRIBUTE10')
14516           --
14517           ,P_MIRROR_CONT_ATTRIBUTE11  =>
14518              hr_transaction_api.get_VARCHAR2_value
14519                (p_transaction_step_id => p_transaction_step_id
14520                ,p_name                => 'P_MIRROR_CONT_ATTRIBUTE11')
14521           --
14522           ,P_MIRROR_CONT_ATTRIBUTE12  =>
14523              hr_transaction_api.get_VARCHAR2_value
14524                (p_transaction_step_id => p_transaction_step_id
14525                ,p_name                => 'P_MIRROR_CONT_ATTRIBUTE12')
14526           --
14527           ,P_MIRROR_CONT_ATTRIBUTE13  =>
14528              hr_transaction_api.get_VARCHAR2_value
14529                (p_transaction_step_id => p_transaction_step_id
14530                ,p_name                => 'P_MIRROR_CONT_ATTRIBUTE13')
14531           --
14532           ,P_MIRROR_CONT_ATTRIBUTE14  =>
14533              hr_transaction_api.get_VARCHAR2_value
14534                (p_transaction_step_id => p_transaction_step_id
14535                ,p_name                => 'P_MIRROR_CONT_ATTRIBUTE14')
14536           --
14537           ,P_MIRROR_CONT_ATTRIBUTE15  =>
14538              hr_transaction_api.get_VARCHAR2_value
14539                (p_transaction_step_id => p_transaction_step_id
14540                ,p_name                => 'P_MIRROR_CONT_ATTRIBUTE15')
14541           --
14542           ,P_MIRROR_CONT_ATTRIBUTE16  =>
14543              hr_transaction_api.get_VARCHAR2_value
14544                (p_transaction_step_id => p_transaction_step_id
14545                ,p_name                => 'P_MIRROR_CONT_ATTRIBUTE16')
14546           --
14547           ,P_MIRROR_CONT_ATTRIBUTE17  =>
14548              hr_transaction_api.get_VARCHAR2_value
14549                (p_transaction_step_id => p_transaction_step_id
14550                ,p_name                => 'P_MIRROR_CONT_ATTRIBUTE17')
14551           --
14552           ,P_MIRROR_CONT_ATTRIBUTE18  =>
14553              hr_transaction_api.get_VARCHAR2_value
14554                (p_transaction_step_id => p_transaction_step_id
14555                ,p_name                => 'P_MIRROR_CONT_ATTRIBUTE18')
14556           --
14557           ,P_MIRROR_CONT_ATTRIBUTE19  =>
14558              hr_transaction_api.get_VARCHAR2_value
14559                (p_transaction_step_id => p_transaction_step_id
14560                ,p_name                => 'P_MIRROR_CONT_ATTRIBUTE19')
14561           --
14562           ,P_MIRROR_CONT_ATTRIBUTE20  =>
14563              hr_transaction_api.get_VARCHAR2_value
14564                (p_transaction_step_id => p_transaction_step_id
14565                ,p_name                => 'P_MIRROR_CONT_ATTRIBUTE20')
14566           --
14567 
14568           ,P_CONTACT_RELATIONSHIP_ID  	=> L_CONTACT_RELATIONSHIP_ID1
14569           --
14570           ,P_CTR_OBJECT_VERSION_NUMBER 	=> L_CTR_OBJECT_VERSION_NUMBER1
14571           --
14572           ,P_PER_PERSON_ID  		=> L_PER_PERSON_ID1
14573           --
14574           ,P_PER_OBJECT_VERSION_NUMBER 	=> L_PER_OBJECT_VERSION_NUMBER1
14575           --
14576           ,P_PER_EFFECTIVE_START_DATE  	=> L_PER_EFFECTIVE_START_DATE1
14577           --
14578           ,P_PER_EFFECTIVE_END_DATE  	=> L_PER_EFFECTIVE_END_DATE1
14579           --
14580           ,P_FULL_NAME  		=> L_FULL_NAME1
14581           --
14582           ,P_PER_COMMENT_ID  		=> L_PER_COMMENT_ID1
14583           --
14584           ,P_NAME_COMBINATION_WARNING  	=> L_CON_NAME_COMBINATION_WARNIN1
14585           --
14586           ,P_ORIG_HIRE_WARNING  	=> L_CON_ORIG_HIRE_WARNING1
14587           --
14588           ,P_CONT_INFORMATION_CATEGORY  =>
14589          hr_transaction_api.get_VARCHAR2_value
14590            (p_transaction_step_id => p_transaction_step_id
14591            ,p_name                => 'P_CONT_INFORMATION_CATEGORY')
14592       --
14593       ,P_CONT_INFORMATION1  =>
14594          hr_transaction_api.get_VARCHAR2_value
14595            (p_transaction_step_id => p_transaction_step_id
14596            ,p_name                => 'P_CONT_INFORMATION1')
14597       --
14598       ,P_CONT_INFORMATION2  =>
14599          hr_transaction_api.get_VARCHAR2_value
14600            (p_transaction_step_id => p_transaction_step_id
14601            ,p_name                => 'P_CONT_INFORMATION2')
14602       --
14603       ,P_CONT_INFORMATION3  =>
14604          hr_transaction_api.get_VARCHAR2_value
14605            (p_transaction_step_id => p_transaction_step_id
14606            ,p_name                => 'P_CONT_INFORMATION3')
14607       --
14608       ,P_CONT_INFORMATION4  =>
14609          hr_transaction_api.get_VARCHAR2_value
14610            (p_transaction_step_id => p_transaction_step_id
14611            ,p_name                => 'P_CONT_INFORMATION4')
14612       --
14613       ,P_CONT_INFORMATION5  =>
14614          hr_transaction_api.get_VARCHAR2_value
14615            (p_transaction_step_id => p_transaction_step_id
14616            ,p_name                => 'P_CONT_INFORMATION5')
14617       --
14618       ,P_CONT_INFORMATION6  =>
14619          hr_transaction_api.get_VARCHAR2_value
14620            (p_transaction_step_id => p_transaction_step_id
14621            ,p_name                => 'P_CONT_INFORMATION6')
14622       --
14623       ,P_CONT_INFORMATION7  =>
14624          hr_transaction_api.get_VARCHAR2_value
14625            (p_transaction_step_id => p_transaction_step_id
14626            ,p_name                => 'P_CONT_INFORMATION7')
14627       --
14628       ,P_CONT_INFORMATION8  =>
14629          hr_transaction_api.get_VARCHAR2_value
14630            (p_transaction_step_id => p_transaction_step_id
14631            ,p_name                => 'P_CONT_INFORMATION8')
14632       --
14633       ,P_CONT_INFORMATION9  =>
14634          hr_transaction_api.get_VARCHAR2_value
14635            (p_transaction_step_id => p_transaction_step_id
14636            ,p_name                => 'P_CONT_INFORMATION9')
14637       --
14638       ,P_CONT_INFORMATION10  =>
14639          hr_transaction_api.get_VARCHAR2_value
14640            (p_transaction_step_id => p_transaction_step_id
14641            ,p_name                => 'P_CONT_INFORMATION10')
14642       --
14643       ,P_CONT_INFORMATION11  =>
14644          hr_transaction_api.get_VARCHAR2_value
14645            (p_transaction_step_id => p_transaction_step_id
14646            ,p_name                => 'P_CONT_INFORMATION11')
14647       --
14648       ,P_CONT_INFORMATION12  =>
14649          hr_transaction_api.get_VARCHAR2_value
14650            (p_transaction_step_id => p_transaction_step_id
14651            ,p_name                => 'P_CONT_INFORMATION12')
14652       --
14653       ,P_CONT_INFORMATION13  =>
14654          hr_transaction_api.get_VARCHAR2_value
14655            (p_transaction_step_id => p_transaction_step_id
14656            ,p_name                => 'P_CONT_INFORMATION13')
14657       --
14658       ,P_CONT_INFORMATION14  =>
14659          hr_transaction_api.get_VARCHAR2_value
14660            (p_transaction_step_id => p_transaction_step_id
14661            ,p_name                => 'P_CONT_INFORMATION14')
14662       --
14663       ,P_CONT_INFORMATION15  =>
14664          hr_transaction_api.get_VARCHAR2_value
14665            (p_transaction_step_id => p_transaction_step_id
14666            ,p_name                => 'P_CONT_INFORMATION15')
14667       --
14668       ,P_CONT_INFORMATION16  =>
14669          hr_transaction_api.get_VARCHAR2_value
14670            (p_transaction_step_id => p_transaction_step_id
14671            ,p_name                => 'P_CONT_INFORMATION16')
14672       --
14673       ,P_CONT_INFORMATION17  =>
14674          hr_transaction_api.get_VARCHAR2_value
14675            (p_transaction_step_id => p_transaction_step_id
14676            ,p_name                => 'P_CONT_INFORMATION17')
14677       --
14678       ,P_CONT_INFORMATION18  =>
14679          hr_transaction_api.get_VARCHAR2_value
14680            (p_transaction_step_id => p_transaction_step_id
14681            ,p_name                => 'P_CONT_INFORMATION18')
14682       --
14683       ,P_CONT_INFORMATION19  =>
14684          hr_transaction_api.get_VARCHAR2_value
14685            (p_transaction_step_id => p_transaction_step_id
14686            ,p_name                => 'P_CONT_INFORMATION19')
14687       --
14688       ,P_CONT_INFORMATION20  =>
14689          hr_transaction_api.get_VARCHAR2_value
14690            (p_transaction_step_id => p_transaction_step_id
14691            ,p_name                => 'P_CONT_INFORMATION20')
14692          );
14693          --
14694     end if;
14695     --
14696   END IF;
14697 
14698   --
14699   IF p_validate THEN
14700      hr_utility.set_location('Rollback hr_process_contact_ss.process_api', 100);
14701      ROLLBACK TO update_cont_relationship;
14702   END IF;
14703   --
14704   -- bug# 2080032
14705   end if; -- l_process_section = 'DELETE_CONTACTS'
14706 
14707   hr_utility.set_location('Leaving hr_process_contact_ss.process_api', 100);
14708   --
14709 EXCEPTION
14710   WHEN hr_utility.hr_error THEN
14711   hr_utility.set_location('Exception:  WHEN hr_utility.hr_error THEN'||l_proc,555);
14712     -- -----------------------------------------------------------------
14713     -- An application error has been raised by the API so we must set
14714     -- the error.
14715     -- -----------------------------------------------------------------
14716     ROLLBACK TO update_cont_relationship;
14717     RAISE;
14718     --
14719 END process_api;
14720 --
14721  --
14722 -- bug 5652542
14723 -- In same transaction if we update both the contact and his address details and also change the relationship start date to a lower value
14724 -- per_people12_pkg updates the contact's person and address data. This changes the ovn and hence error. Contact's person data was
14725 -- taken care by calling person api before contact api. But address issue is fixed with below code. This checks for the conditions when address
14726 -- could have been updated and sets the global variable. Address api checks for this variable and increases the ovn by 1 if it is true.
14727 
14728 procedure is_address_updated
14729   (P_CONTACT_RELATIONSHIP_ID in number
14730             ,P_DATE_START  in date
14731             ,p_transaction_step_id IN NUMBER
14732             ,p_contact_person_id in number
14733             ,p_person_id in number) is
14734   l_date_start   date := hr_api.g_date;
14735   l_pds_date_start date;
14736   l_cont_start_date date;
14737   l_proc   varchar2(72)  := g_package||'will_address_be_changed';
14738   l_cov_date_start date;
14739   l_dummy varchar2(10);
14740   cursor csr_address(c_person_id number, c_date_from date) is
14741     select 'Y'
14742     from per_addresses
14743     where person_id = c_person_id
14744     and date_from = c_date_from
14745     and primary_flag='Y';
14746 
14747   cursor csr_contact_api(c_transaction_step_id number) is
14748     select 'Y' from hr_api_transaction_steps where transaction_id =
14749     (select transaction_id from hr_api_transaction_steps where transaction_step_id =
14750     c_transaction_step_id) and api_name='HR_PROCESS_ADDRESS_SS.PROCESS_API';
14751 
14752 begin
14753   hr_utility.set_location('Entering:'||l_proc, 5);
14754   open csr_contact_api(p_transaction_step_id);
14755   fetch csr_contact_api into l_dummy;
14756   if csr_contact_api%found then
14757     if p_contact_relationship_id is not null then
14758       select date_start into l_date_start from per_contact_relationships where
14759       contact_relationship_id = p_contact_relationship_id;
14760     end if;
14761     if (p_date_start < l_date_start or l_date_start = hr_api.g_date) then
14762       select max(date_start) into l_pds_date_start from per_periods_of_service
14763       where person_id = p_person_id;
14764         if l_pds_date_start > p_date_start then
14765           l_cov_date_start := l_pds_date_start;
14766         else
14767           l_cov_date_start := p_date_start;
14768         end if;
14769         select min(effective_start_date) into l_cont_start_date from per_all_people_f
14770         where person_id=p_contact_person_id;
14771         if (l_cov_date_start < l_cont_start_date) then
14772           open csr_address(p_contact_person_id,l_cont_start_date);
14773           fetch csr_address into l_dummy;
14774           if csr_address%found then
14775             hr_process_contact_ss.g_is_address_updated := true;
14776           end if;
14777           close csr_address;
14778         end if;
14779     end if;
14780   end if;
14781   close csr_contact_api;
14782   hr_utility.set_location('Leaving:'||l_proc, 20);
14783 
14784 end is_address_updated;
14785 
14786   /*
14787   ||===========================================================================
14788   || PROCEDURE: end_contact_relationship
14789   ||---------------------------------------------------------------------------
14790   ||
14791   || Description:
14792   || Description:
14793   ||     This procedure will call the actual API -
14794   ||                hr_contact_rel_api.update_contact_relationship()
14795   ||
14796   || Pre Conditions:
14797   ||
14798   || In Arguments:
14799   ||     Contains entire list of parameters that are defined in the actual
14800   ||     API. For details see peaddapi.pkb file.
14801   ||
14802   || out nocopy Arguments:
14803   ||
14804   || In out nocopy Arguments:
14805   ||
14806   || Post Success:
14807   ||     Executes the API call.
14808   ||
14809   || Post Failure:
14810   ||     Raises an exception
14811   ||
14812   || Access Status:
14813   ||     Public.
14814   ||
14815   ||===========================================================================
14816   */
14817 
14818 PROCEDURE end_contact_relationship
14819   (p_validate                      in        number  default 0
14820   ,p_effective_date                in        date
14821   ,p_contact_relationship_id       in        number
14822   ,p_contact_type                  in        varchar2  default hr_api.g_varchar2
14823   ,p_comments                      in        long      default hr_api.g_varchar2
14824   ,p_primary_contact_flag          in        varchar2  default hr_api.g_varchar2
14825   ,p_third_party_pay_flag          in        varchar2  default hr_api.g_varchar2
14826   ,p_bondholder_flag               in        varchar2  default hr_api.g_varchar2
14827   ,p_date_start                    in        date      default hr_api.g_date
14828   ,p_start_life_reason_id          in        number    default hr_api.g_number
14829   ,p_date_end                      in        date      default hr_api.g_date
14830   ,p_end_life_reason_id            in        number    default hr_api.g_number
14831   ,p_rltd_per_rsds_w_dsgntr_flag   in        varchar2  default hr_api.g_varchar2
14832   ,p_personal_flag                 in        varchar2  default hr_api.g_varchar2
14833   ,p_sequence_number               in        number    default hr_api.g_number
14834   ,p_dependent_flag                in        varchar2  default hr_api.g_varchar2
14835   ,p_beneficiary_flag              in        varchar2  default hr_api.g_varchar2
14836   ,p_cont_attribute_category       in        varchar2  default hr_api.g_varchar2
14837   ,p_cont_attribute1               in        varchar2  default hr_api.g_varchar2
14838   ,p_cont_attribute2               in        varchar2  default hr_api.g_varchar2
14839   ,p_cont_attribute3               in        varchar2  default hr_api.g_varchar2
14840   ,p_cont_attribute4               in        varchar2  default hr_api.g_varchar2
14841   ,p_cont_attribute5               in        varchar2  default hr_api.g_varchar2
14842   ,p_cont_attribute6               in        varchar2  default hr_api.g_varchar2
14843   ,p_cont_attribute7               in        varchar2  default hr_api.g_varchar2
14844   ,p_cont_attribute8               in        varchar2  default hr_api.g_varchar2
14845   ,p_cont_attribute9               in        varchar2  default hr_api.g_varchar2
14846   ,p_cont_attribute10              in        varchar2  default hr_api.g_varchar2
14847   ,p_cont_attribute11              in        varchar2  default hr_api.g_varchar2
14848   ,p_cont_attribute12              in        varchar2  default hr_api.g_varchar2
14849   ,p_cont_attribute13              in        varchar2  default hr_api.g_varchar2
14850   ,p_cont_attribute14              in        varchar2  default hr_api.g_varchar2
14851   ,p_cont_attribute15              in        varchar2  default hr_api.g_varchar2
14852   ,p_cont_attribute16              in        varchar2  default hr_api.g_varchar2
14853   ,p_cont_attribute17              in        varchar2  default hr_api.g_varchar2
14854   ,p_cont_attribute18              in        varchar2  default hr_api.g_varchar2
14855   ,p_cont_attribute19              in        varchar2  default hr_api.g_varchar2
14856   ,p_cont_attribute20              in        varchar2  default hr_api.g_varchar2
14857   ,p_person_id                     in        number
14858   ,p_object_version_number         in out nocopy    number
14859   ,p_item_type                     in        varchar2
14860   ,p_item_key                      in        varchar2
14861   ,p_activity_id                   in        number
14862   ,p_action                        in        varchar2
14863   ,p_process_section_name          in        varchar2
14864   ,p_review_page_region_code       in        varchar2 default hr_api.g_varchar2
14865   ,p_save_mode                     in        varchar2  default null
14866  -- SFL needs it bug #2082333
14867   ,p_login_person_id               in        number
14868   ,p_contact_person_id             in        number
14869   -- Bug 2723267
14870   ,p_contact_operation             in        varchar2
14871   -- Bug 3152505
14872   ,p_end_other_rel                 in        varchar2
14873   ,p_other_rel_id                  in        number
14874  ) IS
14875   --
14876 
14877    cursor get_other_rel_ovn(p_contact_relationship_id  number)
14878    is
14879 	select object_version_number
14880 	from per_contact_relationships
14881 	where contact_relationship_id = p_contact_relationship_id
14882 	and trunc(sysdate) between nvl(date_start, trunc(sysdate))
14883 	and nvl(date_end, trunc(sysdate));
14884 
14885   l_transaction_table            hr_transaction_ss.transaction_table;
14886   l_transaction_step_id          hr_api_transaction_steps.transaction_step_id%type;
14887   l_trs_object_version_number    hr_api_transaction_steps.object_version_number%type;
14888   l_old_ovn                      number;
14889   l_old_contact_relationship_id  number;
14890   l_count                        INTEGER := 0;
14891   l_transaction_id             number default null;
14892   l_trans_obj_vers_num         number default null;
14893   l_result                     varchar2(100) default null;
14894   l_end_life_reason            varchar2(100) default null;
14895 
14896   l_other_rel_object_ver_no    number;
14897   l_proc   varchar2(72)  := g_package||'end_contact_relationship';
14898   --
14899  BEGIN
14900   --
14901 
14902 
14903   hr_utility.set_location('Entering:'||l_proc, 5);
14904   --
14905   l_old_ovn := p_object_version_number;
14906   l_old_contact_relationship_id := p_contact_relationship_id;
14907   if(p_contact_operation = 'EMRG_OVRW_DEL' and p_other_rel_id is not null and p_other_rel_id <> -1 ) then
14908      l_old_contact_relationship_id := p_other_rel_id;
14909   end if;
14910 
14911   --
14912   -- Call the actual API.
14913   --
14914   hr_utility.set_location('Calling hr_contact_rel_api.update_contact_relationship', 10);
14915   --
14916   if nvl(p_save_mode, 'NVL') <> 'SAVE_FOR_LATER' then
14917      --
14918      hr_contact_rel_api.update_contact_relationship(
14919         p_validate                          =>  hr_java_conv_util_ss.get_boolean (
14920                                                     p_number => p_validate)
14921        ,p_effective_date                    => p_effective_date
14922        ,p_contact_relationship_id           => p_contact_relationship_id
14923        ,p_contact_type                      => p_contact_type
14924        ,p_comments                          => p_comments
14925        ,p_primary_contact_flag              => p_primary_contact_flag
14926        ,p_third_party_pay_flag              => p_third_party_pay_flag
14927        ,p_bondholder_flag                   => p_bondholder_flag
14928        ,p_date_start                        => p_date_start
14929        ,p_start_life_reason_id              => p_start_life_reason_id
14930        ,p_date_end                          => p_date_end
14931        ,p_end_life_reason_id                => p_end_life_reason_id
14932        ,p_rltd_per_rsds_w_dsgntr_flag       => p_rltd_per_rsds_w_dsgntr_flag
14933        ,p_personal_flag                     => p_personal_flag
14934        ,p_sequence_number                   => p_sequence_number
14935        ,p_dependent_flag                    => p_dependent_flag
14936        ,p_beneficiary_flag                  => p_beneficiary_flag
14937        ,p_cont_attribute_category           => p_cont_attribute_category
14938        ,p_cont_attribute1                   => p_cont_attribute1
14939        ,p_cont_attribute2                   => p_cont_attribute2
14940        ,p_cont_attribute3                   => p_cont_attribute3
14941        ,p_cont_attribute4                   => p_cont_attribute4
14942        ,p_cont_attribute5                   => p_cont_attribute5
14943        ,p_cont_attribute6                   => p_cont_attribute6
14944        ,p_cont_attribute7                   => p_cont_attribute7
14945        ,p_cont_attribute8                   => p_cont_attribute8
14946        ,p_cont_attribute9                   => p_cont_attribute9
14947        ,p_cont_attribute10                  => p_cont_attribute10
14948        ,p_cont_attribute11                  => p_cont_attribute11
14949        ,p_cont_attribute12                  => p_cont_attribute12
14950        ,p_cont_attribute13                  => p_cont_attribute13
14951        ,p_cont_attribute14                  => p_cont_attribute14
14952        ,p_cont_attribute15                  => p_cont_attribute15
14953        ,p_cont_attribute16                  => p_cont_attribute16
14954        ,p_cont_attribute17                  => p_cont_attribute17
14955        ,p_cont_attribute18                  => p_cont_attribute18
14956        ,p_cont_attribute19                  => p_cont_attribute19
14957        ,p_cont_attribute20                  => p_cont_attribute20
14958        ,p_object_version_number             => p_object_version_number
14959      );
14960 
14961      if p_end_other_rel = 'Y' then
14962       hr_utility.set_location('Fecthing l_other_rel_object_ver_no:'||l_proc, 15);
14963       open get_other_rel_ovn(p_other_rel_id);
14964       fetch get_other_rel_ovn into l_other_rel_object_ver_no;
14965       if get_other_rel_ovn%notfound then
14966          l_other_rel_object_ver_no := 1;
14967       end if;
14968       close get_other_rel_ovn;
14969 
14970       hr_contact_rel_api.update_contact_relationship(
14971         p_validate                          =>  hr_java_conv_util_ss.get_boolean (
14972                                                     p_number => p_validate)
14973        ,p_effective_date                    => p_effective_date
14974 -- Bug 3152505 : Passing the other contact relationship id
14975        ,p_contact_relationship_id           => p_other_rel_id
14976        ,p_contact_type                      => p_contact_type
14977        ,p_comments                          => p_comments
14978        ,p_primary_contact_flag              => p_primary_contact_flag
14979        ,p_third_party_pay_flag              => p_third_party_pay_flag
14980        ,p_bondholder_flag                   => p_bondholder_flag
14981        ,p_date_start                        => p_date_start
14982        ,p_start_life_reason_id              => p_start_life_reason_id
14983        ,p_date_end                          => p_date_end
14984        ,p_end_life_reason_id                => p_end_life_reason_id
14985        ,p_rltd_per_rsds_w_dsgntr_flag       => p_rltd_per_rsds_w_dsgntr_flag
14986        ,p_personal_flag                     => p_personal_flag
14987        ,p_sequence_number                   => p_sequence_number
14988        ,p_dependent_flag                    => p_dependent_flag
14989        ,p_beneficiary_flag                  => p_beneficiary_flag
14990        ,p_cont_attribute_category           => p_cont_attribute_category
14991        ,p_cont_attribute1                   => p_cont_attribute1
14992        ,p_cont_attribute2                   => p_cont_attribute2
14993        ,p_cont_attribute3                   => p_cont_attribute3
14994        ,p_cont_attribute4                   => p_cont_attribute4
14995        ,p_cont_attribute5                   => p_cont_attribute5
14996        ,p_cont_attribute6                   => p_cont_attribute6
14997        ,p_cont_attribute7                   => p_cont_attribute7
14998        ,p_cont_attribute8                   => p_cont_attribute8
14999        ,p_cont_attribute9                   => p_cont_attribute9
15000        ,p_cont_attribute10                  => p_cont_attribute10
15001        ,p_cont_attribute11                  => p_cont_attribute11
15002        ,p_cont_attribute12                  => p_cont_attribute12
15003        ,p_cont_attribute13                  => p_cont_attribute13
15004        ,p_cont_attribute14                  => p_cont_attribute14
15005        ,p_cont_attribute15                  => p_cont_attribute15
15006        ,p_cont_attribute16                  => p_cont_attribute16
15007        ,p_cont_attribute17                  => p_cont_attribute17
15008        ,p_cont_attribute18                  => p_cont_attribute18
15009        ,p_cont_attribute19                  => p_cont_attribute19
15010        ,p_cont_attribute20                  => p_cont_attribute20
15011        ,p_object_version_number             => l_other_rel_object_ver_no
15012      );
15013     end if;
15014      --
15015   end if;
15016   --
15017   -- --------------------------------------------------------------------------
15018   -- We will write the data to transaction tables.
15019   -- Determine if a transaction step exists for this activity
15020   -- if a transaction step does exist then the transaction_step_id and
15021   -- object_version_number are set (i.e. not null).
15022   -- --------------------------------------------------------------------------
15023   hr_utility.set_location('Call :get_transaction_step_info'||l_proc, 20);
15024   hr_transaction_api.get_transaction_step_info
15025                 (p_item_type             => p_item_type
15026                 ,p_item_key              => p_item_key
15027                 ,p_activity_id           => p_activity_id
15028                 ,p_transaction_step_id   => l_transaction_step_id
15029                 ,p_object_version_number => l_trs_object_version_number);
15030   --
15031   hr_utility.set_location('l_transaction_step_id = ' || to_char(l_transaction_step_id), 25);
15032   --
15033   l_count := l_count + 1;
15034   l_transaction_table(l_count).param_name := 'P_EFFECTIVE_DATE';
15035   l_transaction_table(l_count).param_value := to_char(P_EFFECTIVE_DATE,
15036                                               hr_transaction_ss.g_date_format);
15037   l_transaction_table(l_count).param_data_type := 'DATE';
15038   --
15039   l_count:=l_count+1;
15040   l_transaction_table(l_count).param_name      := 'P_SAVE_MODE';
15041   l_transaction_table(l_count).param_value     :=  p_save_mode;
15042   l_transaction_table(l_count).param_data_type := 'VARCHAR2';
15043   -- SFL changes bug #2082333
15044   --
15045   l_count := l_count + 1;
15046   l_transaction_table(l_count).param_name := 'P_PERSON_ID';
15047   l_transaction_table(l_count).param_value := p_person_id;
15048   l_transaction_table(l_count).param_data_type := 'NUMBER';
15049   --
15050   l_count := l_count + 1;
15051   l_transaction_table(l_count).param_name := 'P_LOGIN_PERSON_ID';
15052   l_transaction_table(l_count).param_value := p_login_person_id;
15053   l_transaction_table(l_count).param_data_type := 'NUMBER';
15054   --
15055   l_count := l_count + 1;
15056   l_transaction_table(l_count).param_name := 'P_CONTACT_PERSON_ID';
15057   l_transaction_table(l_count).param_value := p_contact_person_id;
15058   l_transaction_table(l_count).param_data_type := 'NUMBER';
15059   --
15060   l_count := l_count + 1;
15061   l_transaction_table(l_count).param_name :='P_ITEM_TYPE';
15062   l_transaction_table(l_count).param_value := p_item_type;
15063   l_transaction_table(l_count).param_data_type := upper('varchar2');
15064   --
15065   --
15066   l_count := l_count + 1;
15067   l_transaction_table(l_count).param_name :='P_ITEM_KEY';
15068   l_transaction_table(l_count).param_value := p_item_key;
15069   l_transaction_table(l_count).param_data_type := upper('varchar2');
15070 -- End SFL changes bug #2082333
15071   --
15072   l_count := l_count + 1;
15073   l_transaction_table(l_count).param_name := 'P_OLD_OBJECT_VERSION_NUMBER';
15074   l_transaction_table(l_count).param_value := l_old_ovn;
15075   l_transaction_table(l_count).param_data_type := 'NUMBER';
15076   --
15077   l_count := l_count + 1;
15078   l_transaction_table(l_count).param_name := 'P_CONTACT_RELATIONSHIP_ID';
15079   l_transaction_table(l_count).param_value := P_CONTACT_RELATIONSHIP_ID;
15080   l_transaction_table(l_count).param_data_type := 'NUMBER';
15081   --
15082   -- 9999 What does this do
15083   --
15084   l_count := l_count + 1;
15085   l_transaction_table(l_count).param_name := 'P_OLD_CONTACT_RELATIONSHIP_ID';
15086   l_transaction_table(l_count).param_value := l_OLD_CONTACT_RELATIONSHIP_ID;
15087   l_transaction_table(l_count).param_data_type := 'NUMBER';
15088   --
15089   l_count := l_count + 1;
15090   l_transaction_table(l_count).param_name := 'P_CONTACT_TYPE';
15091   l_transaction_table(l_count).param_value := P_CONTACT_TYPE;
15092   l_transaction_table(l_count).param_data_type := 'VARCHAR2';
15093   --
15094   l_count := l_count + 1;
15095   l_transaction_table(l_count).param_name := 'P_COMMENTS';
15096   l_transaction_table(l_count).param_value := P_COMMENTS;
15097   l_transaction_table(l_count).param_data_type := 'VARCHAR2';
15098   --
15099   l_count := l_count + 1;
15100   l_transaction_table(l_count).param_name := 'P_PRIMARY_CONTACT_FLAG';
15101   l_transaction_table(l_count).param_value := P_PRIMARY_CONTACT_FLAG;
15102   l_transaction_table(l_count).param_data_type := 'VARCHAR2';
15103   --
15104   l_count := l_count + 1;
15105   l_transaction_table(l_count).param_name := 'P_THIRD_PARTY_PAY_FLAG';
15106   l_transaction_table(l_count).param_value := P_THIRD_PARTY_PAY_FLAG;
15107   l_transaction_table(l_count).param_data_type := 'VARCHAR2';
15108   --
15109   l_count := l_count + 1;
15110   l_transaction_table(l_count).param_name := 'P_BONDHOLDER_FLAG';
15111   l_transaction_table(l_count).param_value := P_BONDHOLDER_FLAG;
15112   l_transaction_table(l_count).param_data_type := 'VARCHAR2';
15113   --
15114   l_count := l_count + 1;
15115   l_transaction_table(l_count).param_name := 'P_DATE_START';
15116   l_transaction_table(l_count).param_value := to_char(P_DATE_START,
15117                                               hr_transaction_ss.g_date_format);
15118   l_transaction_table(l_count).param_data_type := 'DATE';
15119   --
15120   l_count := l_count + 1;
15121   l_transaction_table(l_count).param_name := 'P_START_LIFE_REASON_ID';
15122   l_transaction_table(l_count).param_value := P_START_LIFE_REASON_ID;
15123   l_transaction_table(l_count).param_data_type := 'NUMBER';
15124   --
15125   hr_utility.set_location('P_DATE_END = ' || to_char(P_DATE_END), 30);
15126   l_count := l_count + 1;
15127   l_transaction_table(l_count).param_name := 'P_DATE_END';
15128   l_transaction_table(l_count).param_value := to_char(P_DATE_END,
15129                                               hr_transaction_ss.g_date_format);
15130   l_transaction_table(l_count).param_data_type := 'DATE';
15131   --
15132   l_count := l_count + 1;
15133   l_transaction_table(l_count).param_name := 'P_END_LIFE_REASON_ID';
15134   l_transaction_table(l_count).param_value := P_END_LIFE_REASON_ID;
15135   l_transaction_table(l_count).param_data_type := 'NUMBER';
15136  --
15137  -- bug # 2080032
15138   if P_END_LIFE_REASON_ID IS NOT NULL THEN
15139 
15140     select   max(BLF.NAME) End_Relation_Reason
15141     into l_end_life_reason
15142     from BEN_LER_F BLF
15143     where BLF.LER_ID = P_END_LIFE_REASON_ID;
15144 
15145    end if;
15146 
15147   l_count := l_count + 1;
15148   l_transaction_table(l_count).param_name := 'P_END_LIFE_REASON';
15149   l_transaction_table(l_count).param_value := l_end_life_reason;
15150   l_transaction_table(l_count).param_data_type := 'VARCHAR2';
15151   --
15152   l_count := l_count + 1;
15153   l_transaction_table(l_count).param_name := 'P_RLTD_PER_RSDS_W_DSGNTR_FLAG';
15154   l_transaction_table(l_count).param_value := P_RLTD_PER_RSDS_W_DSGNTR_FLAG;
15155   l_transaction_table(l_count).param_data_type := 'VARCHAR2';
15156   --
15157   l_count := l_count + 1;
15158   l_transaction_table(l_count).param_name := 'P_PERSONAL_FLAG';
15159   l_transaction_table(l_count).param_value := P_PERSONAL_FLAG;
15160   l_transaction_table(l_count).param_data_type := 'VARCHAR2';
15161   --
15162   l_count := l_count + 1;
15163   l_transaction_table(l_count).param_name := 'P_SEQUENCE_NUMBER';
15164   l_transaction_table(l_count).param_value := P_SEQUENCE_NUMBER;
15165   l_transaction_table(l_count).param_data_type := 'NUMBER';
15166   --
15167   l_count := l_count + 1;
15168   l_transaction_table(l_count).param_name := 'P_DEPENDENT_FLAG';
15169   l_transaction_table(l_count).param_value := P_DEPENDENT_FLAG;
15170   l_transaction_table(l_count).param_data_type := 'VARCHAR2';
15171   --
15172   l_count := l_count + 1;
15173   l_transaction_table(l_count).param_name := 'P_BENEFICIARY_FLAG';
15174   l_transaction_table(l_count).param_value := P_BENEFICIARY_FLAG;
15175   l_transaction_table(l_count).param_data_type := 'VARCHAR2';
15176   --
15177   l_count := l_count + 1;
15178   l_transaction_table(l_count).param_name := 'P_CONT_ATTRIBUTE_CATEGORY';
15179   l_transaction_table(l_count).param_value := P_CONT_ATTRIBUTE_CATEGORY;
15180   l_transaction_table(l_count).param_data_type := 'VARCHAR2';
15181   --
15182   l_count := l_count + 1;
15183   l_transaction_table(l_count).param_name := 'P_CONT_ATTRIBUTE1';
15184   l_transaction_table(l_count).param_value := P_CONT_ATTRIBUTE1;
15185   l_transaction_table(l_count).param_data_type := 'VARCHAR2';
15186   --
15187   l_count := l_count + 1;
15188   l_transaction_table(l_count).param_name := 'P_CONT_ATTRIBUTE2';
15189   l_transaction_table(l_count).param_value := P_CONT_ATTRIBUTE2;
15190   l_transaction_table(l_count).param_data_type := 'VARCHAR2';
15191   --
15192   l_count := l_count + 1;
15193   l_transaction_table(l_count).param_name := 'P_CONT_ATTRIBUTE3';
15194   l_transaction_table(l_count).param_value := P_CONT_ATTRIBUTE3;
15195   l_transaction_table(l_count).param_data_type := 'VARCHAR2';
15196   --
15197   l_count := l_count + 1;
15198   l_transaction_table(l_count).param_name := 'P_CONT_ATTRIBUTE4';
15199   l_transaction_table(l_count).param_value := P_CONT_ATTRIBUTE4;
15200   l_transaction_table(l_count).param_data_type := 'VARCHAR2';
15201   --
15202   l_count := l_count + 1;
15203   l_transaction_table(l_count).param_name := 'P_CONT_ATTRIBUTE5';
15204   l_transaction_table(l_count).param_value := P_CONT_ATTRIBUTE5;
15205   l_transaction_table(l_count).param_data_type := 'VARCHAR2';
15206   --
15207   l_count := l_count + 1;
15208   l_transaction_table(l_count).param_name := 'P_CONT_ATTRIBUTE6';
15209   l_transaction_table(l_count).param_value := P_CONT_ATTRIBUTE6;
15210   l_transaction_table(l_count).param_data_type := 'VARCHAR2';
15211   --
15212   l_count := l_count + 1;
15213   l_transaction_table(l_count).param_name := 'P_CONT_ATTRIBUTE7';
15214   l_transaction_table(l_count).param_value := P_CONT_ATTRIBUTE7;
15215   l_transaction_table(l_count).param_data_type := 'VARCHAR2';
15216   --
15217   l_count := l_count + 1;
15218   l_transaction_table(l_count).param_name := 'P_CONT_ATTRIBUTE8';
15219   l_transaction_table(l_count).param_value := P_CONT_ATTRIBUTE8;
15220   l_transaction_table(l_count).param_data_type := 'VARCHAR2';
15221   --
15222   l_count := l_count + 1;
15223   l_transaction_table(l_count).param_name := 'P_CONT_ATTRIBUTE9';
15224   l_transaction_table(l_count).param_value := P_CONT_ATTRIBUTE9;
15225   l_transaction_table(l_count).param_data_type := 'VARCHAR2';
15226   --
15227   l_count := l_count + 1;
15228   l_transaction_table(l_count).param_name := 'P_CONT_ATTRIBUTE10';
15229   l_transaction_table(l_count).param_value := P_CONT_ATTRIBUTE10;
15230   l_transaction_table(l_count).param_data_type := 'VARCHAR2';
15231   --
15232   l_count := l_count + 1;
15233   l_transaction_table(l_count).param_name := 'P_CONT_ATTRIBUTE11';
15234   l_transaction_table(l_count).param_value := P_CONT_ATTRIBUTE11;
15235   l_transaction_table(l_count).param_data_type := 'VARCHAR2';
15236   --
15237   l_count := l_count + 1;
15238   l_transaction_table(l_count).param_name := 'P_CONT_ATTRIBUTE12';
15239   l_transaction_table(l_count).param_value := P_CONT_ATTRIBUTE12;
15240   l_transaction_table(l_count).param_data_type := 'VARCHAR2';
15241   --
15242   l_count := l_count + 1;
15243   l_transaction_table(l_count).param_name := 'P_CONT_ATTRIBUTE13';
15244   l_transaction_table(l_count).param_value := P_CONT_ATTRIBUTE13;
15245   l_transaction_table(l_count).param_data_type := 'VARCHAR2';
15246   --
15247   l_count := l_count + 1;
15248   l_transaction_table(l_count).param_name := 'P_CONT_ATTRIBUTE14';
15249   l_transaction_table(l_count).param_value := P_CONT_ATTRIBUTE14;
15250   l_transaction_table(l_count).param_data_type := 'VARCHAR2';
15251   --
15252   l_count := l_count + 1;
15253   l_transaction_table(l_count).param_name := 'P_CONT_ATTRIBUTE15';
15254   l_transaction_table(l_count).param_value := P_CONT_ATTRIBUTE15;
15255   l_transaction_table(l_count).param_data_type := 'VARCHAR2';
15256   --
15257   l_count := l_count + 1;
15258   l_transaction_table(l_count).param_name := 'P_CONT_ATTRIBUTE16';
15259   l_transaction_table(l_count).param_value := P_CONT_ATTRIBUTE16;
15260   l_transaction_table(l_count).param_data_type := 'VARCHAR2';
15261   --
15262   l_count := l_count + 1;
15263   l_transaction_table(l_count).param_name := 'P_CONT_ATTRIBUTE17';
15264   l_transaction_table(l_count).param_value := P_CONT_ATTRIBUTE17;
15265   l_transaction_table(l_count).param_data_type := 'VARCHAR2';
15266   --
15267   l_count := l_count + 1;
15268   l_transaction_table(l_count).param_name := 'P_CONT_ATTRIBUTE18';
15269   l_transaction_table(l_count).param_value := P_CONT_ATTRIBUTE18;
15270   l_transaction_table(l_count).param_data_type := 'VARCHAR2';
15271   --
15272 
15273   l_transaction_table(l_count).param_name := 'P_CONT_ATTRIBUTE19';
15274   l_transaction_table(l_count).param_value := P_CONT_ATTRIBUTE19;
15275   l_transaction_table(l_count).param_data_type := 'VARCHAR2';
15276   --
15277   l_count := l_count + 1;
15278   l_transaction_table(l_count).param_name := 'P_CONT_ATTRIBUTE20';
15279   l_transaction_table(l_count).param_value := P_CONT_ATTRIBUTE20;
15280   l_transaction_table(l_count).param_data_type := 'VARCHAR2';
15281   --
15282   l_count := l_count + 1;
15283   l_transaction_table(l_count).param_name := 'P_OBJECT_VERSION_NUMBER';
15284   l_transaction_table(l_count).param_value := P_OBJECT_VERSION_NUMBER;
15285   l_transaction_table(l_count).param_data_type := 'NUMBER';
15286   --
15287   l_count := l_count + 1;
15288   l_transaction_table(l_count).param_name := 'P_REVIEW_PROC_CALL';
15289   l_transaction_table(l_count).param_value := p_review_page_region_code;
15290   l_transaction_table(l_count).param_data_type := 'VARCHAR2';
15291   --
15292   l_count := l_count + 1;
15293   l_transaction_table(l_count).param_name := 'P_REVIEW_ACTID';
15294   l_transaction_table(l_count).param_value := p_activity_id;
15295   l_transaction_table(l_count).param_data_type := 'VARCHAR2';
15296   --
15297   l_count := l_count + 1;
15298   l_transaction_table(l_count).param_name := 'P_PROCESS_SECTION_NAME';
15299   l_transaction_table(l_count).param_value := p_process_section_name;
15300   l_transaction_table(l_count).param_data_type := 'VARCHAR2';
15301   --
15302 
15303  -- Bug 2723267 Fix Start
15304     l_count := l_count + 1;
15305     l_transaction_table(l_count).param_name := 'P_CONTACT_OPERATION';
15306     l_transaction_table(l_count).param_value := p_contact_operation;
15307     l_transaction_table(l_count).param_data_type := 'VARCHAR2';
15308  -- Bug 2723267 Fix End
15309 
15310 -- Bug 3152505 : adding 3 new params.
15311 
15312   l_count := l_count + 1;
15313   l_transaction_table(l_count).param_name := 'P_OTHER_REL_ID';
15314   l_transaction_table(l_count).param_value := p_other_rel_id;
15315   l_transaction_table(l_count).param_data_type := 'NUMBER';
15316 
15317   l_count := l_count + 1;
15318   l_transaction_table(l_count).param_name := 'P_END_OTHER_REL';
15319   l_transaction_table(l_count).param_value := p_end_other_rel;
15320   l_transaction_table(l_count).param_data_type := 'VARCHAR2';
15321 
15322   l_count := l_count + 1;
15323   l_transaction_table(l_count).param_name := 'P_OTHER_REL_OBJ_VER_NO';
15324   l_transaction_table(l_count).param_value := l_other_rel_object_ver_no;
15325   l_transaction_table(l_count).param_data_type := 'NUMBER';
15326 
15327   hr_utility.set_location('Before Calling :hr_transaction_ss.save_transaction_step', 30);
15328   hr_utility.set_location('Before Calling :hr_transaction_ss.save_transaction_step ' || to_char(l_transaction_table.count), 35);
15329   --
15330   hr_transaction_ss.save_transaction_step
15331                 (p_item_type => p_item_type
15332                 ,p_item_key => p_item_key
15333                 ,p_login_person_id => nvl(p_login_person_id,p_person_id)
15334                 ,p_actid => p_activity_id
15335                 ,p_transaction_step_id => l_transaction_step_id
15336                 ,p_api_addtnl_info => p_contact_operation
15337                 -- ,p_api_name => g_package || '.PROCESS_END_API'
15338                 -- Change for contacts approvals.
15339                 ,p_api_name => g_package || '.PROCESS_API'
15340                 ,p_transaction_data => l_transaction_table);
15341   --
15342   hr_utility.set_location('Leaving hr_contact_rel_api.update_contact_relationship', 40);
15343   --
15344   EXCEPTION
15345     WHEN hr_utility.hr_error THEN
15346     hr_utility.set_location('Exception:hr_utility.hr_error THEN'||l_proc,555);
15347          -- -------------------------------------------
15348          -- an application error has been raised so we must
15349          -- redisplay the web form to display the error
15350          -- --------------------------------------------
15351          hr_message.provide_error;
15352          l_message_number := hr_message.Last_message_number;
15353          --
15354          -- 99999 What error messages I have to trap here.
15355          --
15356          IF l_message_number = 'APP-7165' OR
15357             l_message_number = 'APP-7155' THEN
15358             hr_utility.set_message(800, 'HR_UPDATE_NOT_ALLOWED');
15359             hr_utility.raise_error;
15360          ELSE
15361             hr_utility.raise_error;
15362          END IF;
15363     WHEN OTHERS THEN
15364         hr_utility.set_location('Exception:Others'||l_proc,555);
15365       fnd_message.set_name('PER', SQLERRM ||' '||to_char(SQLCODE));
15366       hr_utility.raise_error;
15367 --      RAISE;  -- Raise error here relevant to the new tech stack.
15368   --
15369  end end_contact_relationship;
15370  --
15371  --
15372  -- ---------------------------------------------------------------------------
15373  -- ----------------------------- < process_end_api > -----------------------------
15374  -- ---------------------------------------------------------------------------
15375  -- Purpose: This procedure will be invoked in workflow notification
15376  --          when an approver approves all the changes.  This procedure
15377  --          will call the api to update to the database with p_validate
15378  --          equal to false.
15379  -- ---------------------------------------------------------------------------
15380  PROCEDURE process_end_api
15381           (p_validate IN BOOLEAN DEFAULT FALSE
15382           ,p_transaction_step_id IN NUMBER
15383           ,p_effective_date      in varchar2 default null
15384 )
15385  IS
15386   --
15387   l_effective_start_date             date default null;
15388   l_effective_end_date               date default null;
15389   l_ovn                              number default null;
15390   l_contact_relationship_id          number default null;
15391   l_effective_date                   date;
15392 
15393   l_del_other_rel                    varchar2(5);
15394   --
15395   l_other_rel_ovn                    number default null;
15396   l_proc   varchar2(72)  := g_package||'process_end_api';
15397 
15398  BEGIN
15399   --
15400   hr_utility.set_location('Entering:'||l_proc, 5);
15401 
15402   SAVEPOINT end_cont_relationship;
15403   --
15404   -- SFL changes
15405   --
15406   if (p_effective_date is not null) then
15407   hr_utility.set_location('Eff date is not Null:'||l_proc, 10);
15408     l_effective_date := to_date(p_effective_date,g_date_format);
15409   else
15410        --
15411          hr_utility.set_location('Eff date is  Null:'||l_proc, 15);
15412        l_effective_date:= to_date(
15413          hr_transaction_ss.get_wf_effective_date
15414         (p_transaction_step_id => p_transaction_step_id),g_date_format);
15415        --
15416   end if;
15417   -- For normal commit the effective date should come from txn tbales.
15418   --
15419   if not p_validate then
15420      --
15421        hr_utility.set_location(' not p_validate:'||l_proc, 20);
15422      l_effective_date := hr_transaction_api.get_DATE_value
15423            (p_transaction_step_id => p_transaction_step_id
15424            ,p_name                => 'P_EFFECTIVE_DATE');
15425      --
15426   end if;
15427   --
15428   -- Get the contact_relationship_id  first.  If it is null, that means
15429   -- this is error and raise the error. -- add the error name 99999.
15430   --
15431   l_contact_relationship_id := hr_transaction_api.get_number_value
15432                                 (p_transaction_step_id => p_transaction_step_id
15433                                 ,p_name => 'P_CONTACT_RELATIONSHIP_ID');
15434   --
15435   l_ovn := hr_transaction_api.get_number_value
15436              (p_transaction_step_id => p_transaction_step_id
15437              ,p_name => 'P_OBJECT_VERSION_NUMBER');
15438   --
15439   l_other_rel_ovn := hr_transaction_api.get_NUMBER_value
15440            (p_transaction_step_id => p_transaction_step_id
15441            ,p_name                => 'P_OTHER_REL_OBJ_VER_NO') ;
15442   --
15443   IF l_contact_relationship_id IS NOT NULL
15444   THEN
15445     hr_utility.set_location('l_contact_relationship_id is not NULL:'||l_proc, 25);
15446     --
15447     hr_contact_rel_api.update_contact_relationship(
15448       p_validate                => p_validate
15449       --
15450       ,P_EFFECTIVE_DATE         =>l_effective_date
15451          /*
15452          hr_transaction_api.get_DATE_value
15453            (p_transaction_step_id => p_transaction_step_id
15454            ,p_name                => 'P_EFFECTIVE_DATE')
15455          */
15456       --
15457       ,p_object_version_number   => l_ovn
15458       --
15459       -- 9999 What value to pass on.
15460       /* ,p_attribute_update_mode   => hr_transaction_api.get_varchar2_value
15461                                 (p_transaction_step_id => p_transaction_step_id
15462                                 ,p_name => 'P_ATTRIBUTE_UPDATE_MODE')
15463       */
15464       --
15465       ,P_CONTACT_RELATIONSHIP_ID  =>
15466          hr_transaction_api.get_NUMBER_value
15467            (p_transaction_step_id => p_transaction_step_id
15468            ,p_name                => 'P_CONTACT_RELATIONSHIP_ID')
15469       --
15470      /*
15471       ,P_CONTACT_TYPE  =>
15472          hr_transaction_api.get_VARCHAR2_value
15473            (p_transaction_step_id => p_transaction_step_id
15474            ,p_name                => 'P_CONTACT_TYPE')
15475       --
15476       ,P_COMMENTS  =>
15477          hr_transaction_api.get_varchar2_value
15478            (p_transaction_step_id => p_transaction_step_id
15479            ,p_name                => 'P_COMMENTS')
15480       --
15481       ,P_PRIMARY_CONTACT_FLAG  =>
15482          hr_transaction_api.get_VARCHAR2_value
15483            (p_transaction_step_id => p_transaction_step_id
15484            ,p_name                => 'P_PRIMARY_CONTACT_FLAG')
15485       --
15486       ,P_THIRD_PARTY_PAY_FLAG  =>
15487          hr_transaction_api.get_VARCHAR2_value
15488            (p_transaction_step_id => p_transaction_step_id
15489            ,p_name                => 'P_THIRD_PARTY_PAY_FLAG')
15490       --
15491       ,p_bondholder_flag  =>
15492          hr_transaction_api.get_varchar2_value
15493            (p_transaction_step_id => p_transaction_step_id
15494            ,p_name                => 'p_bondholder_flag')
15495       --
15496       ,p_date_start  =>
15497          hr_transaction_api.get_date_value
15498            (p_transaction_step_id => p_transaction_step_id
15499            ,p_name                => 'p_date_start')
15500       --
15501       ,p_start_life_reason_id  =>
15502          hr_transaction_api.get_number_value
15503            (p_transaction_step_id => p_transaction_step_id
15504            ,p_name                => 'p_start_life_reason_id')
15505       --
15506       */
15507       ,p_date_end  =>
15508          hr_transaction_api.get_date_value
15509            (p_transaction_step_id => p_transaction_step_id
15510            ,p_name                => 'p_date_end')
15511       --
15512       --bug# 2080032
15513       ,p_end_life_reason_id  =>
15514          hr_transaction_api.get_number_value
15515            (p_transaction_step_id => p_transaction_step_id
15516            ,p_name                => 'p_end_life_reason_id')
15517       --
15518    /*
15519      ,p_rltd_per_rsds_w_dsgntr_flag  =>
15520          hr_transaction_api.get_varchar2_value
15521            (p_transaction_step_id => p_transaction_step_id
15522            ,p_name                => 'p_rltd_per_rsds_w_dsgntr_flag')
15523       --
15524       ,p_personal_flag  =>
15525          hr_transaction_api.get_varchar2_value
15526            (p_transaction_step_id => p_transaction_step_id
15527            ,p_name                => 'p_personal_flag')
15528       --
15529       ,p_sequence_number  =>
15530          hr_transaction_api.get_number_value
15531            (p_transaction_step_id => p_transaction_step_id
15532            ,p_name                => 'p_sequence_number')
15533       --
15534       ,p_dependent_flag  =>
15535          hr_transaction_api.get_varchar2_value
15536            (p_transaction_step_id => p_transaction_step_id
15537            ,p_name                => 'p_dependent_flag')
15538       --
15539       ,p_beneficiary_flag  =>
15540          hr_transaction_api.get_varchar2_value
15541            (p_transaction_step_id => p_transaction_step_id
15542            ,p_name                => 'p_beneficiary_flag')
15543       --
15544       ,p_cont_attribute_category  =>
15545          hr_transaction_api.get_varchar2_value
15546            (p_transaction_step_id => p_transaction_step_id
15547            ,p_name                => 'p_cont_attribute_category')
15548       --
15549       ,p_cont_attribute1  =>
15550          hr_transaction_api.get_varchar2_value
15551            (p_transaction_step_id => p_transaction_step_id
15552            ,p_name                => 'p_cont_attribute1')
15553       --
15554       ,p_cont_attribute2  =>
15555          hr_transaction_api.get_varchar2_value
15556            (p_transaction_step_id => p_transaction_step_id
15557            ,p_name                => 'p_cont_attribute2')
15558       --
15559       ,p_cont_attribute3  =>
15560          hr_transaction_api.get_varchar2_value
15561            (p_transaction_step_id => p_transaction_step_id
15562            ,p_name                => 'p_cont_attribute3')
15563       --
15564       ,p_cont_attribute4  =>
15565          hr_transaction_api.get_varchar2_value
15566            (p_transaction_step_id => p_transaction_step_id
15567            ,p_name                => 'p_cont_attribute4')
15568       --
15569       ,p_cont_attribute5  =>
15570          hr_transaction_api.get_varchar2_value
15571            (p_transaction_step_id => p_transaction_step_id
15572            ,p_name                => 'p_cont_attribute5')
15573       --
15574       ,p_cont_attribute6  =>
15575          hr_transaction_api.get_varchar2_value
15576            (p_transaction_step_id => p_transaction_step_id
15577            ,p_name                => 'p_cont_attribute6')
15578       --
15579       ,p_cont_attribute7  =>
15580          hr_transaction_api.get_varchar2_value
15581            (p_transaction_step_id => p_transaction_step_id
15582            ,p_name                => 'p_cont_attribute7')
15583       --
15584       ,p_cont_attribute8  =>
15585          hr_transaction_api.get_varchar2_value
15586            (p_transaction_step_id => p_transaction_step_id
15587            ,p_name                => 'p_cont_attribute8')
15588       --
15589       ,p_cont_attribute9  =>
15590          hr_transaction_api.get_varchar2_value
15591            (p_transaction_step_id => p_transaction_step_id
15592            ,p_name                => 'p_cont_attribute9')
15593       --
15594       ,p_cont_attribute10  =>
15595          hr_transaction_api.get_varchar2_value
15596            (p_transaction_step_id => p_transaction_step_id
15597            ,p_name                => 'p_cont_attribute10')
15598       --
15599       ,p_cont_attribute11  =>
15600          hr_transaction_api.get_varchar2_value
15601            (p_transaction_step_id => p_transaction_step_id
15602            ,p_name                => 'p_cont_attribute11')
15603       --
15604       ,p_cont_attribute12  =>
15605          hr_transaction_api.get_varchar2_value
15606            (p_transaction_step_id => p_transaction_step_id
15607            ,p_name                => 'p_cont_attribute12')
15608       --
15609       ,p_cont_attribute13  =>
15610          hr_transaction_api.get_varchar2_value
15611            (p_transaction_step_id => p_transaction_step_id
15612            ,p_name                => 'p_cont_attribute13')
15613       --
15614       ,p_cont_attribute14  =>
15615          hr_transaction_api.get_varchar2_value
15616            (p_transaction_step_id => p_transaction_step_id
15617            ,p_name                => 'p_cont_attribute14')
15618       --
15619       ,p_cont_attribute15  =>
15620          hr_transaction_api.get_varchar2_value
15621            (p_transaction_step_id => p_transaction_step_id
15622            ,p_name                => 'p_cont_attribute15')
15623       --
15624       ,p_cont_attribute16  =>
15625          hr_transaction_api.get_varchar2_value
15626            (p_transaction_step_id => p_transaction_step_id
15627            ,p_name                => 'p_cont_attribute16')
15628       --
15629       ,p_cont_attribute17  =>
15630          hr_transaction_api.get_varchar2_value
15631            (p_transaction_step_id => p_transaction_step_id
15632            ,p_name                => 'p_cont_attribute17')
15633       --
15634       ,p_cont_attribute18  =>
15635          hr_transaction_api.get_varchar2_value
15636            (p_transaction_step_id => p_transaction_step_id
15637            ,p_name                => 'p_cont_attribute18')
15638       --
15639       ,p_cont_attribute19  =>
15640          hr_transaction_api.get_varchar2_value
15641            (p_transaction_step_id => p_transaction_step_id
15642            ,p_name                => 'p_cont_attribute19')
15643       --
15644       ,p_cont_attribute20  =>
15645          hr_transaction_api.get_varchar2_value
15646            (p_transaction_step_id => p_transaction_step_id
15647            ,p_name                => 'p_cont_attribute20')
15648       --
15649       */
15650     );
15651 -- Bug 3152505 : calling the update_api for second time if user has checked the check bux for deleting
15652 -- the other relationship also.
15653     l_del_other_rel := hr_transaction_api.get_VARCHAR2_value
15654                              (p_transaction_step_id => p_transaction_step_id
15655                              ,p_name                => 'P_END_OTHER_REL');
15656 
15657     if  l_del_other_rel = 'Y' then
15658     hr_utility.set_location('if  l_del_other_rel Y:'||l_proc, 30);
15659     hr_contact_rel_api.update_contact_relationship(
15660        p_validate                => p_validate
15661       ,P_EFFECTIVE_DATE         =>l_effective_date
15662       ,p_object_version_number   => l_other_rel_ovn
15663       ,P_CONTACT_RELATIONSHIP_ID  =>
15664          hr_transaction_api.get_NUMBER_value
15665            (p_transaction_step_id => p_transaction_step_id
15666            ,p_name                => 'P_OTHER_REL_ID')
15667       ,p_date_end  =>
15668          hr_transaction_api.get_date_value
15669            (p_transaction_step_id => p_transaction_step_id
15670            ,p_name                => 'p_date_end')
15671       ,p_end_life_reason_id  =>
15672          hr_transaction_api.get_number_value
15673            (p_transaction_step_id => p_transaction_step_id
15674            ,p_name                => 'p_end_life_reason_id')
15675     );
15676     end if;
15677   ELSE
15678      -- Error message goes here as the contact_relationshipid is null. 9999
15679      null;
15680   END IF;
15681   --
15682   IF p_validate = true THEN
15683          hr_utility.set_location('p_validate = true'||l_proc, 35);
15684      ROLLBACK TO end_cont_relationship;
15685   END IF;
15686   hr_utility.set_location('Exiting:'||l_proc, 40);
15687   --
15688  EXCEPTION
15689   WHEN hr_utility.hr_error THEN
15690   hr_utility.set_location('Exception:hr_utility.hr_error'||l_proc,555);
15691     -- -----------------------------------------------------------------
15692     -- An application error has been raised by the API so we must set
15693     -- the error.
15694     -- -----------------------------------------------------------------
15695     ROLLBACK TO end_cont_relationship;
15696     RAISE;
15697     --
15698  END process_end_api;
15699  --
15700  -- ----------------------------------------------------------------------------
15701  -- |-------------------------< is_contact_added>------------------------|
15702  -- ----------------------------------------------------------------------------
15703  -- Purpose: This procedure will be called from contacts subprocess, which will  -- determine if the control sholud go to the contacts page again or to the
15704  -- conatcs decision page.
15705  -- Case1 : If no contacts were added in this session Then Goto Decision page
15706  --         ( may be from contacts - back button )
15707  -- Case2 : If there are some contacts added,Then Goto Contacts page to show
15708  --         last contact added
15709  --         (coming from back button)
15710  PROCEDURE is_contact_added
15711  (itemtype in     varchar2
15712   ,itemkey  in     varchar2
15713   ,actid    in     number
15714   ,funcmode in     varchar2
15715   ,resultout   out nocopy varchar2)
15716  is
15717    l_contact_set            wf_activity_attr_values.number_value%type;
15718    l_proc   varchar2(72)  := g_package||'is_contact_added';
15719  begin
15720  --
15721   hr_utility.set_location('Entering:'||l_proc, 5);
15722   l_contact_set := wf_engine.GetItemAttrNumber(itemtype => itemtype,
15723                                           itemkey  => itemkey,
15724                                           aname    => 'HR_CONTACT_SET');
15725 
15726      if    l_contact_set > 0  then
15727         hr_utility.set_location('l_contact_set > 0:'||l_proc, 10);
15728         -- Goto Contacts page
15729         resultout := 'COMPLETE:'|| 'Y';
15730      else
15731         -- Goto Decision page
15732         hr_utility.set_location('l_contact_set <= 0:'||l_proc, 15);
15733         resultout := 'COMPLETE:'|| 'N';
15734      end if;
15735   hr_utility.set_location('Exiting:'||l_proc, 20);
15736  EXCEPTION
15737   WHEN OTHERS THEN
15738     hr_utility.set_location('Exception:OTHERS'||l_proc,555);
15739     WF_CORE.CONTEXT(g_package
15740                    ,'is_contact_added'
15741                    ,itemtype
15742                    ,itemkey
15743                    ,to_char(actid)
15744                    ,funcmode);
15745     RAISE;
15746  end is_contact_added;
15747  --
15748 -- -------------------------------------------------------------------------
15749 --   Delete_transaction_steps is used by contacts. This will delete the
15750 --   Transaction steps from the pages from which the user went  back to the
15751 --   current contact page using the contact set.
15752 -- -------------------------------------------------------------------------
15753 PROCEDURE delete_transaction_steps(
15754   p_item_type IN     varchar2,
15755   p_item_key  IN     varchar2,
15756   p_actid     IN     varchar2,
15757   p_login_person_id  IN varchar2) IS
15758 
15759   l_trans_step_ids      hr_util_web.g_varchar2_tab_type;
15760   l_trans_obj_vers_num  hr_util_web.g_varchar2_tab_type;
15761   l_trans_step_rows     NUMBER;
15762   l_contact_set         varchar2(5) := null;
15763   l_wf_contact_set      NUMBER := null;
15764   l_proc   varchar2(72)  := g_package||'delete_transaction_steps';
15765 
15766 BEGIN
15767 
15768   hr_utility.set_location('Entering:'||l_proc, 5);
15769   hr_transaction_api.get_transaction_step_info (
15770     p_Item_Type             => p_item_type,
15771     p_Item_Key              => p_item_key,
15772     p_activity_id           => to_number(p_actid),
15773     p_transaction_step_id   => l_trans_step_ids,
15774     p_object_version_number => l_trans_obj_vers_num,
15775     p_rows                  => l_trans_step_rows
15776   );
15777 
15778 
15779  -- Get the contact set from java and compare with the contact set id in each step.
15780  -- if the step doesnot match, ignore the step and go to next step.
15781 
15782 
15783 --
15784 --  This is a marker for the contact person to be used to identify the
15785 --  transactiion steps to be retrieved for the contact person in context.
15786 --  The HR_LAST_CONTACT_SET is in from the work flow attribute
15787   BEGIN
15788       l_wf_contact_set := wf_engine.GetItemAttrNumber(itemtype => p_item_type,
15789                                                       itemkey  => p_item_key,
15790                                                       aname    => 'HR_CONTACT_SET');
15791 
15792       exception when others then
15793            hr_utility.set_location('Exception:others'||l_proc,555);
15794            l_wf_contact_set := 1000;
15795            -- can't let anyone have so many dependants anyway!
15796 
15797   END;
15798 
15799   hr_utility.set_location('before starting For Loop:'||l_proc, 10);
15800   FOR i IN 0..(l_trans_step_rows - 1) LOOP
15801 
15802       begin
15803         l_contact_set := hr_transaction_api.get_varchar2_value
15804                         (p_transaction_step_id => l_trans_step_ids(i)
15805                         ,p_name                => 'P_CONTACT_SET');
15806       exception
15807         when others then
15808          hr_utility.set_location('Exception:Others'||l_proc,555);
15809          l_contact_set := 1;
15810       end;
15811 
15812       if l_contact_set is null then
15813          l_contact_set := 1;
15814       end if;
15815 
15816       if  l_contact_set >= l_wf_contact_set then
15817           hr_transaction_ss.delete_transaction_step
15818           (p_transaction_step_id => l_trans_step_ids(i)
15819           ,p_object_version_number => l_trans_obj_vers_num(i)
15820           ,p_login_person_id => p_login_person_id);
15821       end if;
15822 
15823   END LOOP;
15824 
15825   --hr_utility.set_message(801, 'HR_51750_WEB_TRANSAC_STARTED');
15826   --hr_utility.raise_error;
15827 hr_utility.set_location('Exiting:'||l_proc, 15);
15828 EXCEPTION
15829   WHEN OTHERS THEN
15830       hr_utility.set_location('Exception:Others'||l_proc,555);
15831       fnd_message.set_name('PER', SQLERRM ||' '||to_char(SQLCODE));
15832       hr_utility.raise_error;
15833     --raise;
15834 END delete_transaction_steps;
15835 --
15836 -- my delete
15837 -- -------------------------------------------------------------------------
15838 --  Delete_transaction_steps overloaded is used by contacts in registration
15839 --  flow.  This will delete the Transaction steps from the pages from which
15840 --  the user went back to the current contact page.
15841 --  It uses the contact set and p_mode to determine which contacts to delete
15842 -- -------------------------------------------------------------------------
15843 PROCEDURE delete_transaction_steps(
15844   p_item_type IN     varchar2,
15845   p_item_key  IN     varchar2,
15846   p_actid     IN     varchar2,
15847   p_login_person_id  IN varchar2,
15848   p_mode IN varchar2) IS
15849 
15850   l_trans_step_ids      hr_util_web.g_varchar2_tab_type;
15851   l_trans_obj_vers_num  hr_util_web.g_varchar2_tab_type;
15852   l_trans_step_rows     NUMBER;
15853   l_contact_set         varchar2(5) := null;
15854   l_wf_contact_set      NUMBER := null;
15855   l_proc   varchar2(72)  := g_package||'delete_transaction_steps';
15856 
15857 BEGIN
15858 
15859   hr_utility.set_location('Entering:'||l_proc, 5);
15860   hr_transaction_api.get_transaction_step_info (
15861     p_Item_Type             => p_item_type,
15862     p_Item_Key              => p_item_key,
15863     p_activity_id           => to_number(p_actid),
15864     p_transaction_step_id   => l_trans_step_ids,
15865     p_object_version_number => l_trans_obj_vers_num,
15866     p_rows                  => l_trans_step_rows
15867   );
15868 
15869 
15870  -- Get the contact set from java and compare with the contact set id in each step.
15871  -- if the step doesnot match, ignore the step and go to next step.
15872 
15873 
15874 --
15875 --  This is a marker for the contact person to be used to identify the
15876 --  transactiion steps to be retrieved for the contact person in context.
15877 --  The HR_LAST_CONTACT_SET is in from the work flow attribute
15878   BEGIN
15879       l_wf_contact_set := wf_engine.GetItemAttrNumber(itemtype => p_item_type,
15880                                                       itemkey  => p_item_key,
15881                                                       aname    => 'HR_CONTACT_SET');
15882 
15883       exception when others then
15884       hr_utility.set_location('Exception:Others'||l_proc,555);
15885            l_wf_contact_set := 1000;
15886            -- can't let anyone have so many dependants anyway!
15887 
15888   END;
15889 
15890   hr_utility.set_location('Before Entering For Loop:'||l_proc,10 );
15891   FOR i IN 0..(l_trans_step_rows - 1) LOOP
15892 
15893       begin
15894         l_contact_set := hr_transaction_api.get_varchar2_value
15895                         (p_transaction_step_id => l_trans_step_ids(i)
15896                         ,p_name                => 'P_CONTACT_SET');
15897       exception
15898         when others then
15899         hr_utility.set_location('Exception:Others'||l_proc,555);
15900          l_contact_set := 1;
15901       end;
15902 
15903       if l_contact_set is null then
15904          l_contact_set := 1;
15905       end if;
15906 
15907      -- When the procedure is called from 'Do not add Contacts'
15908      -- button in 'Add contacts yes no' page
15909       if p_mode = 'ALL' then
15910             hr_transaction_ss.delete_transaction_step
15911             (p_transaction_step_id => l_trans_step_ids(i)
15912             ,p_object_version_number => l_trans_obj_vers_num(i)
15913             ,p_login_person_id => p_login_person_id);
15914 
15915      -- When the procedure is called from 'add another Contact'
15916      -- button in contacts page
15917       elsif p_mode = 'THIS' then
15918         if  l_contact_set = l_wf_contact_set then
15919             hr_transaction_ss.delete_transaction_step
15920             (p_transaction_step_id => l_trans_step_ids(i)
15921             ,p_object_version_number => l_trans_obj_vers_num(i)
15922             ,p_login_person_id => p_login_person_id);
15923         end if;
15924 
15925      -- When the procedure is called from 'Next' button
15926      -- in contacts page
15927       elsif p_mode = 'THIS AND ABOVE' then
15928         if  l_contact_set >= l_wf_contact_set then
15929             hr_transaction_ss.delete_transaction_step
15930             (p_transaction_step_id => l_trans_step_ids(i)
15931             ,p_object_version_number => l_trans_obj_vers_num(i)
15932             ,p_login_person_id => p_login_person_id);
15933         end if;
15934       end if;
15935 
15936   END LOOP;
15937   hr_utility.set_location('End of For Loop:'||l_proc,15 );
15938 
15939   --hr_utility.set_message(801, 'HR_51750_WEB_TRANSAC_STARTED');
15940   --hr_utility.raise_error;
15941   hr_utility.set_location('Exiting:'||l_proc, 20);
15942 
15943 EXCEPTION
15944   WHEN OTHERS THEN
15945       hr_utility.set_location('Exception:Others'||l_proc,555);
15946       fnd_message.set_name('PER', SQLERRM ||' '||to_char(SQLCODE));
15947       hr_utility.raise_error;
15948     --raise;
15949 END delete_transaction_steps;
15950 --
15951 
15952 -- mydelete
15953 --
15954 procedure update_object_version
15955   (p_transaction_step_id in     number
15956   ,p_login_person_id in number) is
15957 
15958 /*
15959   cursor csr_new_object_number(p_asg_id in number) is
15960   select object_version_number
15961     from per_all_assignments_f
15962    where assignment_id = p_asg_id
15963      and assignment_type = 'E'
15964    order by object_version_number desc;
15965 */
15966 
15967   l_old_object_number number;
15968   l_assignment_id number;
15969   l_new_object_number number;
15970   l_proc   varchar2(72)  := g_package||'update_object_version';
15971 
15972 begin
15973 hr_utility.set_location('Entering:'||l_proc, 5);
15974 /*
15975   l_assignment_id :=
15976       hr_transaction_api.get_number_value
15977       (p_transaction_step_id =>  p_transaction_step_id
15978       ,p_name                => 'P_ASSIGNMENT_ID');
15979 
15980     open csr_new_object_number(l_assignment_id);
15981     fetch csr_new_object_number into l_new_object_number;
15982     close csr_new_object_number;
15983 
15984   l_old_object_number :=
15985     hr_transaction_api.get_number_value
15986     (p_transaction_step_id =>  p_transaction_step_id
15987     ,p_name                => 'P_OBJECT_VERSION_NUMBER');
15988 
15989   if l_old_object_number <> l_new_object_number then
15990     hr_transaction_api.set_number_value
15991     (p_transaction_step_id =>  p_transaction_step_id
15992     ,p_person_id           => p_login_person_id
15993     ,p_name                => 'P_OBJECT_VERSION_NUMBER'
15994     ,p_value               => l_new_object_number);
15995   end if;
15996 */
15997 hr_utility.set_location('Exiting:'||l_proc, 15);
15998 null;
15999 
16000 end update_object_version;
16001 --
16002 procedure call_contact_api
16003   (p_validate                     in        boolean     default false
16004   ,p_start_date                   in        date
16005   ,p_business_group_id            in        number
16006   ,p_person_id                    in        number
16007   ,p_contact_person_id            in        number      default null
16008   ,p_contact_type                 in        varchar2
16009   ,p_ctr_comments                 in        varchar2    default null
16010   ,p_primary_contact_flag         in        varchar2    default 'N'
16011   ,p_date_start                   in        date        default null
16012   ,p_start_life_reason_id         in        number      default null
16013   ,p_date_end                     in        date        default null
16014   ,p_end_life_reason_id           in        number      default null
16015   ,p_rltd_per_rsds_w_dsgntr_flag  in        varchar2    default 'N'
16016   ,p_personal_flag                in        varchar2    default 'N'
16017   ,p_sequence_number              in        number      default null
16018   ,p_cont_attribute_category      in        varchar2    default null
16019   ,p_cont_attribute1              in        varchar2    default null
16020   ,p_cont_attribute2              in        varchar2    default null
16021   ,p_cont_attribute3              in        varchar2    default null
16022   ,p_cont_attribute4              in        varchar2    default null
16023   ,p_cont_attribute5              in        varchar2    default null
16024   ,p_cont_attribute6              in        varchar2    default null
16025   ,p_cont_attribute7              in        varchar2    default null
16026   ,p_cont_attribute8              in        varchar2    default null
16027   ,p_cont_attribute9              in        varchar2    default null
16028   ,p_cont_attribute10             in        varchar2    default null
16029   ,p_cont_attribute11             in        varchar2    default null
16030   ,p_cont_attribute12             in        varchar2    default null
16031   ,p_cont_attribute13             in        varchar2    default null
16032   ,p_cont_attribute14             in        varchar2    default null
16033   ,p_cont_attribute15             in        varchar2    default null
16034   ,p_cont_attribute16             in        varchar2    default null
16035   ,p_cont_attribute17             in        varchar2    default null
16036   ,p_cont_attribute18             in        varchar2    default null
16037   ,p_cont_attribute19             in        varchar2    default null
16038   ,p_cont_attribute20             in        varchar2    default null
16039   ,p_cont_information_category      in        varchar2    default null
16040   ,p_cont_information1              in        varchar2    default null
16041   ,p_cont_information2              in        varchar2    default null
16042   ,p_cont_information3              in        varchar2    default null
16043   ,p_cont_information4              in        varchar2    default null
16044   ,p_cont_information5              in        varchar2    default null
16045   ,p_cont_information6              in        varchar2    default null
16046   ,p_cont_information7              in        varchar2    default null
16047   ,p_cont_information8              in        varchar2    default null
16048   ,p_cont_information9              in        varchar2    default null
16049   ,p_cont_information10             in        varchar2    default null
16050   ,p_cont_information11             in        varchar2    default null
16051   ,p_cont_information12             in        varchar2    default null
16052   ,p_cont_information13             in        varchar2    default null
16053   ,p_cont_information14             in        varchar2    default null
16054   ,p_cont_information15             in        varchar2    default null
16055   ,p_cont_information16             in        varchar2    default null
16056   ,p_cont_information17             in        varchar2    default null
16057   ,p_cont_information18             in        varchar2    default null
16058   ,p_cont_information19             in        varchar2    default null
16059   ,p_cont_information20             in        varchar2    default null
16060   ,p_third_party_pay_flag         in        varchar2    default 'N'
16061   ,p_bondholder_flag              in        varchar2    default 'N'
16062   ,p_dependent_flag               in        varchar2    default 'N'
16063   ,p_beneficiary_flag             in        varchar2    default 'N'
16064   ,p_last_name                    in        varchar2    default null
16065   ,p_sex                          in        varchar2    default null
16066   ,p_person_type_id               in        number      default null
16067   ,p_per_comments                 in        varchar2    default null
16068   ,p_date_of_birth                in        date        default null
16069   ,p_email_address                in        varchar2    default null
16070   ,p_first_name                   in        varchar2    default null
16071   ,p_known_as                     in        varchar2    default null
16072   ,p_marital_status               in        varchar2    default null
16073   ,p_middle_names                 in        varchar2    default null
16074   ,p_nationality                  in        varchar2    default null
16075   ,p_national_identifier          in        varchar2    default null
16076   ,p_previous_last_name           in        varchar2    default null
16077   ,p_registered_disabled_flag     in        varchar2    default null
16078   ,p_title                        in        varchar2    default null
16079   ,p_work_telephone               in        varchar2    default null
16080   ,p_attribute_category           in        varchar2    default null
16081   ,p_attribute1                   in        varchar2    default null
16082   ,p_attribute2                   in        varchar2    default null
16083   ,p_attribute3                   in        varchar2    default null
16084   ,p_attribute4                   in        varchar2    default null
16085   ,p_attribute5                   in        varchar2    default null
16086   ,p_attribute6                   in        varchar2    default null
16087   ,p_attribute7                   in        varchar2    default null
16088   ,p_attribute8                   in        varchar2    default null
16089   ,p_attribute9                   in        varchar2    default null
16090   ,p_attribute10                  in        varchar2    default null
16091   ,p_attribute11                  in        varchar2    default null
16092   ,p_attribute12                  in        varchar2    default null
16093   ,p_attribute13                  in        varchar2    default null
16094   ,p_attribute14                  in        varchar2    default null
16095   ,p_attribute15                  in        varchar2    default null
16096   ,p_attribute16                  in        varchar2    default null
16097   ,p_attribute17                  in        varchar2    default null
16098   ,p_attribute18                  in        varchar2    default null
16099   ,p_attribute19                  in        varchar2    default null
16100   ,p_attribute20                  in        varchar2    default null
16101   ,p_attribute21                  in        varchar2    default null
16102   ,p_attribute22                  in        varchar2    default null
16103   ,p_attribute23                  in        varchar2    default null
16104   ,p_attribute24                  in        varchar2    default null
16105   ,p_attribute25                  in        varchar2    default null
16106   ,p_attribute26                  in        varchar2    default null
16107   ,p_attribute27                  in        varchar2    default null
16108   ,p_attribute28                  in        varchar2    default null
16109   ,p_attribute29                  in        varchar2    default null
16110   ,p_attribute30                  in        varchar2    default null
16111   ,p_per_information_category     in        varchar2    default null
16112   ,p_per_information1             in        varchar2    default null
16113   ,p_per_information2             in        varchar2    default null
16114   ,p_per_information3             in        varchar2    default null
16115   ,p_per_information4             in        varchar2    default null
16116   ,p_per_information5             in        varchar2    default null
16117   ,p_per_information6             in        varchar2    default null
16118   ,p_per_information7             in        varchar2    default null
16119   ,p_per_information8             in        varchar2    default null
16120   ,p_per_information9             in        varchar2    default null
16121   ,p_per_information10            in        varchar2    default null
16122   ,p_per_information11            in        varchar2    default null
16123   ,p_per_information12            in        varchar2    default null
16124   ,p_per_information13            in        varchar2    default null
16125   ,p_per_information14            in        varchar2    default null
16126   ,p_per_information15            in        varchar2    default null
16127   ,p_per_information16            in        varchar2    default null
16128   ,p_per_information17            in        varchar2    default null
16129   ,p_per_information18            in        varchar2    default null
16130   ,p_per_information19            in        varchar2    default null
16131   ,p_per_information20            in        varchar2    default null
16132   ,p_per_information21            in        varchar2    default null
16133   ,p_per_information22            in        varchar2    default null
16134   ,p_per_information23            in        varchar2    default null
16135   ,p_per_information24            in        varchar2    default null
16136   ,p_per_information25            in        varchar2    default null
16137   ,p_per_information26            in        varchar2    default null
16138   ,p_per_information27            in        varchar2    default null
16139   ,p_per_information28            in        varchar2    default null
16140   ,p_per_information29            in        varchar2    default null
16141   ,p_per_information30            in        varchar2    default null
16142   ,p_correspondence_language      in        varchar2    default null
16143   ,p_honors                       in        varchar2    default null
16144   ,p_pre_name_adjunct             in        varchar2    default null
16145   ,p_suffix                       in        varchar2    default null
16146   ,p_create_mirror_flag           in        varchar2    default 'N'
16147   ,p_mirror_type                  in        varchar2    default null
16148   ,p_mirror_cont_attribute_cat    in        varchar2    default null
16149   ,p_mirror_cont_attribute1       in        varchar2    default null
16150   ,p_mirror_cont_attribute2       in        varchar2    default null
16151   ,p_mirror_cont_attribute3       in        varchar2    default null
16152   ,p_mirror_cont_attribute4       in        varchar2    default null
16153   ,p_mirror_cont_attribute5       in        varchar2    default null
16154   ,p_mirror_cont_attribute6       in        varchar2    default null
16155   ,p_mirror_cont_attribute7       in        varchar2    default null
16156   ,p_mirror_cont_attribute8       in        varchar2    default null
16157   ,p_mirror_cont_attribute9       in        varchar2    default null
16158   ,p_mirror_cont_attribute10      in        varchar2    default null
16159   ,p_mirror_cont_attribute11      in        varchar2    default null
16160   ,p_mirror_cont_attribute12      in        varchar2    default null
16161   ,p_mirror_cont_attribute13      in        varchar2    default null
16162   ,p_mirror_cont_attribute14      in        varchar2    default null
16163   ,p_mirror_cont_attribute15      in        varchar2    default null
16164   ,p_mirror_cont_attribute16      in        varchar2    default null
16165   ,p_mirror_cont_attribute17      in        varchar2    default null
16166   ,p_mirror_cont_attribute18      in        varchar2    default null
16167   ,p_mirror_cont_attribute19      in        varchar2    default null
16168   ,p_mirror_cont_attribute20      in        varchar2    default null
16169   ,p_mirror_cont_information_cat    in        varchar2    default null
16170   ,p_mirror_cont_information1       in        varchar2    default null
16171   ,p_mirror_cont_information2       in        varchar2    default null
16172   ,p_mirror_cont_information3       in        varchar2    default null
16173   ,p_mirror_cont_information4       in        varchar2    default null
16174   ,p_mirror_cont_information5       in        varchar2    default null
16175   ,p_mirror_cont_information6       in        varchar2    default null
16176   ,p_mirror_cont_information7       in        varchar2    default null
16177   ,p_mirror_cont_information8       in        varchar2    default null
16178   ,p_mirror_cont_information9       in        varchar2    default null
16179   ,p_mirror_cont_information10      in        varchar2    default null
16180   ,p_mirror_cont_information11      in        varchar2    default null
16181   ,p_mirror_cont_information12      in        varchar2    default null
16182   ,p_mirror_cont_information13      in        varchar2    default null
16183   ,p_mirror_cont_information14      in        varchar2    default null
16184   ,p_mirror_cont_information15      in        varchar2    default null
16185   ,p_mirror_cont_information16      in        varchar2    default null
16186   ,p_mirror_cont_information17      in        varchar2    default null
16187   ,p_mirror_cont_information18      in        varchar2    default null
16188   ,p_mirror_cont_information19      in        varchar2    default null
16189   ,p_mirror_cont_information20      in        varchar2    default null
16190 --
16191   ,p_contact_relationship_id      out nocopy number
16192   ,p_ctr_object_version_number    out nocopy number
16193   ,p_per_person_id                out nocopy number
16194   ,p_per_object_version_number    out nocopy number
16195   ,p_per_effective_start_date     out nocopy date
16196   ,p_per_effective_end_date       out nocopy date
16197   ,p_full_name                    out nocopy varchar2
16198   ,p_per_comment_id               out nocopy number
16199   ,p_name_combination_warning     out nocopy boolean
16200   ,p_orig_hire_warning            out nocopy boolean
16201 --
16202   ,p_contact_operation               in        varchar2
16203   ,p_emrg_cont_flag                  in        varchar2   default 'N'
16204   )
16205  is
16206  l_proc   varchar2(72)  := g_package||'call_contact_api';
16207  begin
16208 
16209  /*
16210   if p_primary_contact_flag is 'Y', then use it only first emergency relationship and not for
16211   other personal relationship, if not u will get
16212   This employee already has a primary contact. Cause: You are trying to enter more than one
16213   primary contact for an employee. Action: Uncheck the Primary Contact check box and save your contact
16214   information.*/
16215 
16216  hr_utility.set_location('Entering:'||l_proc, 5);
16217  hr_contact_rel_api.create_contact(
16218     p_validate                 		=>  p_validate -- l_validate_mode
16219    ,p_start_date               		=>  p_start_date --p_start_date
16220    ,p_business_group_id        		=>  p_business_group_id
16221    ,p_person_id                		=>  p_person_id
16222    ,p_contact_person_id        		=>  p_contact_person_id
16223    ,p_contact_type             		=>  p_contact_type
16224    ,p_ctr_comments             		=>  p_ctr_comments
16225    ,p_primary_contact_flag     		=>  'N'
16226    ,p_date_start               		=>  p_date_start
16227    ,p_start_life_reason_id     		=>  p_start_life_reason_id
16228    ,p_date_end                 		=>  p_date_end
16229    ,p_end_life_reason_id       		=>  p_end_life_reason_id
16230    ,p_rltd_per_rsds_w_dsgntr_flag     	=>  p_rltd_per_rsds_w_dsgntr_flag
16231    ,p_personal_flag                   	=>  p_personal_flag
16232    ,p_sequence_number                 	=>  p_sequence_number
16233    ,p_cont_attribute_category     	=>  p_cont_attribute_category
16234    ,p_cont_attribute1                 	=>  p_cont_attribute1
16235    ,p_cont_attribute2                 	=>  p_cont_attribute2
16236    ,p_cont_attribute3                 	=>  p_cont_attribute3
16237    ,p_cont_attribute4                 	=>  p_cont_attribute4
16238    ,p_cont_attribute5     		=>  p_cont_attribute5
16239    ,p_cont_attribute6     		=>  p_cont_attribute6
16240    ,p_cont_attribute7     		=>  p_cont_attribute7
16241    ,p_cont_attribute8     		=>  p_cont_attribute8
16242    ,p_cont_attribute9     		=>  p_cont_attribute9
16243    ,p_cont_attribute10     		=>  p_cont_attribute10
16244    ,p_cont_attribute11     		=>  p_cont_attribute11
16245    ,p_cont_attribute12     		=>  p_cont_attribute12
16246    ,p_cont_attribute13     		=>  p_cont_attribute13
16247    ,p_cont_attribute14     		=>  p_cont_attribute14
16248    ,p_cont_attribute15     		=>  p_cont_attribute15
16249    ,p_cont_attribute16     		=>  p_cont_attribute16
16250    ,p_cont_attribute17     		=>  p_cont_attribute17
16251    ,p_cont_attribute18     		=>  p_cont_attribute18
16252    ,p_cont_attribute19     		=>  p_cont_attribute19
16253    ,p_cont_attribute20    		=>  p_cont_attribute20
16254    ,p_cont_information_category         =>  p_cont_information_category
16255    ,p_cont_information1                 =>  p_cont_information1
16256    ,p_cont_information2                 =>  p_cont_information2
16257    ,p_cont_information3                 =>  p_cont_information3
16258    ,p_cont_information4                 =>  p_cont_information4
16259    ,p_cont_information5                 =>  p_cont_information5
16260    ,p_cont_information6                 =>  p_cont_information6
16261    ,p_cont_information7                 =>  p_cont_information7
16262    ,p_cont_information8                 =>  p_cont_information8
16263    ,p_cont_information9                 =>  p_cont_information9
16264    ,p_cont_information10                =>  p_cont_information10
16265    ,p_cont_information11                =>  p_cont_information11
16266    ,p_cont_information12                =>  p_cont_information12
16267    ,p_cont_information13                =>  p_cont_information13
16268    ,p_cont_information14                =>  p_cont_information14
16269    ,p_cont_information15                =>  p_cont_information15
16270    ,p_cont_information16                =>  p_cont_information16
16271    ,p_cont_information17                =>  p_cont_information17
16272    ,p_cont_information18                =>  p_cont_information18
16273    ,p_cont_information19                =>  p_cont_information19
16274    ,p_cont_information20                =>  p_cont_information20
16275    ,p_third_party_pay_flag     		=>  p_third_party_pay_flag
16276    ,p_bondholder_flag     		=>  p_bondholder_flag
16277    ,p_dependent_flag     		=>  p_dependent_flag
16278    ,p_beneficiary_flag     		=>  p_beneficiary_flag
16279    ,p_last_name     			=>  p_last_name
16280    ,p_sex     				=>  p_sex
16281    ,p_person_type_id     		=>  p_person_type_id
16282    ,p_per_comments     			=>  p_per_comments
16283    ,p_date_of_birth     		=>  p_date_of_birth
16284    ,p_email_address     		=>  p_email_address
16285    ,p_first_name     			=>  p_first_name
16286    ,p_known_as     			=>  p_known_as
16287    ,p_marital_status     		=>  p_marital_status
16288    ,p_middle_names     			=>  p_middle_names
16289    ,p_nationality     			=>  p_nationality
16290    ,p_national_identifier     		=>  p_national_identifier
16291    ,p_previous_last_name     		=>  p_previous_last_name
16292    ,p_registered_disabled_flag     	=>  p_registered_disabled_flag
16293    ,p_title     			=>  p_title
16294    ,p_work_telephone     		=>  p_work_telephone
16295    ,p_attribute_category     		=>  p_attribute_category
16296    ,p_attribute1     			=>  p_attribute1
16297    ,p_attribute2     			=>  p_attribute2
16298    ,p_attribute3     			=>  p_attribute3
16299    ,p_attribute4     			=>  p_attribute4
16300    ,p_attribute5     			=>  p_attribute5
16301    ,p_attribute6     			=>  p_attribute6
16302    ,p_attribute7     			=>  p_attribute7
16303    ,p_attribute8     			=>  p_attribute8
16304    ,p_attribute9     			=>  p_attribute9
16305    ,p_attribute10     			=>  p_attribute10
16306    ,p_attribute11     			=>  p_attribute11
16307    ,p_attribute12     			=>  p_attribute12
16308    ,p_attribute13     			=>  p_attribute13
16309    ,p_attribute14     			=>  p_attribute14
16310    ,p_attribute15     			=>  p_attribute15
16311    ,p_attribute16     			=>  p_attribute16
16312    ,p_attribute17     			=>  p_attribute17
16313    ,p_attribute18     			=>  p_attribute18
16314    ,p_attribute19     			=>  p_attribute19
16315    ,p_attribute20     			=>  p_attribute20
16316    ,p_attribute21     			=>  p_attribute21
16317    ,p_attribute22     			=>  p_attribute22
16318    ,p_attribute23     			=>  p_attribute23
16319    ,p_attribute24     			=>  p_attribute24
16320    ,p_attribute25     			=>  p_attribute25
16321    ,p_attribute26     			=>  p_attribute26
16322    ,p_attribute27     			=>  p_attribute27
16323    ,p_attribute28     			=>  p_attribute28
16324    ,p_attribute29     			=>  p_attribute29
16325    ,p_attribute30     			=>  p_attribute30
16326    ,p_per_information_category     	=>  p_per_information_category
16327    ,p_per_information1      =>  p_per_information1
16328    ,p_per_information2      =>  p_per_information2
16329    ,p_per_information3      =>  p_per_information3
16330    ,p_per_information4      =>  p_per_information4
16331    ,p_per_information5      =>  p_per_information5
16332    ,p_per_information6      =>  p_per_information6
16333    ,p_per_information7      =>  p_per_information7
16334    ,p_per_information8      =>  p_per_information8
16335    ,p_per_information9      =>  p_per_information9
16336    ,p_per_information10     =>  p_per_information10
16337    ,p_per_information11     =>  p_per_information11
16338    ,p_per_information12     =>  p_per_information12
16339    ,p_per_information13     =>  p_per_information13
16340    ,p_per_information14     =>  p_per_information14
16341    ,p_per_information15     =>  p_per_information15
16342    ,p_per_information16     =>  p_per_information16
16343    ,p_per_information17     =>  p_per_information17
16344    ,p_per_information18     =>  p_per_information18
16345    ,p_per_information19     =>  p_per_information19
16346    ,p_per_information20     =>  p_per_information20
16347    ,p_per_information21     =>  p_per_information21
16348    ,p_per_information22     =>  p_per_information22
16349    ,p_per_information23     =>  p_per_information23
16350    ,p_per_information24     =>  p_per_information24
16351    ,p_per_information25     =>  p_per_information25
16352    ,p_per_information26     =>  p_per_information26
16353    ,p_per_information27     =>  p_per_information27
16354    ,p_per_information28     =>  p_per_information28
16355    ,p_per_information29     =>  p_per_information29
16356    ,p_per_information30     =>  p_per_information30
16357    ,p_correspondence_language   =>  p_correspondence_language
16358    ,p_honors     		=>  p_honors
16359    ,p_pre_name_adjunct     	=>  p_pre_name_adjunct
16360    ,p_suffix     		=>  p_suffix
16361    ,p_create_mirror_flag     	=>  p_create_mirror_flag
16362    ,p_mirror_type     		=>  p_mirror_type
16363    ,p_mirror_cont_attribute_cat   =>  p_mirror_cont_attribute_cat
16364    ,p_mirror_cont_attribute1      =>  p_mirror_cont_attribute1
16365    ,p_mirror_cont_attribute2      =>  p_mirror_cont_attribute2
16366    ,p_mirror_cont_attribute3      =>  p_mirror_cont_attribute3
16367    ,p_mirror_cont_attribute4      =>  p_mirror_cont_attribute4
16368    ,p_mirror_cont_attribute5      =>  p_mirror_cont_attribute5
16369    ,p_mirror_cont_attribute6      =>  p_mirror_cont_attribute6
16370    ,p_mirror_cont_attribute7      =>  p_mirror_cont_attribute7
16371    ,p_mirror_cont_attribute8      =>  p_mirror_cont_attribute8
16372    ,p_mirror_cont_attribute9      =>  p_mirror_cont_attribute9
16373    ,p_mirror_cont_attribute10     =>  p_mirror_cont_attribute10
16374    ,p_mirror_cont_attribute11     =>  p_mirror_cont_attribute11
16375    ,p_mirror_cont_attribute12     =>  p_mirror_cont_attribute12
16376    ,p_mirror_cont_attribute13     =>  p_mirror_cont_attribute13
16377    ,p_mirror_cont_attribute14     =>  p_mirror_cont_attribute14
16378    ,p_mirror_cont_attribute15     =>  p_mirror_cont_attribute15
16379    ,p_mirror_cont_attribute16     =>  p_mirror_cont_attribute16
16380    ,p_mirror_cont_attribute17     =>  p_mirror_cont_attribute17
16381    ,p_mirror_cont_attribute18     =>  p_mirror_cont_attribute18
16382    ,p_mirror_cont_attribute19     =>  p_mirror_cont_attribute19
16383    ,p_mirror_cont_attribute20     =>  p_mirror_cont_attribute20
16384    ,P_MIRROR_CONT_INFORMATION_CAT => P_MIRROR_CONT_INFORMATION_CAT
16385    ,P_MIRROR_CONT_INFORMATION1    => P_MIRROR_CONT_INFORMATION1
16386    ,P_MIRROR_CONT_INFORMATION2    => P_MIRROR_CONT_INFORMATION2
16387    ,P_MIRROR_CONT_INFORMATION3    => P_MIRROR_CONT_INFORMATION3
16388    ,P_MIRROR_CONT_INFORMATION4    => P_MIRROR_CONT_INFORMATION4
16389    ,P_MIRROR_CONT_INFORMATION5    => P_MIRROR_CONT_INFORMATION5
16390    ,P_MIRROR_CONT_INFORMATION6    => P_MIRROR_CONT_INFORMATION6
16391    ,P_MIRROR_CONT_INFORMATION7    => P_MIRROR_CONT_INFORMATION7
16392    ,P_MIRROR_CONT_INFORMATION8    => P_MIRROR_CONT_INFORMATION8
16393    ,P_MIRROR_CONT_INFORMATION9    => P_MIRROR_CONT_INFORMATION9
16394    ,P_MIRROR_CONT_INFORMATION10    => P_MIRROR_CONT_INFORMATION10
16395    ,P_MIRROR_CONT_INFORMATION11    => P_MIRROR_CONT_INFORMATION11
16396    ,P_MIRROR_CONT_INFORMATION12    => P_MIRROR_CONT_INFORMATION12
16397    ,P_MIRROR_CONT_INFORMATION13    => P_MIRROR_CONT_INFORMATION13
16398    ,P_MIRROR_CONT_INFORMATION14    => P_MIRROR_CONT_INFORMATION14
16399    ,P_MIRROR_CONT_INFORMATION15    => P_MIRROR_CONT_INFORMATION15
16400    ,P_MIRROR_CONT_INFORMATION16    => P_MIRROR_CONT_INFORMATION16
16401    ,P_MIRROR_CONT_INFORMATION17    => P_MIRROR_CONT_INFORMATION17
16402    ,P_MIRROR_CONT_INFORMATION18    => P_MIRROR_CONT_INFORMATION18
16403    ,P_MIRROR_CONT_INFORMATION19    => P_MIRROR_CONT_INFORMATION19
16404    ,P_MIRROR_CONT_INFORMATION20    => P_MIRROR_CONT_INFORMATION20
16405    ,p_contact_relationship_id     => p_contact_relationship_id
16406    ,p_ctr_object_version_number   => p_ctr_object_version_number
16407    ,p_per_person_id               => p_per_person_id
16408    ,p_per_object_version_number   => p_per_object_version_number
16409    ,p_per_effective_start_date    => p_per_effective_start_date
16410    ,p_per_effective_end_date      => p_per_effective_end_date
16411    ,p_full_name                   => p_full_name
16412    ,p_per_comment_id              => p_per_comment_id
16413    ,p_name_combination_warning    => p_name_combination_warning
16414    ,p_orig_hire_warning           => p_orig_hire_warning
16415    );
16416    --
16417   if (p_contact_operation in ('EMER_CR_NEW_CONT','EMER_CR_NEW_REL')) OR (p_emrg_cont_flag = 'Y') then
16418   hr_utility.set_location('EMER_CR_NEW_CONT or EMER_CR_NEW_REL:'||l_proc, 10);
16419   hr_contact_rel_api.create_contact(
16420     p_validate                 		=>  p_validate -- l_validate_mode
16421    ,p_start_date               		=>  p_start_date --p_start_date
16422    ,p_business_group_id        		=>  p_business_group_id
16423    ,p_person_id                		=>  p_person_id
16424    ,p_contact_person_id        		=>  p_contact_person_id
16425    ,p_contact_type             		=>  'EMRG'
16426    ,p_ctr_comments             		=>  p_ctr_comments
16427    ,p_primary_contact_flag     		=>  p_primary_contact_flag
16428    ,p_date_start               		=>  p_date_start
16429    ,p_start_life_reason_id     		=>  p_start_life_reason_id
16430    ,p_date_end                 		=>  p_date_end
16431    ,p_end_life_reason_id       		=>  p_end_life_reason_id
16432    ,p_rltd_per_rsds_w_dsgntr_flag     	=>  p_rltd_per_rsds_w_dsgntr_flag
16433    ,p_personal_flag                   	=>  p_personal_flag
16434    ,p_sequence_number                 	=>  p_sequence_number
16435    ,p_cont_attribute_category     	=>  p_cont_attribute_category
16436    ,p_cont_attribute1                 	=>  p_cont_attribute1
16437    ,p_cont_attribute2                 	=>  p_cont_attribute2
16438    ,p_cont_attribute3                 	=>  p_cont_attribute3
16439    ,p_cont_attribute4                 	=>  p_cont_attribute4
16440    ,p_cont_attribute5     		=>  p_cont_attribute5
16441    ,p_cont_attribute6     		=>  p_cont_attribute6
16442    ,p_cont_attribute7     		=>  p_cont_attribute7
16443    ,p_cont_attribute8     		=>  p_cont_attribute8
16444    ,p_cont_attribute9     		=>  p_cont_attribute9
16445    ,p_cont_attribute10     		=>  p_cont_attribute10
16446    ,p_cont_attribute11     		=>  p_cont_attribute11
16447    ,p_cont_attribute12     		=>  p_cont_attribute12
16448    ,p_cont_attribute13     		=>  p_cont_attribute13
16449    ,p_cont_attribute14     		=>  p_cont_attribute14
16450    ,p_cont_attribute15     		=>  p_cont_attribute15
16451    ,p_cont_attribute16     		=>  p_cont_attribute16
16452    ,p_cont_attribute17     		=>  p_cont_attribute17
16453    ,p_cont_attribute18     		=>  p_cont_attribute18
16454    ,p_cont_attribute19     		=>  p_cont_attribute19
16455    ,p_cont_attribute20    		=>  p_cont_attribute20
16456    ,p_cont_information_category         =>  p_cont_information_category
16457    ,p_cont_information1                 =>  p_cont_information1
16458    ,p_cont_information2                 =>  p_cont_information2
16459    ,p_cont_information3                 =>  p_cont_information3
16460    ,p_cont_information4                 =>  p_cont_information4
16461    ,p_cont_information5                 =>  p_cont_information5
16462    ,p_cont_information6                 =>  p_cont_information6
16463    ,p_cont_information7                 =>  p_cont_information7
16464    ,p_cont_information8                 =>  p_cont_information8
16465    ,p_cont_information9                 =>  p_cont_information9
16466    ,p_cont_information10                =>  p_cont_information10
16467    ,p_cont_information11                =>  p_cont_information11
16468    ,p_cont_information12                =>  p_cont_information12
16469    ,p_cont_information13                =>  p_cont_information13
16470    ,p_cont_information14                =>  p_cont_information14
16471    ,p_cont_information15                =>  p_cont_information15
16472    ,p_cont_information16                =>  p_cont_information16
16473    ,p_cont_information17                =>  p_cont_information17
16474    ,p_cont_information18                =>  p_cont_information18
16475    ,p_cont_information19                =>  p_cont_information19
16476    ,p_cont_information20                =>  p_cont_information20
16477    ,p_third_party_pay_flag     		=>  p_third_party_pay_flag
16478    ,p_bondholder_flag     		=>  p_bondholder_flag
16479    ,p_dependent_flag     		=>  p_dependent_flag
16480    ,p_beneficiary_flag     		=>  p_beneficiary_flag
16481    ,p_last_name     			=>  p_last_name
16482    ,p_sex     				=>  p_sex
16483    ,p_person_type_id     		=>  p_person_type_id
16484    ,p_per_comments     			=>  p_per_comments
16485    ,p_date_of_birth     		=>  p_date_of_birth
16486    ,p_email_address     		=>  p_email_address
16487    ,p_first_name     			=>  p_first_name
16488    ,p_known_as     			=>  p_known_as
16489    ,p_marital_status     		=>  p_marital_status
16490    ,p_middle_names     			=>  p_middle_names
16491    ,p_nationality     			=>  p_nationality
16492    ,p_national_identifier     		=>  p_national_identifier
16493    ,p_previous_last_name     		=>  p_previous_last_name
16494    ,p_registered_disabled_flag     	=>  p_registered_disabled_flag
16495    ,p_title     			=>  p_title
16496    ,p_work_telephone     		=>  p_work_telephone
16497    ,p_attribute_category     		=>  p_attribute_category
16498    ,p_attribute1     			=>  p_attribute1
16499    ,p_attribute2     			=>  p_attribute2
16500    ,p_attribute3     			=>  p_attribute3
16501    ,p_attribute4     			=>  p_attribute4
16502    ,p_attribute5     			=>  p_attribute5
16503    ,p_attribute6     			=>  p_attribute6
16504    ,p_attribute7     			=>  p_attribute7
16505    ,p_attribute8     			=>  p_attribute8
16506    ,p_attribute9     			=>  p_attribute9
16507    ,p_attribute10     			=>  p_attribute10
16508    ,p_attribute11     			=>  p_attribute11
16509    ,p_attribute12     			=>  p_attribute12
16510    ,p_attribute13     			=>  p_attribute13
16511    ,p_attribute14     			=>  p_attribute14
16512    ,p_attribute15     			=>  p_attribute15
16513    ,p_attribute16     			=>  p_attribute16
16514    ,p_attribute17     			=>  p_attribute17
16515    ,p_attribute18     			=>  p_attribute18
16516    ,p_attribute19     			=>  p_attribute19
16517    ,p_attribute20     			=>  p_attribute20
16518    ,p_attribute21     			=>  p_attribute21
16519    ,p_attribute22     			=>  p_attribute22
16520    ,p_attribute23     			=>  p_attribute23
16521    ,p_attribute24     			=>  p_attribute24
16522    ,p_attribute25     			=>  p_attribute25
16523    ,p_attribute26     			=>  p_attribute26
16524    ,p_attribute27     			=>  p_attribute27
16525    ,p_attribute28     			=>  p_attribute28
16526    ,p_attribute29     			=>  p_attribute29
16527    ,p_attribute30     			=>  p_attribute30
16528    ,p_per_information_category     	=>  p_per_information_category
16529    ,p_per_information1      =>  p_per_information1
16530    ,p_per_information2      =>  p_per_information2
16531    ,p_per_information3      =>  p_per_information3
16532    ,p_per_information4      =>  p_per_information4
16533    ,p_per_information5      =>  p_per_information5
16534    ,p_per_information6      =>  p_per_information6
16535    ,p_per_information7      =>  p_per_information7
16536    ,p_per_information8      =>  p_per_information8
16537    ,p_per_information9      =>  p_per_information9
16538    ,p_per_information10     =>  p_per_information10
16539    ,p_per_information11     =>  p_per_information11
16540    ,p_per_information12     =>  p_per_information12
16541    ,p_per_information13     =>  p_per_information13
16542    ,p_per_information14     =>  p_per_information14
16543    ,p_per_information15     =>  p_per_information15
16544    ,p_per_information16     =>  p_per_information16
16545    ,p_per_information17     =>  p_per_information17
16546    ,p_per_information18     =>  p_per_information18
16547    ,p_per_information19     =>  p_per_information19
16548    ,p_per_information20     =>  p_per_information20
16549    ,p_per_information21     =>  p_per_information21
16550    ,p_per_information22     =>  p_per_information22
16551    ,p_per_information23     =>  p_per_information23
16552    ,p_per_information24     =>  p_per_information24
16553    ,p_per_information25     =>  p_per_information25
16554    ,p_per_information26     =>  p_per_information26
16555    ,p_per_information27     =>  p_per_information27
16556    ,p_per_information28     =>  p_per_information28
16557    ,p_per_information29     =>  p_per_information29
16558    ,p_per_information30     =>  p_per_information30
16559    ,p_correspondence_language   =>  p_correspondence_language
16560    ,p_honors     		=>  p_honors
16561    ,p_pre_name_adjunct     	=>  p_pre_name_adjunct
16562    ,p_suffix     		=>  p_suffix
16563    ,p_create_mirror_flag     	=>  p_create_mirror_flag
16564    ,p_mirror_type     		=>  p_mirror_type
16565    ,p_mirror_cont_attribute_cat   =>  p_mirror_cont_attribute_cat
16566    ,p_mirror_cont_attribute1      =>  p_mirror_cont_attribute1
16567    ,p_mirror_cont_attribute2      =>  p_mirror_cont_attribute2
16568    ,p_mirror_cont_attribute3      =>  p_mirror_cont_attribute3
16569    ,p_mirror_cont_attribute4      =>  p_mirror_cont_attribute4
16570    ,p_mirror_cont_attribute5      =>  p_mirror_cont_attribute5
16571    ,p_mirror_cont_attribute6      =>  p_mirror_cont_attribute6
16572    ,p_mirror_cont_attribute7      =>  p_mirror_cont_attribute7
16573    ,p_mirror_cont_attribute8      =>  p_mirror_cont_attribute8
16574    ,p_mirror_cont_attribute9      =>  p_mirror_cont_attribute9
16575    ,p_mirror_cont_attribute10     =>  p_mirror_cont_attribute10
16576    ,p_mirror_cont_attribute11     =>  p_mirror_cont_attribute11
16577    ,p_mirror_cont_attribute12     =>  p_mirror_cont_attribute12
16578    ,p_mirror_cont_attribute13     =>  p_mirror_cont_attribute13
16579    ,p_mirror_cont_attribute14     =>  p_mirror_cont_attribute14
16580    ,p_mirror_cont_attribute15     =>  p_mirror_cont_attribute15
16581    ,p_mirror_cont_attribute16     =>  p_mirror_cont_attribute16
16582    ,p_mirror_cont_attribute17     =>  p_mirror_cont_attribute17
16583    ,p_mirror_cont_attribute18     =>  p_mirror_cont_attribute18
16584    ,p_mirror_cont_attribute19     =>  p_mirror_cont_attribute19
16585    ,p_mirror_cont_attribute20     =>  p_mirror_cont_attribute20
16586    ,P_MIRROR_CONT_INFORMATION_CAT => P_MIRROR_CONT_INFORMATION_CAT
16587    ,P_MIRROR_CONT_INFORMATION1    => P_MIRROR_CONT_INFORMATION1
16588    ,P_MIRROR_CONT_INFORMATION2    => P_MIRROR_CONT_INFORMATION2
16589    ,P_MIRROR_CONT_INFORMATION3    => P_MIRROR_CONT_INFORMATION3
16590    ,P_MIRROR_CONT_INFORMATION4    => P_MIRROR_CONT_INFORMATION4
16591    ,P_MIRROR_CONT_INFORMATION5    => P_MIRROR_CONT_INFORMATION5
16592    ,P_MIRROR_CONT_INFORMATION6    => P_MIRROR_CONT_INFORMATION6
16593    ,P_MIRROR_CONT_INFORMATION7    => P_MIRROR_CONT_INFORMATION7
16594    ,P_MIRROR_CONT_INFORMATION8    => P_MIRROR_CONT_INFORMATION8
16595    ,P_MIRROR_CONT_INFORMATION9    => P_MIRROR_CONT_INFORMATION9
16596    ,P_MIRROR_CONT_INFORMATION10    => P_MIRROR_CONT_INFORMATION10
16597    ,P_MIRROR_CONT_INFORMATION11    => P_MIRROR_CONT_INFORMATION11
16598    ,P_MIRROR_CONT_INFORMATION12    => P_MIRROR_CONT_INFORMATION12
16599    ,P_MIRROR_CONT_INFORMATION13    => P_MIRROR_CONT_INFORMATION13
16600    ,P_MIRROR_CONT_INFORMATION14    => P_MIRROR_CONT_INFORMATION14
16601    ,P_MIRROR_CONT_INFORMATION15    => P_MIRROR_CONT_INFORMATION15
16602    ,P_MIRROR_CONT_INFORMATION16    => P_MIRROR_CONT_INFORMATION16
16603    ,P_MIRROR_CONT_INFORMATION17    => P_MIRROR_CONT_INFORMATION17
16604    ,P_MIRROR_CONT_INFORMATION18    => P_MIRROR_CONT_INFORMATION18
16605    ,P_MIRROR_CONT_INFORMATION19    => P_MIRROR_CONT_INFORMATION19
16606    ,P_MIRROR_CONT_INFORMATION20    => P_MIRROR_CONT_INFORMATION20
16607    ,p_contact_relationship_id     => p_contact_relationship_id
16608    ,p_ctr_object_version_number   => p_ctr_object_version_number
16609    ,p_per_person_id               => p_per_person_id
16610    ,p_per_object_version_number   => p_per_object_version_number
16611    ,p_per_effective_start_date    => p_per_effective_start_date
16612    ,p_per_effective_end_date      => p_per_effective_end_date
16613    ,p_full_name                   => p_full_name
16614    ,p_per_comment_id              => p_per_comment_id
16615    ,p_name_combination_warning    => p_name_combination_warning
16616    ,p_orig_hire_warning           => p_orig_hire_warning
16617    );
16618   end if;
16619   hr_utility.set_location('Exiting:'||l_proc, 20);
16620  end call_contact_api;
16621 --
16622 
16623 procedure get_emrg_rel_id (
16624    p_contact_relationship_id          in number
16625   ,p_contact_person_id                in number
16626   ,p_emrg_rel_id                      out nocopy varchar2
16627   ,p_no_of_non_emrg_rel               out nocopy varchar2
16628   ,p_other_rel_type                   out nocopy varchar2
16629   ,p_emrg_rel_type                    out nocopy varchar2)
16630 is
16631    l_person_id                                     number;
16632    cursor no_of_non_emrg_rel(p_contact_relationship_id  number
16633                             ,p_contact_person_id        number )
16634    is
16635    select count(pcr.contact_relationship_id)
16636    from PER_CONTACT_RELATIONSHIPS pcr
16637    where person_id = (select person_id
16638                       from PER_CONTACT_RELATIONSHIPS
16639                       where contact_person_id = p_contact_person_id
16640                       and contact_relationship_id = P_contact_relationship_id
16641                       and trunc(sysdate) >= decode(date_start,null,trunc(sysdate),trunc(date_start))
16642                       and trunc(sysdate) <  decode(date_end,null,trunc(sysdate)+1,trunc(date_end)))
16643    and exists  (select 1
16644                 from per_contact_relationships con
16645                 where con.contact_type =  'EMRG'
16646                 and con.contact_person_id = p_contact_person_id
16647                 and con.person_id = pcr.person_id
16648                 and trunc(sysdate) >= decode(con.date_start,null,trunc(sysdate),trunc(con.date_start))
16649                 and trunc(sysdate) <  decode(con.date_end,null,trunc(sysdate)+1,trunc(con.date_end)))
16650    and pcr.contact_person_id = p_contact_person_id
16651    and pcr.contact_type <> 'EMRG'
16652    and pcr.personal_flag = 'Y'
16653    and trunc(sysdate) >= decode(pcr.date_start,null,trunc(sysdate),trunc(pcr.date_start))
16654    and trunc(sysdate) <  decode(pcr.date_end,null,trunc(sysdate)+1,trunc(pcr.date_end));
16655 
16656    cursor emrg_rel_id(p_contact_relationship_id     number
16657                      ,p_contact_person_id           number )
16658    is
16659    select contact_relationship_id,
16660          HR_GENERAL.DECODE_LOOKUP('CONTACT', contact_type) relationship
16661    from PER_CONTACT_RELATIONSHIPS
16662    where person_id = (select person_id
16663                       from PER_CONTACT_RELATIONSHIPS
16664                       where contact_person_id = p_contact_person_id
16665                       and contact_relationship_id = P_contact_relationship_id
16666                       and trunc(sysdate) >= decode(date_start,null,trunc(sysdate),trunc(date_start))
16667                       and trunc(sysdate) <  decode(date_end,null,trunc(sysdate)+1,trunc(date_end)))
16668    and contact_person_id = p_contact_person_id
16669    and contact_type = 'EMRG'
16670    and trunc(sysdate) >= decode(date_start,null,trunc(sysdate),trunc(date_start))
16671    and trunc(sysdate) <  decode(date_end,null,trunc(sysdate)+1,trunc(date_end));
16672 
16673    cursor other_rel_type(p_contact_relationship_id     number
16674                      ,p_contact_person_id           number )
16675    is
16676    select HR_GENERAL.DECODE_LOOKUP('CONTACT', pcr.contact_type) relationship
16677    from PER_CONTACT_RELATIONSHIPS pcr
16678    where pcr.contact_person_id = p_contact_person_id
16679    and pcr.contact_relationship_id = p_contact_relationship_id
16680    and trunc(sysdate) >= decode(pcr.date_start,null,trunc(sysdate),trunc(pcr.date_start))
16681    and trunc(sysdate) <  decode(pcr.date_end,null,trunc(sysdate)+1,trunc(pcr.date_end));
16682 
16683    l_emrg_rel_id          varchar2(20);
16684    l_no_of_non_emrg_rel   varchar2(20);
16685    l_other_rel_type       varchar2(200);
16686    l_emrg_rel_type       varchar2(200);
16687    l_proc   varchar2(72)  := g_package||'get_emrg_rel_id';
16688 
16689 begin
16690 
16691    hr_utility.set_location('Entering:'||l_proc, 5);
16692    hr_utility.set_location('Before Fetching no_of_non_emrg_rel:'||l_proc, 10);
16693    open no_of_non_emrg_rel(p_contact_relationship_id,p_contact_person_id);
16694    fetch no_of_non_emrg_rel
16695    into l_no_of_non_emrg_rel;
16696    IF no_of_non_emrg_rel%NOTFOUND THEN
16697    l_no_of_non_emrg_rel := '0';
16698    end if;
16699    close no_of_non_emrg_rel;
16700 
16701    open emrg_rel_id(p_contact_relationship_id,p_contact_person_id);
16702    fetch emrg_rel_id
16703    into l_emrg_rel_id, l_emrg_rel_type;
16704    IF emrg_rel_id%NOTFOUND THEN
16705    l_emrg_rel_id := '-1';
16706    l_emrg_rel_type := '';
16707    end if;
16708 
16709    close emrg_rel_id;
16710 
16711 
16712    open other_rel_type(p_contact_relationship_id,p_contact_person_id);
16713    fetch other_rel_type into l_other_rel_type;
16714    IF other_rel_type%NOTFOUND THEN
16715      l_other_rel_type := '';
16716    end if;
16717 
16718    close other_rel_type;
16719 
16720    p_emrg_rel_id := l_emrg_rel_id;
16721    p_no_of_non_emrg_rel := l_no_of_non_emrg_rel;
16722    p_other_rel_type := l_other_rel_type;
16723    p_emrg_rel_type :=  l_emrg_rel_type;
16724    hr_utility.set_location('Exiting:'||l_proc, 25);
16725 end get_emrg_rel_id;
16726 
16727 --
16728 procedure validate_rel_start_date (
16729    p_person_id                        in number
16730   ,p_item_key                         in varchar2
16731   ,p_save_mode                        in varchar2
16732   ,p_date_start                       in out nocopy date
16733   ,p_date_of_birth                    in date)
16734 is
16735  /*
16736 --  bug # 2168275
16737    requirement : If relation_ship_start_date < (DOB of Employee) or (DOB of Contact), then
16738                  raise error message PER_50386_CON_SDT_LES_EMP_BDT.
16739 
16740     1. Get emplyee record start date
16741 
16742         if employee id is available, then
16743             get  Employee_DOB from per_people_f
16744         else
16745             get Employee_DOB from transaction_step
16746 
16747     1. if l_main_per_date_of_birth is not null and l_main_per_date_of_birth > p_date_start then
16748         raise error;
16749         set errormessage .....
16750     elsif p_date_of_birth is not null and p_date_of_birth > p_date_start then
16751         raise error;
16752         set errormessage .....
16753 
16754     2. Compare the DOBs with  p_date_start
16755         If  Employee_DOB > p_date_start then
16756             raise error.
16757         Else
16758             If  p_date_of_birth > p_date_start then
16759             raise error.
16760 
16761 --  end bug # 2168275
16762 */
16763 
16764   --bug # 2168275,2123868
16765  l_validate_g_per_step_id            number;
16766  l_main_per_eff_start_date           date;
16767  l_main_per_date_of_birth            date;
16768  l_proc   varchar2(72)  := g_package||'validate_rel_start_date';
16769 begin
16770 
16771     hr_utility.set_location('Entering:'||l_proc, 5);
16772     if p_person_id is not null then
16773         hr_utility.set_location('if p_person_id is not null then:'||l_proc, 10);
16774         select  min(p.date_of_birth) , min(p.effective_start_date)
16775         into    l_main_per_date_of_birth , l_main_per_eff_start_date
16776         from    per_people_f p
16777         where   p.person_id = p_person_id;
16778     else
16779         begin
16780             hr_utility.set_location('if p_person_id is not null then:'||l_proc, 15);
16781             select nvl(max(hats1.transaction_step_id),0)
16782             into   l_validate_g_per_step_id
16783             from   hr_api_transaction_steps hats1
16784             where  hats1.item_type = 'HRSSA'
16785             and    hats1.item_key  = p_item_key
16786             and    hats1.api_name  in( 'HR_PROCESS_PERSON_SS.PROCESS_API', 'BEN_PROCESS_COBRA_PERSON_SS.PROCESS_API');
16787 
16788             l_main_per_date_of_birth := hr_transaction_api.get_date_value
16789                                 (p_transaction_step_id => l_validate_g_per_step_id
16790                                 ,p_name => 'P_DATE_OF_BIRTH') ;
16791 
16792             l_main_per_eff_start_date := hr_transaction_api.get_date_value
16793                                 (p_transaction_step_id => l_validate_g_per_step_id
16794                                 ,p_name => 'P_EFFECTIVE_DATE');
16795 
16796         exception
16797             when others then
16798             hr_utility.set_location('Exception:Others'||l_proc,555);
16799             null;
16800         end;
16801 
16802     end if; --l_person_id is/not null
16803 
16804     -- raise error if relationship start date is earlier tahn date of birth
16805 -- fix for bug # 2221040
16806     if  nvl(p_save_mode, 'NVL') <> 'SAVE_FOR_LATER'
16807       then
16808        if l_main_per_date_of_birth is not null and l_main_per_date_of_birth > p_date_start then
16809           hr_utility.set_message(800, 'PER_50386_CON_SDT_LES_EMP_BDT');
16810           hr_utility.raise_error;
16811        elsif p_date_of_birth is not null and p_date_of_birth > p_date_start then
16812           hr_utility.set_message(800, 'PER_50386_CON_SDT_LES_EMP_BDT');
16813           hr_utility.raise_error;
16814        end if;
16815     end if;
16816 -- l_main_per_eff_start_date will be used in Create_Contact_tt , so we need to return it.
16817 p_date_start := l_main_per_eff_start_date;
16818 hr_utility.set_location('Exiting:'||l_proc, 15);
16819 end validate_rel_start_date;
16820 
16821 --
16822 
16823 Procedure validate_primary_cont_flag(
16824    p_contact_relationship_id          in number
16825   ,p_primary_contact_flag             in varchar2
16826   ,p_date_start                       in date
16827   ,p_contact_person_id                in number
16828   ,p_object_version_number             in out nocopy    number)
16829 
16830 is
16831 
16832 l_emerg_cont_rel_id            number;
16833 
16834 l_emrg_rel_id                  varchar2(50);
16835 l_no_of_non_emrg_rel           varchar2(50);
16836 l_other_rel_type               varchar2(50);
16837 l_emrg_rel_type                varchar2(50);
16838 l_proc   varchar2(72)  := g_package||'validate_primary_cont_flag';
16839 
16840 CURSOR gc_get_emerg_contact_data
16841          (p_contact_relationship_id      in number
16842          ,p_eff_date                     in date default trunc(sysdate)
16843           )
16844   IS
16845   SELECT
16846   primary_contact_flag,
16847   pcr.object_version_number ovn
16848   FROM
16849       per_contact_relationships pcr
16850      ,per_all_people_f pap
16851      ,hr_comments        hc
16852   WHERE  pcr.contact_relationship_id = p_contact_relationship_id
16853     AND  pcr.contact_person_id = pap.person_id
16854     AND  p_eff_date BETWEEN pap.effective_start_date and pap.effective_end_date
16855     AND  hc.comment_id (+) = pap.comment_id;
16856 
16857 l_emerg_contact_data               gc_get_emerg_contact_data%rowtype;
16858 
16859 begin
16860 
16861 
16862    hr_utility.set_location('Entering:'||l_proc, 5);
16863    get_emrg_rel_id ( P_contact_relationship_id => p_contact_relationship_id
16864                     ,p_contact_person_id       => p_contact_person_id
16865                     ,p_emrg_rel_id             => l_emrg_rel_id
16866                     ,p_no_of_non_emrg_rel      => l_no_of_non_emrg_rel
16867                     ,p_other_rel_type          => l_other_rel_type
16868                     ,p_emrg_rel_type           => l_emrg_rel_type);
16869    l_emerg_cont_rel_id := to_number(l_emrg_rel_id);
16870 
16871    hr_utility.set_location('Before fetching gc_get_emerg_contact_data:'||l_proc,10 );
16872    OPEN gc_get_emerg_contact_data(p_contact_relationship_id => l_emerg_cont_rel_id);
16873 
16874    FETCH gc_get_emerg_contact_data into l_emerg_contact_data;
16875    IF gc_get_emerg_contact_data%NOTFOUND THEN
16876      CLOSE gc_get_emerg_contact_data;
16877      raise g_data_error;
16878    ELSE
16879      CLOSE gc_get_emerg_contact_data;
16880    END IF;
16881 -- Bug 3504216 : passing date_start as sysdate.
16882       hr_contact_rel_api.update_contact_relationship(
16883          p_validate                => false
16884         ,P_EFFECTIVE_DATE          => sysdate
16885         ,p_object_version_number   => l_emerg_contact_data.ovn
16886         ,P_CONTACT_RELATIONSHIP_ID => l_emerg_cont_rel_id
16887         ,p_date_start              => sysdate
16888         ,P_PRIMARY_CONTACT_FLAG     => p_primary_contact_flag
16889      );
16890 
16891    if p_contact_relationship_id = l_emerg_cont_rel_id then
16892       p_object_version_number := l_emerg_contact_data.ovn;
16893    end if;
16894 
16895 hr_utility.set_location('Exiting:'||l_proc, 15);
16896 end validate_primary_cont_flag;
16897 
16898 --
16899 
16900 END HR_PROCESS_CONTACT_SS;