DBA Data[Home] [Help]

PACKAGE BODY: APPS.IRC_LOCATION_CRITERIA_VAL_SWI

Source


1 Package Body irc_location_criteria_val_swi As
2 /* $Header: irlcvswi.pkb 120.0 2005/10/03 14:58 rbanda noship $ */
3 --
4 -- Package variables
5 --
6 g_package  varchar2(33) := 'irc_location_criteria_val_swi.';
7 --
8 -- ----------------------------------------------------------------------------
9 -- |-----------------------< create_location_criteria >-----------------------|
10 -- ----------------------------------------------------------------------------
11 PROCEDURE create_location_criteria
12   (p_validate                     in     number    default hr_api.g_false_num
13   ,p_search_criteria_id           in     number
14   ,p_derived_locale               in     varchar2
15   ,p_location_criteria_value_id   in     number
16   ,p_object_version_number           out nocopy number
17   ,p_return_status                   out nocopy varchar2
18   ) is
19   --
20   -- Variables for API Boolean parameters
21   l_validate                      boolean;
22   --
23   -- Variables for IN/OUT parameters
24   --
25   -- Other variables
26   l_location_criteria_value_id   number;
27   l_proc    varchar2(72) := g_package ||'create_location_criteria';
28 Begin
29   hr_utility.set_location(' Entering:' || l_proc,10);
30   --
31   -- Issue a savepoint
32   --
33   savepoint create_location_criteria_swi;
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   -- Register Surrogate ID or user key values
49   --
50   irc_lcv_ins.set_base_key_value
51     (p_location_criteria_value_id => p_location_criteria_value_id
52     );
53   --
54   -- Call API
55   --
56   irc_location_criteria_val_api.create_location_criteria
57     (p_validate                     => l_validate
58     ,p_search_criteria_id           => p_search_criteria_id
59     ,p_derived_locale               => p_derived_locale
60     ,p_location_criteria_value_id   => l_location_criteria_value_id
61     ,p_object_version_number        => p_object_version_number
62     );
63   --
64   -- Convert API warning boolean parameter values to specific
65   -- messages and add them to Multiple Message List
66   --
67   --
68   -- Convert API non-warning boolean parameter values
69   --
70   --
71   -- Derive the API return status value based on whether
72   -- messages of any type exist in the Multiple Message List.
73   -- Also disable Multiple Message Detection.
74   --
75   p_return_status := hr_multi_message.get_return_status_disable;
76   hr_utility.set_location(' Leaving:' || l_proc,20);
77   --
78 exception
79   when hr_multi_message.error_message_exist then
80     --
81     -- Catch the Multiple Message List exception which
82     -- indicates API processing has been aborted because
83     -- at least one message exists in the list.
84     --
85     rollback to create_location_criteria_swi;
86     --
87     -- Reset IN OUT parameters and set OUT parameters
88     --
89     p_object_version_number        := null;
90     p_return_status := hr_multi_message.get_return_status_disable;
91     hr_utility.set_location(' Leaving:' || l_proc, 30);
92   when others then
93     --
94     -- When Multiple Message Detection is enabled catch
95     -- any Application specific or other unexpected
96     -- exceptions.  Adding appropriate details to the
97     -- Multiple Message List.  Otherwise re-raise the
98     -- error.
99     --
100     rollback to create_location_criteria_swi;
101     if hr_multi_message.unexpected_error_add(l_proc) then
102        hr_utility.set_location(' Leaving:' || l_proc,40);
103        raise;
104     end if;
105     --
106     -- Reset IN OUT and set OUT parameters
107     --
108     p_object_version_number        := null;
109     p_return_status := hr_multi_message.get_return_status_disable;
110     hr_utility.set_location(' Leaving:' || l_proc,50);
111 end create_location_criteria;
112 -- ----------------------------------------------------------------------------
113 -- |-----------------------< delete_location_criteria >-----------------------|
114 -- ----------------------------------------------------------------------------
115 PROCEDURE delete_location_criteria
116   (p_validate                     in     number    default hr_api.g_false_num
117   ,p_location_criteria_value_id   in     number
118   ,p_object_version_number        in     number
119   ,p_return_status                   out nocopy varchar2
120   ) is
121   --
122   -- Variables for API Boolean parameters
123   l_validate                      boolean;
124   --
125   -- Variables for IN/OUT parameters
126   --
127   -- Other variables
128   l_proc    varchar2(72) := g_package ||'delete_location_criteria';
129 Begin
130   hr_utility.set_location(' Entering:' || l_proc,10);
131   --
132   -- Issue a savepoint
133   --
134   savepoint delete_location_criteria_swi;
135   --
136   -- Initialise Multiple Message Detection
137   --
138   hr_multi_message.enable_message_list;
139   --
140   -- Remember IN OUT parameter IN values
141   --
142   --
143   -- Convert constant values to their corresponding boolean value
144   --
145   l_validate :=
146     hr_api.constant_to_boolean
147       (p_constant_value => p_validate);
148   --
149   -- Register Surrogate ID or user key values
150   --
151   --
152   -- Call API
153   --
154   irc_location_criteria_val_api.delete_location_criteria
155     (p_validate                     => l_validate
156     ,p_location_criteria_value_id   => p_location_criteria_value_id
157     ,p_object_version_number        => p_object_version_number
158     );
159   --
160   -- Convert API warning boolean parameter values to specific
161   -- messages and add them to Multiple Message List
162   --
163   --
164   -- Convert API non-warning boolean parameter values
165   --
166   --
167   -- Derive the API return status value based on whether
168   -- messages of any type exist in the Multiple Message List.
169   -- Also disable Multiple Message Detection.
170   --
171   p_return_status := hr_multi_message.get_return_status_disable;
172   hr_utility.set_location(' Leaving:' || l_proc,20);
173   --
174 exception
175   when hr_multi_message.error_message_exist then
176     --
177     -- Catch the Multiple Message List exception which
178     -- indicates API processing has been aborted because
179     -- at least one message exists in the list.
180     --
181     rollback to delete_location_criteria_swi;
182     --
183     -- Reset IN OUT parameters and set OUT parameters
184     --
185     p_return_status := hr_multi_message.get_return_status_disable;
186     hr_utility.set_location(' Leaving:' || l_proc, 30);
187   when others then
188     --
189     -- When Multiple Message Detection is enabled catch
190     -- any Application specific or other unexpected
191     -- exceptions.  Adding appropriate details to the
192     -- Multiple Message List.  Otherwise re-raise the
193     -- error.
194     --
195     rollback to delete_location_criteria_swi;
196     if hr_multi_message.unexpected_error_add(l_proc) then
197        hr_utility.set_location(' Leaving:' || l_proc,40);
198        raise;
199     end if;
200     --
201     -- Reset IN OUT and set OUT parameters
202     --
203     p_return_status := hr_multi_message.get_return_status_disable;
204     hr_utility.set_location(' Leaving:' || l_proc,50);
205 end delete_location_criteria;
206 end irc_location_criteria_val_swi;