DBA Data[Home] [Help]

PACKAGE BODY: APPS.IRC_LOCATION_PREFERENCES_SWI

Source


1 Package Body irc_location_preferences_swi As
2 /* $Header: irilpswi.pkb 120.2 2011/02/09 10:14:00 avarri noship $ */
3 --
4 -- Package variables
5 --
6 g_package  varchar2(33) := 'irc_location_preferences_swi.';
7 --
8 -- ----------------------------------------------------------------------------
9 -- |-----------------------< create_vac_rec_area_value >----------------------|
10 -- ----------------------------------------------------------------------------
11 PROCEDURE create_vac_rec_area_value
12   (p_validate                     in     number    default hr_api.g_false_num
13   ,p_effective_date               in     date
14   ,p_vacancy_id                   in     number    default null
15   ,p_hierarchy_version_id         in     number    default null
16   ,p_hierarchy_name               in     varchar2  default null
17   ,p_vac_rec_area_id              in out nocopy number
18   ,p_object_version_number           out nocopy number
19   ,p_return_status                   out nocopy varchar2
20   ) is
21   --
22   -- Variables for API Boolean parameters
23   l_validate                      boolean;
24   --
25   -- Variables for IN/OUT parameters
26   --
27   -- Other variables
28   l_proc    varchar2(72) := g_package ||'create_vac_rec_area_value';
29 Begin
30   hr_utility.set_location(' Entering:' || l_proc,10);
31   --
32   -- Issue a savepoint
33   --
34   savepoint create_vac_rec_area_value_swi;
35   --
36   -- Initialise Multiple Message Detection
37   --
38   hr_multi_message.enable_message_list;
39   --
40   -- Remember IN OUT parameter IN values
41   --
42   --
43   -- Convert constant values to their corresponding boolean value
44   --
45   l_validate :=
46     hr_api.constant_to_boolean
47       (p_constant_value => p_validate);
48   --
49   -- Register Surrogate ID or user key values
50   --
51   irc_rav_ins.set_base_key_value
52     (p_vac_rec_area_id => p_vac_rec_area_id
53     );
54   --
55   -- Call API
56   --
57   if ( p_hierarchy_version_id is not null) then
58     irc_location_preferences_api.create_vac_rec_area_value
59     (p_validate                     => l_validate
60     ,p_effective_date               => p_effective_date
61     ,p_vacancy_id                   => p_vacancy_id
62     ,p_hierarchy_version_id         => p_hierarchy_version_id
63     ,p_hierarchy_name               => p_hierarchy_name
64     ,p_vac_rec_area_id              => p_vac_rec_area_id
65     ,p_object_version_number        => p_object_version_number
66     );
67   end if;
68   --
69   -- Convert API warning boolean parameter values to specific
70   -- messages and add them to Multiple Message List
71   --
72   --
73   -- Convert API non-warning boolean parameter values
74   --
75   --
76   -- Derive the API return status value based on whether
77   -- messages of any type exist in the Multiple Message List.
78   -- Also disable Multiple Message Detection.
79   --
80   p_return_status := hr_multi_message.get_return_status_disable;
81   hr_utility.set_location(' Leaving:' || l_proc,20);
82   --
83 exception
84   when hr_multi_message.error_message_exist then
85     --
86     -- Catch the Multiple Message List exception which
87     -- indicates API processing has been aborted because
88     -- at least one message exists in the list.
89     --
90     rollback to create_vac_rec_area_value_swi;
91     --
92     -- Reset IN OUT parameters and set OUT parameters
93     --
94     p_vac_rec_area_id              := null;
95     p_object_version_number        := null;
96     p_return_status := hr_multi_message.get_return_status_disable;
97     hr_utility.set_location(' Leaving:' || l_proc, 30);
98   when others then
99     --
100     -- When Multiple Message Detection is enabled catch
101     -- any Application specific or other unexpected
102     -- exceptions.  Adding appropriate details to the
103     -- Multiple Message List.  Otherwise re-raise the
104     -- error.
105     --
106     rollback to create_vac_rec_area_value_swi;
107     if hr_multi_message.unexpected_error_add(l_proc) then
108        hr_utility.set_location(' Leaving:' || l_proc,40);
109        raise;
110     end if;
111     --
112     -- Reset IN OUT and set OUT parameters
113     --
114     p_vac_rec_area_id              := null;
115     p_object_version_number        := null;
116     p_return_status := hr_multi_message.get_return_status_disable;
117     hr_utility.set_location(' Leaving:' || l_proc,50);
118 end create_vac_rec_area_value;
119 --
120 -- ----------------------------------------------------------------------------
121 -- |----------------------< delete_location_preference >----------------------|
122 -- ----------------------------------------------------------------------------
123 PROCEDURE delete_location_preference
124   (p_validate                     in     number    default hr_api.g_false_num
125   ,p_location_pref_id             in     number
126   ,p_object_version_number        in     number
127   ,p_return_status                   out nocopy varchar2
128   ) is
129   --
130   -- Variables for API Boolean parameters
131   l_validate                      boolean;
132   --
133   -- Variables for IN/OUT parameters
134   --
135   -- Other variables
136   l_proc    varchar2(72) := g_package ||'delete_location_preference';
137 Begin
138   hr_utility.set_location(' Entering:' || l_proc,10);
139   --
140   -- Issue a savepoint
141   --
142   savepoint delete_location_preference_swi;
143   --
144   -- Initialise Multiple Message Detection
145   --
146   hr_multi_message.enable_message_list;
147   --
148   -- Remember IN OUT parameter IN values
149   --
150   --
151   -- Convert constant values to their corresponding boolean value
152   --
153   l_validate :=
154     hr_api.constant_to_boolean
155       (p_constant_value => p_validate);
156   --
157   -- Register Surrogate ID or user key values
158   --
159   --
160   -- Call API
161   --
162   irc_location_preferences_api.delete_location_preference
163     (p_validate                     => l_validate
164     ,p_location_pref_id             => p_location_pref_id
165     ,p_object_version_number        => p_object_version_number
166     );
167   --
168   -- Convert API warning boolean parameter values to specific
169   -- messages and add them to Multiple Message List
170   --
171   --
172   -- Convert API non-warning boolean parameter values
173   --
174   --
175   -- Derive the API return status value based on whether
176   -- messages of any type exist in the Multiple Message List.
177   -- Also disable Multiple Message Detection.
178   --
179   p_return_status := hr_multi_message.get_return_status_disable;
180   hr_utility.set_location(' Leaving:' || l_proc,20);
181   --
182 exception
183   when hr_multi_message.error_message_exist then
184     --
185     -- Catch the Multiple Message List exception which
186     -- indicates API processing has been aborted because
187     -- at least one message exists in the list.
188     --
189     rollback to delete_location_preference_swi;
190     --
191     -- Reset IN OUT parameters and set OUT parameters
192     --
193     p_return_status := hr_multi_message.get_return_status_disable;
194     hr_utility.set_location(' Leaving:' || l_proc, 30);
195   when others then
196     --
197     -- When Multiple Message Detection is enabled catch
198     -- any Application specific or other unexpected
199     -- exceptions.  Adding appropriate details to the
200     -- Multiple Message List.  Otherwise re-raise the
201     -- error.
202     --
203     rollback to delete_location_preference_swi;
204     if hr_multi_message.unexpected_error_add(l_proc) then
205        hr_utility.set_location(' Leaving:' || l_proc,40);
206        raise;
207     end if;
208     --
209     -- Reset IN OUT and set OUT parameters
210     --
211     p_return_status := hr_multi_message.get_return_status_disable;
212     hr_utility.set_location(' Leaving:' || l_proc,50);
213 end delete_location_preference;
214 --
215 -- ----------------------------------------------------------------------------
216 -- |----------------------< create_location_preference >----------------------|
217 -- ----------------------------------------------------------------------------
218 PROCEDURE create_location_preference
219   (p_validate                     in     number    default hr_api.g_false_num
220   ,p_effective_date               in     date
221   ,p_object_id                    in     number
222   ,p_object_type                  in     varchar2
223   ,p_rec_area_id                  in     number    default null
224   ,p_business_group_id            in     number    default null
225   ,p_country_code                 in     varchar2  default null
226   ,p_location_id                  in     number    default null
227   ,p_attribute_category           in     varchar2  default null
228   ,p_attribute1                   in     varchar2  default null
229   ,p_attribute2                   in     varchar2  default null
230   ,p_attribute3                   in     varchar2  default null
231   ,p_attribute4                   in     varchar2  default null
232   ,p_attribute5                   in     varchar2  default null
233   ,p_attribute6                   in     varchar2  default null
234   ,p_attribute7                   in     varchar2  default null
235   ,p_attribute8                   in     varchar2  default null
236   ,p_attribute9                   in     varchar2  default null
237   ,p_attribute10                  in     varchar2  default null
238   ,p_attribute11                  in     varchar2  default null
239   ,p_attribute12                  in     varchar2  default null
240   ,p_attribute13                  in     varchar2  default null
241   ,p_attribute14                  in     varchar2  default null
242   ,p_attribute15                  in     varchar2  default null
243   ,p_attribute16                  in     varchar2  default null
244   ,p_attribute17                  in     varchar2  default null
245   ,p_attribute18                  in     varchar2  default null
246   ,p_attribute19                  in     varchar2  default null
247   ,p_attribute20                  in     varchar2  default null
248   ,p_attribute21                  in     varchar2  default null
249   ,p_attribute22                  in     varchar2  default null
250   ,p_attribute23                  in     varchar2  default null
251   ,p_attribute24                  in     varchar2  default null
252   ,p_attribute25                  in     varchar2  default null
253   ,p_attribute26                  in     varchar2  default null
254   ,p_attribute27                  in     varchar2  default null
255   ,p_attribute28                  in     varchar2  default null
256   ,p_attribute29                  in     varchar2  default null
257   ,p_attribute30                  in     varchar2  default null
258   ,p_location_pref_id             in out nocopy number
259   ,p_object_version_number           out nocopy number
260   ,p_return_status                   out nocopy varchar2
261   ) is
262   --
263   -- Variables for API Boolean parameters
264   l_validate                      boolean;
265   --
266   -- Variables for IN/OUT parameters
267   --
268   -- Other variables
269   l_location_pref_id             number;
270   l_proc    varchar2(72) := g_package ||'create_location_preference';
271 Begin
272   hr_utility.set_location(' Entering:' || l_proc,10);
273   --
274   -- Issue a savepoint
275   --
276   savepoint create_location_preference_swi;
277   --
278   -- Initialise Multiple Message Detection
279   --
280   hr_multi_message.enable_message_list;
281   --
282   -- Remember IN OUT parameter IN values
283   --
284   --
285   -- Convert constant values to their corresponding boolean value
286   --
287   l_validate :=
288     hr_api.constant_to_boolean
289       (p_constant_value => p_validate);
290   --
291   -- Register Surrogate ID or user key values
292   --
293   irc_ilp_ins.set_base_key_value
294     (p_location_pref_id => p_location_pref_id
295     );
296   --
297   -- Call API
298   --
299   irc_location_preferences_api.create_location_preference
300     (p_validate                     => l_validate
301     ,p_effective_date               => p_effective_date
302     ,p_object_id                    => p_object_id
303     ,p_object_type                  => p_object_type
304     ,p_rec_area_id                  => p_rec_area_id
305     ,p_business_group_id            => p_business_group_id
306     ,p_country_code                 => p_country_code
307     ,p_location_id                  => p_location_id
308     ,p_attribute_category           => p_attribute_category
309     ,p_attribute1                   => p_attribute1
310     ,p_attribute2                   => p_attribute2
311     ,p_attribute3                   => p_attribute3
312     ,p_attribute4                   => p_attribute4
313     ,p_attribute5                   => p_attribute5
314     ,p_attribute6                   => p_attribute6
315     ,p_attribute7                   => p_attribute7
316     ,p_attribute8                   => p_attribute8
317     ,p_attribute9                   => p_attribute9
318     ,p_attribute10                  => p_attribute10
319     ,p_attribute11                  => p_attribute11
320     ,p_attribute12                  => p_attribute12
321     ,p_attribute13                  => p_attribute13
322     ,p_attribute14                  => p_attribute14
323     ,p_attribute15                  => p_attribute15
324     ,p_attribute16                  => p_attribute16
325     ,p_attribute17                  => p_attribute17
326     ,p_attribute18                  => p_attribute18
327     ,p_attribute19                  => p_attribute19
328     ,p_attribute20                  => p_attribute20
329     ,p_attribute21                  => p_attribute21
330     ,p_attribute22                  => p_attribute22
331     ,p_attribute23                  => p_attribute23
332     ,p_attribute24                  => p_attribute24
333     ,p_attribute25                  => p_attribute25
334     ,p_attribute26                  => p_attribute26
335     ,p_attribute27                  => p_attribute27
336     ,p_attribute28                  => p_attribute28
337     ,p_attribute29                  => p_attribute29
338     ,p_attribute30                  => p_attribute30
339     ,p_location_pref_id             => l_location_pref_id
340     ,p_object_version_number        => p_object_version_number
341     );
342   --
343   -- Convert API warning boolean parameter values to specific
344   -- messages and add them to Multiple Message List
345   --
346   --
347   -- Convert API non-warning boolean parameter values
348   --
349   --
350   -- Derive the API return status value based on whether
351   -- messages of any type exist in the Multiple Message List.
352   -- Also disable Multiple Message Detection.
353   --
354   p_return_status := hr_multi_message.get_return_status_disable;
355   hr_utility.set_location(' Leaving:' || l_proc,20);
356   --
357 exception
358   when hr_multi_message.error_message_exist then
359     --
360     -- Catch the Multiple Message List exception which
361     -- indicates API processing has been aborted because
362     -- at least one message exists in the list.
363     --
364     rollback to create_location_preference_swi;
365     --
366     -- Reset IN OUT parameters and set OUT parameters
367     --
368     p_object_version_number        := null;
369     p_return_status := hr_multi_message.get_return_status_disable;
370     hr_utility.set_location(' Leaving:' || l_proc, 30);
371   when others then
372     --
373     -- When Multiple Message Detection is enabled catch
374     -- any Application specific or other unexpected
375     -- exceptions.  Adding appropriate details to the
376     -- Multiple Message List.  Otherwise re-raise the
377     -- error.
378     --
379     rollback to create_location_preference_swi;
380     if hr_multi_message.unexpected_error_add(l_proc) then
381        hr_utility.set_location(' Leaving:' || l_proc,40);
382        raise;
383     end if;
384     --
385     -- Reset IN OUT and set OUT parameters
386     --
387     p_object_version_number        := null;
388     p_return_status := hr_multi_message.get_return_status_disable;
389     hr_utility.set_location(' Leaving:' || l_proc,50);
390 end create_location_preference;
391 --
392 -- ----------------------------------------------------------------------------
393 -- |-----------------------< delete_vac_rec_area_value >----------------------|
394 -- ----------------------------------------------------------------------------
395 PROCEDURE delete_vac_rec_area_value
396   (p_validate                     in     number    default hr_api.g_false_num
397   ,p_vac_rec_area_id              in     number
398   ,p_object_version_number        in     number
399   ,p_return_status                   out nocopy varchar2
400   ) is
401   --
402   -- Variables for API Boolean parameters
403   l_validate                      boolean;
404   --
405   -- Variables for IN/OUT parameters
406   --
407   -- Other variables
408   l_proc    varchar2(72) := g_package ||'delete_vac_rec_area_value';
409 Begin
410   hr_utility.set_location(' Entering:' || l_proc,10);
411   --
412   -- Issue a savepoint
413   --
414   savepoint delete_vac_rec_area_value_swi;
415   --
416   -- Initialise Multiple Message Detection
417   --
418   hr_multi_message.enable_message_list;
419   --
420   -- Remember IN OUT parameter IN values
421   --
422   --
423   -- Convert constant values to their corresponding boolean value
424   --
425   l_validate :=
426     hr_api.constant_to_boolean
427       (p_constant_value => p_validate);
428   --
429   -- Register Surrogate ID or user key values
430   --
431   --
432   -- Call API
433   --
434   irc_location_preferences_api.delete_vac_rec_area_value
435     (p_validate                     => l_validate
436     ,p_vac_rec_area_id              => p_vac_rec_area_id
437     ,p_object_version_number        => p_object_version_number
438     );
439   --
440   -- Convert API warning boolean parameter values to specific
441   -- messages and add them to Multiple Message List
442   --
443   --
444   -- Convert API non-warning boolean parameter values
445   --
446   --
447   -- Derive the API return status value based on whether
448   -- messages of any type exist in the Multiple Message List.
449   -- Also disable Multiple Message Detection.
450   --
451   p_return_status := hr_multi_message.get_return_status_disable;
452   hr_utility.set_location(' Leaving:' || l_proc,20);
453   --
454 exception
455   when hr_multi_message.error_message_exist then
456     --
457     -- Catch the Multiple Message List exception which
458     -- indicates API processing has been aborted because
459     -- at least one message exists in the list.
460     --
461     rollback to delete_vac_rec_area_value_swi;
462     --
463     -- Reset IN OUT parameters and set OUT parameters
464     --
465     p_return_status := hr_multi_message.get_return_status_disable;
466     hr_utility.set_location(' Leaving:' || l_proc, 30);
467   when others then
468     --
469     -- When Multiple Message Detection is enabled catch
470     -- any Application specific or other unexpected
471     -- exceptions.  Adding appropriate details to the
472     -- Multiple Message List.  Otherwise re-raise the
473     -- error.
474     --
475     rollback to delete_vac_rec_area_value_swi;
476     if hr_multi_message.unexpected_error_add(l_proc) then
477        hr_utility.set_location(' Leaving:' || l_proc,40);
478        raise;
479     end if;
480     --
481     -- Reset IN OUT and set OUT parameters
482     --
483     p_return_status := hr_multi_message.get_return_status_disable;
484     hr_utility.set_location(' Leaving:' || l_proc,50);
485 end delete_vac_rec_area_value;
486 --
487 -- ----------------------------------------------------------------------------
488 -- |-----------------------< update_vac_rec_area_value >----------------------|
489 -- ----------------------------------------------------------------------------
490 PROCEDURE update_vac_rec_area_value
491   (p_validate                     in     number    default hr_api.g_false_num
492   ,p_effective_date               in     date
493   ,p_vacancy_id                   in     number    default hr_api.g_number
494   ,p_hierarchy_version_id         in     number    default hr_api.g_number
495   ,p_hierarchy_name               in     varchar2  default hr_api.g_varchar2
496   ,p_vac_rec_area_id              in     number
497   ,p_object_version_number        in out nocopy number
498   ,p_return_status                   out nocopy varchar2
499   ) is
500   --
501   -- Variables for API Boolean parameters
502   l_validate                      boolean;
503   --
504   -- Variables for IN/OUT parameters
505   --
506   -- Other variables
507   l_proc    varchar2(72) := g_package ||'update_vac_rec_area_value';
508   l_object_version_number   number;
509 Begin
510   hr_utility.set_location(' Entering:' || l_proc,10);
511   --
512   -- Issue a savepoint
513   --
514   savepoint update_vac_rec_area_value_swi;
515   --
516   -- Initialise Multiple Message Detection
517   --
518   hr_multi_message.enable_message_list;
519   --
520   -- Remember IN OUT parameter IN values
521   --
522   l_object_version_number := p_object_version_number;
523   --
524   -- Convert constant values to their corresponding boolean value
525   --
526   l_validate :=
527     hr_api.constant_to_boolean
528       (p_constant_value => p_validate);
529   --
530   -- Call API
531   --
532   if ( p_hierarchy_version_id is not null) then
533     irc_location_preferences_api.update_vac_rec_area_value
534     (p_validate                     => l_validate
535     ,p_effective_date               => p_effective_date
536     ,p_vacancy_id                   => p_vacancy_id
537     ,p_hierarchy_version_id         => p_hierarchy_version_id
538     ,p_hierarchy_name               => p_hierarchy_name
539     ,p_vac_rec_area_id              => p_vac_rec_area_id
540     ,p_object_version_number        => p_object_version_number
541     );
542   end if;
543   --
544   -- Convert API warning boolean parameter values to specific
545   -- messages and add them to Multiple Message List
546   --
547   --
548   -- Convert API non-warning boolean parameter values
549   --
550   --
551   -- Derive the API return status value based on whether
552   -- messages of any type exist in the Multiple Message List.
553   -- Also disable Multiple Message Detection.
554   --
555   p_return_status := hr_multi_message.get_return_status_disable;
556   hr_utility.set_location(' Leaving:' || l_proc,20);
557   --
558 exception
559   when hr_multi_message.error_message_exist then
560     --
561     -- Catch the Multiple Message List exception which
562     -- indicates API processing has been aborted because
563     -- at least one message exists in the list.
564     --
565     rollback to update_vac_rec_area_value_swi;
566     --
567     -- Reset IN OUT parameters and set OUT parameters
568     --
569     p_object_version_number        := l_object_version_number;
570     p_return_status := hr_multi_message.get_return_status_disable;
571     hr_utility.set_location(' Leaving:' || l_proc, 30);
572   when others then
573     --
574     -- When Multiple Message Detection is enabled catch
575     -- any Application specific or other unexpected
576     -- exceptions.  Adding appropriate details to the
577     -- Multiple Message List.  Otherwise re-raise the
578     -- error.
579     --
580     rollback to update_vac_rec_area_value_swi;
581     if hr_multi_message.unexpected_error_add(l_proc) then
582        hr_utility.set_location(' Leaving:' || l_proc,40);
583        raise;
584     end if;
585     --
586     -- Reset IN OUT and set OUT parameters
587     --
588     p_object_version_number        := l_object_version_number;
589     p_return_status := hr_multi_message.get_return_status_disable;
590     hr_utility.set_location(' Leaving:' || l_proc,50);
591 end update_vac_rec_area_value;
592 --
593 -- ----------------------------------------------------------------------------
594 -- |-------------------------< process_vac_rec_area_api >---------------------|
595 -- ----------------------------------------------------------------------------
596 procedure process_vac_rec_area_api
597 (
598   p_document            in         CLOB
599  ,p_return_status       out nocopy VARCHAR2
600  ,p_validate            in         number    default hr_api.g_false_num
601  ,p_effective_date      in         date      default null
602 )
603 IS
604    l_postState VARCHAR2(2);
605    l_return_status VARCHAR2(1);
606    l_object_version_number number;
607    l_commitElement xmldom.DOMElement;
608    l_parser xmlparser.Parser;
609    l_CommitNode xmldom.DOMNode;
610    l_proc    varchar2(72) := g_package || 'PROCESS_VAC_REC_AREA_API';
611 
612    -- Variables for OUT parameters
613    l_vac_rec_area_id     number;
614    l_vacancy_id          number;
615    l_effective_date      date  :=  trunc(sysdate);
616    --
617 BEGIN
618 --
619    hr_utility.set_location(' Entering:' || l_proc,10);
620    hr_utility.set_location(' CLOB --> xmldom.DOMNode:' || l_proc,15);
621 --
622    l_parser      := xmlparser.newParser;
623    xmlparser.ParseCLOB(l_parser,p_document);
624    l_CommitNode  := xmldom.makeNode(xmldom.getDocumentElement(xmlparser.getDocument(l_parser)));
625 --
626 
627    hr_utility.set_location('Extracting the PostState:' || l_proc,20);
628 
629    l_commitElement := xmldom.makeElement(l_CommitNode);
630    l_postState := xmldom.getAttribute(l_commitElement, 'PS');
631 --
632 --Get the values for in/out parameters
633 --
634    l_vac_rec_area_id       := hr_transaction_swi.getNumberValue(l_CommitNode,'VacRecAreaId');
635    l_object_version_number := hr_transaction_swi.getNumberValue(l_CommitNode,'ObjectVersionNumber');
636 --
637    if p_effective_date is null
638    then
639    --
640      l_effective_date := trunc(sysdate);
641    --
642    else
643    --
644      l_effective_date := p_effective_date;
645    --
646    end if;
647    --
648 
649    if l_postState = '0' then
650    hr_utility.set_location('updating :' || l_proc,30);
651     -- Call Create Rec Area Value
652     create_vac_rec_area_value(
653      p_validate                     =>  p_validate
654     ,p_effective_date               =>  l_effective_date
655     ,p_vacancy_id                   =>  hr_transaction_swi.getNumberValue(l_CommitNode,'VacancyId',NULL)
656     ,p_hierarchy_version_id         =>  hr_transaction_swi.getNumberValue(l_CommitNode,'HierarchyVersionId',NULL)
657     ,p_hierarchy_name               =>  hr_transaction_swi.getVarchar2Value(l_CommitNode,'HierarchyName',NULL)
658     ,p_vac_rec_area_id              =>  l_vac_rec_area_id
659     ,p_object_version_number        =>  l_object_version_number
660     ,p_return_status                =>  l_return_status
661     ) ;
662    --
663    elsif l_postState = '2' then
664    hr_utility.set_location('updating :' || l_proc,32);
665     -- Call Create Rec Area Value
666     update_vac_rec_area_value(
667      p_validate                     =>  p_validate
668     ,p_effective_date               =>  l_effective_date
669     ,p_vacancy_id                   =>  hr_transaction_swi.getNumberValue(l_CommitNode,'VacancyId',NULL)
670     ,p_hierarchy_version_id         =>  hr_transaction_swi.getNumberValue(l_CommitNode,'HierarchyVersionId',NULL)
671     ,p_hierarchy_name               =>  hr_transaction_swi.getVarchar2Value(l_CommitNode,'HierarchyName',NULL)
672     ,p_vac_rec_area_id              =>  l_vac_rec_area_id
673     ,p_object_version_number        =>  l_object_version_number
674     ,p_return_status                =>  l_return_status
675     ) ;
676   --
677   elsif l_postState = '3' then
678    hr_utility.set_location('updating :' || l_proc,33);
679   --
680      -- call delete rec area value
681      --
682      delete_vac_rec_area_value(
683       p_validate                 =>  p_validate
684      ,p_object_version_number    =>  l_object_version_number
685      ,p_vac_rec_area_id          =>  l_vac_rec_area_id
686      ,p_return_status            =>  l_return_status
687      );
688      --
689    end if;
690    --
691    p_return_status := l_return_status;
692    hr_utility.set_location('Exiting:' || l_proc,40);
693 --
694 end process_vac_rec_area_api;
695 --
696 -- ----------------------------------------------------------------------------
697 -- |-------------------------< process_location_pref_api >--------------------|
698 -- ----------------------------------------------------------------------------
699 procedure process_location_pref_api
700 (
701   p_document            in         CLOB
702  ,p_return_status       out nocopy VARCHAR2
703  ,p_validate            in         number    default hr_api.g_false_num
704  ,p_effective_date      in         date      default null
705 )
706 IS
707    l_postState VARCHAR2(2);
708    l_return_status VARCHAR2(1);
709    l_object_version_number number;
710    l_commitElement xmldom.DOMElement;
711    l_parser xmlparser.Parser;
712    l_CommitNode xmldom.DOMNode;
713    l_proc    varchar2(72) := g_package || 'PROCESS_LOCATION_PREF_API';
714 
715    -- Variables for OUT parameters
716    l_location_pref_id     number;
717    l_effective_date      date  :=  trunc(sysdate);
718    --
719 BEGIN
720 --
721    hr_utility.set_location(' Entering:' || l_proc,10);
722    hr_utility.set_location(' CLOB --> xmldom.DOMNode:' || l_proc,15);
723 --
724    l_parser      := xmlparser.newParser;
725    xmlparser.ParseCLOB(l_parser,p_document);
726    l_CommitNode  := xmldom.makeNode(xmldom.getDocumentElement(xmlparser.getDocument(l_parser)));
727 --
728 
729    hr_utility.set_location('Extracting the PostState:' || l_proc,20);
730 
731    l_commitElement := xmldom.makeElement(l_CommitNode);
732    l_postState := xmldom.getAttribute(l_commitElement, 'PS');
733 --
734 --Get the values for in/out parameters
735 --
736    l_location_pref_id       := hr_transaction_swi.getNumberValue(l_CommitNode,'LocationPrefId');
737    l_object_version_number  := hr_transaction_swi.getNumberValue(l_CommitNode,'ObjectVersionNumber');
738 --
739    if p_effective_date is null
740    then
741    --
742      l_effective_date := trunc(sysdate);
743    --
744    else
745    --
746      l_effective_date := p_effective_date;
747    --
748    end if;
749    --
750 
751    if l_postState = '0' then
752     -- call create location preference
753     create_location_preference(
754        p_validate                =>  p_validate
755       ,p_effective_date          =>  l_effective_date
756       ,p_object_id               =>  hr_transaction_swi.getNumberValue(l_CommitNode,'ObjectId')
757       ,p_object_type             =>  hr_transaction_swi.getVarchar2Value(l_CommitNode,'ObjectType')
758       ,p_rec_area_id             =>  hr_transaction_swi.getNumberValue(l_CommitNode,'RecAreaId')
759       ,p_business_group_id       =>  hr_transaction_swi.getNumberValue(l_CommitNode,'BusinessGroupId')
760       ,p_country_code            =>  hr_transaction_swi.getVarchar2Value(l_CommitNode,'CountryCode')
761       ,p_location_id             =>  hr_transaction_swi.getNumberValue(l_CommitNode,'LocationId')
762       ,p_attribute_category      =>  hr_transaction_swi.getVarchar2Value(l_CommitNode,'AttributeCategory',NULL)
763       ,p_attribute1              =>  hr_transaction_swi.getVarchar2Value(l_CommitNode,'Attribute1',NULL)
764       ,p_attribute2              =>  hr_transaction_swi.getVarchar2Value(l_CommitNode,'Attribute2',NULL)
765       ,p_attribute3              =>  hr_transaction_swi.getVarchar2Value(l_CommitNode,'Attribute3',NULL)
766       ,p_attribute4              =>  hr_transaction_swi.getVarchar2Value(l_CommitNode,'Attribute4',NULL)
767       ,p_attribute5              =>  hr_transaction_swi.getVarchar2Value(l_CommitNode,'Attribute5',NULL)
768       ,p_attribute6              =>  hr_transaction_swi.getVarchar2Value(l_CommitNode,'Attribute6',NULL)
769       ,p_attribute7              =>  hr_transaction_swi.getVarchar2Value(l_CommitNode,'Attribute7',NULL)
770       ,p_attribute8              =>  hr_transaction_swi.getVarchar2Value(l_CommitNode,'Attribute8',NULL)
771       ,p_attribute9              =>  hr_transaction_swi.getVarchar2Value(l_CommitNode,'Attribute9',NULL)
772       ,p_attribute10             =>  hr_transaction_swi.getVarchar2Value(l_CommitNode,'Attribute10',NULL)
773       ,p_attribute11             =>  hr_transaction_swi.getVarchar2Value(l_CommitNode,'Attribute11',NULL)
774       ,p_attribute12             =>  hr_transaction_swi.getVarchar2Value(l_CommitNode,'Attribute12',NULL)
775       ,p_attribute13             =>  hr_transaction_swi.getVarchar2Value(l_CommitNode,'Attribute13',NULL)
776       ,p_attribute14             =>  hr_transaction_swi.getVarchar2Value(l_CommitNode,'Attribute14',NULL)
777       ,p_attribute15             =>  hr_transaction_swi.getVarchar2Value(l_CommitNode,'Attribute15',NULL)
778       ,p_attribute16             =>  hr_transaction_swi.getVarchar2Value(l_CommitNode,'Attribute16',NULL)
779       ,p_attribute17             =>  hr_transaction_swi.getVarchar2Value(l_CommitNode,'Attribute17',NULL)
780       ,p_attribute18             =>  hr_transaction_swi.getVarchar2Value(l_CommitNode,'Attribute18',NULL)
781       ,p_attribute19             =>  hr_transaction_swi.getVarchar2Value(l_CommitNode,'Attribute19',NULL)
782       ,p_attribute20             =>  hr_transaction_swi.getVarchar2Value(l_CommitNode,'Attribute20',NULL)
783       ,p_attribute21             =>  hr_transaction_swi.getVarchar2Value(l_CommitNode,'Attribute21',NULL)
784       ,p_attribute22             =>  hr_transaction_swi.getVarchar2Value(l_CommitNode,'Attribute22',NULL)
785       ,p_attribute23             =>  hr_transaction_swi.getVarchar2Value(l_CommitNode,'Attribute23',NULL)
786       ,p_attribute24             =>  hr_transaction_swi.getVarchar2Value(l_CommitNode,'Attribute24',NULL)
787       ,p_attribute25             =>  hr_transaction_swi.getVarchar2Value(l_CommitNode,'Attribute25',NULL)
788       ,p_attribute26             =>  hr_transaction_swi.getVarchar2Value(l_CommitNode,'Attribute26',NULL)
789       ,p_attribute27             =>  hr_transaction_swi.getVarchar2Value(l_CommitNode,'Attribute27',NULL)
790       ,p_attribute28             =>  hr_transaction_swi.getVarchar2Value(l_CommitNode,'Attribute28',NULL)
791       ,p_attribute29             =>  hr_transaction_swi.getVarchar2Value(l_CommitNode,'Attribute29',NULL)
792       ,p_attribute30             =>  hr_transaction_swi.getVarchar2Value(l_CommitNode,'Attribute30',NULL)
793       ,p_location_pref_id        =>  l_location_pref_id
794       ,p_object_version_number   =>  l_object_version_number
795       ,p_return_status           =>  l_return_status
796     ) ;
797   --
798   elsif l_postState = '3' then
799      --
800      -- call delete location preference
801      --
802      delete_location_preference(
803       p_validate                 =>  p_validate
804      ,p_object_version_number    =>  l_object_version_number
805      ,p_location_pref_id         =>  l_location_pref_id
806      ,p_return_status            =>  l_return_status
807      );
808      --
809    end if;
810    --
811    p_return_status := l_return_status;
812    hr_utility.set_location('Exiting:' || l_proc,40);
813 --
814 end process_location_pref_api;
815 --
816 end irc_location_preferences_swi;