DBA Data[Home] [Help]

PACKAGE BODY: APPS.HR_KI_INTEGRATIONS_SWI

Source


1 Package Body hr_ki_integrations_swi As
2 /* $Header: hrintswi.pkb 115.0 2004/01/09 01:42 vkarandi noship $ */
3 --
4 -- Package variables
5 --
6 g_package  varchar2(33) := 'hr_ki_integrations_swi.';
7 -- ----------------------------------------------------------------------------
8 -- |-----------------------< validate_integration >----------------------------|
9 -- ----------------------------------------------------------------------------
10 PROCEDURE validate_integration
11   (p_validate                     in     number    default hr_api.g_false_num
12   ,p_integration_id               in     number
13   ,p_object_version_number        in     out nocopy number
14   ,p_error                        out    nocopy varchar2
15   ,p_return_status                out nocopy varchar2
16   ) is
17   --
18   -- Variables for API Boolean parameters
19   l_validate                      boolean;
20   --
21   -- Variables for IN/OUT parameters
22   --
23   -- Other variables
24   l_proc    varchar2(72) := g_package ||'validate_integration';
25   l_object_version_number number :=p_object_version_number;
26   l_error   varchar2(2000) := null;
27   l_index   number := null;
28 Begin
29   hr_utility.set_location(' Entering:' || l_proc,10);
30   --
31   -- Issue a savepoint
32   --
33   savepoint validate_integration;
34   --
35   -- Initialise Multiple Message Detection
36   --
37   hr_multi_message.enable_message_list;
38   --
39   -- Remember IN OUT parameter IN values
40   --
41   --
42   -- Convert constant values to their corresponding boolean value
43   --
44   l_validate :=
45     hr_api.constant_to_boolean
46       (p_constant_value => p_validate);
47 
48   -- Call API
49   --
50   hr_ki_integrations_api.validate_integration
51     (p_validate                     => l_validate
52     ,p_integration_id               => p_integration_id
53     ,p_object_version_number        => l_object_version_number
54     );
55 
56   -- Derive the API return status value based on whether
57   -- messages of any type exist in the Multiple Message List.
58   -- Also disable Multiple Message Detection.
59   --
60   p_return_status := hr_multi_message.get_return_status_disable;
61   hr_utility.set_location(' Leaving:' || l_proc,20);
62   --
63 exception
64   when hr_multi_message.error_message_exist then
65     --
66     -- Catch the Multiple Message List exception which
67     -- indicates API processing has been aborted because
68     -- at least one message exists in the list.
69     --
70 
71     rollback to validate_integration;
72     fnd_msg_pub.get
73     (
74       p_data          => l_error
75      ,p_encoded       => 'F'
76      ,p_msg_index_out => l_index
77 
78     );
79     --
80     -- Reset IN OUT parameters and set OUT parameters
81     --
82     p_error := l_error;
83     p_return_status := hr_multi_message.get_return_status_disable;
84     p_object_version_number  := l_object_version_number;
85     hr_utility.set_location(' Leaving:' || l_proc, 30);
86   when others then
87     --
88     -- When Multiple Message Detection is enabled catch
89     -- any Application specific or other unexpected
90     -- exceptions.  Adding appropriate details to the
91     -- Multiple Message List.  Otherwise re-raise the
92     -- error.
93     --
94 
95     rollback to validate_integration;
96 
97     if hr_multi_message.unexpected_error_add(l_proc) then
98        hr_utility.set_location(' Leaving:' || l_proc,40);
99        raise;
100     end if;
101 
102     fnd_msg_pub.get
103     (
104       p_data          => l_error
105      ,p_encoded       => 'F'
106      ,p_msg_index_out => l_index
107 
108     );
109     --
110     -- Reset IN OUT and set OUT parameters
111     --
112     p_return_status := hr_multi_message.get_return_status_disable;
113     p_object_version_number  := l_object_version_number;
114     p_error := l_error;
115     hr_utility.set_location(' Leaving:' || l_proc,50);
116 end validate_integration;
117 end hr_ki_integrations_swi;