[Home] [Help]
PACKAGE BODY: APPS.HR_NAME_FORMAT_SWI
Source
1 Package Body hr_name_format_swi As
2 /* $Header: hrnmfswi.pkb 120.0 2005/05/31 01:35 appldev noship $ */
3 --
4 -- Package variables
5 --
6 g_package varchar2(33) := 'hr_name_format_swi.';
7 --
8 -- ----------------------------------------------------------------------------
9 -- |--------------------------< create_name_format >--------------------------|
10 -- ----------------------------------------------------------------------------
11 PROCEDURE create_name_format
12 (p_validate in number default hr_api.g_false_num
13 ,p_effective_date in date
14 ,p_format_name in varchar2
15 ,p_user_format_choice in varchar2
16 ,p_format_mask in varchar2
17 ,p_legislation_code in varchar2
18 ,p_name_format_id in number
19 ,p_object_version_number out nocopy number
20 ,p_return_status out nocopy varchar2
21 ) is
22 --
23 -- Variables for API Boolean parameters
24 l_validate boolean;
25 --
26 -- Variables for IN/OUT parameters
27 --
28 -- Other variables
29 l_name_format_id number;
30 l_proc varchar2(72) := g_package ||'create_name_format';
31 Begin
32 hr_utility.set_location(' Entering:' || l_proc,10);
33 --
34 -- Issue a savepoint
35 --
36 savepoint create_name_format_swi;
37 --
38 -- Initialise Multiple Message Detection
39 --
40 hr_multi_message.enable_message_list;
41 --
42 -- Remember IN OUT parameter IN values
43 --
44 --
45 -- Convert constant values to their corresponding boolean value
46 --
47 l_validate :=
48 hr_api.constant_to_boolean
49 (p_constant_value => p_validate);
50 --
51 -- Register Surrogate ID or user key values
52 --
53 hr_nmf_ins.set_base_key_value
54 (p_name_format_id => p_name_format_id
55 );
56 --
57 -- Call API
58 --
59 hr_name_format_api.create_name_format
60 (p_validate => l_validate
61 ,p_effective_date => p_effective_date
62 ,p_format_name => p_format_name
63 ,p_user_format_choice => p_user_format_choice
64 ,p_format_mask => p_format_mask
65 ,p_legislation_code => p_legislation_code
66 ,p_name_format_id => l_name_format_id
67 ,p_object_version_number => p_object_version_number
68 );
69 --
70 -- Convert API warning boolean parameter values to specific
71 -- messages and add them to Multiple Message List
72 --
73 --
74 -- Convert API non-warning boolean parameter values
75 --
76 --
77 -- Derive the API return status value based on whether
78 -- messages of any type exist in the Multiple Message List.
79 -- Also disable Multiple Message Detection.
80 --
81 p_return_status := hr_multi_message.get_return_status_disable;
82 hr_utility.set_location(' Leaving:' || l_proc,20);
83 --
84 exception
85 when hr_multi_message.error_message_exist then
86 --
87 -- Catch the Multiple Message List exception which
88 -- indicates API processing has been aborted because
89 -- at least one message exists in the list.
90 --
91 rollback to create_name_format_swi;
92 --
93 -- Reset IN OUT parameters and set OUT parameters
94 --
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_name_format_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_object_version_number := null;
115 p_return_status := hr_multi_message.get_return_status_disable;
116 hr_utility.set_location(' Leaving:' || l_proc,50);
117 end create_name_format;
118 -- ----------------------------------------------------------------------------
119 -- |--------------------------< update_name_format >--------------------------|
120 -- ----------------------------------------------------------------------------
121 PROCEDURE update_name_format
122 (p_validate in number default hr_api.g_false_num
123 ,p_effective_date in date
124 ,p_name_format_id in number
125 ,p_format_mask in varchar2
126 ,p_object_version_number in out nocopy 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 l_object_version_number number;
135 --
136 -- Other variables
137 l_proc varchar2(72) := g_package ||'update_name_format';
138 Begin
139 hr_utility.set_location(' Entering:' || l_proc,10);
140 --
141 -- Issue a savepoint
142 --
143 savepoint update_name_format_swi;
144 --
145 -- Initialise Multiple Message Detection
146 --
147 hr_multi_message.enable_message_list;
148 --
149 -- Remember IN OUT parameter IN values
150 --
151 l_object_version_number := p_object_version_number;
152 --
153 -- Convert constant values to their corresponding boolean value
154 --
155 l_validate :=
156 hr_api.constant_to_boolean
157 (p_constant_value => p_validate);
158 --
159 -- Register Surrogate ID or user key values
160 --
161 --
162 -- Call API
163 --
164 hr_name_format_api.update_name_format
165 (p_validate => l_validate
166 ,p_effective_date => p_effective_date
167 ,p_name_format_id => p_name_format_id
168 ,p_format_mask => p_format_mask
169 ,p_object_version_number => p_object_version_number
170 );
171 --
172 -- Convert API warning boolean parameter values to specific
173 -- messages and add them to Multiple Message List
174 --
175 --
176 -- Convert API non-warning boolean parameter values
177 --
178 --
179 -- Derive the API return status value based on whether
180 -- messages of any type exist in the Multiple Message List.
181 -- Also disable Multiple Message Detection.
182 --
183 p_return_status := hr_multi_message.get_return_status_disable;
184 hr_utility.set_location(' Leaving:' || l_proc,20);
185 --
186 exception
187 when hr_multi_message.error_message_exist then
188 --
189 -- Catch the Multiple Message List exception which
190 -- indicates API processing has been aborted because
191 -- at least one message exists in the list.
192 --
193 rollback to update_name_format_swi;
194 --
195 -- Reset IN OUT parameters and set OUT parameters
196 --
197 p_object_version_number := l_object_version_number;
198 p_return_status := hr_multi_message.get_return_status_disable;
199 hr_utility.set_location(' Leaving:' || l_proc, 30);
200 when others then
201 --
202 -- When Multiple Message Detection is enabled catch
203 -- any Application specific or other unexpected
204 -- exceptions. Adding appropriate details to the
205 -- Multiple Message List. Otherwise re-raise the
206 -- error.
207 --
208 rollback to update_name_format_swi;
209 if hr_multi_message.unexpected_error_add(l_proc) then
210 hr_utility.set_location(' Leaving:' || l_proc,40);
211 raise;
212 end if;
213 --
214 -- Reset IN OUT and set OUT parameters
215 --
216 p_object_version_number := l_object_version_number;
217 p_return_status := hr_multi_message.get_return_status_disable;
218 hr_utility.set_location(' Leaving:' || l_proc,50);
219 end update_name_format;
220 -- ----------------------------------------------------------------------------
221 -- |--------------------------< delete_name_format >--------------------------|
222 -- ----------------------------------------------------------------------------
223 PROCEDURE delete_name_format
224 (p_validate in number default hr_api.g_false_num
225 ,p_name_format_id in number
226 ,p_object_version_number in out nocopy number
227 ,p_return_status out nocopy varchar2
228 ) is
229 --
230 -- Variables for API Boolean parameters
231 l_validate boolean;
232 --
233 -- Variables for IN/OUT parameters
234 l_object_version_number number;
235 --
236 -- Other variables
237 l_proc varchar2(72) := g_package ||'delete_name_format';
238 Begin
239 hr_utility.set_location(' Entering:' || l_proc,10);
240 --
241 -- Issue a savepoint
242 --
243 savepoint delete_name_format_swi;
244 --
245 -- Initialise Multiple Message Detection
246 --
247 hr_multi_message.enable_message_list;
248 --
249 -- Remember IN OUT parameter IN values
250 --
251 l_object_version_number := p_object_version_number;
252 --
253 -- Convert constant values to their corresponding boolean value
254 --
255 l_validate :=
256 hr_api.constant_to_boolean
257 (p_constant_value => p_validate);
258 --
259 -- Register Surrogate ID or user key values
260 --
261 --
262 -- Call API
263 --
264 hr_name_format_api.delete_name_format
265 (p_validate => l_validate
266 ,p_name_format_id => p_name_format_id
267 ,p_object_version_number => p_object_version_number
268 );
269 --
270 -- Convert API warning boolean parameter values to specific
271 -- messages and add them to Multiple Message List
272 --
273 --
274 -- Convert API non-warning boolean parameter values
275 --
276 --
277 -- Derive the API return status value based on whether
278 -- messages of any type exist in the Multiple Message List.
279 -- Also disable Multiple Message Detection.
280 --
281 p_return_status := hr_multi_message.get_return_status_disable;
282 hr_utility.set_location(' Leaving:' || l_proc,20);
283 --
284 exception
285 when hr_multi_message.error_message_exist then
286 --
287 -- Catch the Multiple Message List exception which
288 -- indicates API processing has been aborted because
289 -- at least one message exists in the list.
290 --
291 rollback to delete_name_format_swi;
292 --
293 -- Reset IN OUT parameters and set OUT parameters
294 --
295 p_object_version_number := l_object_version_number;
296 p_return_status := hr_multi_message.get_return_status_disable;
297 hr_utility.set_location(' Leaving:' || l_proc, 30);
298 when others then
299 --
300 -- When Multiple Message Detection is enabled catch
301 -- any Application specific or other unexpected
302 -- exceptions. Adding appropriate details to the
303 -- Multiple Message List. Otherwise re-raise the
304 -- error.
305 --
306 rollback to delete_name_format_swi;
307 if hr_multi_message.unexpected_error_add(l_proc) then
308 hr_utility.set_location(' Leaving:' || l_proc,40);
309 raise;
310 end if;
311 --
312 -- Reset IN OUT and set OUT parameters
313 --
314 p_object_version_number := l_object_version_number;
315 p_return_status := hr_multi_message.get_return_status_disable;
316 hr_utility.set_location(' Leaving:' || l_proc,50);
317 end delete_name_format;
318 end hr_name_format_swi;