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